[27-Jun-2025 08:52:55 UTC] Database connection failed: SQLSTATE[HY000] [1044] Access denied for user 'icodesxy_sale'@'localhost' to database 'icodesxy_sale'
[27-Jun-2025 08:54:36 UTC] Database connection failed: SQLSTATE[HY000] [1044] Access denied for user 'icodesxy_sale'@'localhost' to database 'icodesxy_sale'
[27-Jun-2025 08:59:31 UTC] Error fetching low stock items: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'minimum_quantity' in 'WHERE'
[27-Jun-2025 08:59:48 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale`.`purchase_invoice_items`, CONSTRAINT `purchase_invoice_items_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`)) in /home/icodesxy/public_html/sale/add_item.php:97
Stack trace:
#0 /home/icodesxy/public_html/sale/add_item.php(97): PDOStatement->execute()
#1 {main}
  thrown in /home/icodesxy/public_html/sale/add_item.php on line 97
[27-Jun-2025 08:59:57 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale`.`purchase_invoice_items`, CONSTRAINT `purchase_invoice_items_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`)) in /home/icodesxy/public_html/sale/add_item.php:97
Stack trace:
#0 /home/icodesxy/public_html/sale/add_item.php(97): PDOStatement->execute()
#1 {main}
  thrown in /home/icodesxy/public_html/sale/add_item.php on line 97
[28-Jun-2025 17:58:37 UTC] Error fetching low stock items: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'minimum_quantity' in 'WHERE'
[28-Jun-2025 18:12:03 UTC] Saving invoice with values: {"invoice_number":23,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":800,"discount":"0","final_total":800,"paid_amount":800,"remaining_amount":0,"shift_id":3,"items_data":[{"id":"1","name":"\u0647\u0648\u062f\u064a","quantity":1,"price":800,"total":800}]}
[28-Jun-2025 18:12:03 UTC] Invoice inserted successfully with ID: 23
[28-Jun-2025 18:12:03 UTC] Treasury updated with final_total: 800 for treasury_id: 1
[28-Jun-2025 18:48:26 UTC] Saving invoice with values: {"invoice_number":24,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":152,"discount":"0","final_total":152,"paid_amount":152,"remaining_amount":0,"shift_id":3,"items_data":[{"id":"2","name":"\u0628\u0646\u0643\u0644\u0648\u0646","quantity":1,"price":152,"total":152}]}
[28-Jun-2025 18:48:26 UTC] Invoice inserted successfully with ID: 24
[28-Jun-2025 18:48:26 UTC] Treasury updated with final_total: 152 for treasury_id: 1
[28-Jun-2025 20:01:41 UTC] Error fetching low stock items: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'minimum_quantity' in 'WHERE'
[29-Jun-2025 04:31:12 UTC] Error fetching low stock items: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'minimum_quantity' in 'WHERE'
[29-Jun-2025 04:31:38 UTC] Saving invoice with values: {"invoice_number":25,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":152,"discount":"0","final_total":152,"paid_amount":152,"remaining_amount":0,"shift_id":3,"items_data":[{"id":"2","name":"\u0628\u0646\u0643\u0644\u0648\u0646","quantity":1,"price":152,"total":152}]}
[29-Jun-2025 04:31:38 UTC] Invoice inserted successfully with ID: 25
[29-Jun-2025 04:31:38 UTC] Treasury updated with final_total: 152 for treasury_id: 1
[29-Jun-2025 04:31:57 UTC] Saving invoice with values: {"invoice_number":26,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":800,"discount":"0","final_total":800,"paid_amount":800,"remaining_amount":0,"shift_id":3,"items_data":[{"id":"1","name":"\u0647\u0648\u062f\u064a","quantity":1,"price":800,"total":800}]}
[29-Jun-2025 04:31:57 UTC] Invoice inserted successfully with ID: 26
[29-Jun-2025 04:31:57 UTC] Treasury updated with final_total: 800 for treasury_id: 1
[29-Jun-2025 04:32:51 UTC] Saving invoice with values: {"invoice_number":27,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":152,"discount":"0","final_total":152,"paid_amount":152,"remaining_amount":0,"shift_id":3,"items_data":[{"id":"2","name":"\u0628\u0646\u0643\u0644\u0648\u0646","quantity":1,"price":152,"total":152}]}
[29-Jun-2025 04:32:51 UTC] Invoice inserted successfully with ID: 27
[29-Jun-2025 04:32:51 UTC] Treasury updated with final_total: 152 for treasury_id: 1
[29-Jun-2025 05:43:00 UTC] Error fetching low stock items: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'minimum_quantity' in 'WHERE'
[29-Jun-2025 05:43:15 UTC] Saving invoice with values: {"invoice_number":28,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":800,"discount":"0","final_total":800,"paid_amount":800,"remaining_amount":0,"shift_id":3,"items_data":[{"id":"1","name":"\u0647\u0648\u062f\u064a","quantity":1,"price":800,"total":800}]}
[29-Jun-2025 05:43:15 UTC] Invoice inserted successfully with ID: 28
[29-Jun-2025 05:43:15 UTC] Treasury updated with final_total: 800 for treasury_id: 1
[29-Jun-2025 05:43:45 UTC] Saving invoice with values: {"invoice_number":29,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":150,"discount":"0","final_total":150,"paid_amount":150,"remaining_amount":0,"shift_id":3,"items_data":[{"id":"3","name":"\u0647\u0648\u064a \u062c\u062f\u064a\u062f","quantity":1,"price":150,"total":150}]}
[29-Jun-2025 05:43:45 UTC] Invoice inserted successfully with ID: 29
[29-Jun-2025 05:43:45 UTC] Treasury updated with final_total: 150 for treasury_id: 1
[29-Jun-2025 12:14:21 UTC] Error fetching low stock items: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'minimum_quantity' in 'WHERE'
[29-Jun-2025 15:13:50 UTC] Error fetching low stock items: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'minimum_quantity' in 'WHERE'
[29-Jun-2025 15:15:15 UTC] Saving invoice with values: {"invoice_number":30,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":150,"discount":"0","final_total":150,"paid_amount":150,"remaining_amount":0,"shift_id":3,"items_data":[{"id":"3","name":"\u0647\u0648\u064a \u062c\u062f\u064a\u062f","quantity":1,"price":150,"total":150}]}
[29-Jun-2025 15:15:15 UTC] Invoice inserted successfully with ID: 30
[29-Jun-2025 15:15:15 UTC] Treasury updated with final_total: 150 for treasury_id: 1
[29-Jun-2025 15:18:09 UTC] Error fetching low stock items: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'minimum_quantity' in 'WHERE'
[29-Jun-2025 15:23:18 UTC] Saving invoice with values: {"invoice_number":31,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":112,"discount":"0","final_total":112,"paid_amount":112,"remaining_amount":0,"shift_id":3,"items_data":[{"id":"4","name":"dgdgdgd","quantity":2,"price":56,"total":112}]}
[29-Jun-2025 15:23:18 UTC] Invoice inserted successfully with ID: 31
[29-Jun-2025 15:23:18 UTC] Treasury updated with final_total: 112 for treasury_id: 1
[29-Jun-2025 15:24:31 UTC] Error fetching low stock items: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'minimum_quantity' in 'WHERE'
[29-Jun-2025 15:34:53 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale`.`sales_invoice_items`, CONSTRAINT `sales_invoice_items_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`)) in /home/icodesxy/public_html/sale/add_item.php:97
Stack trace:
#0 /home/icodesxy/public_html/sale/add_item.php(97): PDOStatement->execute()
#1 {main}
  thrown in /home/icodesxy/public_html/sale/add_item.php on line 97
[30-Jun-2025 04:44:50 UTC] Saving invoice with values: {"invoice_number":1,"store_id":"1","treasury_id":"1","client_id":1,"user_id":11,"payment_type":"cash","total":12,"discount":"0","final_total":12,"paid_amount":12,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"1","name":"\u0642\u0644\u0645 \u0631\u0635\u0627\u0635","quantity":2,"price":6,"total":12}]}
[30-Jun-2025 04:44:50 UTC] Error saving invoice: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`icodesxy_sale_ahmed`.`sales_invoices`, CONSTRAINT `sales_invoices_ibfk_2` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`))
[30-Jun-2025 04:45:43 UTC] Saving invoice with values: {"invoice_number":1,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":12,"discount":"0","final_total":12,"paid_amount":12,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"1","name":"\u0642\u0644\u0645 \u0631\u0635\u0627\u0635","quantity":2,"price":6,"total":12}]}
[30-Jun-2025 04:45:43 UTC] Invoice inserted successfully with ID: 2
[30-Jun-2025 04:45:43 UTC] Treasury updated with final_total: 12 for treasury_id: 1
[30-Jun-2025 04:53:25 UTC] Saving invoice with values: {"invoice_number":3,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":12,"discount":"0","final_total":12,"paid_amount":12,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"2","name":"\u0643\u0631\u0627\u0633\u0629","quantity":1,"price":6,"total":6},{"id":"1","name":"\u0642\u0644\u0645 \u0631\u0635\u0627\u0635","quantity":1,"price":6,"total":6}]}
[30-Jun-2025 04:53:25 UTC] Invoice inserted successfully with ID: 3
[30-Jun-2025 04:53:25 UTC] Treasury updated with final_total: 12 for treasury_id: 1
[30-Jun-2025 05:00:00 UTC] Error fetching treasury transactions: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'icodesxy_sale_ahmed.invoices' doesn't exist
[30-Jun-2025 05:00:07 UTC] Error fetching treasury transactions: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'icodesxy_sale_ahmed.invoices' doesn't exist
[30-Jun-2025 05:00:14 UTC] Error fetching treasury transactions: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'icodesxy_sale_ahmed.invoices' doesn't exist
[30-Jun-2025 05:00:50 UTC] Saving invoice with values: {"invoice_number":4,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":6,"discount":"0","final_total":6,"paid_amount":6,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"1","name":"\u0642\u0644\u0645 \u0631\u0635\u0627\u0635","quantity":1,"price":6,"total":6}]}
[30-Jun-2025 05:00:50 UTC] Invoice inserted successfully with ID: 4
[30-Jun-2025 05:00:50 UTC] Treasury updated with final_total: 6 for treasury_id: 1
[30-Jun-2025 06:01:19 UTC] PHP Parse error:  syntax error, unexpected identifier "SEARCH_query", expecting variable or "{" or "$" in /home/icodesxy/public_html/sale_ahmed/treasury.php on line 48
[30-Jun-2025 06:01:25 UTC] PHP Parse error:  syntax error, unexpected identifier "SEARCH_query", expecting variable or "{" or "$" in /home/icodesxy/public_html/sale_ahmed/treasury.php on line 48
[30-Jun-2025 08:10:54 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"1","name":"قلم رصاص","available_quantity":96,"quantity":2,"price":6,"total":12}]
)

[30-Jun-2025 08:10:54 UTC] save_purchase not set in POST data. Full POST data: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"1","name":"قلم رصاص","available_quantity":96,"quantity":2,"price":6,"total":12}]
)

[30-Jun-2025 08:11:23 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"1","name":"قلم رصاص","available_quantity":96,"quantity":2,"price":6,"total":12}]
    [save_purchase] => 
)

[30-Jun-2025 08:11:23 UTC] Error creating purchase invoice: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column `icodesxy_sale_ahmed`.`purchase_invoices`.`supplier_id` at row 1
[30-Jun-2025 08:12:12 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 1
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"2","name":"كراسة","available_quantity":9,"quantity":2,"price":6,"total":12}]
    [save_purchase] => 
)

[30-Jun-2025 08:12:12 UTC] Inserted purchase invoice: id=1, invoice_number=1000
[30-Jun-2025 08:12:12 UTC] Inserted purchase item: invoice_id=1, item_id=2, quantity=2, price=6
[30-Jun-2025 08:12:12 UTC] Updated item: item_id=2, new_quantity=4, new_retail_price=6
[30-Jun-2025 08:12:12 UTC] Updated treasury balance: treasury_id=1, old_balance=30.00, new_balance=18
[30-Jun-2025 08:12:12 UTC] Error creating purchase invoice: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'transaction_type' at row 1
[30-Jun-2025 08:15:01 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 1
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"1","name":"قلم رصاص","available_quantity":96,"quantity":1,"price":6,"total":6}]
    [save_purchase] => 
)

[30-Jun-2025 08:15:01 UTC] Inserted purchase invoice: id=2, invoice_number=1000
[30-Jun-2025 08:15:01 UTC] Inserted purchase item: invoice_id=2, item_id=1, quantity=1, price=6
[30-Jun-2025 08:15:01 UTC] Updated item: item_id=1, new_quantity=2, new_retail_price=6
[30-Jun-2025 08:15:01 UTC] Updated treasury balance: treasury_id=1, old_balance=30.00, new_balance=24
[30-Jun-2025 08:15:01 UTC] Error creating purchase invoice: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'transaction_type' at row 1
[30-Jun-2025 08:22:02 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 1
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"1","name":"قلم رصاص","available_quantity":96,"quantity":1,"price":6,"total":6}]
    [save_purchase] => 
)

[30-Jun-2025 08:22:02 UTC] Inserted purchase invoice: id=3, invoice_number=1000
[30-Jun-2025 08:22:02 UTC] Inserted purchase item: invoice_id=3, item_id=1, quantity=1, price=6
[30-Jun-2025 08:22:02 UTC] Updated item: item_id=1, new_quantity=2, new_retail_price=6
[30-Jun-2025 08:22:02 UTC] Updated treasury balance: treasury_id=1, old_balance=30.00, new_balance=24
[30-Jun-2025 08:22:02 UTC] Added treasury transaction: treasury_id=1, amount=6, invoice_id=3, invoice_type=purchase
[30-Jun-2025 08:22:02 UTC] Purchase invoice 3 committed successfully
[30-Jun-2025 08:29:43 UTC] POST request received: Array
(
    [invoice_number] => 1001
    [payment_type] => cash
    [supplier_id] => 1
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"1","name":"قلم رصاص","available_quantity":97,"quantity":1,"price":6,"total":6}]
    [save_purchase] => 
)

