[2026-08-03 14:56:26] live.INFO: Today's sales for date 2026-08-03: 17842.4800  
[2026-08-03 14:56:26] live.INFO: Today's purchases for date 2026-08-03: 0  
[2026-08-03 14:56:26] live.INFO: Today's expenses for date 2026-08-03: 0  
[2026-08-03 14:56:26] live.INFO: === CALCULATING CASH IN HAND FOR DATE: 2026-08-03 ===  
[2026-08-03 14:56:26] live.INFO: Cash in hand calculated for 2026-08-03: 2092947.5300  
[2026-08-03 14:56:26] live.INFO: === CALCULATING BANK BALANCE FOR DATE: 2026-08-03 ===  
[2026-08-03 14:56:26] live.INFO: Bank balance calculated for 2026-08-03: 14343.0000  
[2026-08-03 14:56:26] live.INFO: Today's collections for date 2026-08-03: 17842.4800  
[2026-08-03 14:56:26] live.INFO: Original end_date from request: 03/08/2026  
[2026-08-03 14:56:26] live.INFO: Date converted manually from DD/MM/YYYY to: 2026-08-03  
[2026-08-03 14:56:26] live.INFO: Final parameters - Date: 2026-08-03, Location: null, Business: 1  
[2026-08-03 14:56:26] live.INFO: === SALES BREAKDOWN METHOD START ===  
[2026-08-03 14:56:26] live.INFO: Parameters - Business ID: 1, Date: 2026-08-03, Location: null  
[2026-08-03 14:56:26] live.INFO: Calculating opening balance for date 2026-08-03, using previous date: 2026-08-02  
[2026-08-03 14:56:26] live.INFO: === CALCULATING CASH IN HAND FOR DATE: 2026-08-02 ===  
[2026-08-03 14:56:26] live.INFO: Base query built for business 1, date 2026-08-03  
[2026-08-03 14:56:26] live.INFO: Final SQL query: select * from `transactions` where `business_id` = ? and `type` = ? and `status` = ? and date(`transaction_date`) = ?  
[2026-08-03 14:56:26] live.INFO: Query bindings: [1,"sell","final","2026-08-03"]  
[2026-08-03 14:56:26] live.INFO: Total transactions found: 34  
[2026-08-03 14:56:26] live.INFO: Raw SQL result: {"count":34,"subtotal":"17842.4800","tax":"0.0000","discount":"0.0000","total":"17842.4800","paid_amount":"17842.4800","due_amount":"0.0000","partial_amount":"0.0000"}  
[2026-08-03 14:56:26] live.INFO: Final processed result: {"count":34,"subtotal":17842.48,"tax":0,"discount":0,"total":17842.48,"paid_amount":17842.48,"due_amount":0,"partial_amount":0}  
[2026-08-03 14:56:26] live.INFO: === SALES BREAKDOWN METHOD END ===  
[2026-08-03 14:56:26] live.INFO: === GETTING MONTHLY CASH BREAKDOWN UP TO DATE: 2026-08-03 ===  
[2026-08-03 14:56:26] live.INFO: Cash in hand calculated for 2026-08-02: 2075105.0500  
[2026-08-03 14:56:26] live.INFO: === CALCULATING BANK BALANCE FOR DATE: 2026-08-02 ===  
[2026-08-03 14:56:26] live.INFO: Bank balance calculated for 2026-08-02: 14343.0000  
[2026-08-03 14:56:26] live.INFO: === DAILY REPORT DEBUG END ===  
[2026-08-03 14:56:26] live.INFO: Monthly cash breakdown calculated: [{"month":"2026-08","month_name":"August 2026","transaction_count":306,"net_cash_flow":103556.92,"running_total":2092947.5299999998},{"month":"2026-07","month_name":"July 2026","transaction_count":4034,"net_cash_flow":1772368.16,"running_total":1989390.6099999999},{"month":"2026-06","month_name":"June 2026","transaction_count":418,"net_cash_flow":217022.45,"running_total":217022.45}] 
[2026-08-03 14:57:35] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"product","name":"product","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"quantity","name":"quantity","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"action","name":"action","searchable":"false","orderable":"false","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"product","_":"1785749255006"}  
[2026-08-03 14:57:35] live.INFO: Analysis type: product, Business ID: 1  
[2026-08-03 14:57:35] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"category","name":"category","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"products_count","name":"products_count","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"contribution","name":"contribution","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"category","_":"1785749255007"}  
[2026-08-03 14:57:35] live.INFO: Analysis type: category, Business ID: 1  
[2026-08-03 14:57:35] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"brand","name":"brand","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"products_count","name":"products_count","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"market_share","name":"market_share","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"brand","_":"1785749255008"}  
[2026-08-03 14:57:35] live.INFO: Analysis type: brand, Business ID: 1  
[2026-08-03 14:57:36] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"customer","name":"customer","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"orders_count","name":"orders_count","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"avg_order_value","name":"avg_order_value","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"customer","_":"1785749255009"}  
[2026-08-03 14:57:36] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"location","name":"location","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"transactions_count","name":"transactions_count","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"performance","name":"performance","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"location","_":"1785749255010"}  
[2026-08-03 14:57:36] live.INFO: Analysis type: customer, Business ID: 1  
[2026-08-03 14:57:36] live.INFO: Analysis type: location, Business ID: 1  
[2026-08-03 14:57:36] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"invoice_no","name":"invoice_no","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"transaction_date","name":"transaction_date","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"customer_name","name":"customer_name","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"location_name","name":"location_name","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"payment_status","name":"payment_status","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"action","name":"action","searchable":"false","orderable":"false","search":{"value":null,"regex":"false"}}],"order":[{"column":"1","dir":"desc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"invoice","_":"1785749255012"}  
[2026-08-03 14:57:36] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"staff","name":"staff","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"sales_count","name":"sales_count","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"commission","name":"commission","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"staff","_":"1785749255011"}  
[2026-08-03 14:57:36] live.INFO: getProfitAnalysis called with params: {"draw":"2","columns":[{"data":"product","name":"product","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"quantity","name":"quantity","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"action","name":"action","searchable":"false","orderable":"false","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"start_date":"2026-08-01","end_date":"2026-08-31","location_id":null,"customer_id":null,"type":"product","_":"1785749255013"}  
[2026-08-03 14:57:36] live.INFO: Analysis type: invoice, Business ID: 1  
[2026-08-03 14:57:36] live.INFO: Analysis type: staff, Business ID: 1  
[2026-08-03 14:57:36] live.INFO: Analysis type: product, Business ID: 1  
[2026-08-03 14:57:50] live.INFO: getProfitAnalysis called with params: {"draw":"3","columns":[{"data":"product","name":"product","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"quantity","name":"quantity","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"action","name":"action","searchable":"false","orderable":"false","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"start_date":"2026-07-26","end_date":"2026-08-01","location_id":null,"customer_id":null,"type":"product","_":"1785749255014"}  
[2026-08-03 14:57:50] live.INFO: Analysis type: product, Business ID: 1  
[2026-08-03 14:58:27] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"product","name":"product","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"quantity","name":"quantity","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"action","name":"action","searchable":"false","orderable":"false","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"product","_":"1785749306697"}  
[2026-08-03 14:58:27] live.INFO: Analysis type: product, Business ID: 1  
[2026-08-03 14:58:27] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"category","name":"category","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"products_count","name":"products_count","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"contribution","name":"contribution","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"category","_":"1785749306698"}  
[2026-08-03 14:58:27] live.INFO: Analysis type: category, Business ID: 1  
[2026-08-03 14:58:27] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"brand","name":"brand","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"products_count","name":"products_count","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"market_share","name":"market_share","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"brand","_":"1785749306699"}  
[2026-08-03 14:58:27] live.INFO: Analysis type: brand, Business ID: 1  
[2026-08-03 14:58:27] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"location","name":"location","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"transactions_count","name":"transactions_count","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"performance","name":"performance","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"location","_":"1785749306701"}  
[2026-08-03 14:58:27] live.INFO: Analysis type: location, Business ID: 1  
[2026-08-03 14:58:27] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"customer","name":"customer","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"orders_count","name":"orders_count","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"avg_order_value","name":"avg_order_value","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"customer","_":"1785749306700"}  
[2026-08-03 14:58:27] live.INFO: Analysis type: customer, Business ID: 1  
[2026-08-03 14:58:27] live.INFO: getProfitAnalysis called with params: {"draw":"2","columns":[{"data":"product","name":"product","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"quantity","name":"quantity","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"action","name":"action","searchable":"false","orderable":"false","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"start_date":"2026-08-01","end_date":"2026-08-31","location_id":null,"customer_id":null,"type":"product","_":"1785749306704"}  
[2026-08-03 14:58:28] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"staff","name":"staff","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"sales_count","name":"sales_count","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"commission","name":"commission","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}}],"order":[{"column":"0","dir":"asc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"staff","_":"1785749306702"}  
[2026-08-03 14:58:28] live.INFO: Analysis type: product, Business ID: 1  
[2026-08-03 14:58:28] live.INFO: getProfitAnalysis called with params: {"draw":"1","columns":[{"data":"invoice_no","name":"invoice_no","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"transaction_date","name":"transaction_date","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"customer_name","name":"customer_name","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"location_name","name":"location_name","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"revenue","name":"revenue","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"cost","name":"cost","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"profit","name":"profit","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"margin","name":"margin","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"payment_status","name":"payment_status","searchable":"true","orderable":"true","search":{"value":null,"regex":"false"}},{"data":"action","name":"action","searchable":"false","orderable":"false","search":{"value":null,"regex":"false"}}],"order":[{"column":"1","dir":"desc"}],"start":"0","length":"25","search":{"value":null,"regex":"false"},"type":"invoice","_":"1785749306703"}  
[2026-08-03 14:58:28] live.INFO: Analysis type: staff, Business ID: 1  
[2026-08-03 14:58:28] live.INFO: Analysis type: invoice, Business ID: 1  