[30-Jun-2025 08:29:43 UTC] Inserted purchase invoice: id=4, invoice_number=1001
[30-Jun-2025 08:29:43 UTC] Inserted purchase item: invoice_id=4, item_id=1, quantity=1, price=6
[30-Jun-2025 08:29:43 UTC] Updated item: item_id=1, new_quantity=2, new_retail_price=6
[30-Jun-2025 08:29:43 UTC] Updated treasury balance: treasury_id=1, old_balance=24.00, new_balance=18
[30-Jun-2025 08:29:43 UTC] Added treasury transaction: treasury_id=1, amount=6, invoice_id=4, invoice_type=purchase
[30-Jun-2025 08:29:43 UTC] Purchase invoice 4 committed successfully
[30-Jun-2025 08:30:53 UTC] Error adding expense: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'transaction_type' at row 1
[30-Jun-2025 08:33:28 UTC] Error adding expense: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'transaction_type' at row 1
[30-Jun-2025 08:34:02 UTC] Error adding expense: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'transaction_type' at row 1
[30-Jun-2025 08:47:25 UTC] Saving invoice with values: {"invoice_number":5,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":6,"discount":"0","final_total":6,"paid_amount":6,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"1","name":"\u0642\u0644\u0645 \u0631\u0635\u0627\u0635","quantity":1,"price":6,"total":6}]}
[30-Jun-2025 08:47:25 UTC] Invoice inserted successfully with ID: 5
[30-Jun-2025 08:47:25 UTC] Treasury updated with final_total: 6 for treasury_id: 1
[30-Jun-2025 08:48:42 UTC] Report data count: 5
[30-Jun-2025 08:48:42 UTC] First row sample: {"invoice_id":2,"invoice_number":1,"date":"2025-06-30 07:45:43","total":"12.00","discount":"0.00","final_total":"12.00","paid_amount":"12.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"عميل نقدي","item_name":"قلم رصاص","quantity":2,"price":"6.00","item_total":"12.00","payment_amount":null,"record_type":"invoice","total_paid":12,"adjusted_remaining":0}
[30-Jun-2025 08:48:42 UTC] Print row 0: {"invoice_id":2,"invoice_number":1,"date":"2025-06-30 07:45:43","total":"12.00","discount":"0.00","final_total":"12.00","paid_amount":"12.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"عميل نقدي","item_name":"قلم رصاص","quantity":2,"price":"6.00","item_total":"12.00","payment_amount":null,"record_type":"invoice","total_paid":12,"adjusted_remaining":0}
[30-Jun-2025 08:48:42 UTC] Print row 1: {"invoice_id":3,"invoice_number":3,"date":"2025-06-30 07:53:25","total":"12.00","discount":"0.00","final_total":"12.00","paid_amount":"12.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"عميل نقدي","item_name":"كراسة","quantity":1,"price":"6.00","item_total":"6.00","payment_amount":null,"record_type":"invoice","total_paid":12,"adjusted_remaining":0}
[30-Jun-2025 08:48:42 UTC] Print row 2: {"invoice_id":3,"invoice_number":3,"date":"2025-06-30 07:53:25","total":"12.00","discount":"0.00","final_total":"12.00","paid_amount":"12.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"عميل نقدي","item_name":"قلم رصاص","quantity":1,"price":"6.00","item_total":"6.00","payment_amount":null,"record_type":"invoice","total_paid":12,"adjusted_remaining":0}
[30-Jun-2025 08:48:42 UTC] Print row 3: {"invoice_id":4,"invoice_number":4,"date":"2025-06-30 08:00:50","total":"6.00","discount":"0.00","final_total":"6.00","paid_amount":"6.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"عميل نقدي","item_name":"قلم رصاص","quantity":1,"price":"6.00","item_total":"6.00","payment_amount":null,"record_type":"invoice","total_paid":6,"adjusted_remaining":0}
[30-Jun-2025 08:48:42 UTC] Print row 4: {"invoice_id":5,"invoice_number":5,"date":"2025-06-30 11:47:25","total":"6.00","discount":"0.00","final_total":"6.00","paid_amount":"6.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"عميل نقدي","item_name":"قلم رصاص","quantity":1,"price":"6.00","item_total":"6.00","payment_amount":null,"record_type":"invoice","total_paid":6,"adjusted_remaining":0}
[30-Jun-2025 17:00:04 UTC] No items found in database. Consider adding items.
[30-Jun-2025 17:09:16 UTC] No items found in database. Consider adding items.
[30-Jun-2025 17:33:03 UTC] Saving invoice with values: {"invoice_number":1,"store_id":"1","treasury_id":1,"client_id":"1","user_id":11,"payment_type":"cash","total":60,"discount":"0","final_total":60,"paid_amount":60,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"1","name":"\u0645\u0633\u0637\u0631\u0647","quantity":1,"price":60,"total":60}]}
[30-Jun-2025 17:33:03 UTC] Error saving invoice: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`icodesxy_sale_hasan`.`sales_invoices`, CONSTRAINT `sales_invoices_ibfk_3` FOREIGN KEY (`treasury_id`) REFERENCES `treasuries` (`id`))
[30-Jun-2025 17:34:27 UTC] Saving invoice with values: {"invoice_number":1,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":60,"discount":"0","final_total":60,"paid_amount":60,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"1","name":"\u0645\u0633\u0637\u0631\u0647","quantity":1,"price":60,"total":60}]}
[30-Jun-2025 17:34:27 UTC] Invoice inserted successfully with ID: 2
[30-Jun-2025 17:34:27 UTC] Treasury updated with final_total: 60 for treasury_id: 1
[30-Jun-2025 17:35:03 UTC] Restored pending invoice #3
[30-Jun-2025 17:41:26 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute()
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[30-Jun-2025 17:41:31 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute()
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[30-Jun-2025 17:41:49 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute()
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[30-Jun-2025 17:41:51 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute()
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[30-Jun-2025 17:41:53 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute()
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[30-Jun-2025 17:42:04 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute()
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[30-Jun-2025 17:42:06 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute()
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[01-Jul-2025 21:49:46 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[01-Jul-2025 21:49:46 UTC] Error: No items provided in items_data
[01-Jul-2025 21:49:47 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[01-Jul-2025 21:49:47 UTC] Error: No items provided in items_data
[01-Jul-2025 21:50:13 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[01-Jul-2025 21:50:13 UTC] Error: No items provided in items_data
[01-Jul-2025 21:50:20 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[01-Jul-2025 21:50:20 UTC] Error: No items provided in items_data
[01-Jul-2025 21:50:58 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[01-Jul-2025 21:50:58 UTC] Error: No items provided in items_data
[01-Jul-2025 21:59:30 UTC] Saving invoice with values: {"invoice_number":3,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":900,"discount":"0","final_total":900,"paid_amount":900,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"38","name":"\u0627\u0644\u0647 \u062d\u0627\u0633\u0628\u0647 \u0643\u0627\u0633\u064a\u0648fx991","quantity":1,"price":900,"total":900}]}
[01-Jul-2025 21:59:30 UTC] Invoice inserted successfully with ID: 3
[01-Jul-2025 21:59:30 UTC] Treasury updated with final_total: 900 for treasury_id: 1
[05-Jul-2025 14:33:15 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[05-Jul-2025 14:33:16 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[05-Jul-2025 14:33:18 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[05-Jul-2025 14:33:19 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[05-Jul-2025 14:33:19 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[05-Jul-2025 14:33:36 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[05-Jul-2025 14:33:39 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[05-Jul-2025 14:33:40 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_sale_hasan`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/sale_hasan/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/sale_hasan/categories.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/categories.php on line 35
[05-Jul-2025 15:20:07 UTC] Saving invoice with values: {"invoice_number":4,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":60,"discount":"0","final_total":60,"paid_amount":60,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"69","name":"\u0633\u0645\u0627\u0639\u0647 \u0647\u0627\u0646\u062f \u0641\u0631\u064a m6","quantity":1,"price":60,"total":60}]}
[05-Jul-2025 15:20:07 UTC] Invoice inserted successfully with ID: 4
[05-Jul-2025 15:20:07 UTC] Treasury updated with final_total: 60 for treasury_id: 1
[06-Jul-2025 11:03:58 UTC] Saving invoice with values: {"invoice_number":5,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":15,"discount":"0","final_total":15,"paid_amount":15,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"367","name":"\u0642\u0644\u0645 \u062d\u0628\u0631 \u062f\u064a\u0644\u064a A120","quantity":1,"price":15,"total":15}]}
[06-Jul-2025 11:03:58 UTC] Invoice inserted successfully with ID: 5
[06-Jul-2025 11:03:58 UTC] Treasury updated with final_total: 15 for treasury_id: 1
[06-Jul-2025 11:04:01 UTC] Saving invoice with values: {"invoice_number":6,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":15,"discount":"0","final_total":15,"paid_amount":15,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"367","name":"\u0642\u0644\u0645 \u062d\u0628\u0631 \u062f\u064a\u0644\u064a A120","quantity":1,"price":15,"total":15}]}
[06-Jul-2025 11:04:01 UTC] Invoice inserted successfully with ID: 6
[06-Jul-2025 11:04:01 UTC] Treasury updated with final_total: 15 for treasury_id: 1
[06-Jul-2025 14:52:18 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function exec() in /home/icodesxy/public_html/sale_hasan/backup.php:73
Stack trace:
#0 {main}
  thrown in /home/icodesxy/public_html/sale_hasan/backup.php on line 73
[06-Jul-2025 14:52:27 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 485
[06-Jul-2025 14:52:27 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 486
[06-Jul-2025 14:52:27 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 487
[08-Jul-2025 11:33:25 UTC] Saving invoice with values: {"invoice_number":7,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":12,"discount":"0","final_total":12,"paid_amount":12,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"246","name":"\u0646\u0648\u062a\u0629 \u0644\u0627\u0635\u0642\u0629 \u0635\u063a\u064a\u0631\u0629","quantity":1,"price":12,"total":12}]}
[08-Jul-2025 11:33:25 UTC] Invoice inserted successfully with ID: 7
[08-Jul-2025 11:33:25 UTC] Treasury updated with final_total: 12 for treasury_id: 1
[08-Jul-2025 20:36:26 UTC] Saving invoice with values: {"invoice_number":8,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":55,"discount":"0","final_total":55,"paid_amount":55,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"740","name":"\u062d\u062c\u0631 \u0631\u064a\u0645\u0648\u062a \u0639\u0631\u0628\u064a\u0629 \u0627\u064a\u0646\u064a\u0631\u062c\u064a\u0632\u0631","quantity":1,"price":55,"total":55}]}
[08-Jul-2025 20:36:26 UTC] Invoice inserted successfully with ID: 8
[08-Jul-2025 20:36:26 UTC] Treasury updated with final_total: 55 for treasury_id: 1
[08-Jul-2025 20:37:19 UTC] Saving invoice with values: {"invoice_number":9,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":25,"discount":"0","final_total":25,"paid_amount":25,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"528","name":"\u0628\u0637\u0629 \u0644\u0639\u0628\u0629","quantity":1,"price":25,"total":25}]}
[08-Jul-2025 20:37:19 UTC] Invoice inserted successfully with ID: 9
[08-Jul-2025 20:37:19 UTC] Treasury updated with final_total: 25 for treasury_id: 1
[08-Jul-2025 20:40:15 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 485
[08-Jul-2025 20:40:15 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 486
[08-Jul-2025 20:40:15 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 487
[08-Jul-2025 20:41:15 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 485
[08-Jul-2025 20:41:15 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 486
[08-Jul-2025 20:41:15 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 487
[08-Jul-2025 20:41:34 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 485
[08-Jul-2025 20:41:34 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 486
[08-Jul-2025 20:41:34 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 487
[08-Jul-2025 20:46:30 UTC] Saving invoice with values: {"invoice_number":10,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":38,"discount":"0","final_total":38,"paid_amount":38,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"725","name":"\u0646\u0648\u062a\u0629 \u0635\u063a\u064a\u0631\u0629 \u0645\u0639 \u0642\u0644\u0645","quantity":1,"price":25,"total":25},{"id":"745","name":"\u062f\u0628\u0627\u0628\u064a\u0633 \u062a\u0648\u062f\u0627\u064a","quantity":1,"price":13,"total":13}]}
[08-Jul-2025 20:46:30 UTC] Invoice inserted successfully with ID: 10
[08-Jul-2025 20:46:30 UTC] Treasury updated with final_total: 38 for treasury_id: 1
[08-Jul-2025 21:34:10 UTC] Saving invoice with values: {"invoice_number":11,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":40,"discount":"0","final_total":40,"paid_amount":40,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"694","name":"\u0635\u0644\u0635\u0627\u0644 \u0637\u0628\u064a","quantity":1,"price":25,"total":25},{"id":"206","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 \u0627\u0634\u0643\u0627\u0644","quantity":1,"price":15,"total":15}]}
[08-Jul-2025 21:34:10 UTC] Invoice inserted successfully with ID: 11
[08-Jul-2025 21:34:10 UTC] Treasury updated with final_total: 40 for treasury_id: 1
[09-Jul-2025 12:28:53 UTC] Saving invoice with values: {"invoice_number":12,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":360,"discount":"0","final_total":360,"paid_amount":360,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"399","name":"\u0644\u0641\u0629 \u0648\u0631\u0642 A3","quantity":1,"price":360,"total":360}]}
[09-Jul-2025 12:28:53 UTC] Invoice inserted successfully with ID: 12
[09-Jul-2025 12:28:53 UTC] Treasury updated with final_total: 360 for treasury_id: 1
[09-Jul-2025 12:32:18 UTC] Saving invoice with values: {"invoice_number":13,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":330,"discount":"0","final_total":330,"paid_amount":330,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"302","name":"\u062f\u0628\u0627\u0633\u0647 \u062f\u064a\u0644\u064a Expert","quantity":1,"price":330,"total":330}]}
[09-Jul-2025 12:32:18 UTC] Invoice inserted successfully with ID: 13
[09-Jul-2025 12:32:18 UTC] Treasury updated with final_total: 330 for treasury_id: 1
[09-Jul-2025 15:50:31 UTC] Saving invoice with values: {"invoice_number":14,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":87,"discount":"0","final_total":87,"paid_amount":87,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"555","name":"\u0634\u0645\u0639 \u0639\u064a\u062f \u0645\u064a\u0644\u0627\u062f \u0631\u0641\u064a\u0639","quantity":1,"price":10,"total":10},{"id":"530","name":"\u0645\u0633\u062f\u0633 \u0645\u064a\u0627\u0647 \u0633\u0628\u0648\u0646\u062c \u0628\u0648\u0628","quantity":1,"price":35,"total":35},{"id":"543","name":"\u0645\u0643\u0639\u0628 \u0631\u0648\u0628\u064a\u0643","quantity":1,"price":12,"total":12},{"id":"524","name":"\u0646\u0636\u0627\u0631\u0629 \u0628\u062d\u0631","quantity":1,"price":30,"total":30}]}
[09-Jul-2025 15:50:31 UTC] Invoice inserted successfully with ID: 14
[09-Jul-2025 15:50:31 UTC] Treasury updated with final_total: 87 for treasury_id: 1
[09-Jul-2025 16:16:03 UTC] Saving invoice with values: {"invoice_number":15,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":60,"discount":"0","final_total":60,"paid_amount":60,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"530","name":"\u0645\u0633\u062f\u0633 \u0645\u064a\u0627\u0647 \u0633\u0628\u0648\u0646\u062c \u0628\u0648\u0628","quantity":1,"price":35,"total":35},{"id":"487","name":"\u0644\u0639\u0628 \u0627\u0637\u0641\u0627\u0644","quantity":1,"price":25,"total":25}]}
[09-Jul-2025 16:16:03 UTC] Invoice inserted successfully with ID: 15
[09-Jul-2025 16:16:03 UTC] Treasury updated with final_total: 60 for treasury_id: 1
[09-Jul-2025 16:57:13 UTC] Saving invoice with values: {"invoice_number":16,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":185,"discount":"0","final_total":185,"paid_amount":185,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"61","name":"\u0641\u0644\u0627\u0634\u0647 alhua 16 GB","quantity":1,"price":165,"total":165},{"id":"346","name":"\u062f\u0628\u0627\u0628\u064a\u0633 \u062f\u064a\u0644\u064a \u0635\u063a\u064a\u0631","quantity":1,"price":20,"total":20}]}
[09-Jul-2025 16:57:13 UTC] Invoice inserted successfully with ID: 16
[09-Jul-2025 16:57:13 UTC] Treasury updated with final_total: 185 for treasury_id: 1
[09-Jul-2025 17:38:47 UTC] Saving invoice with values: {"invoice_number":17,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":195,"discount":"0","final_total":195,"paid_amount":195,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"86","name":"\u0634\u0627\u062d\u0646 \u0627\u0648\u0628\u0648 65 \u0648\u0627\u062a","quantity":1,"price":195,"total":195}]}
[09-Jul-2025 17:38:47 UTC] Invoice inserted successfully with ID: 17
[09-Jul-2025 17:38:47 UTC] Treasury updated with final_total: 195 for treasury_id: 1
[09-Jul-2025 18:23:44 UTC] Saving invoice with values: {"invoice_number":18,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":25,"discount":"0","final_total":25,"paid_amount":25,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"712","name":"\u0643\u0648\u0631\u0629 \u0628\u0633\u0648\u0633\u062a\u0629","quantity":1,"price":25,"total":25}]}
[09-Jul-2025 18:23:44 UTC] Invoice inserted successfully with ID: 18
[09-Jul-2025 18:23:44 UTC] Treasury updated with final_total: 25 for treasury_id: 1
[09-Jul-2025 20:25:45 UTC] Saving invoice with values: {"invoice_number":19,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":20,"discount":"0","final_total":20,"paid_amount":20,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"575","name":"\u0645\u064a\u062f\u0627\u0644\u064a\u0647 \u0645\u0627\u0631\u0643\u0627\u062a \u0633\u064a\u0627\u0631\u0627\u062a","quantity":1,"price":20,"total":20}]}
[09-Jul-2025 20:25:45 UTC] Invoice inserted successfully with ID: 19
[09-Jul-2025 20:25:45 UTC] Treasury updated with final_total: 20 for treasury_id: 1
[10-Jul-2025 13:55:27 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 13:55:54 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 13:56:08 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 13:56:17 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 13:56:24 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 13:56:41 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 13:57:26 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 13:59:00 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 13:59:05 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 14:08:12 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 14:25:43 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 14:26:51 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 14:30:56 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 14:54:20 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 14:54:57 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 14:57:30 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 14:57:34 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 15:01:16 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 15:01:49 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 15:03:15 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 15:04:25 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 15:18:11 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 15:33:41 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 15:33:49 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 15:39:34 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 15:40:07 UTC] Database connection failed: SQLSTATE[HY000] [2002] Connection refused
[10-Jul-2025 16:55:38 UTC] Saving invoice with values: {"invoice_number":20,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":30,"discount":"0","final_total":30,"paid_amount":30,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"826","name":"\u0643\u0648\u062a\u0634\u064a\u0646\u0647 \u0628\u0644\u0627\u0633\u062a\u064a\u0643 \u0631\u0648\u064a\u0627\u0644","quantity":1,"price":30,"total":30}]}
[10-Jul-2025 16:55:38 UTC] Invoice inserted successfully with ID: 20
[10-Jul-2025 16:55:38 UTC] Treasury updated with final_total: 30 for treasury_id: 1
[10-Jul-2025 17:28:00 UTC] Saving invoice with values: {"invoice_number":21,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":6,"discount":"0","final_total":6,"paid_amount":6,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"171","name":"\u0642\u0644\u0645 \u0631\u0635\u0627\u0635","quantity":2,"price":3,"total":6}]}
[10-Jul-2025 17:28:00 UTC] Invoice inserted successfully with ID: 21
[10-Jul-2025 17:28:00 UTC] Treasury updated with final_total: 6 for treasury_id: 1
[10-Jul-2025 18:07:10 UTC] Saving invoice with values: {"invoice_number":22,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":50,"discount":"0","final_total":50,"paid_amount":50,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"386","name":"\u0628\u0644\u0627\u0633\u062a\u0631 \u0634\u0641\u0627\u0641 \u0643","quantity":1,"price":50,"total":50}]}
[10-Jul-2025 18:07:10 UTC] Invoice inserted successfully with ID: 22
[10-Jul-2025 18:07:10 UTC] Treasury updated with final_total: 50 for treasury_id: 1
[10-Jul-2025 18:59:42 UTC] Saving invoice with values: {"invoice_number":23,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":4,"discount":"0","final_total":4,"paid_amount":4,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"139","name":"\u0623\u0646\u0628\u0648\u0628\u0629 \u0623\u0645\u064a\u0631","quantity":2,"price":2,"total":4}]}
[10-Jul-2025 18:59:42 UTC] Invoice inserted successfully with ID: 23
[10-Jul-2025 18:59:42 UTC] Treasury updated with final_total: 4 for treasury_id: 1
[10-Jul-2025 19:26:47 UTC] Saving invoice with values: {"invoice_number":24,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":100,"discount":"0","final_total":100,"paid_amount":100,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"567","name":"\u0645\u062d\u0641\u0638\u0629 \u062c\u0644\u062f \u0637\u0628\u064a\u0639\u064a \u0648\u0633\u0637","quantity":1,"price":100,"total":100}]}
[10-Jul-2025 19:26:47 UTC] Invoice inserted successfully with ID: 24
[10-Jul-2025 19:26:47 UTC] Treasury updated with final_total: 100 for treasury_id: 1
[10-Jul-2025 21:15:03 UTC] Error fetching sales return: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sri.product_id' in 'ON'
[10-Jul-2025 21:16:01 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 485
[10-Jul-2025 21:16:01 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 486
[10-Jul-2025 21:16:01 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 487
[13-Jul-2025 15:45:22 UTC] Saving invoice with values: {"invoice_number":24,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":65,"discount":"0","final_total":65,"paid_amount":65,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"803","name":"\u0643\u0627\u0628\u0644 138 X-SCOOT","quantity":1,"price":65,"total":65}]}
[13-Jul-2025 15:45:22 UTC] Invoice inserted successfully with ID: 25
[13-Jul-2025 15:45:22 UTC] Treasury updated with final_total: 65 for treasury_id: 1
[15-Jul-2025 16:29:52 UTC] Saving invoice with values: {"invoice_number":26,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":7,"discount":"0","final_total":7,"paid_amount":7,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"588","name":"\u062d\u0638\u0627\u0638\u0647","quantity":1,"price":7,"total":7}]}
[15-Jul-2025 16:29:52 UTC] Invoice inserted successfully with ID: 26
[15-Jul-2025 16:29:52 UTC] Treasury updated with final_total: 7 for treasury_id: 1
[15-Jul-2025 17:18:11 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 485
[15-Jul-2025 17:18:11 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 486
[15-Jul-2025 17:18:11 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/sale_hasan/sales_invoices.php on line 487
[15-Jul-2025 17:19:30 UTC] POST request received: Array
(
    [id] => 26
    [store_id] => 1
    [treasury_id] => 1
    [client_id] => 1
    [payment_type] => cash
    [paid_amount] => 7.00
    [discount_value] => 0.00
    [discount_type] => fixed
    [items_data] => [{"id":588,"name":"حظاظه","quantity":2,"price":7,"total":14}]
    [save_changes] => 
)

[15-Jul-2025 17:19:30 UTC] save_changes is set
[15-Jul-2025 17:19:30 UTC] Received POST data: store_id=1, treasury_id=1, client_id=1, payment_type=cash, discount_value=0, paid_amount=7, items_data=Array
(
    [0] => Array
        (
            [id] => 588
            [name] => حظاظه
            [quantity] => 2
            [price] => 7
            [total] => 14
        )

)

[15-Jul-2025 17:19:30 UTC] Item processed: id=588, quantity=2, price=7, subtotal=14
[15-Jul-2025 17:19:30 UTC] Calculated totals: total=14, discount=0, final_total=14, remaining_amount=0
[15-Jul-2025 17:19:30 UTC] Restored quantity for item_id=588, quantity=1
[15-Jul-2025 17:19:30 UTC] Deleted old items for invoice_id=26
[15-Jul-2025 17:19:30 UTC] Checking available quantity for item_id=588: available=24, requested=2
[15-Jul-2025 17:19:30 UTC] Inserted item: invoice_id=26, item_id=588, quantity=2, price=7
[15-Jul-2025 17:19:30 UTC] Updated item quantity: item_id=588, sold_quantity=2
[15-Jul-2025 17:19:30 UTC] Updated invoice 26: total=14, final_total=14
[15-Jul-2025 17:19:30 UTC] Invoice 26 committed successfully
[15-Jul-2025 17:22:21 UTC] Saving invoice with values: {"invoice_number":27,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":435,"discount":"0","final_total":435,"paid_amount":435,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"569","name":"\u0645\u062d\u0641\u0638\u0629 \u0631\u062c\u0627\u0644\u064a 2 \u0643\u0628\u0633\u0648\u0644\u0629","quantity":1,"price":60,"total":60},{"id":"712","name":"\u0643\u0648\u0631\u0629 \u0628\u0633\u0648\u0633\u062a\u0629","quantity":1,"price":30,"total":30},{"id":"516","name":"\u0643\u064a\u0633 \u0628\u0644\u0627\u0644\u064a\u0646 10 \u0628\u0627\u0644\u0648\u0646\u0629","quantity":1,"price":15,"total":15},{"id":"806","name":"\u0643\u0627\u0628\u0644 60W X-SCOOT","quantity":1,"price":75,"total":75},{"id":"670","name":"\u062e\u0627\u062a\u0645 \u0627\u0637\u0641\u0627\u0644","quantity":1,"price":5,"total":5},{"id":"545","name":"\u0639\u0631\u0628\u064a\u0629 \u0631\u064a\u0645\u0648\u062a","quantity":1,"price":250,"total":250}]}
[15-Jul-2025 17:22:21 UTC] Invoice inserted successfully with ID: 27
[15-Jul-2025 17:22:21 UTC] Treasury updated with final_total: 435 for treasury_id: 1
[15-Jul-2025 17:22:28 UTC] Saving invoice with values: {"invoice_number":28,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":435,"discount":"0","final_total":435,"paid_amount":435,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"569","name":"\u0645\u062d\u0641\u0638\u0629 \u0631\u062c\u0627\u0644\u064a 2 \u0643\u0628\u0633\u0648\u0644\u0629","quantity":1,"price":60,"total":60},{"id":"712","name":"\u0643\u0648\u0631\u0629 \u0628\u0633\u0648\u0633\u062a\u0629","quantity":1,"price":30,"total":30},{"id":"516","name":"\u0643\u064a\u0633 \u0628\u0644\u0627\u0644\u064a\u0646 10 \u0628\u0627\u0644\u0648\u0646\u0629","quantity":1,"price":15,"total":15},{"id":"806","name":"\u0643\u0627\u0628\u0644 60W X-SCOOT","quantity":1,"price":75,"total":75},{"id":"670","name":"\u062e\u0627\u062a\u0645 \u0627\u0637\u0641\u0627\u0644","quantity":1,"price":5,"total":5},{"id":"545","name":"\u0639\u0631\u0628\u064a\u0629 \u0631\u064a\u0645\u0648\u062a","quantity":1,"price":250,"total":250}]}
[15-Jul-2025 17:22:28 UTC] Invoice inserted successfully with ID: 28
[15-Jul-2025 17:22:28 UTC] Error saving invoice: الكمية غير كافية للصنف: عربية ريموت
[15-Jul-2025 17:38:07 UTC] Saving invoice with values: {"invoice_number":28,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":743,"discount":"5","final_total":738,"paid_amount":738,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"468","name":"\u0645\u062f\u0641\u0639 \u0648\u0631\u0642 \u0643\u0628\u064a\u0631 60 \u0633\u0645","quantity":1,"price":35,"total":35},{"id":"70","name":"\u0648\u0635\u0644\u0629 \u0634\u0627\u062d\u0646 \u0639\u0627\u062f\u064a\u0647","quantity":1,"price":45,"total":45},{"id":"514","name":"\u0643\u0648\u0631\u0647 \u0628\u0644\u0627\u0633\u062a\u064a\u0643","quantity":1,"price":15,"total":15},{"id":"674","name":"\u062a\u0648\u0643\u0629","quantity":1,"price":18,"total":18},{"id":"524","name":"\u0646\u0636\u0627\u0631\u0629 \u0628\u062d\u0631","quantity":4,"price":30,"total":120},{"id":"805","name":"\u0634\u0627\u062d\u0646 \u0627\u0645\u0631\u064a\u0643\u064a X-SCOOT","quantity":1,"price":115,"total":115},{"id":"105","name":"\u0634\u0631\u064a\u0637 \u0639\u0644\u0627\u0642\u0629 ID","quantity":1,"price":10,"total":10},{"id":"863","name":"\u0628\u0627\u0632\u0644 \u062e\u0634\u0628 \u0643\u0628\u064a\u0631","quantity":1,"price":50,"total":50},{"id":"692","name":"\u0635\u0644\u0635\u0627\u0644 \u0641\u0648\u0645","quantity":1,"price":20,"total":20},{"id":"214","name":"\u0638\u0631\u0641 \u062c\u0648\u0627\u0628 \u0643\u0628\u064a\u0631","quantity":3,"price":10,"total":30},{"id":"484","name":"\u0644\u0639\u0628 \u0627\u0637\u0641\u0627\u0644","quantity":2,"price":35,"total":70},{"id":"238","name":"\u0642\u0635\u0635 \u0627\u0637\u0641\u0627\u0644","quantity":6,"price":5,"total":30},{"id":"452","name":"\u0643\u062a\u0628 \u062a\u0639\u0644\u064a\u0645\u064a\u0629","quantity":1,"price":15,"total":15},{"id":"396","name":"\u0642\u0635\u0635 \u0627\u0637\u0641\u0627\u0644","quantity":1,"price":10,"total":10},{"id":"150","name":"\u0643\u0634\u0643\u0648\u0644 \u0639\u0631\u0628\u064a 56 \u0648\u0631\u0642\u0629","quantity":10,"price":8,"total":80},{"id":"163","name":"\u0643\u0634\u0643\u0648\u0644 56 \u0648\u0631\u0642\u0629 E","quantity":10,"price":8,"total":80}]}
[15-Jul-2025 17:38:07 UTC] Invoice inserted successfully with ID: 29
[15-Jul-2025 17:38:07 UTC] Treasury updated with final_total: 738 for treasury_id: 1
[15-Jul-2025 17:38:40 UTC] POST request received: Array
(
    [id] => 29
    [store_id] => 1
    [treasury_id] => 1
    [client_id] => 1
    [payment_type] => cash
    [paid_amount] => 738.00
    [discount_value] => 25.00
    [discount_type] => percentage
    [items_data] => [{"id":468,"name":"مدفع ورق كبير 60 سم","quantity":1,"price":35,"total":35},{"id":70,"name":"وصلة شاحن عاديه","quantity":1,"price":45,"total":45},{"id":514,"name":"كوره بلاستيك","quantity":1,"price":15,"total":15},{"id":674,"name":"توكة","quantity":1,"price":18,"total":18},{"id":524,"name":"نضارة بحر","quantity":4,"price":30,"total":120},{"id":805,"name":"شاحن امريكي X-SCOOT","quantity":1,"price":115,"total":115},{"id":105,"name":"شريط علاقة ID","quantity":1,"price":10,"total":10},{"id":863,"name":"بازل خشب كبير","quantity":1,"price":50,"total":50},{"id":692,"name":"صلصال فوم","quantity":1,"price":20,"total":20},{"id":214,"name":"ظرف جواب كبير","quantity":3,"price":10,"total":30},{"id":484,"name":"لعب اطفال","quantity":2,"price":35,"total":70},{"id":238,"name":"قصص اطفال","quantity":6,"price":5,"total":30},{"id":452,"name":"كتب تعليمية ","quantity":1,"price":15,"total":15},{"id":396,"name":"قصص اطفال","quantity":1,"price":10,"total":10},{"id":150,"name":"كشكول عربي 56 ورقة","quantity":10,"price":8,"total":80},{"id":163,"name":"كشكول 56 ورقة E","quantity":10,"price":8,"total":80}]
    [save_changes] => 
)

[15-Jul-2025 17:38:40 UTC] save_changes is set
[15-Jul-2025 17:38:40 UTC] Received POST data: store_id=1, treasury_id=1, client_id=1, payment_type=cash, discount_value=25, paid_amount=738, items_data=Array
(
    [0] => Array
        (
            [id] => 468
            [name] => مدفع ورق كبير 60 سم
            [quantity] => 1
            [price] => 35
            [total] => 35
        )

    [1] => Array
        (
            [id] => 70
            [name] => وصلة شاحن عاديه
            [quantity] => 1
            [price] => 45
            [total] => 45
        )

    [2] => Array
        (
            [id] => 514
            [name] => كوره بلاستيك
            [quantity] => 1
            [price] => 15
            [total] => 15
        )

    [3] => Array
        (
            [id] => 674
            [name] => توكة
            [quantity] => 1
            [price] => 18
            [total] => 18
        )

    [4] => Array
        (
            [id] => 524
            [name] => نضارة بحر
            [quantity] => 4
            [price] => 30
            [total] => 120
        )

    [5] => Array
        (
            [id] => 805
            [name] => شاحن امريكي X-SCOOT
            [quantity] => 1
            [price] => 115
            [total] => 115
        )

    [6] => Array
        (
            [id] => 105
            [name] => شريط علاقة ID
            [quantity] => 1
            [price] => 10
            [total] => 10
        )

    [7] => Array
        (
            [id] => 863
            [name] => بازل خشب كبير
            [quantity] => 1
            [price] => 50
            [total] => 50
        )

    [8] => Array
        (
            [id] => 692
            [name] => صلصال فوم
            [quantity] => 1
            [price] => 20
            [total] => 20
        )

    [9] => Array
        (
            [id] => 214
            [name] => ظرف جواب كبير
            [quantity] => 3
            [price] => 10
            [total] => 30
        )

    [10] => Array
        (
            [id] => 484
            [name] => لعب اطفال
            [quantity] => 2
            [price] => 35
            [total] => 70
        )

    [11] => Array
        (
            [id] => 238
            [name] => قصص اطفال
            [quantity] => 6
            [price] => 5
            [total] => 30
        )

    [12] => Array
        (
            [id] => 452
            [name] => كتب تعليمية 
            [quantity] => 1
            [price] => 15
            [total] => 15
        )

    [13] => Array
        (
            [id] => 396
            [name] => قصص اطفال
            [quantity] => 1
            [price] => 10
            [total] => 10
        )

    [14] => Array
        (
            [id] => 150
            [name] => كشكول عربي 56 ورقة
            [quantity] => 10
            [price] => 8
            [total] => 80
        )

    [15] => Array
        (
            [id] => 163
            [name] => كشكول 56 ورقة E
            [quantity] => 10
            [price] => 8
            [total] => 80
        )

)

[15-Jul-2025 17:38:40 UTC] Item processed: id=468, quantity=1, price=35, subtotal=35
[15-Jul-2025 17:38:40 UTC] Item processed: id=70, quantity=1, price=45, subtotal=45
[15-Jul-2025 17:38:40 UTC] Item processed: id=514, quantity=1, price=15, subtotal=15
[15-Jul-2025 17:38:40 UTC] Item processed: id=674, quantity=1, price=18, subtotal=18
[15-Jul-2025 17:38:40 UTC] Item processed: id=524, quantity=4, price=30, subtotal=120
[15-Jul-2025 17:38:40 UTC] Item processed: id=805, quantity=1, price=115, subtotal=115
[15-Jul-2025 17:38:40 UTC] Item processed: id=105, quantity=1, price=10, subtotal=10
[15-Jul-2025 17:38:40 UTC] Item processed: id=863, quantity=1, price=50, subtotal=50
[15-Jul-2025 17:38:40 UTC] Item processed: id=692, quantity=1, price=20, subtotal=20
[15-Jul-2025 17:38:40 UTC] Item processed: id=214, quantity=3, price=10, subtotal=30
[15-Jul-2025 17:38:40 UTC] Item processed: id=484, quantity=2, price=35, subtotal=70
[15-Jul-2025 17:38:40 UTC] Item processed: id=238, quantity=6, price=5, subtotal=30
[15-Jul-2025 17:38:40 UTC] Item processed: id=452, quantity=1, price=15, subtotal=15
[15-Jul-2025 17:38:40 UTC] Item processed: id=396, quantity=1, price=10, subtotal=10
[15-Jul-2025 17:38:40 UTC] Item processed: id=150, quantity=10, price=8, subtotal=80
[15-Jul-2025 17:38:40 UTC] Item processed: id=163, quantity=10, price=8, subtotal=80
[15-Jul-2025 17:38:40 UTC] Calculated totals: total=743, discount=185.75, final_total=557.25, remaining_amount=0
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=468, quantity=1
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=70, quantity=1
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=514, quantity=1
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=674, quantity=1
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=524, quantity=4
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=805, quantity=1
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=105, quantity=1
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=863, quantity=1
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=692, quantity=1
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=214, quantity=3
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=484, quantity=2
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=238, quantity=6
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=452, quantity=1
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=396, quantity=1
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=150, quantity=10
[15-Jul-2025 17:38:40 UTC] Restored quantity for item_id=163, quantity=10
[15-Jul-2025 17:38:40 UTC] Deleted old items for invoice_id=29
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=468: available=3, requested=1
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=468, quantity=1, price=35
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=468, sold_quantity=1
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=70: available=5, requested=1
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=70, quantity=1, price=45
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=70, sold_quantity=1
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=514: available=24, requested=1
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=514, quantity=1, price=15
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=514, sold_quantity=1
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=674: available=12, requested=1
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=674, quantity=1, price=18
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=674, sold_quantity=1
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=524: available=5, requested=4
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=524, quantity=4, price=30
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=524, sold_quantity=4
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=805: available=6, requested=1
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=805, quantity=1, price=115
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=805, sold_quantity=1
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=105: available=120, requested=1
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=105, quantity=1, price=10
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=105, sold_quantity=1
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=863: available=12, requested=1
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=863, quantity=1, price=50
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=863, sold_quantity=1
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=692: available=15, requested=1
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=692, quantity=1, price=20
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=692, sold_quantity=1
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=214: available=50, requested=3
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=214, quantity=3, price=10
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=214, sold_quantity=3
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=484: available=6, requested=2
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=484, quantity=2, price=35
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=484, sold_quantity=2
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=238: available=40, requested=6
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=238, quantity=6, price=5
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=238, sold_quantity=6
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=452: available=1, requested=1
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=452, quantity=1, price=15
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=452, sold_quantity=1
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=396: available=10, requested=1
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=396, quantity=1, price=10
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=396, sold_quantity=1
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=150: available=110, requested=10
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=150, quantity=10, price=8
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=150, sold_quantity=10
[15-Jul-2025 17:38:40 UTC] Checking available quantity for item_id=163: available=550, requested=10
[15-Jul-2025 17:38:40 UTC] Inserted item: invoice_id=29, item_id=163, quantity=10, price=8
[15-Jul-2025 17:38:40 UTC] Updated item quantity: item_id=163, sold_quantity=10
[15-Jul-2025 17:38:40 UTC] Updated invoice 29: total=743, final_total=557.25
[15-Jul-2025 17:38:40 UTC] Invoice 29 committed successfully
[15-Jul-2025 17:38:57 UTC] POST request received: Array
(
    [id] => 29
    [store_id] => 1
    [treasury_id] => 1
    [client_id] => 1
    [payment_type] => cash
    [paid_amount] => 738.00
    [discount_value] => 25
    [discount_type] => fixed
    [items_data] => [{"id":468,"name":"مدفع ورق كبير 60 سم","quantity":1,"price":35,"total":35},{"id":70,"name":"وصلة شاحن عاديه","quantity":1,"price":45,"total":45},{"id":514,"name":"كوره بلاستيك","quantity":1,"price":15,"total":15},{"id":674,"name":"توكة","quantity":1,"price":18,"total":18},{"id":524,"name":"نضارة بحر","quantity":4,"price":30,"total":120},{"id":805,"name":"شاحن امريكي X-SCOOT","quantity":1,"price":115,"total":115},{"id":105,"name":"شريط علاقة ID","quantity":1,"price":10,"total":10},{"id":863,"name":"بازل خشب كبير","quantity":1,"price":50,"total":50},{"id":692,"name":"صلصال فوم","quantity":1,"price":20,"total":20},{"id":214,"name":"ظرف جواب كبير","quantity":3,"price":10,"total":30},{"id":484,"name":"لعب اطفال","quantity":2,"price":35,"total":70},{"id":238,"name":"قصص اطفال","quantity":6,"price":5,"total":30},{"id":452,"name":"كتب تعليمية ","quantity":1,"price":15,"total":15},{"id":396,"name":"قصص اطفال","quantity":1,"price":10,"total":10},{"id":150,"name":"كشكول عربي 56 ورقة","quantity":10,"price":8,"total":80},{"id":163,"name":"كشكول 56 ورقة E","quantity":10,"price":8,"total":80}]
    [save_changes] => 
)

[15-Jul-2025 17:38:57 UTC] save_changes is set
[15-Jul-2025 17:38:57 UTC] Received POST data: store_id=1, treasury_id=1, client_id=1, payment_type=cash, discount_value=25, paid_amount=738, items_data=Array
(
    [0] => Array
        (
            [id] => 468
            [name] => مدفع ورق كبير 60 سم
            [quantity] => 1
            [price] => 35
            [total] => 35
        )

    [1] => Array
        (
            [id] => 70
            [name] => وصلة شاحن عاديه
            [quantity] => 1
            [price] => 45
            [total] => 45
        )

    [2] => Array
        (
            [id] => 514
            [name] => كوره بلاستيك
            [quantity] => 1
            [price] => 15
            [total] => 15
        )

    [3] => Array
        (
            [id] => 674
            [name] => توكة
            [quantity] => 1
            [price] => 18
            [total] => 18
        )

    [4] => Array
        (
            [id] => 524
            [name] => نضارة بحر
            [quantity] => 4
            [price] => 30
            [total] => 120
        )

    [5] => Array
        (
            [id] => 805
            [name] => شاحن امريكي X-SCOOT
            [quantity] => 1
            [price] => 115
            [total] => 115
        )

    [6] => Array
        (
            [id] => 105
            [name] => شريط علاقة ID
            [quantity] => 1
            [price] => 10
            [total] => 10
        )

    [7] => Array
        (
            [id] => 863
            [name] => بازل خشب كبير
            [quantity] => 1
            [price] => 50
            [total] => 50
        )

    [8] => Array
        (
            [id] => 692
            [name] => صلصال فوم
            [quantity] => 1
            [price] => 20
            [total] => 20
        )

    [9] => Array
        (
            [id] => 214
            [name] => ظرف جواب كبير
            [quantity] => 3
            [price] => 10
            [total] => 30
        )

    [10] => Array
        (
            [id] => 484
            [name] => لعب اطفال
            [quantity] => 2
            [price] => 35
            [total] => 70
        )

    [11] => Array
        (
            [id] => 238
            [name] => قصص اطفال
            [quantity] => 6
            [price] => 5
            [total] => 30
        )

    [12] => Array
        (
            [id] => 452
            [name] => كتب تعليمية 
            [quantity] => 1
            [price] => 15
            [total] => 15
        )

    [13] => Array
        (
            [id] => 396
            [name] => قصص اطفال
            [quantity] => 1
            [price] => 10
            [total] => 10
        )

    [14] => Array
        (
            [id] => 150
            [name] => كشكول عربي 56 ورقة
            [quantity] => 10
            [price] => 8
            [total] => 80
        )

    [15] => Array
        (
            [id] => 163
            [name] => كشكول 56 ورقة E
            [quantity] => 10
            [price] => 8
            [total] => 80
        )

)

[15-Jul-2025 17:38:57 UTC] Item processed: id=468, quantity=1, price=35, subtotal=35
[15-Jul-2025 17:38:57 UTC] Item processed: id=70, quantity=1, price=45, subtotal=45
[15-Jul-2025 17:38:57 UTC] Item processed: id=514, quantity=1, price=15, subtotal=15
[15-Jul-2025 17:38:57 UTC] Item processed: id=674, quantity=1, price=18, subtotal=18
[15-Jul-2025 17:38:57 UTC] Item processed: id=524, quantity=4, price=30, subtotal=120
[15-Jul-2025 17:38:57 UTC] Item processed: id=805, quantity=1, price=115, subtotal=115
[15-Jul-2025 17:38:57 UTC] Item processed: id=105, quantity=1, price=10, subtotal=10
[15-Jul-2025 17:38:57 UTC] Item processed: id=863, quantity=1, price=50, subtotal=50
[15-Jul-2025 17:38:57 UTC] Item processed: id=692, quantity=1, price=20, subtotal=20
[15-Jul-2025 17:38:57 UTC] Item processed: id=214, quantity=3, price=10, subtotal=30
[15-Jul-2025 17:38:57 UTC] Item processed: id=484, quantity=2, price=35, subtotal=70
[15-Jul-2025 17:38:57 UTC] Item processed: id=238, quantity=6, price=5, subtotal=30
[15-Jul-2025 17:38:57 UTC] Item processed: id=452, quantity=1, price=15, subtotal=15
[15-Jul-2025 17:38:57 UTC] Item processed: id=396, quantity=1, price=10, subtotal=10
[15-Jul-2025 17:38:57 UTC] Item processed: id=150, quantity=10, price=8, subtotal=80
[15-Jul-2025 17:38:57 UTC] Item processed: id=163, quantity=10, price=8, subtotal=80
[15-Jul-2025 17:38:57 UTC] Calculated totals: total=743, discount=25, final_total=718, remaining_amount=0
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=468, quantity=1
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=70, quantity=1
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=514, quantity=1
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=674, quantity=1
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=524, quantity=4
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=805, quantity=1
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=105, quantity=1
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=863, quantity=1
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=692, quantity=1
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=214, quantity=3
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=484, quantity=2
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=238, quantity=6
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=452, quantity=1
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=396, quantity=1
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=150, quantity=10
[15-Jul-2025 17:38:57 UTC] Restored quantity for item_id=163, quantity=10
[15-Jul-2025 17:38:57 UTC] Deleted old items for invoice_id=29
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=468: available=3, requested=1
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=468, quantity=1, price=35
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=468, sold_quantity=1
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=70: available=5, requested=1
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=70, quantity=1, price=45
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=70, sold_quantity=1
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=514: available=24, requested=1
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=514, quantity=1, price=15
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=514, sold_quantity=1
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=674: available=12, requested=1
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=674, quantity=1, price=18
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=674, sold_quantity=1
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=524: available=5, requested=4
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=524, quantity=4, price=30
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=524, sold_quantity=4
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=805: available=6, requested=1
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=805, quantity=1, price=115
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=805, sold_quantity=1
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=105: available=120, requested=1
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=105, quantity=1, price=10
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=105, sold_quantity=1
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=863: available=12, requested=1
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=863, quantity=1, price=50
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=863, sold_quantity=1
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=692: available=15, requested=1
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=692, quantity=1, price=20
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=692, sold_quantity=1
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=214: available=50, requested=3
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=214, quantity=3, price=10
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=214, sold_quantity=3
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=484: available=6, requested=2
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=484, quantity=2, price=35
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=484, sold_quantity=2
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=238: available=40, requested=6
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=238, quantity=6, price=5
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=238, sold_quantity=6
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=452: available=1, requested=1
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=452, quantity=1, price=15
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=452, sold_quantity=1
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=396: available=10, requested=1
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=396, quantity=1, price=10
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=396, sold_quantity=1
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=150: available=110, requested=10
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=150, quantity=10, price=8
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=150, sold_quantity=10
[15-Jul-2025 17:38:57 UTC] Checking available quantity for item_id=163: available=550, requested=10
[15-Jul-2025 17:38:57 UTC] Inserted item: invoice_id=29, item_id=163, quantity=10, price=8
[15-Jul-2025 17:38:57 UTC] Updated item quantity: item_id=163, sold_quantity=10
[15-Jul-2025 17:38:57 UTC] Updated invoice 29: total=743, final_total=718
[15-Jul-2025 17:38:57 UTC] Invoice 29 committed successfully
[15-Jul-2025 17:54:16 UTC] Saving invoice with values: {"invoice_number":30,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":520,"discount":"0","final_total":520,"paid_amount":520,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"803","name":"\u0643\u0627\u0628\u0644 138 X-SCOOT","quantity":1,"price":65,"total":65},{"id":"757","name":"\u0633\u0645\u0627\u0639\u0647 \u0633\u0644\u0643 \u0628\u0644\u0648 \u0633\u0628\u0643\u062a\u0631\u0648\u0645","quantity":1,"price":70,"total":70},{"id":"722","name":"\u0643\u0634\u0643\u0648\u0644 \u0633\u0644\u0643 \u0645\u062d\u0645\u062f \u0648\u0627\u0645\u064a\u0631\u0629 140 \u0648\u0631\u0642\u0629","quantity":1,"price":48,"total":48},{"id":"256","name":"\u0627\u0633\u062a\u064a\u0643\u0629 \u0641\u0627\u0628\u0631\u064a\u0643\u0627\u0633\u0644 \u0632\u0631\u0642\u0627\u0621 \u0635\u063a\u064a\u0631\u0629","quantity":1,"price":9,"total":9},{"id":"716","name":"\u0642\u0644\u0645 \u0631\u0648\u062a\u0648 \u0628\u0648\u0644","quantity":5,"price":4,"total":20},{"id":"430","name":"\u062c\u0632\u0621 \u0639\u0645","quantity":1,"price":15,"total":15},{"id":"683","name":"\u0628\u0644\u0648\u0646\u0629 \u0635\u0627\u0631\u0648\u062e","quantity":5,"price":2,"total":10},{"id":"116","name":"\u062d\u0627\u0645\u0644 \u0627\u0642\u0644\u0627\u0645 DGG","quantity":1,"price":60,"total":60},{"id":"692","name":"\u0635\u0644\u0635\u0627\u0644 \u0641\u0648\u0645","quantity":2,"price":20,"total":40},{"id":"285","name":"\u0628\u0631\u0627\u064a\u0647 \u0645\u0639\u062f\u0646","quantity":1,"price":10,"total":10},{"id":"407","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 MATIC nikan","quantity":2,"price":5,"total":10},{"id":"575","name":"\u0645\u064a\u062f\u0627\u0644\u064a\u0647 \u0645\u0627\u0631\u0643\u0627\u062a \u0633\u064a\u0627\u0631\u0627\u062a","quantity":1,"price":20,"total":20},{"id":"608","name":"\u0643\u0648\u0631\u0647 \u063a\u0627\u0646\u0627","quantity":1,"price":80,"total":80},{"id":"428","name":"\u0643\u0631\u0627\u0633\u0629 \u062a\u0644\u0648\u064a\u0646","quantity":2,"price":15,"total":30},{"id":"682","name":"\u0628\u0644\u0648\u0646\u0629 \u0643\u0628\u064a\u0631\u0629","quantity":1,"price":5,"total":5},{"id":"395","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 \u0627\u0632\u0631\u0642 STAEDTLER","quantity":1,"price":10,"total":10},{"id":"711","name":"\u062f\u0648\u0633\u064a\u0647 \u0643\u0628\u0633\u0648\u0644\u0629 \u0628\u0631\u064a\u0645\u0627","quantity":1,"price":8,"total":8},{"id":"229","name":"\u0639\u0642\u062f \u0627\u064a\u062c\u0627\u0631","quantity":4,"price":2.5,"total":10}]}
[15-Jul-2025 17:54:16 UTC] Invoice inserted successfully with ID: 30
[15-Jul-2025 17:54:16 UTC] Treasury updated with final_total: 520 for treasury_id: 1
[15-Jul-2025 18:04:09 UTC] Saving invoice with values: {"invoice_number":31,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":417,"discount":"0","final_total":417,"paid_amount":417,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"341","name":"\u0643\u0648\u0631\u064a\u0643\u062a\u0648\u0631 ROCK","quantity":1,"price":7,"total":7},{"id":"428","name":"\u0643\u0631\u0627\u0633\u0629 \u062a\u0644\u0648\u064a\u0646","quantity":1,"price":15,"total":15},{"id":"387","name":"\u0628\u0644\u0627\u0633\u062a\u0631 \u0634\u0641\u0627\u0641 \u0639\u0631\u064a\u0636 \u0635","quantity":1,"price":10,"total":10},{"id":"727","name":"\u062d\u062c\u0631 \u0631\u064a\u0645\u0648\u062a \u0627\u064a\u0641\u064a\u0631\u064a\u062f\u064a \u0627\u062d\u0645\u0631","quantity":2,"price":25,"total":50},{"id":"514","name":"\u0643\u0648\u0631\u0647 \u0628\u0644\u0627\u0633\u062a\u064a\u0643","quantity":2,"price":15,"total":30},{"id":"487","name":"\u0644\u0639\u0628 \u0627\u0637\u0641\u0627\u0644","quantity":1,"price":25,"total":25},{"id":"548","name":"\u0645\u0633\u062f\u0633 \u0639\u0644\u0628\u0629","quantity":1,"price":120,"total":120},{"id":"423","name":"\u0643\u062a\u0631","quantity":1,"price":15,"total":15},{"id":"524","name":"\u0646\u0636\u0627\u0631\u0629 \u0628\u062d\u0631","quantity":1,"price":30,"total":30},{"id":"525","name":"\u0646\u0636\u0627\u0631\u0629 \u0628\u062d\u0631 \u0634\u0646\u0637\u0629","quantity":1,"price":40,"total":40},{"id":"271","name":"\u062f\u0648\u0633\u064a\u0647 \u062f\u064a\u0644\u064a \u0634\u0641\u0627\u0641","quantity":1,"price":10,"total":10},{"id":"803","name":"\u0643\u0627\u0628\u0644 138 X-SCOOT","quantity":1,"price":65,"total":65}]}
[15-Jul-2025 18:04:09 UTC] Invoice inserted successfully with ID: 31
[15-Jul-2025 18:04:09 UTC] Treasury updated with final_total: 417 for treasury_id: 1
[15-Jul-2025 18:23:04 UTC] Saving invoice with values: {"invoice_number":32,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":793,"discount":"5","final_total":788,"paid_amount":788,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"519","name":"\u0639\u0631\u0628\u064a\u0629 2\u0641\u064a1","quantity":1,"price":55,"total":55},{"id":"486","name":"\u0645\u064a\u062f\u0627\u0644\u064a\u0629 \u0645\u0641\u0627\u062a\u064a\u062d \u0627\u0634\u0643\u0627\u0644","quantity":1,"price":12,"total":12},{"id":"250","name":"\u0627\u0633\u062a\u064a\u0643\u0629 \u062a\u0648\u062f\u0627\u064a \u0633\u0648\u062f\u0627\u0621","quantity":1,"price":3,"total":3},{"id":"394","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 \u0641\u0627\u0628\u0631\u064a\u0643\u0627\u0633\u0644 \u0627\u0633\u0648\u062f","quantity":1,"price":10,"total":10},{"id":"870","name":"\u0643\u0631\u0627\u0633\u0647 E","quantity":1,"price":4,"total":4},{"id":"241","name":"\u0643\u0634\u0643\u0648\u0644 \u0633\u0644\u0643 \u0648\u0633\u0637 100 \u0648\u0631\u0642\u0647 \u0627\u0644\u0646\u0647\u0636\u0647","quantity":1,"price":45,"total":45},{"id":"411","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 \u0627\u0637\u0641\u0627\u0644 nikan","quantity":1,"price":5,"total":5},{"id":"244","name":"\u0643\u0634\u0643\u0648\u0644 \u0633\u0644\u0643 \u0648\u0633\u0637 60 \u0648\u0631\u0642\u0647 \u0627\u0644\u0646\u0647\u0636\u0647","quantity":1,"price":30,"total":30},{"id":"266","name":"\u0643\u0634\u0648\u0644 \u0633\u0644\u0643 \u0635\u063a\u064a\u0631 240 \u0648\u0631\u0642\u0629 \u0627\u0644\u0646\u0647\u0636\u0629","quantity":1,"price":70,"total":70},{"id":"854","name":"\u0646\u0636\u0627\u0631\u0629 \u063a\u0637\u0633","quantity":1,"price":50,"total":50},{"id":"514","name":"\u0643\u0648\u0631\u0647 \u0628\u0644\u0627\u0633\u062a\u064a\u0643","quantity":3,"price":15,"total":45},{"id":"280","name":"\u0628\u0631\u0627\u064a\u0647 \u062f\u0648\u0627\u0626\u0631","quantity":1,"price":3,"total":3},{"id":"281","name":"\u0628\u0631\u0627\u064a\u0647 \u0641\u0631\u0627\u0634\u0629 DOMS","quantity":1,"price":5,"total":5},{"id":"356","name":"\u0628\u0644\u0627\u0633\u062a\u0631 \u0642\u0645\u0627\u0634 10 \u0645\u062a\u0631","quantity":1,"price":100,"total":100},{"id":"384","name":"\u0628\u0644\u0627\u0633\u062a\u0631 \u0634\u0641\u0627\u0641","quantity":1,"price":40,"total":40},{"id":"671","name":"\u0634\u0645\u0639 \u0645\u0633\u062f\u0633 \u0627\u0628\u064a\u0636","quantity":2,"price":5,"total":10},{"id":"853","name":"\u0639\u0631\u0648\u0633\u0647 \u0634\u0643\u0644 \u0637\u0641\u0644","quantity":1,"price":140,"total":140},{"id":"529","name":"\u0627\u062a\u0627\u0631\u064a \u0645\u064a\u0627\u0647","quantity":1,"price":30,"total":30},{"id":"237","name":"\u0642\u0635\u0635 \u0627\u0644\u0627\u0646\u0628\u064a\u0627\u0621","quantity":5,"price":5,"total":25},{"id":"692","name":"\u0635\u0644\u0635\u0627\u0644 \u0641\u0648\u0645","quantity":2,"price":20,"total":40},{"id":"377","name":"\u062c\u0644\u0627\u062a\u0648\u0631","quantity":2,"price":7.5,"total":15},{"id":"557","name":"\u0635\u0644\u0635\u0627\u0644 \u0635\u063a\u064a\u0631 \u0645\u0641\u0631\u0645\u0629","quantity":1,"price":25,"total":25},{"id":"190","name":"\u0642\u0644\u0645 \u0641\u0633\u0641\u0648\u0631\u064a \u062f\u064a\u0644\u064a","quantity":1,"price":15,"total":15},{"id":"400","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 ROTO Rapid Flow","quantity":1,"price":6,"total":6},{"id":"214","name":"\u0638\u0631\u0641 \u062c\u0648\u0627\u0628 \u0643\u0628\u064a\u0631","quantity":1,"price":10,"total":10}]}
[15-Jul-2025 18:23:04 UTC] Invoice inserted successfully with ID: 32
[15-Jul-2025 18:23:04 UTC] Treasury updated with final_total: 788 for treasury_id: 1
[15-Jul-2025 19:10:04 UTC] Saving invoice with values: {"invoice_number":33,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":762,"discount":"0","final_total":762,"paid_amount":762,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"507","name":"\u0644\u0641\u0629 \u0648\u0631\u0642 A4 \u0627\u0645\u0646\u064a\u0629","quantity":2,"price":130,"total":260},{"id":"342","name":"\u0643\u0648\u0631\u064a\u0643\u062a\u0648\u0631 \u062f\u064a\u0644\u064a \u0643\u0628\u064a\u0631","quantity":1,"price":20,"total":20},{"id":"772","name":"\u0631\u064a\u062f\u0631","quantity":1,"price":15,"total":15},{"id":"403","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 \u0627\u0632\u0631\u0642 BRAVO","quantity":1,"price":4,"total":4},{"id":"235","name":"\u0641\u0627\u064a\u0644 \u062f\u064a\u0644\u064a","quantity":2,"price":2,"total":4},{"id":"399","name":"\u0644\u0641\u0629 \u0648\u0631\u0642 A3","quantity":1,"price":300,"total":300},{"id":"365","name":"\u0633\u0646\u0648\u0646 0.7 \u0645\u0644\u0645 DOMS","quantity":1,"price":7,"total":7},{"id":"440","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 \u0628\u0633\u0646\u0627\u062f\u0629","quantity":1,"price":35,"total":35},{"id":"482","name":"\u0637\u0642\u0645 \u062a\u0648\u0643","quantity":3,"price":18,"total":54},{"id":"623","name":"\u062a\u0648\u0643\u0647","quantity":2,"price":10,"total":20},{"id":"870","name":"\u0643\u0631\u0627\u0633\u0647 E","quantity":2,"price":4,"total":8},{"id":"642","name":"\u062e\u0631\u0634\u0648\u0641\u0647","quantity":1,"price":35,"total":35}]}
[15-Jul-2025 19:10:04 UTC] Invoice inserted successfully with ID: 33
[15-Jul-2025 19:10:04 UTC] Treasury updated with final_total: 762 for treasury_id: 1
[19-Jul-2025 11:39:28 UTC] Saving invoice with values: {"invoice_number":34,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":78,"discount":"0","final_total":78,"paid_amount":78,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"775","name":"\u0645\u0627\u0648\u0633 \u0633\u0644\u0643","quantity":1,"price":70,"total":70},{"id":"155","name":"\u0643\u0631\u0627\u0633\u0629 \u0645\u0631\u0628\u0639\u0627\u062a 28 \u0648\u0631\u0642\u0629","quantity":2,"price":4,"total":8}]}
[19-Jul-2025 11:39:28 UTC] Invoice inserted successfully with ID: 34
[19-Jul-2025 11:39:28 UTC] Treasury updated with final_total: 78 for treasury_id: 1
[19-Jul-2025 12:29:02 UTC] Saving invoice with values: {"invoice_number":35,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":436,"discount":"10","final_total":426,"paid_amount":426,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"525","name":"\u0646\u0636\u0627\u0631\u0629 \u0628\u062d\u0631 \u0634\u0646\u0637\u0629","quantity":1,"price":40,"total":40},{"id":"803","name":"\u0643\u0627\u0628\u0644 138 X-SCOOT","quantity":1,"price":65,"total":65},{"id":"556","name":"\u0635\u0644\u0635\u0627\u0644 \u0646\u0634\u0627\u0628\u0647","quantity":1,"price":30,"total":30},{"id":"538","name":"\u0635\u064a\u0627\u062f\u0629 \u0633\u0645\u0643","quantity":1,"price":100,"total":100},{"id":"608","name":"\u0643\u0648\u0631\u0647 \u063a\u0627\u0646\u0627","quantity":1,"price":80,"total":80},{"id":"681","name":"\u0635\u0644\u0635\u0627\u0644 \u0641\u0648\u0645","quantity":1,"price":20,"total":20},{"id":"528","name":"\u0628\u0637\u0629 \u0644\u0639\u0628\u0629","quantity":1,"price":25,"total":25},{"id":"213","name":"\u0638\u0631\u0641 \u062c\u0648\u0627\u0628 \u0648\u0633\u0637","quantity":38,"price":2,"total":76}]}
[19-Jul-2025 12:29:02 UTC] Invoice inserted successfully with ID: 35
[19-Jul-2025 12:29:02 UTC] Treasury updated with final_total: 426 for treasury_id: 1
[19-Jul-2025 12:48:24 UTC] Saving invoice with values: {"invoice_number":36,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":106,"discount":"0","final_total":106,"paid_amount":106,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"850","name":"\u0643\u0648\u062a\u0634\u064a\u0646\u0629","quantity":1,"price":20,"total":20},{"id":"860","name":"\u0643\u0648\u0631\u0647 \u0628\u0644\u0627\u0633\u062a\u064a\u0643 \u0627\u0644\u0644\u0648\u0627\u0646 \u0641\u0633\u0641\u0648\u0631\u064a","quantity":1,"price":15,"total":15},{"id":"828","name":"\u062a\u0644\u062c \u0627\u0641\u0631\u0627\u062d","quantity":1,"price":33,"total":33},{"id":"539","name":"\u0645\u0633\u062f\u0633 \u0635\u0648\u062a \u0644\u0639\u0628\u0629","quantity":1,"price":30,"total":30},{"id":"406","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 ROTO Liquid Ball","quantity":1,"price":4,"total":4},{"id":"403","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 \u0627\u0632\u0631\u0642 BRAVO","quantity":1,"price":4,"total":4}]}
[19-Jul-2025 12:48:24 UTC] Invoice inserted successfully with ID: 36
[19-Jul-2025 12:48:24 UTC] Treasury updated with final_total: 106 for treasury_id: 1
[19-Jul-2025 19:19:30 UTC] Restored pending invoice #37
[19-Jul-2025 19:34:11 UTC] Restored pending invoice #37
[19-Jul-2025 19:34:52 UTC] Saving invoice with values: {"invoice_number":37,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":52,"discount":"0","final_total":52,"paid_amount":52,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"206","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 \u0627\u0634\u0643\u0627\u0644","quantity":1,"price":15,"total":15},{"id":"728","name":"\u062d\u062c\u0631 \u0642\u0644\u0645 \u0627\u064a\u0641\u064a\u0631\u064a\u062f\u064a \u0627\u062d\u0645\u0631","quantity":1,"price":25,"total":25},{"id":"587","name":"\u062e\u0648\u0627\u062a\u0645 \u0642\u0644\u0628","quantity":1,"price":7,"total":7},{"id":"670","name":"\u062e\u0627\u062a\u0645 \u0627\u0637\u0641\u0627\u0644","quantity":1,"price":5,"total":5}]}
[19-Jul-2025 19:34:52 UTC] Invoice inserted successfully with ID: 37
[19-Jul-2025 19:34:52 UTC] Treasury updated with final_total: 52 for treasury_id: 1
[21-Jul-2025 14:34:15 UTC] Saving invoice with values: {"invoice_number":38,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":30,"discount":"0","final_total":30,"paid_amount":30,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"438","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 \u0628\u0633\u0646\u0627\u062f\u0629","quantity":1,"price":30,"total":30}]}
[21-Jul-2025 14:34:15 UTC] Invoice inserted successfully with ID: 38
[21-Jul-2025 14:34:15 UTC] Treasury updated with final_total: 30 for treasury_id: 1
[24-Jul-2025 12:46:56 UTC] Saving invoice with values: {"invoice_number":39,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":312,"discount":"0","final_total":312,"paid_amount":312,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"828","name":"\u062a\u0644\u062c \u0627\u0641\u0631\u0627\u062d","quantity":4,"price":33,"total":132},{"id":"541","name":"\u0645\u062f\u0641\u0639 \u0648\u0631\u0642 \u0635\u063a\u064a\u0631","quantity":3,"price":20,"total":60},{"id":"867","name":"\u0644\u0639\u0628\u0629 \u062d\u0644\u0627\u0642\u0627\u062a \u0643\u0628\u064a\u0631\u0647","quantity":1,"price":75,"total":75},{"id":"456","name":"\u0634\u0648\u0643\u0629 \u0628\u0644\u0627\u0633\u062a\u064a\u0643","quantity":2,"price":15,"total":30},{"id":"457","name":"\u0637\u0628\u0642 \u0643\u0631\u062a\u0648\u0646 \u0635\u063a\u064a\u0631","quantity":1,"price":15,"total":15}]}
[24-Jul-2025 12:46:56 UTC] Invoice inserted successfully with ID: 39
[24-Jul-2025 12:46:56 UTC] Treasury updated with final_total: 312 for treasury_id: 1
[24-Jul-2025 13:02:12 UTC] Saving invoice with values: {"invoice_number":40,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":767,"discount":"0","final_total":767,"paid_amount":767,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"531","name":"\u0627\u0643\u0633\u0644\u0641\u0648\u0646 \u0644\u0639\u0628\u0629","quantity":1,"price":70,"total":70},{"id":"536","name":"\u0634\u0646\u0637\u0629 \u062f\u0643\u062a\u0648\u0631","quantity":1,"price":80,"total":80},{"id":"543","name":"\u0645\u0643\u0639\u0628 \u0631\u0648\u0628\u064a\u0643","quantity":1,"price":12,"total":12},{"id":"525","name":"\u0646\u0636\u0627\u0631\u0629 \u0628\u062d\u0631 \u0634\u0646\u0637\u0629","quantity":1,"price":40,"total":40},{"id":"529","name":"\u0627\u062a\u0627\u0631\u064a \u0645\u064a\u0627\u0647","quantity":1,"price":30,"total":30},{"id":"542","name":"\u0628\u064a\u0627\u0646\u0648 \u0644\u0639\u0628\u0629","quantity":1,"price":85,"total":85},{"id":"548","name":"\u0645\u0633\u062f\u0633 \u0639\u0644\u0628\u0629","quantity":1,"price":120,"total":120},{"id":"682","name":"\u0628\u0644\u0648\u0646\u0629 \u0643\u0628\u064a\u0631\u0629","quantity":5,"price":5,"total":25},{"id":"712","name":"\u0643\u0648\u0631\u0647 \u0628\u0633\u0648\u0633\u062a\u0647","quantity":1,"price":30,"total":30},{"id":"855","name":"\u0639\u0631\u0648\u0633\u0647 \u0635\u063a\u064a\u0631\u0647","quantity":2,"price":35,"total":70},{"id":"865","name":"\u0645\u0636\u0631\u0628 \u0643\u0648\u0631\u0647 \u0628\u064a\u0646\u062c","quantity":1,"price":50,"total":50},{"id":"866","name":"\u0643\u0648\u0631\u0647 \u0646\u0637\u0627\u0637\u0647","quantity":1,"price":60,"total":60},{"id":"894","name":"\u0643\u0631\u062a \u0627\u062f\u0648\u0627\u062a \u0645\u0637\u0627\u0641\u064a","quantity":1,"price":80,"total":80},{"id":"501","name":"\u0648\u0644\u0627\u0639\u0629 \u0645\u0637\u0628\u062e","quantity":1,"price":15,"total":15}]}
[24-Jul-2025 13:02:12 UTC] Invoice inserted successfully with ID: 40
[24-Jul-2025 13:02:12 UTC] Treasury updated with final_total: 767 for treasury_id: 1
[24-Jul-2025 13:19:16 UTC] Saving invoice with values: {"invoice_number":41,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":1710,"discount":"10","final_total":1700,"paid_amount":1700,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"507","name":"\u0644\u0641\u0629 \u0648\u0631\u0642 A4 \u0627\u0645\u0646\u064a\u0629","quantity":6,"price":130,"total":780},{"id":"508","name":"\u0644\u0641\u0629 \u0648\u0631\u0642 A4 \u0628\u0631\u0648\u062c\u064a\u0643\u062a\u0627","quantity":2,"price":130,"total":260},{"id":"513","name":"\u0643\u0648\u0631\u0647 \u0643\u0641\u0631","quantity":1,"price":120,"total":120},{"id":"16","name":"\u0628\u0627\u0644\u062a\u0629 \u0627\u0644\u0648\u0627\u0646 \u0645\u0627\u0621 \u0635\u063a\u064a\u0631","quantity":1,"price":25,"total":25},{"id":"468","name":"\u0645\u062f\u0641\u0639 \u0648\u0631\u0642 \u0643\u0628\u064a\u0631 60 \u0633\u0645","quantity":1,"price":35,"total":35},{"id":"448","name":"\u0643\u0634\u0643\u0648\u0644 \u0633\u0644\u0643 \u0643\u0628\u064a\u0631 140 \u0648\u0631\u0642\u0629 \u0627\u0644\u0646\u0647\u0636\u0629","quantity":2,"price":80,"total":160},{"id":"975","name":"\u0627\u0644\u0647 \u062d\u0627\u0633\u0628\u0647 \u0643\u0627\u0633\u064a\u0648","quantity":1,"price":330,"total":330}]}
[24-Jul-2025 13:19:16 UTC] Invoice inserted successfully with ID: 41
[24-Jul-2025 13:19:16 UTC] Treasury updated with final_total: 1700 for treasury_id: 1
[24-Jul-2025 13:40:12 UTC] Saving invoice with values: {"invoice_number":42,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":480,"discount":"0","final_total":480,"paid_amount":480,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"48","name":"\u0628\u0644\u0627\u0644\u064a\u0646 \u0627\u0644\u0644\u0648\u0627\u0646 \u0643\u0628\u064a\u0631\u0647","quantity":16,"price":2,"total":32},{"id":"746","name":"\u0633\u0645\u0627\u0639\u0647 \u0633\u0644\u0643 \u0646\u064a\u0648 \u0628\u064a\u0633\u062a","quantity":1,"price":70,"total":70},{"id":"50","name":"\u0645\u0634\u062a\u0631\u0643 ilook","quantity":1,"price":35,"total":35},{"id":"538","name":"\u0635\u064a\u0627\u062f\u0629 \u0633\u0645\u0643","quantity":1,"price":100,"total":100},{"id":"875","name":"\u0646\u0648\u062a\u0629 \u0628\u0643\u0628\u0633\u0648\u0646\u0629","quantity":1,"price":40,"total":40},{"id":"150","name":"\u0643\u0634\u0643\u0648\u0644 \u0639\u0631\u0628\u064a 56 \u0648\u0631\u0642\u0629","quantity":1,"price":8,"total":8},{"id":"569","name":"\u0645\u062d\u0641\u0638\u0629 \u0631\u062c\u0627\u0644\u064a 2 \u0643\u0628\u0633\u0648\u0644\u0629","quantity":1,"price":60,"total":60},{"id":"646","name":"\u0645\u0639\u0637\u0631 \u0633\u064a\u0627\u0631\u0647 \u0643\u0628\u064a\u0631","quantity":1,"price":25,"total":25},{"id":"805","name":"\u0634\u0627\u062d\u0646 \u0627\u0645\u0631\u064a\u0643\u064a X-SCOOT","quantity":1,"price":110,"total":110}]}
[24-Jul-2025 13:40:12 UTC] Invoice inserted successfully with ID: 42
[24-Jul-2025 13:40:12 UTC] Treasury updated with final_total: 480 for treasury_id: 1
[24-Jul-2025 15:53:24 UTC] POST request received: Array
(
    [id] => 41
    [store_id] => 1
    [treasury_id] => 1
    [client_id] => 1
    [payment_type] => cash
    [paid_amount] => 1700.00
    [discount_value] => 10.00
    [discount_type] => percentage
    [items_data] => [{"id":507,"name":"لفة ورق A4 امنية","quantity":6,"price":130,"total":780},{"id":508,"name":"لفة ورق A4 بروجيكتا","quantity":2,"price":130,"total":260},{"id":513,"name":"كوره كفر ","quantity":1,"price":120,"total":120},{"id":16,"name":"بالتة الوان ماء صغير","quantity":1,"price":25,"total":25},{"id":468,"name":"مدفع ورق كبير 60 سم","quantity":1,"price":35,"total":35},{"id":448,"name":"كشكول سلك كبير 140 ورقة النهضة","quantity":2,"price":80,"total":160},{"id":975,"name":"اله حاسبه كاسيو ","quantity":1,"price":330,"total":330}]
)

[24-Jul-2025 15:53:24 UTC] save_changes not set in POST data. Full POST data: Array
(
    [id] => 41
    [store_id] => 1
    [treasury_id] => 1
    [client_id] => 1
    [payment_type] => cash
    [paid_amount] => 1700.00
    [discount_value] => 10.00
    [discount_type] => percentage
    [items_data] => [{"id":507,"name":"لفة ورق A4 امنية","quantity":6,"price":130,"total":780},{"id":508,"name":"لفة ورق A4 بروجيكتا","quantity":2,"price":130,"total":260},{"id":513,"name":"كوره كفر ","quantity":1,"price":120,"total":120},{"id":16,"name":"بالتة الوان ماء صغير","quantity":1,"price":25,"total":25},{"id":468,"name":"مدفع ورق كبير 60 سم","quantity":1,"price":35,"total":35},{"id":448,"name":"كشكول سلك كبير 140 ورقة النهضة","quantity":2,"price":80,"total":160},{"id":975,"name":"اله حاسبه كاسيو ","quantity":1,"price":330,"total":330}]
)

[24-Jul-2025 15:53:38 UTC] POST request received: Array
(
    [id] => 41
    [store_id] => 1
    [treasury_id] => 1
    [client_id] => 1
    [payment_type] => cash
    [paid_amount] => 1700.00
    [discount_value] => 10.00
    [discount_type] => percentage
    [items_data] => [{"id":507,"name":"لفة ورق A4 امنية","quantity":6,"price":130,"total":780},{"id":508,"name":"لفة ورق A4 بروجيكتا","quantity":2,"price":130,"total":260},{"id":513,"name":"كوره كفر ","quantity":1,"price":120,"total":120},{"id":16,"name":"بالتة الوان ماء صغير","quantity":1,"price":25,"total":25},{"id":468,"name":"مدفع ورق كبير 60 سم","quantity":1,"price":35,"total":35},{"id":448,"name":"كشكول سلك كبير 140 ورقة النهضة","quantity":2,"price":80,"total":160}]
    [save_changes] => 
)

[24-Jul-2025 15:53:38 UTC] save_changes is set
[24-Jul-2025 15:53:38 UTC] Received POST data: store_id=1, treasury_id=1, client_id=1, payment_type=cash, discount_value=10, paid_amount=1700, items_data=Array
(
    [0] => Array
        (
            [id] => 507
            [name] => لفة ورق A4 امنية
            [quantity] => 6
            [price] => 130
            [total] => 780
        )

    [1] => Array
        (
            [id] => 508
            [name] => لفة ورق A4 بروجيكتا
            [quantity] => 2
            [price] => 130
            [total] => 260
        )

    [2] => Array
        (
            [id] => 513
            [name] => كوره كفر 
            [quantity] => 1
            [price] => 120
            [total] => 120
        )

    [3] => Array
        (
            [id] => 16
            [name] => بالتة الوان ماء صغير
            [quantity] => 1
            [price] => 25
            [total] => 25
        )

    [4] => Array
        (
            [id] => 468
            [name] => مدفع ورق كبير 60 سم
            [quantity] => 1
            [price] => 35
            [total] => 35
        )

    [5] => Array
        (
            [id] => 448
            [name] => كشكول سلك كبير 140 ورقة النهضة
            [quantity] => 2
            [price] => 80
            [total] => 160
        )

)

[24-Jul-2025 15:53:38 UTC] Item processed: id=507, quantity=6, price=130, subtotal=780
[24-Jul-2025 15:53:38 UTC] Item processed: id=508, quantity=2, price=130, subtotal=260
[24-Jul-2025 15:53:38 UTC] Item processed: id=513, quantity=1, price=120, subtotal=120
[24-Jul-2025 15:53:38 UTC] Item processed: id=16, quantity=1, price=25, subtotal=25
[24-Jul-2025 15:53:38 UTC] Item processed: id=468, quantity=1, price=35, subtotal=35
[24-Jul-2025 15:53:38 UTC] Item processed: id=448, quantity=2, price=80, subtotal=160
[24-Jul-2025 15:53:38 UTC] Calculated totals: total=1380, discount=138, final_total=1242, remaining_amount=0
[24-Jul-2025 15:53:38 UTC] Restored quantity for item_id=507, quantity=6
[24-Jul-2025 15:53:38 UTC] Restored quantity for item_id=508, quantity=2
[24-Jul-2025 15:53:38 UTC] Restored quantity for item_id=513, quantity=1
[24-Jul-2025 15:53:38 UTC] Restored quantity for item_id=16, quantity=1
[24-Jul-2025 15:53:38 UTC] Restored quantity for item_id=468, quantity=1
[24-Jul-2025 15:53:38 UTC] Restored quantity for item_id=448, quantity=2
[24-Jul-2025 15:53:38 UTC] Restored quantity for item_id=975, quantity=1
[24-Jul-2025 15:53:38 UTC] Deleted old items for invoice_id=41
[24-Jul-2025 15:53:38 UTC] Checking available quantity for item_id=507: available=8, requested=6
[24-Jul-2025 15:53:38 UTC] Inserted item: invoice_id=41, item_id=507, quantity=6, price=130
[24-Jul-2025 15:53:38 UTC] Updated item quantity: item_id=507, sold_quantity=6
[24-Jul-2025 15:53:38 UTC] Checking available quantity for item_id=508: available=10, requested=2
[24-Jul-2025 15:53:38 UTC] Inserted item: invoice_id=41, item_id=508, quantity=2, price=130
[24-Jul-2025 15:53:38 UTC] Updated item quantity: item_id=508, sold_quantity=2
[24-Jul-2025 15:53:38 UTC] Checking available quantity for item_id=513: available=3, requested=1
[24-Jul-2025 15:53:38 UTC] Inserted item: invoice_id=41, item_id=513, quantity=1, price=120
[24-Jul-2025 15:53:38 UTC] Updated item quantity: item_id=513, sold_quantity=1
[24-Jul-2025 15:53:38 UTC] Checking available quantity for item_id=16: available=12, requested=1
[24-Jul-2025 15:53:38 UTC] Inserted item: invoice_id=41, item_id=16, quantity=1, price=25
[24-Jul-2025 15:53:38 UTC] Updated item quantity: item_id=16, sold_quantity=1
[24-Jul-2025 15:53:38 UTC] Checking available quantity for item_id=468: available=2, requested=1
[24-Jul-2025 15:53:38 UTC] Inserted item: invoice_id=41, item_id=468, quantity=1, price=35
[24-Jul-2025 15:53:38 UTC] Updated item quantity: item_id=468, sold_quantity=1
[24-Jul-2025 15:53:38 UTC] Checking available quantity for item_id=448: available=6, requested=2
[24-Jul-2025 15:53:38 UTC] Inserted item: invoice_id=41, item_id=448, quantity=2, price=80
[24-Jul-2025 15:53:38 UTC] Updated item quantity: item_id=448, sold_quantity=2
[24-Jul-2025 15:53:38 UTC] Updated invoice 41: total=1380, final_total=1242
[24-Jul-2025 15:53:38 UTC] Invoice 41 committed successfully
[24-Jul-2025 15:54:19 UTC] POST request received: Array
(
    [id] => 41
    [store_id] => 1
    [treasury_id] => 1
    [client_id] => 1
    [payment_type] => cash
    [paid_amount] => 1700.00
    [discount_value] => 10
    [discount_type] => fixed
    [items_data] => [{"id":507,"name":"لفة ورق A4 امنية","quantity":6,"price":130,"total":780},{"id":508,"name":"لفة ورق A4 بروجيكتا","quantity":2,"price":130,"total":260},{"id":513,"name":"كوره كفر ","quantity":1,"price":120,"total":120},{"id":16,"name":"بالتة الوان ماء صغير","quantity":1,"price":25,"total":25},{"id":468,"name":"مدفع ورق كبير 60 سم","quantity":1,"price":35,"total":35},{"id":448,"name":"كشكول سلك كبير 140 ورقة النهضة","quantity":2,"price":80,"total":160}]
)

[24-Jul-2025 15:54:19 UTC] save_changes not set in POST data. Full POST data: Array
(
    [id] => 41
    [store_id] => 1
    [treasury_id] => 1
    [client_id] => 1
    [payment_type] => cash
    [paid_amount] => 1700.00
    [discount_value] => 10
    [discount_type] => fixed
    [items_data] => [{"id":507,"name":"لفة ورق A4 امنية","quantity":6,"price":130,"total":780},{"id":508,"name":"لفة ورق A4 بروجيكتا","quantity":2,"price":130,"total":260},{"id":513,"name":"كوره كفر ","quantity":1,"price":120,"total":120},{"id":16,"name":"بالتة الوان ماء صغير","quantity":1,"price":25,"total":25},{"id":468,"name":"مدفع ورق كبير 60 سم","quantity":1,"price":35,"total":35},{"id":448,"name":"كشكول سلك كبير 140 ورقة النهضة","quantity":2,"price":80,"total":160}]
)

[24-Jul-2025 15:54:39 UTC] POST request received: Array
(
    [id] => 41
    [store_id] => 1
    [treasury_id] => 1
    [client_id] => 1
    [payment_type] => cash
    [paid_amount] => 1700.00
    [discount_value] => 10
    [discount_type] => fixed
    [items_data] => [{"id":507,"name":"لفة ورق A4 امنية","quantity":6,"price":130,"total":780},{"id":508,"name":"لفة ورق A4 بروجيكتا","quantity":2,"price":130,"total":260},{"id":513,"name":"كوره كفر ","quantity":1,"price":120,"total":120},{"id":16,"name":"بالتة الوان ماء صغير","quantity":1,"price":25,"total":25},{"id":468,"name":"مدفع ورق كبير 60 سم","quantity":1,"price":35,"total":35},{"id":448,"name":"كشكول سلك كبير 140 ورقة النهضة","quantity":2,"price":80,"total":160}]
    [save_changes] => 
)

[24-Jul-2025 15:54:39 UTC] save_changes is set
[24-Jul-2025 15:54:39 UTC] Received POST data: store_id=1, treasury_id=1, client_id=1, payment_type=cash, discount_value=10, paid_amount=1700, items_data=Array
(
    [0] => Array
        (
            [id] => 507
            [name] => لفة ورق A4 امنية
            [quantity] => 6
            [price] => 130
            [total] => 780
        )

    [1] => Array
        (
            [id] => 508
            [name] => لفة ورق A4 بروجيكتا
            [quantity] => 2
            [price] => 130
            [total] => 260
        )

    [2] => Array
        (
            [id] => 513
            [name] => كوره كفر 
            [quantity] => 1
            [price] => 120
            [total] => 120
        )

    [3] => Array
        (
            [id] => 16
            [name] => بالتة الوان ماء صغير
            [quantity] => 1
            [price] => 25
            [total] => 25
        )

    [4] => Array
        (
            [id] => 468
            [name] => مدفع ورق كبير 60 سم
            [quantity] => 1
            [price] => 35
            [total] => 35
        )

    [5] => Array
        (
            [id] => 448
            [name] => كشكول سلك كبير 140 ورقة النهضة
            [quantity] => 2
            [price] => 80
            [total] => 160
        )

)

[24-Jul-2025 15:54:39 UTC] Item processed: id=507, quantity=6, price=130, subtotal=780
[24-Jul-2025 15:54:39 UTC] Item processed: id=508, quantity=2, price=130, subtotal=260
[24-Jul-2025 15:54:39 UTC] Item processed: id=513, quantity=1, price=120, subtotal=120
[24-Jul-2025 15:54:39 UTC] Item processed: id=16, quantity=1, price=25, subtotal=25
[24-Jul-2025 15:54:39 UTC] Item processed: id=468, quantity=1, price=35, subtotal=35
[24-Jul-2025 15:54:39 UTC] Item processed: id=448, quantity=2, price=80, subtotal=160
[24-Jul-2025 15:54:39 UTC] Calculated totals: total=1380, discount=10, final_total=1370, remaining_amount=0
[24-Jul-2025 15:54:39 UTC] Restored quantity for item_id=507, quantity=6
[24-Jul-2025 15:54:39 UTC] Restored quantity for item_id=508, quantity=2
[24-Jul-2025 15:54:39 UTC] Restored quantity for item_id=513, quantity=1
[24-Jul-2025 15:54:39 UTC] Restored quantity for item_id=16, quantity=1
[24-Jul-2025 15:54:39 UTC] Restored quantity for item_id=468, quantity=1
[24-Jul-2025 15:54:39 UTC] Restored quantity for item_id=448, quantity=2
[24-Jul-2025 15:54:39 UTC] Deleted old items for invoice_id=41
[24-Jul-2025 15:54:39 UTC] Checking available quantity for item_id=507: available=8, requested=6
[24-Jul-2025 15:54:39 UTC] Inserted item: invoice_id=41, item_id=507, quantity=6, price=130
[24-Jul-2025 15:54:39 UTC] Updated item quantity: item_id=507, sold_quantity=6
[24-Jul-2025 15:54:39 UTC] Checking available quantity for item_id=508: available=10, requested=2
[24-Jul-2025 15:54:39 UTC] Inserted item: invoice_id=41, item_id=508, quantity=2, price=130
[24-Jul-2025 15:54:39 UTC] Updated item quantity: item_id=508, sold_quantity=2
[24-Jul-2025 15:54:39 UTC] Checking available quantity for item_id=513: available=3, requested=1
[24-Jul-2025 15:54:39 UTC] Inserted item: invoice_id=41, item_id=513, quantity=1, price=120
[24-Jul-2025 15:54:39 UTC] Updated item quantity: item_id=513, sold_quantity=1
[24-Jul-2025 15:54:39 UTC] Checking available quantity for item_id=16: available=12, requested=1
[24-Jul-2025 15:54:39 UTC] Inserted item: invoice_id=41, item_id=16, quantity=1, price=25
[24-Jul-2025 15:54:39 UTC] Updated item quantity: item_id=16, sold_quantity=1
[24-Jul-2025 15:54:39 UTC] Checking available quantity for item_id=468: available=2, requested=1
[24-Jul-2025 15:54:39 UTC] Inserted item: invoice_id=41, item_id=468, quantity=1, price=35
[24-Jul-2025 15:54:39 UTC] Updated item quantity: item_id=468, sold_quantity=1
[24-Jul-2025 15:54:39 UTC] Checking available quantity for item_id=448: available=6, requested=2
[24-Jul-2025 15:54:39 UTC] Inserted item: invoice_id=41, item_id=448, quantity=2, price=80
[24-Jul-2025 15:54:39 UTC] Updated item quantity: item_id=448, sold_quantity=2
[24-Jul-2025 15:54:39 UTC] Updated invoice 41: total=1380, final_total=1370
[24-Jul-2025 15:54:39 UTC] Invoice 41 committed successfully
[24-Jul-2025 16:44:55 UTC] Saving invoice with values: {"invoice_number":43,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":824,"discount":"23","final_total":801,"paid_amount":801,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"384","name":"\u0628\u0644\u0627\u0633\u062a\u0631 \u0634\u0641\u0627\u0641","quantity":1,"price":40,"total":40},{"id":"555","name":"\u0634\u0645\u0639 \u0639\u064a\u062f \u0645\u064a\u0644\u0627\u062f \u0631\u0641\u064a\u0639","quantity":1,"price":10,"total":10},{"id":"405","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 CLARO","quantity":1,"price":14,"total":14},{"id":"190","name":"\u0642\u0644\u0645 \u0641\u0633\u0641\u0648\u0631\u064a \u0627\u0635\u0641\u0631 \u062f\u064a\u0644\u064a","quantity":1,"price":15,"total":15},{"id":"407","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 MATIC nikan","quantity":2,"price":5,"total":10},{"id":"235","name":"\u0641\u0627\u064a\u0644 \u062f\u064a\u0644\u064a","quantity":2,"price":2,"total":4},{"id":"792","name":"\u0643\u0627\u0628\u0644 \u0643\u0648\u064a\u0646 T-C","quantity":1,"price":75,"total":75},{"id":"214","name":"\u0638\u0631\u0641 \u062c\u0648\u0627\u0628 \u0643\u0628\u064a\u0631","quantity":2,"price":10,"total":20},{"id":"21","name":"\u0627\u0642\u0644\u0627\u0645 \u0627\u0644\u0648\u0627\u0646 \u0632\u064a\u062a 6 \u0642\u0644\u0645","quantity":1,"price":20,"total":20},{"id":"20","name":"\u0627\u0642\u0644\u0627\u0645 \u0627\u0644\u0648\u0627\u0646 \u0632\u064a\u062a 12 \u0642\u0644\u0645","quantity":1,"price":25,"total":25},{"id":"720","name":"\u0643\u0631\u0627\u0633\u0629 \u0631\u0633\u0645 \u0645\u062d\u0645\u062f \u0648\u0627\u0645\u064a\u0631\u0629 34 \u0648\u0631\u0642\u0629","quantity":1,"price":38,"total":38},{"id":"610","name":"\u0627\u0633\u0641\u0646\u062c\u0629 \u062a\u0646\u0636\u064a\u0641 \u062c\u0632\u0645","quantity":1,"price":20,"total":20},{"id":"704","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 \u0648\u064a\u0632\u0631 \u0631\u0648\u0644","quantity":2,"price":10,"total":20},{"id":"346","name":"\u062f\u0628\u0627\u0628\u064a\u0633 \u062f\u064a\u0644\u064a \u0635\u063a\u064a\u0631","quantity":1,"price":20,"total":20},{"id":"192","name":"\u0642\u0644\u0645 \u0633\u0628\u0648\u0631\u0629 \u0627\u062d\u0645\u0631","quantity":16,"price":10,"total":160},{"id":"406","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 ROTO Liquid Ball","quantity":27,"price":4,"total":108},{"id":"728","name":"\u062d\u062c\u0631 \u0642\u0644\u0645 \u0627\u064a\u0641\u064a\u0631\u064a\u062f\u064a \u0627\u062d\u0645\u0631","quantity":1,"price":25,"total":25},{"id":"668","name":"\u0645\u0639\u0637\u0631 \u0627\u064a\u0644\u0627\u0646","quantity":1,"price":30,"total":30},{"id":"484","name":"\u0644\u0639\u0628 \u0627\u0637\u0641\u0627\u0644","quantity":1,"price":35,"total":35},{"id":"772","name":"\u0631\u064a\u062f\u0631","quantity":1,"price":15,"total":15},{"id":"139","name":"\u0623\u0646\u0628\u0648\u0628\u0629 \u0623\u0645\u064a\u0631","quantity":5,"price":2,"total":10},{"id":"608","name":"\u0643\u0648\u0631\u0647 \u063a\u0627\u0646\u0627","quantity":1,"price":80,"total":80},{"id":"465","name":"\u0634\u0645\u0639 \u0627\u0631\u0642\u0627\u0645 \u062c\u0644\u062a\u0631","quantity":2,"price":15,"total":30}]}
[24-Jul-2025 16:44:55 UTC] Invoice inserted successfully with ID: 43
[24-Jul-2025 16:44:55 UTC] Treasury updated with final_total: 801 for treasury_id: 1
[24-Jul-2025 17:17:02 UTC] Saving invoice with values: {"invoice_number":44,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":32,"discount":"0","final_total":32,"paid_amount":32,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"979","name":"\u0645\u0634\u0628\u0643 \u0648\u0631\u0642 \u0643\u0628\u064a\u0631","quantity":1,"price":7,"total":7},{"id":"407","name":"\u0642\u0644\u0645 \u062c\u0627\u0641 MATIC nikan","quantity":2,"price":5,"total":10},{"id":"367","name":"\u0642\u0644\u0645 \u062d\u0628\u0631 \u062f\u064a\u0644\u064a A120","quantity":1,"price":15,"total":15}]}
[24-Jul-2025 17:17:02 UTC] Invoice inserted successfully with ID: 44
[24-Jul-2025 17:17:02 UTC] Treasury updated with final_total: 32 for treasury_id: 1
[26-Jul-2025 11:35:12 UTC] Saving invoice with values: {"invoice_number":45,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":595,"discount":"0","final_total":595,"paid_amount":595,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"454","name":"\u0627\u0644\u0648\u0627\u0646 \u0641\u0644\u0648\u0645\u0633\u062a\u0631 \u0628\u0631\u064a\u0645\u0627 \u0635\u063a\u064a\u0631","quantity":1,"price":14,"total":14},{"id":"814","name":"\u062f\u0628\u062f\u0648\u0628 \u0627\u0635\u0641\u0631","quantity":1,"price":170,"total":170},{"id":"831","name":"\u062f\u0628\u062f\u0648\u0628","quantity":1,"price":140,"total":140},{"id":"242","name":"\u0643\u0634\u0643\u0648\u0644 \u0633\u0644\u0643 \u0648\u0633\u0637 80 \u0648\u0631\u0642\u0647 \u0627\u0644\u0646\u0647\u0636\u0647","quantity":1,"price":35,"total":35},{"id":"268","name":"\u0643\u0634\u0643\u0648\u0644 \u0633\u0644\u0643 \u0635\u063a\u064a\u0631 100 \u0648\u0631\u0642\u0629 \u0627\u0644\u0646\u0647\u0636\u0629","quantity":1,"price":45,"total":45},{"id":"220","name":"\u0643\u0631\u0627\u0633\u0629 \u0631\u0633\u0645 \u0643\u0628\u064a\u0631\u0629 \u0627\u0644\u0646\u0647\u0636\u0629 40 \u0648\u0631\u0642\u0629","quantity":1,"price":45,"total":45},{"id":"223","name":"\u0643\u0631\u0627\u0633\u0629 \u0631\u0633\u0645 \u0635\u063a\u064a\u0631\u0629 16 \u0648\u0631\u0642\u0629 KMS","quantity":2,"price":5,"total":10},{"id":"183","name":"\u0639\u0644\u0628\u0629\u0642\u0644\u0645 \u0627\u0644\u0644\u0648\u0627\u0646 \u062e\u0634\u0628 24 \u0642","quantity":1,"price":85,"total":85},{"id":"832","name":"\u0634\u0646\u0637\u0629 \u0647\u062f\u0627\u064a\u0627","quantity":2,"price":12,"total":24},{"id":"171","name":"\u0642\u0644\u0645 \u0631\u0635\u0627\u0635","quantity":5,"price":3,"total":15},{"id":"182","name":"\u0642\u0644\u0645 \u0631\u0635\u0627\u0635","quantity":1,"price":8,"total":8},{"id":"973","name":"\u0643\u0631\u0627\u0633\u0647 \u0639\u0631\u0628\u064a 28 \u0648\u0631\u0642\u0629","quantity":1,"price":4,"total":4}]}
[26-Jul-2025 11:35:12 UTC] Invoice inserted successfully with ID: 45
[26-Jul-2025 11:35:12 UTC] Treasury updated with final_total: 595 for treasury_id: 1
[26-Jul-2025 12:01:46 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/sale_ahmed/logout.php on line 2
[26-Jul-2025 12:01:46 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/sale_ahmed/logout.php on line 4
[26-Jul-2025 12:01:46 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/sale_ahmed/logout.php:1) in /home/icodesxy/public_html/sale_ahmed/logout.php on line 5
[26-Jul-2025 12:02:31 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/sale_ahmed/logout.php on line 2
[26-Jul-2025 12:02:31 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/sale_ahmed/logout.php on line 4
[26-Jul-2025 12:02:31 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/sale_ahmed/logout.php:1) in /home/icodesxy/public_html/sale_ahmed/logout.php on line 5
[28-Jul-2025 09:55:20 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/sale_ahmed/logout.php on line 2
[28-Jul-2025 09:55:20 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/sale_ahmed/logout.php on line 4
[28-Jul-2025 09:55:20 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/sale_ahmed/logout.php:1) in /home/icodesxy/public_html/sale_ahmed/logout.php on line 5
[07-Aug-2025 11:43:34 UTC] Saving invoice with values: {"invoice_number":1,"store_id":"1","treasury_id":1,"client_id":1,"user_id":11,"payment_type":"cash","total":7,"discount":"0","final_total":7,"paid_amount":7,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"1","name":"\u0633\u0648\u0644\u064a\u062a\u0628 \u0643\u0647\u0631\u0628\u0627","quantity":1,"price":7,"total":7}]}
[07-Aug-2025 11:43:34 UTC] Error saving invoice: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`icodesxy_astra`.`sales_invoices`, CONSTRAINT `sales_invoices_ibfk_2` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`))
[07-Aug-2025 11:44:12 UTC] Saving invoice with values: {"invoice_number":1,"store_id":"1","treasury_id":1,"client_id":1,"user_id":11,"payment_type":"cash","total":12,"discount":"0","final_total":12,"paid_amount":12,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"1","name":"\u0633\u0648\u0644\u064a\u062a\u0628 \u0643\u0647\u0631\u0628\u0627","quantity":2,"price":6,"total":12}]}
[07-Aug-2025 11:44:12 UTC] Error saving invoice: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`icodesxy_astra`.`sales_invoices`, CONSTRAINT `sales_invoices_ibfk_2` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`))
[07-Aug-2025 12:33:58 UTC] Saving invoice with values: {"invoice_number":1,"store_id":"1","treasury_id":1,"client_id":"1","user_id":11,"payment_type":"cash","total":2,"discount":"0","final_total":2,"paid_amount":2,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"2","name":"\u0643\u0627\u0628","quantity":1,"price":2,"total":2}]}
[07-Aug-2025 12:33:58 UTC] Error saving invoice: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`icodesxy_astra`.`sales_invoices`, CONSTRAINT `sales_invoices_ibfk_3` FOREIGN KEY (`treasury_id`) REFERENCES `treasuries` (`id`))
[07-Aug-2025 12:34:08 UTC] Saving invoice with values: {"invoice_number":1,"store_id":"1","treasury_id":1,"client_id":"1","user_id":11,"payment_type":"cash","total":2,"discount":"0","final_total":2,"paid_amount":2,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"2","name":"\u0643\u0627\u0628","quantity":1,"price":2,"total":2}]}
[07-Aug-2025 12:34:08 UTC] Error saving invoice: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`icodesxy_astra`.`sales_invoices`, CONSTRAINT `sales_invoices_ibfk_3` FOREIGN KEY (`treasury_id`) REFERENCES `treasuries` (`id`))
[07-Aug-2025 12:34:11 UTC] Saving invoice with values: {"invoice_number":1,"store_id":"1","treasury_id":1,"client_id":"1","user_id":11,"payment_type":"cash","total":2,"discount":"0","final_total":2,"paid_amount":2,"remaining_amount":0,"shift_id":1,"items_data":[{"id":"2","name":"\u0643\u0627\u0628","quantity":1,"price":2,"total":2}]}
[07-Aug-2025 12:34:11 UTC] Error saving invoice: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`icodesxy_astra`.`sales_invoices`, CONSTRAINT `sales_invoices_ibfk_3` FOREIGN KEY (`treasury_id`) REFERENCES `treasuries` (`id`))
[07-Aug-2025 16:13:46 UTC] No items found in database. Consider adding items.
[08-Aug-2025 08:43:40 UTC] No items found in database. Consider adding items.
[08-Aug-2025 13:05:12 UTC] No items found in database. Consider adding items.
[08-Aug-2025 13:20:16 UTC] No items found in database. Consider adding items.
[08-Aug-2025 13:28:37 UTC] Saving invoice with values: {"invoice_number":1,"store_id":"1","treasury_id":1,"client_id":"1","user_id":11,"payment_type":"cash","total":30,"discount":"0","final_total":30,"paid_amount":30,"remaining_amount":0,"shift_id":2,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u062a","quantity":1,"price":30,"total":30}]}
[08-Aug-2025 13:28:37 UTC] Error saving invoice: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`icodesxy_astra`.`sales_invoices`, CONSTRAINT `sales_invoices_ibfk_3` FOREIGN KEY (`treasury_id`) REFERENCES `treasuries` (`id`))
[08-Aug-2025 13:28:50 UTC] Saving invoice with values: {"invoice_number":1,"store_id":"1","treasury_id":1,"client_id":"1","user_id":11,"payment_type":"cash","total":30,"discount":"0","final_total":30,"paid_amount":30,"remaining_amount":0,"shift_id":2,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u062a","quantity":1,"price":30,"total":30}]}
[08-Aug-2025 13:28:50 UTC] Error saving invoice: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`icodesxy_astra`.`sales_invoices`, CONSTRAINT `sales_invoices_ibfk_3` FOREIGN KEY (`treasury_id`) REFERENCES `treasuries` (`id`))
[08-Aug-2025 13:29:50 UTC] Saving invoice with values: {"invoice_number":1,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":60,"discount":"0","final_total":60,"paid_amount":60,"remaining_amount":0,"shift_id":2,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u062a","quantity":2,"price":30,"total":60}]}
[08-Aug-2025 13:29:50 UTC] Invoice inserted successfully with ID: 8
[08-Aug-2025 13:29:50 UTC] Treasury updated with final_total: 60 for treasury_id: 1
[08-Aug-2025 13:30:33 UTC] Saving invoice with values: {"invoice_number":9,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":30,"discount":"0","final_total":30,"paid_amount":30,"remaining_amount":0,"shift_id":2,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u062a","quantity":1,"price":30,"total":30}]}
[08-Aug-2025 13:30:33 UTC] Invoice inserted successfully with ID: 9
[08-Aug-2025 13:30:33 UTC] Treasury updated with final_total: 30 for treasury_id: 1
[08-Aug-2025 13:32:47 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 1
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"4","name":"بسكوت","available_quantity":497,"quantity":500,"price":30,"total":15000}]
    [save_purchase] => 
)

[08-Aug-2025 13:32:47 UTC] Inserted purchase invoice: id=1, invoice_number=1000
[08-Aug-2025 13:32:47 UTC] Inserted purchase item: invoice_id=1, item_id=4, quantity=500, price=30
[08-Aug-2025 13:32:47 UTC] Updated item: item_id=4, new_quantity=1000, new_retail_price=30
[08-Aug-2025 13:32:47 UTC] Updated treasury balance: treasury_id=1, old_balance=90.00, new_balance=-14910
[08-Aug-2025 13:32:47 UTC] Added treasury transaction: treasury_id=1, amount=15000, invoice_id=1, invoice_type=purchase
[08-Aug-2025 13:32:47 UTC] Purchase invoice 1 committed successfully
[08-Aug-2025 17:54:51 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_2` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`)) in /home/icodesxy/public_html/astra/units.php:35
Stack trace:
#0 /home/icodesxy/public_html/astra/units.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/units.php on line 35
[08-Aug-2025 17:54:53 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_2` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`)) in /home/icodesxy/public_html/astra/units.php:35
Stack trace:
#0 /home/icodesxy/public_html/astra/units.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/units.php on line 35
[08-Aug-2025 17:54:54 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_2` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`)) in /home/icodesxy/public_html/astra/units.php:35
Stack trace:
#0 /home/icodesxy/public_html/astra/units.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/units.php on line 35
[08-Aug-2025 17:55:03 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_2` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`)) in /home/icodesxy/public_html/astra/units.php:35
Stack trace:
#0 /home/icodesxy/public_html/astra/units.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/units.php on line 35
[08-Aug-2025 17:55:05 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_2` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`)) in /home/icodesxy/public_html/astra/units.php:35
Stack trace:
#0 /home/icodesxy/public_html/astra/units.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/units.php on line 35
[08-Aug-2025 19:34:45 UTC] Saving invoice with values: {"invoice_number":10,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":125,"discount":"10","final_total":115,"paid_amount":115,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"5","name":"\u0628\u0633\u0643\u0648\u062a \u0627\u0648\u0644\u0643\u0631","quantity":5,"price":25,"total":125}]}
[08-Aug-2025 19:34:45 UTC] Invoice inserted successfully with ID: 10
[08-Aug-2025 19:34:45 UTC] Treasury updated with final_total: 115 for treasury_id: 1
[08-Aug-2025 19:37:51 UTC] POST request received: Array
(
    [invoice_number] => 1001
    [payment_type] => credit
    [supplier_id] => 2
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[08-Aug-2025 19:37:51 UTC] Error: No items provided in items_data
[08-Aug-2025 19:38:22 UTC] POST request received: Array
(
    [invoice_number] => 1001
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"5","name":"بسكوت اولكر","available_quantity":45,"quantity":100,"price":30,"total":3000}]
)

[08-Aug-2025 19:38:22 UTC] save_purchase not set in POST data. Full POST data: Array
(
    [invoice_number] => 1001
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"5","name":"بسكوت اولكر","available_quantity":45,"quantity":100,"price":30,"total":3000}]
)

[08-Aug-2025 19:38:29 UTC] POST request received: Array
(
    [invoice_number] => 1001
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[08-Aug-2025 19:38:29 UTC] Error: No items provided in items_data
[08-Aug-2025 19:39:01 UTC] POST request received: Array
(
    [invoice_number] => 1001
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"5","name":"بسكوت اولكر","available_quantity":45,"quantity":100,"price":20,"total":2000},{"id":"4","name":"بسكوت","available_quantity":997,"quantity":1,"price":30,"total":30}]
    [save_purchase] => 
)

[08-Aug-2025 19:39:01 UTC] Error creating purchase invoice: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`icodesxy_astra`.`purchase_invoices`, CONSTRAINT `purchase_invoices_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`))
[08-Aug-2025 19:47:58 UTC] Saving invoice with values: {"invoice_number":11,"store_id":"2","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":600,"discount":"0","final_total":600,"paid_amount":600,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"5","name":"\u0628\u0633\u0643\u0648\u062a \u0627\u0648\u0644\u0643\u0631","quantity":20,"price":30,"total":600}]}
[08-Aug-2025 19:47:58 UTC] Invoice inserted successfully with ID: 11
[08-Aug-2025 19:47:58 UTC] Treasury updated with final_total: 600 for treasury_id: 1
[08-Aug-2025 19:50:23 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[08-Aug-2025 19:50:23 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[08-Aug-2025 19:50:23 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[09-Aug-2025 15:16:55 UTC] Error fetching item movement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sri.product_id' in 'WHERE'
[10-Aug-2025 21:34:47 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[10-Aug-2025 21:34:47 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[10-Aug-2025 21:34:47 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[14-Aug-2025 08:53:04 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[14-Aug-2025 08:53:04 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[14-Aug-2025 08:53:04 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[14-Aug-2025 08:54:21 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[14-Aug-2025 08:54:21 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[14-Aug-2025 08:54:21 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[17-Aug-2025 13:09:19 UTC] POST request received: Array
(
    [invoice_number] => 1001
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"4","name":"بسكوت","available_quantity":997,"quantity":10,"price":30,"total":300}]
    [save_purchase] => 
)

[17-Aug-2025 13:09:19 UTC] Error creating purchase invoice: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`icodesxy_astra`.`purchase_invoices`, CONSTRAINT `purchase_invoices_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`))
[17-Aug-2025 18:45:47 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[17-Aug-2025 18:45:47 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[17-Aug-2025 18:45:47 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[17-Aug-2025 20:07:47 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`sales_invoices`, CONSTRAINT `sales_invoices_ibfk_2` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`)) in /home/icodesxy/public_html/astra/clients.php:127
Stack trace:
#0 /home/icodesxy/public_html/astra/clients.php(127): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/clients.php on line 127
[17-Aug-2025 20:08:15 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[17-Aug-2025 20:08:15 UTC] Error: No items provided in items_data
[17-Aug-2025 20:08:29 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"4","name":"بسكوت","available_quantity":997,"quantity":1,"price":30,"total":30}]
    [save_purchase] => 
)

[17-Aug-2025 20:08:29 UTC] Error creating purchase invoice: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`icodesxy_astra`.`purchase_invoices`, CONSTRAINT `purchase_invoices_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`))
[17-Aug-2025 20:13:38 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/astra/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/astra/categories.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/categories.php on line 35
[17-Aug-2025 20:13:40 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/astra/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/astra/categories.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/categories.php on line 35
[17-Aug-2025 20:13:40 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/astra/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/astra/categories.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/categories.php on line 35
[17-Aug-2025 20:13:41 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/astra/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/astra/categories.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/categories.php on line 35
[17-Aug-2025 20:13:42 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)) in /home/icodesxy/public_html/astra/categories.php:35
Stack trace:
#0 /home/icodesxy/public_html/astra/categories.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/categories.php on line 35
[17-Aug-2025 20:14:21 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_2` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`)) in /home/icodesxy/public_html/astra/units.php:35
Stack trace:
#0 /home/icodesxy/public_html/astra/units.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/units.php on line 35
[17-Aug-2025 20:14:44 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[17-Aug-2025 20:14:44 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[17-Aug-2025 20:14:44 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[17-Aug-2025 20:17:57 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[17-Aug-2025 20:17:57 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[17-Aug-2025 20:17:57 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[17-Aug-2025 20:31:29 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => credit
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[17-Aug-2025 20:31:29 UTC] Error: No items provided in items_data
[17-Aug-2025 20:31:44 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[17-Aug-2025 20:31:44 UTC] Error: No items provided in items_data
[17-Aug-2025 20:31:48 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[17-Aug-2025 20:31:48 UTC] Error: No items provided in items_data
[17-Aug-2025 20:32:57 UTC] Error deleting user: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`sales_invoices`, CONSTRAINT `sales_invoices_ibfk_4` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`))
[17-Aug-2025 20:33:46 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_3` FOREIGN KEY (`store_id`) REFERENCES `stores` (`id`)) in /home/icodesxy/public_html/astra/store_add.php:52
Stack trace:
#0 /home/icodesxy/public_html/astra/store_add.php(52): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/store_add.php on line 52
[22-Aug-2025 12:43:38 UTC] Saving invoice with values: {"invoice_number":12,"store_id":"4","treasury_id":"1","client_id":"2","user_id":11,"payment_type":"cash","total":195,"discount":"10","final_total":185,"paid_amount":185,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u062a","quantity":4,"price":30,"total":120},{"id":"6","name":"\u0643\u0648\u0639 1","quantity":5,"price":15,"total":75}]}
[22-Aug-2025 12:43:38 UTC] Invoice inserted successfully with ID: 12
[22-Aug-2025 12:43:38 UTC] Treasury updated with final_total: 185 for treasury_id: 1
[23-Aug-2025 20:11:08 UTC] Auto backup failed: 
[23-Aug-2025 20:22:35 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[23-Aug-2025 20:22:35 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[23-Aug-2025 20:22:35 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[23-Aug-2025 20:22:41 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[23-Aug-2025 20:22:41 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[23-Aug-2025 20:22:41 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[23-Aug-2025 20:22:44 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[23-Aug-2025 20:22:44 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[23-Aug-2025 20:22:44 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[23-Aug-2025 20:22:48 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[23-Aug-2025 20:22:48 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[23-Aug-2025 20:22:48 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[23-Aug-2025 20:23:03 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[23-Aug-2025 20:23:03 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[23-Aug-2025 20:23:03 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[23-Aug-2025 23:06:13 UTC] Report data count: 4
[23-Aug-2025 23:06:13 UTC] First row sample: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[23-Aug-2025 23:06:13 UTC] Print row 0: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[23-Aug-2025 23:06:13 UTC] Print row 1: {"invoice_id":9,"invoice_number":9,"date":"2025-08-08 16:30:33","total":"30.00","discount":"0.00","final_total":"30.00","paid_amount":"30.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت","quantity":1,"price":"30.00","item_total":"30.00","payment_amount":null,"record_type":"invoice","total_paid":30,"adjusted_remaining":0}
[23-Aug-2025 23:06:13 UTC] Print row 2: {"invoice_id":10,"invoice_number":10,"date":"2025-08-08 22:34:45","total":"125.00","discount":"10.00","final_total":"115.00","paid_amount":"115.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":5,"price":"25.00","item_total":"125.00","payment_amount":null,"record_type":"invoice","total_paid":115,"adjusted_remaining":0}
[23-Aug-2025 23:06:13 UTC] Print row 3: {"invoice_id":11,"invoice_number":11,"date":"2025-08-08 22:47:58","total":"600.00","discount":"0.00","final_total":"600.00","paid_amount":"600.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":20,"price":"30.00","item_total":"600.00","payment_amount":null,"record_type":"invoice","total_paid":600,"adjusted_remaining":0}
[23-Aug-2025 23:08:24 UTC] Report data count: 4
[23-Aug-2025 23:08:24 UTC] First row sample: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[23-Aug-2025 23:08:24 UTC] Print row 0: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[23-Aug-2025 23:08:24 UTC] Print row 1: {"invoice_id":9,"invoice_number":9,"date":"2025-08-08 16:30:33","total":"30.00","discount":"0.00","final_total":"30.00","paid_amount":"30.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت","quantity":1,"price":"30.00","item_total":"30.00","payment_amount":null,"record_type":"invoice","total_paid":30,"adjusted_remaining":0}
[23-Aug-2025 23:08:24 UTC] Print row 2: {"invoice_id":10,"invoice_number":10,"date":"2025-08-08 22:34:45","total":"125.00","discount":"10.00","final_total":"115.00","paid_amount":"115.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":5,"price":"25.00","item_total":"125.00","payment_amount":null,"record_type":"invoice","total_paid":115,"adjusted_remaining":0}
[23-Aug-2025 23:08:24 UTC] Print row 3: {"invoice_id":11,"invoice_number":11,"date":"2025-08-08 22:47:58","total":"600.00","discount":"0.00","final_total":"600.00","paid_amount":"600.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":20,"price":"30.00","item_total":"600.00","payment_amount":null,"record_type":"invoice","total_paid":600,"adjusted_remaining":0}
[23-Aug-2025 23:14:22 UTC] Error fetching installment invoices: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'si.advance_payment' in 'SELECT'
[23-Aug-2025 23:14:22 UTC] Error fetching due installments: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'icodesxy_astra.installments' doesn't exist
[23-Aug-2025 23:19:14 UTC] PHP Fatal error:  Uncaught TypeError: Unsupported operand types: int - string in /home/icodesxy/public_html/astra/installment_sales.php:181
Stack trace:
#0 {main}
  thrown in /home/icodesxy/public_html/astra/installment_sales.php on line 181
[23-Aug-2025 23:19:20 UTC] PHP Fatal error:  Uncaught TypeError: Unsupported operand types: int - string in /home/icodesxy/public_html/astra/installment_sales.php:181
Stack trace:
#0 {main}
  thrown in /home/icodesxy/public_html/astra/installment_sales.php on line 181
[23-Aug-2025 23:19:36 UTC] PHP Fatal error:  Uncaught TypeError: Unsupported operand types: int - string in /home/icodesxy/public_html/astra/installment_sales.php:181
Stack trace:
#0 {main}
  thrown in /home/icodesxy/public_html/astra/installment_sales.php on line 181
[23-Aug-2025 23:19:45 UTC] Restored pending installment invoice #13
[23-Aug-2025 23:22:08 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[23-Aug-2025 23:22:08 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[23-Aug-2025 23:22:08 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[23-Aug-2025 23:22:11 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[23-Aug-2025 23:22:11 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[23-Aug-2025 23:22:11 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[23-Aug-2025 23:26:06 UTC] Saving invoice with values: {"invoice_number":13,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"credit","total":18000,"discount":"0","final_total":18000,"paid_amount":0,"remaining_amount":18000,"shift_id":5,"items_data":[{"id":"4","name":"labtop","quantity":3,"price":6000,"total":18000}]}
[23-Aug-2025 23:26:06 UTC] Invoice inserted successfully with ID: 13
[23-Aug-2025 23:31:09 UTC] Error paying debt: المبلغ المدفوع يتجاوز الدين الحالي!
[23-Aug-2025 23:34:05 UTC] Report data count: 6
[23-Aug-2025 23:34:05 UTC] First row sample: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[23-Aug-2025 23:34:05 UTC] Print row 0: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[23-Aug-2025 23:34:05 UTC] Print row 1: {"invoice_id":9,"invoice_number":9,"date":"2025-08-08 16:30:33","total":"30.00","discount":"0.00","final_total":"30.00","paid_amount":"30.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":1,"price":"30.00","item_total":"30.00","payment_amount":null,"record_type":"invoice","total_paid":30,"adjusted_remaining":0}
[23-Aug-2025 23:34:05 UTC] Print row 2: {"invoice_id":10,"invoice_number":10,"date":"2025-08-08 22:34:45","total":"125.00","discount":"10.00","final_total":"115.00","paid_amount":"115.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":5,"price":"25.00","item_total":"125.00","payment_amount":null,"record_type":"invoice","total_paid":115,"adjusted_remaining":0}
[23-Aug-2025 23:34:05 UTC] Print row 3: {"invoice_id":11,"invoice_number":11,"date":"2025-08-08 22:47:58","total":"600.00","discount":"0.00","final_total":"600.00","paid_amount":"600.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":20,"price":"30.00","item_total":"600.00","payment_amount":null,"record_type":"invoice","total_paid":600,"adjusted_remaining":0}
[23-Aug-2025 23:34:05 UTC] Print row 4: {"invoice_id":13,"invoice_number":13,"date":"2025-08-24 02:26:06","total":"18000.00","discount":"0.00","final_total":"18000.00","paid_amount":"0.00","remaining_amount":"18000.00","payment_type":"credit","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":3,"price":"6000.00","item_total":"18000.00","payment_amount":null,"record_type":"invoice","total_paid":0,"adjusted_remaining":18000}
[23-Aug-2025 23:34:05 UTC] Print row 5: {"invoice_id":13,"invoice_number":13,"date":"2025-08-24 02:31:22","total":"18000.00","discount":"0.00","final_total":"18000.00","paid_amount":null,"remaining_amount":8000,"payment_type":"تسديد","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":3,"price":"6000.00","item_total":"18000.00","payment_amount":10000,"record_type":"payment","total_paid":10000,"adjusted_remaining":8000}
[23-Aug-2025 23:38:43 UTC] Report data count: 6
[23-Aug-2025 23:38:43 UTC] First row sample: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[23-Aug-2025 23:38:43 UTC] Print row 0: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[23-Aug-2025 23:38:43 UTC] Print row 1: {"invoice_id":9,"invoice_number":9,"date":"2025-08-08 16:30:33","total":"30.00","discount":"0.00","final_total":"30.00","paid_amount":"30.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":1,"price":"30.00","item_total":"30.00","payment_amount":null,"record_type":"invoice","total_paid":30,"adjusted_remaining":0}
[23-Aug-2025 23:38:43 UTC] Print row 2: {"invoice_id":10,"invoice_number":10,"date":"2025-08-08 22:34:45","total":"125.00","discount":"10.00","final_total":"115.00","paid_amount":"115.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":5,"price":"25.00","item_total":"125.00","payment_amount":null,"record_type":"invoice","total_paid":115,"adjusted_remaining":0}
[23-Aug-2025 23:38:43 UTC] Print row 3: {"invoice_id":11,"invoice_number":11,"date":"2025-08-08 22:47:58","total":"600.00","discount":"0.00","final_total":"600.00","paid_amount":"600.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":20,"price":"30.00","item_total":"600.00","payment_amount":null,"record_type":"invoice","total_paid":600,"adjusted_remaining":0}
[23-Aug-2025 23:38:43 UTC] Print row 4: {"invoice_id":13,"invoice_number":13,"date":"2025-08-24 02:26:06","total":"18000.00","discount":"0.00","final_total":"18000.00","paid_amount":"0.00","remaining_amount":"18000.00","payment_type":"credit","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":3,"price":"6000.00","item_total":"18000.00","payment_amount":null,"record_type":"invoice","total_paid":0,"adjusted_remaining":18000}
[23-Aug-2025 23:38:43 UTC] Print row 5: {"invoice_id":13,"invoice_number":13,"date":"2025-08-24 02:31:22","total":"18000.00","discount":"0.00","final_total":"18000.00","paid_amount":null,"remaining_amount":8000,"payment_type":"تسديد","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":3,"price":"6000.00","item_total":"18000.00","payment_amount":10000,"record_type":"payment","total_paid":10000,"adjusted_remaining":8000}
[23-Aug-2025 23:39:13 UTC] Error fetching item movement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sri.product_id' in 'WHERE'
[23-Aug-2025 23:39:34 UTC] Error fetching item movement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sri.product_id' in 'WHERE'
[24-Aug-2025 09:27:41 UTC] Report data count: 8
[24-Aug-2025 09:27:41 UTC] First row sample: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[24-Aug-2025 09:27:41 UTC] Print row 0: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[24-Aug-2025 09:27:41 UTC] Print row 1: {"invoice_id":9,"invoice_number":9,"date":"2025-08-08 16:30:33","total":"30.00","discount":"0.00","final_total":"30.00","paid_amount":"30.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":1,"price":"30.00","item_total":"30.00","payment_amount":null,"record_type":"invoice","total_paid":30,"adjusted_remaining":0}
[24-Aug-2025 09:27:41 UTC] Print row 2: {"invoice_id":10,"invoice_number":10,"date":"2025-08-08 22:34:45","total":"125.00","discount":"10.00","final_total":"115.00","paid_amount":"115.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":5,"price":"25.00","item_total":"125.00","payment_amount":null,"record_type":"invoice","total_paid":115,"adjusted_remaining":0}
[24-Aug-2025 09:27:41 UTC] Print row 3: {"invoice_id":11,"invoice_number":11,"date":"2025-08-08 22:47:58","total":"600.00","discount":"0.00","final_total":"600.00","paid_amount":"600.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":20,"price":"30.00","item_total":"600.00","payment_amount":null,"record_type":"invoice","total_paid":600,"adjusted_remaining":0}
[24-Aug-2025 09:27:41 UTC] Print row 4: {"invoice_id":12,"invoice_number":12,"date":"2025-08-22 15:43:38","total":"195.00","discount":"10.00","final_total":"185.00","paid_amount":"185.00","remaining_amount":"0.00","payment_type":"cash","client_id":2,"client_name":"مالك فهد ","item_name":"كوع 1","quantity":5,"price":"15.00","item_total":"75.00","payment_amount":null,"record_type":"invoice","total_paid":185,"adjusted_remaining":0}
[24-Aug-2025 09:27:41 UTC] Print row 5: {"invoice_id":12,"invoice_number":12,"date":"2025-08-22 15:43:38","total":"195.00","discount":"10.00","final_total":"185.00","paid_amount":"185.00","remaining_amount":"0.00","payment_type":"cash","client_id":2,"client_name":"مالك فهد ","item_name":"labtop","quantity":4,"price":"30.00","item_total":"120.00","payment_amount":null,"record_type":"invoice","total_paid":185,"adjusted_remaining":0}
[24-Aug-2025 09:27:41 UTC] Print row 6: {"invoice_id":13,"invoice_number":13,"date":"2025-08-24 02:26:06","total":"18000.00","discount":"0.00","final_total":"18000.00","paid_amount":"0.00","remaining_amount":"18000.00","payment_type":"credit","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":3,"price":"6000.00","item_total":"18000.00","payment_amount":null,"record_type":"invoice","total_paid":0,"adjusted_remaining":18000}
[24-Aug-2025 09:27:41 UTC] Print row 7: {"invoice_id":13,"invoice_number":13,"date":"2025-08-24 02:31:22","total":"18000.00","discount":"0.00","final_total":"18000.00","paid_amount":null,"remaining_amount":8000,"payment_type":"تسديد","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":3,"price":"6000.00","item_total":"18000.00","payment_amount":10000,"record_type":"payment","total_paid":10000,"adjusted_remaining":8000}
[24-Aug-2025 09:29:48 UTC] Report data count: 8
[24-Aug-2025 09:29:48 UTC] First row sample: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[24-Aug-2025 09:29:48 UTC] Print row 0: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[24-Aug-2025 09:29:48 UTC] Print row 1: {"invoice_id":9,"invoice_number":9,"date":"2025-08-08 16:30:33","total":"30.00","discount":"0.00","final_total":"30.00","paid_amount":"30.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":1,"price":"30.00","item_total":"30.00","payment_amount":null,"record_type":"invoice","total_paid":30,"adjusted_remaining":0}
[24-Aug-2025 09:29:48 UTC] Print row 2: {"invoice_id":10,"invoice_number":10,"date":"2025-08-08 22:34:45","total":"125.00","discount":"10.00","final_total":"115.00","paid_amount":"115.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":5,"price":"25.00","item_total":"125.00","payment_amount":null,"record_type":"invoice","total_paid":115,"adjusted_remaining":0}
[24-Aug-2025 09:29:48 UTC] Print row 3: {"invoice_id":11,"invoice_number":11,"date":"2025-08-08 22:47:58","total":"600.00","discount":"0.00","final_total":"600.00","paid_amount":"600.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":20,"price":"30.00","item_total":"600.00","payment_amount":null,"record_type":"invoice","total_paid":600,"adjusted_remaining":0}
[24-Aug-2025 09:29:48 UTC] Print row 4: {"invoice_id":12,"invoice_number":12,"date":"2025-08-22 15:43:38","total":"195.00","discount":"10.00","final_total":"185.00","paid_amount":"185.00","remaining_amount":"0.00","payment_type":"cash","client_id":2,"client_name":"مالك فهد ","item_name":"labtop","quantity":4,"price":"30.00","item_total":"120.00","payment_amount":null,"record_type":"invoice","total_paid":185,"adjusted_remaining":0}
[24-Aug-2025 09:29:48 UTC] Print row 5: {"invoice_id":12,"invoice_number":12,"date":"2025-08-22 15:43:38","total":"195.00","discount":"10.00","final_total":"185.00","paid_amount":"185.00","remaining_amount":"0.00","payment_type":"cash","client_id":2,"client_name":"مالك فهد ","item_name":"كوع 1","quantity":5,"price":"15.00","item_total":"75.00","payment_amount":null,"record_type":"invoice","total_paid":185,"adjusted_remaining":0}
[24-Aug-2025 09:29:48 UTC] Print row 6: {"invoice_id":13,"invoice_number":13,"date":"2025-08-24 02:26:06","total":"18000.00","discount":"0.00","final_total":"18000.00","paid_amount":"0.00","remaining_amount":"18000.00","payment_type":"credit","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":3,"price":"6000.00","item_total":"18000.00","payment_amount":null,"record_type":"invoice","total_paid":0,"adjusted_remaining":18000}
[24-Aug-2025 09:29:48 UTC] Print row 7: {"invoice_id":13,"invoice_number":13,"date":"2025-08-24 02:31:22","total":"18000.00","discount":"0.00","final_total":"18000.00","paid_amount":null,"remaining_amount":8000,"payment_type":"تسديد","client_id":1,"client_name":"احمد","item_name":"labtop","quantity":3,"price":"6000.00","item_total":"18000.00","payment_amount":10000,"record_type":"payment","total_paid":10000,"adjusted_remaining":8000}
[24-Aug-2025 12:49:01 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => cash
    [supplier_id] => 5
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[24-Aug-2025 12:49:01 UTC] Error: No items provided in items_data
[24-Aug-2025 12:49:25 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => credit
    [supplier_id] => 5
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[24-Aug-2025 12:49:25 UTC] Error: No items provided in items_data
[24-Aug-2025 12:49:38 UTC] POST request received: Array
(
    [invoice_number] => 1000
    [payment_type] => credit
    [supplier_id] => 5
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"5","name":"بسكوت اولكر","available_quantity":0,"quantity":1,"price":30,"total":30}]
    [save_purchase] => 
)

[24-Aug-2025 12:49:38 UTC] Inserted purchase invoice: id=5, invoice_number=1000
[24-Aug-2025 12:49:38 UTC] Inserted purchase item: invoice_id=5, item_id=5, quantity=1, price=30
[24-Aug-2025 12:49:38 UTC] Updated item: item_id=5, new_quantity=2, new_retail_price=30
[24-Aug-2025 12:49:38 UTC] Updated supplier debt: supplier_id=5, new_debt=300030
[24-Aug-2025 12:49:38 UTC] Purchase invoice 5 committed successfully
[25-Aug-2025 08:20:18 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[25-Aug-2025 08:20:18 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[25-Aug-2025 08:20:18 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[25-Aug-2025 11:21:24 UTC] Report data count: 8
[25-Aug-2025 11:21:24 UTC] First row sample: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكويت","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[25-Aug-2025 11:21:24 UTC] Print row 0: {"invoice_id":8,"invoice_number":1,"date":"2025-08-08 16:29:50","total":"60.00","discount":"0.00","final_total":"60.00","paid_amount":"60.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكويت","quantity":2,"price":"30.00","item_total":"60.00","payment_amount":null,"record_type":"invoice","total_paid":60,"adjusted_remaining":0}
[25-Aug-2025 11:21:24 UTC] Print row 1: {"invoice_id":9,"invoice_number":9,"date":"2025-08-08 16:30:33","total":"30.00","discount":"0.00","final_total":"30.00","paid_amount":"30.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكويت","quantity":1,"price":"30.00","item_total":"30.00","payment_amount":null,"record_type":"invoice","total_paid":30,"adjusted_remaining":0}
[25-Aug-2025 11:21:24 UTC] Print row 2: {"invoice_id":10,"invoice_number":10,"date":"2025-08-08 22:34:45","total":"125.00","discount":"10.00","final_total":"115.00","paid_amount":"115.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":5,"price":"25.00","item_total":"125.00","payment_amount":null,"record_type":"invoice","total_paid":115,"adjusted_remaining":0}
[25-Aug-2025 11:21:24 UTC] Print row 3: {"invoice_id":11,"invoice_number":11,"date":"2025-08-08 22:47:58","total":"600.00","discount":"0.00","final_total":"600.00","paid_amount":"600.00","remaining_amount":"0.00","payment_type":"cash","client_id":1,"client_name":"احمد","item_name":"بسكوت اولكر","quantity":20,"price":"30.00","item_total":"600.00","payment_amount":null,"record_type":"invoice","total_paid":600,"adjusted_remaining":0}
[25-Aug-2025 11:21:24 UTC] Print row 4: {"invoice_id":12,"invoice_number":12,"date":"2025-08-22 15:43:38","total":"195.00","discount":"10.00","final_total":"185.00","paid_amount":"185.00","remaining_amount":"0.00","payment_type":"cash","client_id":2,"client_name":"مالك فهد ","item_name":"كوع 1","quantity":5,"price":"15.00","item_total":"75.00","payment_amount":null,"record_type":"invoice","total_paid":185,"adjusted_remaining":0}
[25-Aug-2025 11:21:24 UTC] Print row 5: {"invoice_id":12,"invoice_number":12,"date":"2025-08-22 15:43:38","total":"195.00","discount":"10.00","final_total":"185.00","paid_amount":"185.00","remaining_amount":"0.00","payment_type":"cash","client_id":2,"client_name":"مالك فهد ","item_name":"بسكويت","quantity":4,"price":"30.00","item_total":"120.00","payment_amount":null,"record_type":"invoice","total_paid":185,"adjusted_remaining":0}
[25-Aug-2025 11:21:24 UTC] Print row 6: {"invoice_id":13,"invoice_number":13,"date":"2025-08-24 02:26:06","total":"18000.00","discount":"0.00","final_total":"18000.00","paid_amount":"0.00","remaining_amount":"18000.00","payment_type":"credit","client_id":1,"client_name":"احمد","item_name":"بسكويت","quantity":3,"price":"6000.00","item_total":"18000.00","payment_amount":null,"record_type":"invoice","total_paid":0,"adjusted_remaining":18000}
[25-Aug-2025 11:21:24 UTC] Print row 7: {"invoice_id":13,"invoice_number":13,"date":"2025-08-24 02:31:22","total":"18000.00","discount":"0.00","final_total":"18000.00","paid_amount":null,"remaining_amount":8000,"payment_type":"تسديد","client_id":1,"client_name":"احمد","item_name":"بسكويت","quantity":3,"price":"6000.00","item_total":"18000.00","payment_amount":10000,"record_type":"payment","total_paid":10000,"adjusted_remaining":8000}
[30-Aug-2025 19:18:28 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[30-Aug-2025 19:18:28 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[30-Aug-2025 19:18:28 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[30-Aug-2025 19:18:41 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[30-Aug-2025 19:18:41 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[30-Aug-2025 19:18:41 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[03-Sep-2025 23:00:04 UTC] PHP Warning:  Trying to access array offset on value of type bool in /home/icodesxy/public_html/astra/item_search.php on line 158
[03-Sep-2025 23:00:04 UTC] PHP Deprecated:  htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/icodesxy/public_html/astra/item_search.php on line 158
[03-Sep-2025 23:00:04 UTC] PHP Warning:  Trying to access array offset on value of type bool in /home/icodesxy/public_html/astra/item_search.php on line 159
[03-Sep-2025 23:00:04 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/item_search.php on line 159
[03-Sep-2025 23:03:22 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[03-Sep-2025 23:03:22 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[03-Sep-2025 23:03:22 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[03-Sep-2025 23:03:29 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[03-Sep-2025 23:03:29 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[03-Sep-2025 23:03:29 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[03-Sep-2025 23:03:38 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[03-Sep-2025 23:03:38 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[03-Sep-2025 23:03:38 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[07-Sep-2025 16:25:49 UTC] Saving invoice with values: {"invoice_number":14,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":6000,"discount":"0","final_total":6000,"paid_amount":6000,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u064a\u062a","quantity":1,"price":6000,"total":6000}]}
[07-Sep-2025 16:25:49 UTC] Invoice inserted successfully with ID: 14
[07-Sep-2025 16:25:49 UTC] Treasury updated with final_total: 6000 for treasury_id: 1
[07-Sep-2025 17:28:37 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 485
[07-Sep-2025 17:28:37 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 486
[07-Sep-2025 17:28:37 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 487
[07-Sep-2025 17:28:42 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 485
[07-Sep-2025 17:28:42 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 486
[07-Sep-2025 17:28:42 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 487
[07-Sep-2025 17:32:21 UTC] Saving invoice with values: {"invoice_number":14,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":200,"discount":"5","final_total":195,"paid_amount":195,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"7","name":"\u0628\u0646\u0637\u0644\u0648\u0646 \u062c\u064a\u0646\u0632","quantity":1,"price":200,"total":200}]}
[07-Sep-2025 17:32:21 UTC] Invoice inserted successfully with ID: 15
[07-Sep-2025 17:32:21 UTC] Treasury updated with final_total: 195 for treasury_id: 1
[07-Sep-2025 17:33:36 UTC] Saving invoice with values: {"invoice_number":16,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":200,"discount":"0","final_total":200,"paid_amount":200,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"7","name":"\u0628\u0646\u0637\u0644\u0648\u0646 \u062c\u064a\u0646\u0632","quantity":1,"price":200,"total":200}]}
[07-Sep-2025 17:33:36 UTC] Invoice inserted successfully with ID: 16
[07-Sep-2025 17:33:36 UTC] Treasury updated with final_total: 200 for treasury_id: 1
[07-Sep-2025 17:34:40 UTC] Saving invoice with values: {"invoice_number":17,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":200,"discount":"0","final_total":200,"paid_amount":200,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"7","name":"\u0628\u0646\u0637\u0644\u0648\u0646 \u062c\u064a\u0646\u0632","quantity":1,"price":200,"total":200}]}
[07-Sep-2025 17:34:40 UTC] Invoice inserted successfully with ID: 17
[07-Sep-2025 17:34:40 UTC] Treasury updated with final_total: 200 for treasury_id: 1
[18-Sep-2025 15:38:00 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[18-Sep-2025 15:38:00 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[18-Sep-2025 15:38:00 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[18-Sep-2025 15:38:06 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[18-Sep-2025 15:38:06 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[18-Sep-2025 15:38:06 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[18-Sep-2025 15:38:21 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[18-Sep-2025 15:38:21 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[18-Sep-2025 15:38:21 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[18-Sep-2025 15:45:43 UTC] Saving invoice with values: {"invoice_number":18,"store_id":"1","treasury_id":"1","client_id":"2","user_id":11,"payment_type":"cash","total":6215,"discount":"0","final_total":6215,"paid_amount":6215,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u064a\u062a","quantity":1,"price":6000,"total":6000},{"id":"6","name":"\u0643\u0648\u0639 1","quantity":1,"price":15,"total":15},{"id":"7","name":"\u0628\u0646\u0637\u0644\u0648\u0646 \u062c\u064a\u0646\u0632","quantity":1,"price":200,"total":200}]}
[18-Sep-2025 15:45:43 UTC] Invoice inserted successfully with ID: 18
[18-Sep-2025 15:45:43 UTC] Treasury updated with final_total: 6215 for treasury_id: 1
[15-Oct-2025 06:30:57 UTC] Saving invoice with values: {"invoice_number":19,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":6000,"discount":"0","final_total":6000,"paid_amount":6000,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u064a\u062a","quantity":1,"price":6000,"total":6000}]}
[15-Oct-2025 06:30:57 UTC] Invoice inserted successfully with ID: 19
[15-Oct-2025 06:30:57 UTC] Treasury updated with final_total: 6000 for treasury_id: 1
[15-Oct-2025 18:41:58 UTC] Saving invoice with values: {"invoice_number":20,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":120,"discount":12,"final_total":108,"paid_amount":108,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"8","name":"\u0643\u0648\u062a\u0634\u064a \u062d\u0631\u064a\u0645\u064a","quantity":1,"price":120,"total":120}]}
[15-Oct-2025 18:41:58 UTC] Invoice inserted successfully with ID: 20
[15-Oct-2025 18:41:58 UTC] Treasury updated with final_total: 108 for treasury_id: 1
[19-Oct-2025 09:26:11 UTC] Saving invoice with values: {"invoice_number":21,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":200,"discount":"0","final_total":200,"paid_amount":200,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"7","name":"\u0628\u0646\u0637\u0644\u0648\u0646 \u062c\u064a\u0646\u0632","quantity":1,"price":200,"total":200}]}
[19-Oct-2025 09:26:11 UTC] Invoice inserted successfully with ID: 21
[19-Oct-2025 09:26:11 UTC] Treasury updated with final_total: 200 for treasury_id: 1
[26-Oct-2025 09:55:48 UTC] Saving invoice with values: {"invoice_number":22,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":6045,"discount":"0","final_total":6045,"paid_amount":6045,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u064a\u062a","quantity":1,"price":6000,"total":6000},{"id":"5","name":"\u0628\u0633\u0643\u0648\u062a \u0627\u0648\u0644\u0643\u0631","quantity":1,"price":30,"total":30},{"id":"6","name":"\u0643\u0648\u0639 1","quantity":1,"price":15,"total":15}]}
[26-Oct-2025 09:55:48 UTC] Invoice inserted successfully with ID: 22
[26-Oct-2025 09:55:48 UTC] Treasury updated with final_total: 6045 for treasury_id: 1
[26-Oct-2025 09:55:59 UTC] Saving invoice with values: {"invoice_number":23,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"credit","total":6045,"discount":"0","final_total":6045,"paid_amount":0,"remaining_amount":6045,"shift_id":5,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u064a\u062a","quantity":1,"price":6000,"total":6000},{"id":"5","name":"\u0628\u0633\u0643\u0648\u062a \u0627\u0648\u0644\u0643\u0631","quantity":1,"price":30,"total":30},{"id":"6","name":"\u0643\u0648\u0639 1","quantity":1,"price":15,"total":15}]}
[26-Oct-2025 09:55:59 UTC] Invoice inserted successfully with ID: 23
[26-Oct-2025 09:55:59 UTC] Error saving invoice: الكمية غير كافية للصنف: بسكوت اولكر
[26-Oct-2025 09:56:07 UTC] Saving invoice with values: {"invoice_number":23,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"credit","total":6045,"discount":"0","final_total":6045,"paid_amount":0,"remaining_amount":6045,"shift_id":5,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u064a\u062a","quantity":1,"price":6000,"total":6000},{"id":"5","name":"\u0628\u0633\u0643\u0648\u062a \u0627\u0648\u0644\u0643\u0631","quantity":1,"price":30,"total":30},{"id":"6","name":"\u0643\u0648\u0639 1","quantity":1,"price":15,"total":15}]}
[26-Oct-2025 09:56:07 UTC] Invoice inserted successfully with ID: 24
[26-Oct-2025 09:56:07 UTC] Error saving invoice: الكمية غير كافية للصنف: بسكوت اولكر
[08-Dec-2025 16:21:57 UTC] Error fetching installment invoices: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'si.advance_payment' in 'SELECT'
[08-Dec-2025 16:21:57 UTC] Error fetching due installments: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'icodesxy_astra.installments' doesn't exist
[08-Dec-2025 16:49:37 UTC] Error fetching item movement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sri.product_id' in 'WHERE'
[01-Jan-2026 16:10:23 UTC] Saving invoice with values: {"invoice_number":23,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":6000,"discount":"0","final_total":6000,"paid_amount":6000,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u064a\u062a","quantity":1,"price":6000,"total":6000}]}
[01-Jan-2026 16:10:23 UTC] Invoice inserted successfully with ID: 25
[01-Jan-2026 16:10:23 UTC] Treasury updated with final_total: 6000 for treasury_id: 1
[01-Jan-2026 16:16:26 UTC] Saving invoice with values: {"invoice_number":26,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":6000,"discount":"0","final_total":6000,"paid_amount":6000,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u064a\u062a","quantity":1,"price":6000,"total":6000}]}
[01-Jan-2026 16:16:26 UTC] Invoice inserted successfully with ID: 26
[01-Jan-2026 16:16:26 UTC] Treasury updated with final_total: 6000 for treasury_id: 1
[12-Jan-2026 18:05:43 UTC] Saving invoice with values: {"invoice_number":27,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"credit","total":6000,"discount":"0","final_total":6000,"paid_amount":500,"remaining_amount":5500,"shift_id":5,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u064a\u062a","quantity":1,"price":6000,"total":6000}]}
[12-Jan-2026 18:05:43 UTC] Invoice inserted successfully with ID: 27
[19-Jan-2026 08:49:49 UTC] Saving invoice with values: {"invoice_number":28,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":6000,"discount":"0","final_total":6000,"paid_amount":6000,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u064a\u062a","quantity":1,"price":6000,"total":6000}]}
[19-Jan-2026 08:49:49 UTC] Invoice inserted successfully with ID: 28
[19-Jan-2026 08:49:49 UTC] Treasury updated with final_total: 6000 for treasury_id: 1
[19-Jan-2026 08:50:56 UTC] Saving invoice with values: {"invoice_number":29,"store_id":"1","treasury_id":"1","client_id":"1","user_id":11,"payment_type":"cash","total":6000,"discount":"0","final_total":6000,"paid_amount":6000,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"4","name":"\u0628\u0633\u0643\u0648\u064a\u062a","quantity":1,"price":6000,"total":6000}]}
[19-Jan-2026 08:50:56 UTC] Invoice inserted successfully with ID: 29
[19-Jan-2026 08:50:56 UTC] Treasury updated with final_total: 6000 for treasury_id: 1
[02-Mar-2026 06:46:25 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 485
[02-Mar-2026 06:46:25 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 486
[02-Mar-2026 06:46:25 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 487
[02-Mar-2026 06:46:29 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 485
[02-Mar-2026 06:46:29 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 486
[02-Mar-2026 06:46:29 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 487
[02-Mar-2026 06:46:33 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 485
[02-Mar-2026 06:46:33 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 486
[02-Mar-2026 06:46:33 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 487
[02-Mar-2026 06:46:43 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 485
[02-Mar-2026 06:46:43 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 486
[02-Mar-2026 06:46:43 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 487
[02-Mar-2026 06:46:54 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 485
[02-Mar-2026 06:46:54 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 486
[02-Mar-2026 06:46:54 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 487
[02-Mar-2026 06:48:21 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 485
[02-Mar-2026 06:48:21 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 486
[02-Mar-2026 06:48:21 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 487
[02-Mar-2026 06:49:51 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_2` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`)) in /home/icodesxy/public_html/astra/units.php:35
Stack trace:
#0 /home/icodesxy/public_html/astra/units.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/units.php on line 35
[02-Mar-2026 06:50:07 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`items`, CONSTRAINT `items_ibfk_2` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`)) in /home/icodesxy/public_html/astra/units.php:35
Stack trace:
#0 /home/icodesxy/public_html/astra/units.php(35): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/units.php on line 35
[02-Mar-2026 06:51:39 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`icodesxy_astra`.`purchase_invoices`, CONSTRAINT `purchase_invoices_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`)) in /home/icodesxy/public_html/astra/suppliers.php:84
Stack trace:
#0 /home/icodesxy/public_html/astra/suppliers.php(84): PDOStatement->execute(Array)
#1 {main}
  thrown in /home/icodesxy/public_html/astra/suppliers.php on line 84
[03-Mar-2026 19:04:57 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 485
[03-Mar-2026 19:04:57 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 486
[03-Mar-2026 19:04:57 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 487
[03-Mar-2026 19:05:01 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 485
[03-Mar-2026 19:05:01 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 486
[03-Mar-2026 19:05:01 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 487
[03-Mar-2026 19:05:15 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 485
[03-Mar-2026 19:05:15 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 486
[03-Mar-2026 19:05:15 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/sales_invoices.php on line 487
[04-Mar-2026 10:06:01 UTC] POST request received: Array
(
    [invoice_number] => 1001
    [payment_type] => cash
    [supplier_id] => 
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => [{"id":"5","name":"طقم حمام ايديال","available_quantity":26,"quantity":5,"price":2500,"total":12500}]
    [save_purchase] => 
)

[04-Mar-2026 10:06:01 UTC] Error creating purchase invoice: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`icodesxy_astra`.`purchase_invoices`, CONSTRAINT `purchase_invoices_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`))
[22-Apr-2026 18:26:30 UTC] Restored pending invoice #1
[22-Apr-2026 18:29:35 UTC] Saving invoice with values: {"invoice_number":1,"store_id":"3","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":7500,"discount":750,"final_total":6750,"paid_amount":6750,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"5","name":"\u0637\u0642\u0645 \u062d\u0645\u0627\u0645 \u0627\u064a\u062f\u064a\u0627\u0644","quantity":3,"price":2500,"total":7500}]}
[22-Apr-2026 18:29:35 UTC] Invoice inserted successfully with ID: 30
[22-Apr-2026 18:29:35 UTC] Treasury updated with final_total: 6750 for treasury_id: 1
[22-Apr-2026 18:31:00 UTC] Saving invoice with values: {"invoice_number":31,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":2500,"discount":1250,"final_total":1250,"paid_amount":1250,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"5","name":"\u0637\u0642\u0645 \u062d\u0645\u0627\u0645 \u0627\u064a\u062f\u064a\u0627\u0644","quantity":1,"price":2500,"total":2500}]}
[22-Apr-2026 18:31:00 UTC] Invoice inserted successfully with ID: 31
[22-Apr-2026 18:31:00 UTC] Treasury updated with final_total: 1250 for treasury_id: 1
[22-Apr-2026 18:36:18 UTC] Saving invoice with values: {"invoice_number":32,"store_id":"1","treasury_id":"1","client_id":"5","user_id":11,"payment_type":"cash","total":2500,"discount":"500","final_total":2000,"paid_amount":2000,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"5","name":"\u0637\u0642\u0645 \u062d\u0645\u0627\u0645 \u0627\u064a\u062f\u064a\u0627\u0644","quantity":1,"price":2500,"total":2500}]}
[22-Apr-2026 18:36:18 UTC] Invoice inserted successfully with ID: 32
[22-Apr-2026 18:36:18 UTC] Treasury updated with final_total: 2000 for treasury_id: 1
[22-Apr-2026 18:36:33 UTC] Saving invoice with values: {"invoice_number":33,"store_id":"1","treasury_id":"1","client_id":"5","user_id":11,"payment_type":"cash","total":2500,"discount":250,"final_total":2250,"paid_amount":2250,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"5","name":"\u0637\u0642\u0645 \u062d\u0645\u0627\u0645 \u0627\u064a\u062f\u064a\u0627\u0644","quantity":1,"price":2500,"total":2500}]}
[22-Apr-2026 18:36:33 UTC] Invoice inserted successfully with ID: 33
[22-Apr-2026 18:36:33 UTC] Treasury updated with final_total: 2250 for treasury_id: 1
[22-Apr-2026 18:36:47 UTC] Saving invoice with values: {"invoice_number":34,"store_id":"1","treasury_id":"1","client_id":"5","user_id":11,"payment_type":"cash","total":2500,"discount":875,"final_total":1625,"paid_amount":1625,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"5","name":"\u0637\u0642\u0645 \u062d\u0645\u0627\u0645 \u0627\u064a\u062f\u064a\u0627\u0644","quantity":1,"price":2500,"total":2500}]}
[22-Apr-2026 18:36:47 UTC] Invoice inserted successfully with ID: 34
[22-Apr-2026 18:36:47 UTC] Treasury updated with final_total: 1625 for treasury_id: 1
[22-Apr-2026 18:39:46 UTC] Error fetching item movement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sri.product_id' in 'WHERE'
[22-Apr-2026 18:40:11 UTC] Error fetching item movement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sri.product_id' in 'WHERE'
[27-Apr-2026 12:31:09 UTC] PHP Warning:  Trying to access array offset on value of type bool in /home/icodesxy/public_html/astra/item_search.php on line 158
[27-Apr-2026 12:31:09 UTC] PHP Deprecated:  htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/icodesxy/public_html/astra/item_search.php on line 158
[27-Apr-2026 12:31:09 UTC] PHP Warning:  Trying to access array offset on value of type bool in /home/icodesxy/public_html/astra/item_search.php on line 159
[27-Apr-2026 12:31:09 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/item_search.php on line 159
[27-Apr-2026 12:42:57 UTC] PHP Warning:  Trying to access array offset on value of type bool in /home/icodesxy/public_html/astra/item_search.php on line 158
[27-Apr-2026 12:42:57 UTC] PHP Deprecated:  htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/icodesxy/public_html/astra/item_search.php on line 158
[27-Apr-2026 12:42:57 UTC] PHP Warning:  Trying to access array offset on value of type bool in /home/icodesxy/public_html/astra/item_search.php on line 159
[27-Apr-2026 12:42:57 UTC] PHP Deprecated:  number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/icodesxy/public_html/astra/item_search.php on line 159
[27-Apr-2026 12:43:34 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /home/icodesxy/public_html/astra/logout.php on line 2
[27-Apr-2026 12:43:34 UTC] PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /home/icodesxy/public_html/astra/logout.php on line 4
[27-Apr-2026 12:43:34 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/icodesxy/public_html/astra/logout.php:1) in /home/icodesxy/public_html/astra/logout.php on line 5
[27-Apr-2026 16:09:35 UTC] Saving invoice with values: {"invoice_number":35,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":4035,"discount":"0","final_total":4035,"paid_amount":4035,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":21,"price":190,"total":3990},{"id":"11","name":"\u0637\u0634\u0637 \u0641\u064a\u0644\u0648 \u0645\u0642\u0627\u0633 1","quantity":1,"price":45,"total":45}]}
[27-Apr-2026 16:09:35 UTC] Invoice inserted successfully with ID: 35
[27-Apr-2026 16:09:35 UTC] Treasury updated with final_total: 4035 for treasury_id: 1
[27-Apr-2026 16:33:18 UTC] POST request received: Array
(
    [invoice_number] => 1001
    [payment_type] => cash
    [supplier_id] => 5
    [paid_amount] => 0
    [treasury_id] => 1
    [items_data] => []
    [save_purchase] => 
)

[27-Apr-2026 16:33:18 UTC] Error: No items provided in items_data
[28-Apr-2026 12:32:40 UTC] Saving invoice with values: {"invoice_number":36,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":200,"discount":"0","final_total":200,"paid_amount":200,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":1,"price":200,"total":200}]}
[28-Apr-2026 12:32:40 UTC] Invoice inserted successfully with ID: 36
[28-Apr-2026 12:32:40 UTC] Treasury updated with final_total: 200 for treasury_id: 1
[28-Apr-2026 18:32:12 UTC] Saving invoice with values: {"invoice_number":37,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":200,"discount":"0","final_total":200,"paid_amount":200,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":1,"price":200,"total":200}]}
[28-Apr-2026 18:32:12 UTC] Invoice inserted successfully with ID: 37
[28-Apr-2026 18:32:12 UTC] Treasury updated with final_total: 200 for treasury_id: 1
[28-Apr-2026 18:33:06 UTC] Saving invoice with values: {"invoice_number":38,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":2500,"discount":"0","final_total":2500,"paid_amount":2500,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"5","name":"\u0637\u0642\u0645 \u062d\u0645\u0627\u0645 \u0627\u064a\u062f\u064a\u0627\u0644","quantity":1,"price":2500,"total":2500}]}
[28-Apr-2026 18:33:06 UTC] Invoice inserted successfully with ID: 38
[28-Apr-2026 18:33:06 UTC] Treasury updated with final_total: 2500 for treasury_id: 1
[28-Apr-2026 18:42:03 UTC] Saving invoice with values: {"invoice_number":39,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":250,"discount":"0","final_total":250,"paid_amount":250,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250}]}
[28-Apr-2026 18:42:03 UTC] Invoice inserted successfully with ID: 39
[28-Apr-2026 18:42:03 UTC] Treasury updated with final_total: 250 for treasury_id: 1
[28-Apr-2026 18:42:20 UTC] Saving invoice with values: {"invoice_number":40,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":250,"discount":"0","final_total":250,"paid_amount":250,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250}]}
[28-Apr-2026 18:42:20 UTC] Invoice inserted successfully with ID: 40
[28-Apr-2026 18:42:20 UTC] Treasury updated with final_total: 250 for treasury_id: 1
[28-Apr-2026 18:42:40 UTC] Saving invoice with values: {"invoice_number":41,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":250,"discount":"0","final_total":250,"paid_amount":250,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250}]}
[28-Apr-2026 18:42:40 UTC] Invoice inserted successfully with ID: 41
[28-Apr-2026 18:42:40 UTC] Treasury updated with final_total: 250 for treasury_id: 1
[28-Apr-2026 18:42:49 UTC] Saving invoice with values: {"invoice_number":42,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":250,"discount":"0","final_total":250,"paid_amount":250,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250}]}
[28-Apr-2026 18:42:49 UTC] Invoice inserted successfully with ID: 42
[28-Apr-2026 18:42:49 UTC] Treasury updated with final_total: 250 for treasury_id: 1
[28-Apr-2026 18:46:06 UTC] Saving invoice with values: {"invoice_number":43,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":500,"discount":"0","final_total":500,"paid_amount":500,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":2,"price":250,"total":500}]}
[28-Apr-2026 18:46:06 UTC] Invoice inserted successfully with ID: 43
[28-Apr-2026 18:46:06 UTC] Treasury updated with final_total: 500 for treasury_id: 1
[28-Apr-2026 18:53:45 UTC] Saving invoice with values: {"invoice_number":44,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":200,"discount":"0","final_total":200,"paid_amount":200,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":1,"price":200,"total":200}]}
[28-Apr-2026 18:53:45 UTC] Invoice inserted successfully with ID: 44
[28-Apr-2026 18:53:45 UTC] Treasury updated with final_total: 200 for treasury_id: 1
[28-Apr-2026 18:53:52 UTC] Saving invoice with values: {"invoice_number":45,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":200,"discount":"0","final_total":200,"paid_amount":200,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":1,"price":200,"total":200}]}
[28-Apr-2026 18:53:52 UTC] Invoice inserted successfully with ID: 45
[28-Apr-2026 18:53:52 UTC] Treasury updated with final_total: 200 for treasury_id: 1
[28-Apr-2026 18:55:03 UTC] Saving invoice with values: {"invoice_number":46,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":200,"discount":"0","final_total":200,"paid_amount":200,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":1,"price":200,"total":200}]}
[28-Apr-2026 18:55:03 UTC] Invoice inserted successfully with ID: 46
[28-Apr-2026 18:55:03 UTC] Treasury updated with final_total: 200 for treasury_id: 1
[28-Apr-2026 18:55:49 UTC] Saving invoice with values: {"invoice_number":47,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":250,"discount":"0","final_total":250,"paid_amount":250,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250}]}
[28-Apr-2026 18:55:49 UTC] Invoice inserted successfully with ID: 47
[28-Apr-2026 18:55:49 UTC] Treasury updated with final_total: 250 for treasury_id: 1
[28-Apr-2026 18:56:39 UTC] Saving invoice with values: {"invoice_number":48,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":3075,"discount":"0","final_total":3075,"paid_amount":3075,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":1,"price":200,"total":200},{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250},{"id":"5","name":"\u0637\u0642\u0645 \u062d\u0645\u0627\u0645 \u0627\u064a\u062f\u064a\u0627\u0644","quantity":1,"price":2500,"total":2500},{"id":"11","name":"\u0637\u0634\u0637 \u0641\u064a\u0644\u0648 \u0645\u0642\u0627\u0633 1","quantity":1,"price":50,"total":50},{"id":"12","name":"\u0637\u0634\u0637 \u0641\u064a\u0644\u0648 \u0645\u0642\u0627\u0633 2","quantity":1,"price":75,"total":75}]}
[28-Apr-2026 18:56:39 UTC] Invoice inserted successfully with ID: 48
[28-Apr-2026 18:56:39 UTC] Treasury updated with final_total: 3075 for treasury_id: 1
[28-Apr-2026 18:57:46 UTC] Saving invoice with values: {"invoice_number":49,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":3075,"discount":"0","final_total":3075,"paid_amount":3075,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"5","name":"\u0637\u0642\u0645 \u062d\u0645\u0627\u0645 \u0627\u064a\u062f\u064a\u0627\u0644","quantity":1,"price":2500,"total":2500},{"id":"11","name":"\u0637\u0634\u0637 \u0641\u064a\u0644\u0648 \u0645\u0642\u0627\u0633 1","quantity":1,"price":50,"total":50},{"id":"12","name":"\u0637\u0634\u0637 \u0641\u064a\u0644\u0648 \u0645\u0642\u0627\u0633 2","quantity":1,"price":75,"total":75},{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250},{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":1,"price":200,"total":200}]}
[28-Apr-2026 18:57:46 UTC] Invoice inserted successfully with ID: 49
[28-Apr-2026 18:57:46 UTC] Treasury updated with final_total: 3075 for treasury_id: 1
[28-Apr-2026 19:10:47 UTC] Saving invoice with values: {"invoice_number":50,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":250,"discount":"0","final_total":250,"paid_amount":250,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250}]}
[28-Apr-2026 19:10:47 UTC] Invoice inserted successfully with ID: 50
[28-Apr-2026 19:10:47 UTC] Treasury updated with final_total: 250 for treasury_id: 1
[28-Apr-2026 19:16:36 UTC] Saving invoice with values: {"invoice_number":51,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":200,"discount":"0","final_total":200,"paid_amount":200,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":1,"price":200,"total":200}]}
[28-Apr-2026 19:16:36 UTC] Invoice inserted successfully with ID: 51
[28-Apr-2026 19:16:36 UTC] Treasury updated with final_total: 200 for treasury_id: 1
[28-Apr-2026 19:20:43 UTC] Saving invoice with values: {"invoice_number":52,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":250,"discount":"0","final_total":250,"paid_amount":250,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250}]}
[28-Apr-2026 19:20:43 UTC] Invoice inserted successfully with ID: 52
[28-Apr-2026 19:20:43 UTC] Treasury updated with final_total: 250 for treasury_id: 1
[28-Apr-2026 19:21:47 UTC] Saving invoice with values: {"invoice_number":53,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":250,"discount":"0","final_total":250,"paid_amount":250,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250}]}
[28-Apr-2026 19:21:47 UTC] Invoice inserted successfully with ID: 53
[28-Apr-2026 19:21:47 UTC] Treasury updated with final_total: 250 for treasury_id: 1
[28-Apr-2026 19:22:23 UTC] Saving invoice with values: {"invoice_number":54,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":250,"discount":"0","final_total":250,"paid_amount":250,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250}]}
[28-Apr-2026 19:22:23 UTC] Invoice inserted successfully with ID: 54
[28-Apr-2026 19:22:23 UTC] Treasury updated with final_total: 250 for treasury_id: 1
[28-Apr-2026 19:25:45 UTC] Saving invoice with values: {"invoice_number":55,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":200,"discount":"0","final_total":200,"paid_amount":200,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":1,"price":200,"total":200}]}
[28-Apr-2026 19:25:45 UTC] Invoice inserted successfully with ID: 55
[28-Apr-2026 19:25:45 UTC] Treasury updated with final_total: 200 for treasury_id: 1
[28-Apr-2026 19:25:56 UTC] Saving invoice with values: {"invoice_number":56,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":250,"discount":"0","final_total":250,"paid_amount":250,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250}]}
[28-Apr-2026 19:25:56 UTC] Invoice inserted successfully with ID: 56
[28-Apr-2026 19:25:56 UTC] Treasury updated with final_total: 250 for treasury_id: 1
[28-Apr-2026 19:26:38 UTC] Saving invoice with values: {"invoice_number":57,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":250,"discount":"0","final_total":250,"paid_amount":250,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250}]}
[28-Apr-2026 19:26:38 UTC] Invoice inserted successfully with ID: 57
[28-Apr-2026 19:26:38 UTC] Treasury updated with final_total: 250 for treasury_id: 1
[28-Apr-2026 19:26:58 UTC] Saving invoice with values: {"invoice_number":58,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":3075,"discount":"0","final_total":3075,"paid_amount":3075,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"13","name":"\u0634\u0631\u0648\u0627\u0644 \u063a\u0637\u0633 \u0627\u0644\u0643\u0644\u0627\u0641","quantity":1,"price":250,"total":250},{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":1,"price":200,"total":200},{"id":"5","name":"\u0637\u0642\u0645 \u062d\u0645\u0627\u0645 \u0627\u064a\u062f\u064a\u0627\u0644","quantity":1,"price":2500,"total":2500},{"id":"11","name":"\u0637\u0634\u0637 \u0641\u064a\u0644\u0648 \u0645\u0642\u0627\u0633 1","quantity":1,"price":50,"total":50},{"id":"12","name":"\u0637\u0634\u0637 \u0641\u064a\u0644\u0648 \u0645\u0642\u0627\u0633 2","quantity":1,"price":75,"total":75}]}
[28-Apr-2026 19:26:58 UTC] Invoice inserted successfully with ID: 58
[28-Apr-2026 19:26:58 UTC] Error saving invoice: الكمية غير كافية للصنف: شروال غطس الكلاف
[28-Apr-2026 19:27:07 UTC] Saving invoice with values: {"invoice_number":58,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":2825,"discount":"0","final_total":2825,"paid_amount":2825,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":1,"price":200,"total":200},{"id":"5","name":"\u0637\u0642\u0645 \u062d\u0645\u0627\u0645 \u0627\u064a\u062f\u064a\u0627\u0644","quantity":1,"price":2500,"total":2500},{"id":"11","name":"\u0637\u0634\u0637 \u0641\u064a\u0644\u0648 \u0645\u0642\u0627\u0633 1","quantity":1,"price":50,"total":50},{"id":"12","name":"\u0637\u0634\u0637 \u0641\u064a\u0644\u0648 \u0645\u0642\u0627\u0633 2","quantity":1,"price":75,"total":75}]}
[28-Apr-2026 19:27:07 UTC] Invoice inserted successfully with ID: 59
[28-Apr-2026 19:27:07 UTC] Treasury updated with final_total: 2825 for treasury_id: 1
[28-Apr-2026 19:28:09 UTC] Saving invoice with values: {"invoice_number":60,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":2825,"discount":"0","final_total":2825,"paid_amount":2825,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"5","name":"\u0637\u0642\u0645 \u062d\u0645\u0627\u0645 \u0627\u064a\u062f\u064a\u0627\u0644","quantity":1,"price":2500,"total":2500},{"id":"11","name":"\u0637\u0634\u0637 \u0641\u064a\u0644\u0648 \u0645\u0642\u0627\u0633 1","quantity":1,"price":50,"total":50},{"id":"12","name":"\u0637\u0634\u0637 \u0641\u064a\u0644\u0648 \u0645\u0642\u0627\u0633 2","quantity":1,"price":75,"total":75},{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":1,"price":200,"total":200}]}
[28-Apr-2026 19:28:09 UTC] Invoice inserted successfully with ID: 60
[28-Apr-2026 19:28:09 UTC] Treasury updated with final_total: 2825 for treasury_id: 1
[28-Apr-2026 19:29:04 UTC] Saving invoice with values: {"invoice_number":61,"store_id":"1","treasury_id":"1","client_id":"4","user_id":11,"payment_type":"cash","total":2825,"discount":"25","final_total":2800,"paid_amount":2800,"remaining_amount":0,"shift_id":5,"items_data":[{"id":"5","name":"\u0637\u0642\u0645 \u062d\u0645\u0627\u0645 \u0627\u064a\u062f\u064a\u0627\u0644","quantity":1,"price":2500,"total":2500},{"id":"11","name":"\u0637\u0634\u0637 \u0641\u064a\u0644\u0648 \u0645\u0642\u0627\u0633 1","quantity":1,"price":50,"total":50},{"id":"12","name":"\u0637\u0634\u0637 \u0641\u064a\u0644\u0648 \u0645\u0642\u0627\u0633 2","quantity":1,"price":75,"total":75},{"id":"10","name":"\u062a\u064a \u0634\u064a\u0631\u062a \u0627\u0648\u0644\u0627\u062f\u064a","quantity":1,"price":200,"total":200}]}
[28-Apr-2026 19:29:04 UTC] Invoice inserted successfully with ID: 61
[28-Apr-2026 19:29:04 UTC] Treasury updated with final_total: 2800 for treasury_id: 1
