=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 2456
    [supplier_id] => 82
    [purchase_date] => 2026-06-12
    [payment_term] => cash
    [subtotal] => 45.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 45.00
    [notes] => 
    [amount_to_pay] => 45.00
    [acc] => 1
    [items] => [{"material_id":"7244","item_type":"raw","quantity":"10.00","unit_price":"4.5","discount_percent":"0","discount_flat":"0","total_price":"45.00"}]
    [batch_data] => {"1781265250552":{"material_id":"7244","batches":[{"batch_no":"25477","qty":"010","expiry_date":"2028-06-12"}]}}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 45, Account ID: 1
Inserted PO ID: 143

BATCH KEYS = 1781265250552
Batch data received: Array
(
    [1781265250552] => Array
        (
            [material_id] => 7244
            [batches] => Array
                (
                    [0] => Array
                        (
                            [batch_no] => 25477
                            [qty] => 010
                            [expiry_date] => 2028-06-12
                        )

                )

        )

)

Processing item 0 - Type: raw, ID: 7244, Qty: 10
History inserted for raw material: 7244
Products stock updated: +10
No batch data found for item 0 (material_id: 7244)
Purchase Pay record inserted with ID: 118
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 547
    [supplier_id] => 82
    [purchase_date] => 2026-06-12
    [payment_term] => cash
    [subtotal] => 165.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 165.00
    [notes] => 
    [amount_to_pay] => 165.00
    [acc] => 1
    [items] => [{"material_id":"30489","item_type":"raw","quantity":"30.00","unit_price":"5.5","discount_percent":"0","discount_flat":"0","total_price":"165.00"}]
    [batch_data] => {"1781265573293":{"material_id":"30489","batches":[{"batch_no":"547","qty":"030","expiry_date":"2028-06-12"}]}}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 165, Account ID: 1
Inserted PO ID: 144

BATCH KEYS = 1781265573293
Batch data received: Array
(
    [1781265573293] => Array
        (
            [material_id] => 30489
            [batches] => Array
                (
                    [0] => Array
                        (
                            [batch_no] => 547
                            [qty] => 030
                            [expiry_date] => 2028-06-12
                        )

                )

        )

)

Processing item 0 - Type: raw, ID: 30489, Qty: 30
History inserted for raw material: 30489
Products stock updated: +30
No batch data found for item 0 (material_id: 30489)
Purchase Pay record inserted with ID: 119
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => PO-287087
    [supplier_id] => 82
    [purchase_date] => 2026-06-12
    [payment_term] => cash
    [subtotal] => 195.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 195.00
    [notes] => 
    [amount_to_pay] => 195.00
    [acc] => 1
    [items] => [{"material_id":"7245","item_type":"raw","quantity":"30.00","unit_price":"6.5","discount_percent":"0","discount_flat":"0","total_price":"195.00"}]
    [batch_data] => {"1781265682085":{"material_id":"7245","batches":[{"batch_no":"30","qty":"030","expiry_date":"2028-06-12"}]}}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 195, Account ID: 1
Inserted PO ID: 145

BATCH KEYS = 1781265682085
Batch data received: Array
(
    [1781265682085] => Array
        (
            [material_id] => 7245
            [batches] => Array
                (
                    [0] => Array
                        (
                            [batch_no] => 30
                            [qty] => 030
                            [expiry_date] => 2028-06-12
                        )

                )

        )

)

Processing item 0 - Type: raw, ID: 7245, Qty: 30
History inserted for raw material: 7245
Products stock updated: +30
No batch data found for item 0 (material_id: 7245)
Purchase Pay record inserted with ID: 120
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => PO-287024
    [supplier_id] => 82
    [purchase_date] => 2026-06-12
    [payment_term] => cash
    [subtotal] => 132.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 132.00
    [notes] => 
    [amount_to_pay] => 132.00
    [acc] => 1
    [items] => [{"material_id":"30489","item_type":"raw","quantity":"24.00","unit_price":"5.5","discount_percent":"0","discount_flat":"0","total_price":"132.00"}]
    [batch_data] => {"1781266236754":{"material_id":"30489","batches":[{"batch_no":"24","qty":"024","expiry_date":"2028-06-12"}]}}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 132, Account ID: 1
Inserted PO ID: 146
Serials data received: Array
(
)

Batch data received: Array
(
    [1781266236754] => Array
        (
            [material_id] => 30489
            [batches] => Array
                (
                    [0] => Array
                        (
                            [batch_no] => 24
                            [qty] => 024
                            [expiry_date] => 2028-06-12
                        )

                )

        )

)

Processing item 0 - Type: raw, ID: 30489, Qty: 24
History inserted for raw material: 30489
Products stock updated: +24
Found batch data for material_id: 30489
Expiry SQL: INSERT INTO expiry (po_id, product_id, lot, quantity, item_type, expier_date) 
                                          VALUES (146, 30489, '24', 24, 'raw', '2028-06-12')
Batch inserted: 24
Purchase Pay record inserted with ID: 121
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => PO-287047
    [supplier_id] => 82
    [purchase_date] => 2026-06-12
    [payment_term] => cash
    [subtotal] => 435.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 435.00
    [notes] => note
    [amount_to_pay] => 435.00
    [acc] => 1
    [items] => [{"material_id":"30489","item_type":"raw","quantity":"10.00","unit_price":"5.5","discount_percent":"0","discount_flat":"0","total_price":"55.00"},{"material_id":"205","item_type":"raw","quantity":"140.00","unit_price":"1","discount_percent":"0","discount_flat":"0","total_price":"140.00"},{"material_id":"10","item_type":"product","quantity":"2","unit_price":"120","discount_percent":"0","discount_flat":"0","total_price":"240.00"}]
    [batch_data] => {"1781267642524":{"material_id":"30489","batches":[{"batch_no":"5874","qty":"10","expiry_date":"2028-06-12"}]},"1781267655574":{"material_id":"205","batches":[{"batch_no":"874","qty":"140","expiry_date":"2028-06-12"}]}}
    [serial_data] => {"1781267681328":{"material_id":"10","serials":["214","13574"]}}
)

Received FILES data: Array
(
    [attachments] => Array
        (
            [name] => Array
                (
                    [0] => Greenweb.com.bd Bulk SMS Service Invoice #59254.pdf
                )

            [full_path] => Array
                (
                    [0] => Greenweb.com.bd Bulk SMS Service Invoice #59254.pdf
                )

            [type] => Array
                (
                    [0] => application/pdf
                )

            [tmp_name] => Array
                (
                    [0] => C:\xampp\tmp\phpD862.tmp
                )

            [error] => Array
                (
                    [0] => 0
                )

            [size] => Array
                (
                    [0] => 218852
                )

        )

)

Payment Term: cash, Amount to Pay: 435, Account ID: 1
Inserted PO ID: 147
Serials data received: Array
(
    [1781267681328] => Array
        (
            [material_id] => 10
            [serials] => Array
                (
                    [0] => 214
                    [1] => 13574
                )

        )

)

Batch data received: Array
(
    [1781267642524] => Array
        (
            [material_id] => 30489
            [batches] => Array
                (
                    [0] => Array
                        (
                            [batch_no] => 5874
                            [qty] => 10
                            [expiry_date] => 2028-06-12
                        )

                )

        )

    [1781267655574] => Array
        (
            [material_id] => 205
            [batches] => Array
                (
                    [0] => Array
                        (
                            [batch_no] => 874
                            [qty] => 140
                            [expiry_date] => 2028-06-12
                        )

                )

        )

)

Processing item 0 - Type: raw, ID: 30489, Qty: 10
History inserted for raw material: 30489
Products stock updated: +10
Found batch data for material_id: 30489
Expiry SQL: INSERT INTO expiry (po_id, product_id, lot, quantity, item_type, expier_date) 
                                          VALUES (147, 30489, '5874', 10, 'raw', '2028-06-12')
Batch inserted: 5874
Processing item 1 - Type: raw, ID: 205, Qty: 140
History inserted for raw material: 205
Products stock updated: +140
Found batch data for material_id: 205
Expiry SQL: INSERT INTO expiry (po_id, product_id, lot, quantity, item_type, expier_date) 
                                          VALUES (147, 205, '874', 140, 'raw', '2028-06-12')
Batch inserted: 874
Processing item 2 - Type: product, ID: 10, Qty: 2
Product stock inserted for ID: 10
Serial_products stock updated: +2
Serial inserted: 214
Serial inserted: 13574
Purchase Pay record inserted with ID: 122
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => PO-28707
    [supplier_id] => 82
    [purchase_date] => 2026-06-06
    [payment_term] => cash
    [subtotal] => 1165.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 1165.00
    [notes] => 
    [amount_to_pay] => 1165.00
    [acc] => 1
    [items] => [{"material_id":"7244","item_type":"raw","quantity":"250.00","unit_price":"4.5","discount_percent":"0","discount_flat":"0","total_price":"1125.00"},{"material_id":"5645","item_type":"raw","quantity":"2","unit_price":"20","discount_percent":"0","discount_flat":"0","total_price":"40.00"}]
    [batch_data] => {"1781267865740":{"material_id":"7244","batches":[{"batch_no":"147","qty":"250","expiry_date":"2028-06-12"},{"batch_no":"14","qty":"025","expiry_date":"2028-06-12"}]}}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 1165, Account ID: 1
Inserted PO ID: 148
Serials data received: Array
(
)

Batch data received: Array
(
    [1781267865740] => Array
        (
            [material_id] => 7244
            [batches] => Array
                (
                    [0] => Array
                        (
                            [batch_no] => 147
                            [qty] => 250
                            [expiry_date] => 2028-06-12
                        )

                    [1] => Array
                        (
                            [batch_no] => 14
                            [qty] => 025
                            [expiry_date] => 2028-06-12
                        )

                )

        )

)

Processing item 0 - Type: raw, ID: 7244, Qty: 250
History inserted for raw material: 7244
Products stock updated: +250
Found batch data for material_id: 7244
Expiry SQL: INSERT INTO expiry (po_id, product_id, lot, quantity, item_type, expier_date) 
                                          VALUES (148, 7244, '147', 250, 'raw', '2028-06-12')
Batch inserted: 147
Expiry SQL: INSERT INTO expiry (po_id, product_id, lot, quantity, item_type, expier_date) 
                                          VALUES (148, 7244, '14', 25, 'raw', '2028-06-12')
Batch inserted: 14
Processing item 1 - Type: raw, ID: 5645, Qty: 2
History inserted for raw material: 5645
Products stock updated: +2
No batch data found for material_id: 5645
Purchase Pay record inserted with ID: 123
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 1414
    [supplier_id] => 82
    [purchase_date] => 2026-06-12
    [payment_term] => cash
    [subtotal] => 11.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 11.00
    [notes] => 
    [amount_to_pay] => 11.00
    [acc] => 1
    [items] => [{"material_id":"30489","item_type":"raw","quantity":"2","unit_price":"5.5","discount_percent":"0","discount_flat":"0","total_price":"11.00"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 11, Account ID: 1
Inserted PO ID: 149
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 30489, Qty: 2
History inserted for raw material: 30489
Products stock updated: +2
No batch data found for material_id: 30489
Purchase Pay record inserted with ID: 124
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 4757
    [supplier_id] => 82
    [purchase_date] => 2026-06-12
    [payment_term] => cash
    [subtotal] => 308.90
    [tax_percent] => 01
    [tax_amount] => 3.09
    [discount_percent] => 02
    [discount] => 6.18
    [shipping] => 0300
    [grand_total] => 605.81
    [notes] => add batch information
    [amount_to_pay] => 605.81
    [acc] => 1
    [items] => [{"material_id":"30489","item_type":"raw","quantity":"20.00","unit_price":"5.5","discount_percent":"01","discount_flat":"0.06","total_price":"108.90"},{"material_id":"5645","item_type":"raw","quantity":"10","unit_price":"20","discount_percent":"0","discount_flat":"0","total_price":"200.00"}]
    [batch_data] => {"1781269261760":{"material_id":"30489","batches":[{"batch_no":"10","qty":"010","expiry_date":"2028-06-12"},{"batch_no":"104","qty":"010","expiry_date":"2028-06-12"}]}}
    [serial_data] => {}
)

Received FILES data: Array
(
    [attachments] => Array
        (
            [name] => Array
                (
                    [0] => 897.jpg
                )

            [full_path] => Array
                (
                    [0] => 897.jpg
                )

            [type] => Array
                (
                    [0] => image/jpeg
                )

            [tmp_name] => Array
                (
                    [0] => C:\xampp\tmp\phpD4DF.tmp
                )

            [error] => Array
                (
                    [0] => 0
                )

            [size] => Array
                (
                    [0] => 119993
                )

        )

)

Payment Term: cash, Amount to Pay: 605.81, Account ID: 1
Inserted PO ID: 150
Serials data received: Array
(
)

Batch data received: Array
(
    [1781269261760] => Array
        (
            [material_id] => 30489
            [batches] => Array
                (
                    [0] => Array
                        (
                            [batch_no] => 10
                            [qty] => 010
                            [expiry_date] => 2028-06-12
                        )

                    [1] => Array
                        (
                            [batch_no] => 104
                            [qty] => 010
                            [expiry_date] => 2028-06-12
                        )

                )

        )

)

Processing item 0 - Type: raw, ID: 30489, Qty: 20
History inserted for raw material: 30489
Products stock updated: +20
Found batch data for material_id: 30489
Expiry SQL: INSERT INTO expiry (po_id, product_id, lot, quantity, item_type, expier_date) 
                                          VALUES (150, 30489, '10', 10, 'raw', '2028-06-12')
Batch inserted: 10
Expiry SQL: INSERT INTO expiry (po_id, product_id, lot, quantity, item_type, expier_date) 
                                          VALUES (150, 30489, '104', 10, 'raw', '2028-06-12')
Batch inserted: 104
Processing item 1 - Type: raw, ID: 5645, Qty: 10
History inserted for raw material: 5645
Products stock updated: +10
No batch data found for material_id: 5645
Purchase Pay record inserted with ID: 125
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 204747
    [supplier_id] => 82
    [purchase_date] => 2026-06-12
    [payment_term] => cash
    [subtotal] => 1200.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 1200.00
    [notes] => 
    [amount_to_pay] => 1200.00
    [acc] => 1
    [items] => [{"material_id":"5645","item_type":"raw","quantity":"60.00","unit_price":"20","discount_percent":"0","discount_flat":"0","total_price":"1200.00"}]
    [batch_data] => {"1781273013412":{"material_id":"5645","batches":[{"batch_no":"14","qty":"030","expiry_date":"2028-06-12"},{"batch_no":"14","qty":"030","expiry_date":"2028-06-12"}]}}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 1200, Account ID: 1
Inserted PO ID: 151
Serials data received: Array
(
)

Batch data received: Array
(
    [1781273013412] => Array
        (
            [material_id] => 5645
            [batches] => Array
                (
                    [0] => Array
                        (
                            [batch_no] => 14
                            [qty] => 030
                            [expiry_date] => 2028-06-12
                        )

                    [1] => Array
                        (
                            [batch_no] => 14
                            [qty] => 030
                            [expiry_date] => 2028-06-12
                        )

                )

        )

)

Processing item 0 - Type: raw, ID: 5645, Qty: 60
History inserted for raw material: 5645
Products stock updated: +60
Found batch data for material_id: 5645
Expiry SQL: INSERT INTO expiry (po_id, product_id, lot, quantity, item_type, expier_date) 
                                          VALUES (151, 5645, '14', 30, 'raw', '2028-06-12')
Batch inserted: 14
Expiry SQL: INSERT INTO expiry (po_id, product_id, lot, quantity, item_type, expier_date) 
                                          VALUES (151, 5645, '14', 30, 'raw', '2028-06-12')
Batch inserted: 14
Purchase Pay record inserted with ID: 126
=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 18
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 30, Received: 100, Change: 70
Customer found: Anowar Auto Garage
Sale Order Inserted. ID: 224
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 30
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 900
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-224: 30, Remaining: 0
Total Summary:
Grand Total: 900
Wish to Pay: 30
Total Paid: 30
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-224
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-06-12
        )

)

Script execution completed at: 2026-06-12 17:29:56

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => PO-2
    [supplier_id] => 82
    [purchase_date] => 2026-06-12
    [payment_term] => cash
    [subtotal] => 360.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 360.00
    [notes] => 
    [amount_to_pay] => 360.00
    [acc] => 1
    [items] => [{"material_id":"10","item_type":"product","quantity":"3","unit_price":"120","discount_percent":"0","discount_flat":"0","total_price":"360.00"}]
    [batch_data] => {}
    [serial_data] => {"1781281888312":{"material_id":"10","serials":["123","234","345"]}}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 360, Account ID: 1
Inserted PO ID: 152
Serials data received: Array
(
    [1781281888312] => Array
        (
            [material_id] => 10
            [serials] => Array
                (
                    [0] => 123
                    [1] => 234
                    [2] => 345
                )

        )

)

Batch data received: Array
(
)

Processing item 0 - Type: product, ID: 10, Qty: 3
Product stock inserted for ID: 10
Serial_products stock updated: +3
Serial inserted: 123
Serial inserted: 234
Serial inserted: 345
Purchase Pay record inserted with ID: 127
=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 0, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 225
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 30
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 900
    [item_type] => raw
    [serials] => Array
        (
        )

)

Total Summary:
Grand Total: 900
Wish to Pay: 0
Total Paid: 0
Payment Distribution: Array
(
)

Script execution completed at: 2026-06-12 18:52:04

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 900, To Pay: 1800, Wish To Pay: 2000, Received: 2300, Change: 300
Customer found: Walk In
Sale Order Inserted. ID: 226
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 30
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 900
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-225: 900, Remaining: 1100
Previous Sale Due Paid for sel-226: 900, Remaining: 200
Current Sale Paid: 200, Remaining: 0
Total Summary:
Grand Total: 900
Wish to Pay: 2000
Total Paid: 2000
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-225
            [amount] => 900
            [type] => Previous Sale Due Payment
            [date] => 2026-06-12
        )

    [1] => Array
        (
            [ref] => sel-226
            [amount] => 900
            [type] => Previous Sale Due Payment
            [date] => 2026-06-12
        )

    [2] => Array
        (
            [ref] => sel-226
            [amount] => 200
            [type] => Current Sale Payment
            [date] => 2026-06-12
        )

)

Script execution completed at: 2026-06-12 20:11:43

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 18
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 200, To Pay: 1412.02, Wish To Pay: 1500, Received: 1550, Change: 50
Customer found: Anowar Auto Garage
Sale Order Inserted. ID: 227
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 30
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 900
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 10
    [quantity] => 2
    [unit_price] => 150.01
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300.02
    [item_type] => product
    [serials] => Array
        (
            [0] => 123
            [1] => 234
        )

)

Serial_products table updated: product_id=10, Old Stock: 136, Sold: 2, New Stock: 134
Serial '123' status updated to 'sold'
Serial '234' status updated to 'sold'
Opening Balance Paid: 200, Remaining: 1300
Previous Sale Due Paid for sel-227: 1212.02, Remaining: 87.98
Current Sale Paid: 87.98, Remaining: 0
Total Summary:
Grand Total: 1212.02
Wish to Pay: 1500
Total Paid: 1500
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => OB_Paid
            [amount] => 200
            [type] => Opening Balance Payment
            [date] => 2026-06-12
        )

    [1] => Array
        (
            [ref] => sel-227
            [amount] => 1212.02
            [type] => Previous Sale Due Payment
            [date] => 2026-06-12
        )

    [2] => Array
        (
            [ref] => sel-227
            [amount] => 87.98
            [type] => Current Sale Payment
            [date] => 2026-06-12
        )

)

Script execution completed at: 2026-06-12 20:27:54

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 18
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 200, To Pay: 1488.02, Wish To Pay: 1300, Received: 1400, Change: 100
Customer found: Anowar Auto Garage
Sale Order Inserted. ID: 228
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 30
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 900
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 10
    [quantity] => 2
    [unit_price] => 150.01
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300.02
    [item_type] => product
    [serials] => Array
        (
            [0] => 123
            [1] => 234
        )

)

Serial_products table updated: product_id=10, Old Stock: 134, Sold: 2, New Stock: 132
Serial '123' status updated to 'sold'
Serial '234' status updated to 'sold'
Opening Balance Paid: 200, Remaining: 1100
Previous Sale Due Paid for sel-228: 1100, Remaining: 0
Total Summary:
Grand Total: 1288.02
Wish to Pay: 1300
Total Paid: 1300
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => OB_Paid
            [amount] => 200
            [type] => Opening Balance Payment
            [date] => 2026-06-12
        )

    [1] => Array
        (
            [ref] => sel-228
            [amount] => 1100
            [type] => Previous Sale Due Payment
            [date] => 2026-06-12
        )

)

Script execution completed at: 2026-06-12 20:34:56

=== FORM DATA REQUEST ===
Processing file upload...
Files count: 1
File uploaded successfully: Doc1.docx -> 1781291461_6a2c59c50a26f.docx
Batch data received: Array
(
)

Serial data received: Array
(
    [1781291410536] => Array
        (
            [material_id] => 10
            [serials] => Array
                (
                    [0] => 345
                )

        )

)

Customer ID: 18
Items count: 2
Files uploaded: 1
Payment Info - Prev Due: 188.02, To Pay: 1238.03, Wish To Pay: 1300, Received: 1500, Change: 200
Customer found: Anowar Auto Garage
Sale Order Inserted. ID: 229
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 30
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 900
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 5645, Available: 16, Requested: 30
Script execution completed at: 2026-06-12 21:11:01

=== FORM DATA REQUEST ===
Processing file upload...
Files count: 1
File uploaded successfully: Doc1.docx -> 1781291488_6a2c59e06773f.docx
Batch data received: Array
(
)

Serial data received: Array
(
    [1781291410536] => Array
        (
            [material_id] => 10
            [serials] => Array
                (
                    [0] => 345
                )

        )

)

Customer ID: 18
Items count: 2
Files uploaded: 1
Payment Info - Prev Due: 188.02, To Pay: 692.63, Wish To Pay: 1300, Received: 1500, Change: 200
Customer found: Anowar Auto Garage
Sale Order Inserted. ID: 230
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 12
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 10
    [quantity] => 1
    [unit_price] => 150.01
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150.01
    [item_type] => product
    [serials] => Array
        (
            [0] => 345
        )

)

Serial_products table updated: product_id=10, Old Stock: 132, Sold: 1, New Stock: 131
Serial '345' status updated to 'sold'
Previous Sale Due Paid for sel-228: 188.02, Remaining: 1111.98
Previous Sale Due Paid for sel-230: 504.61, Remaining: 607.37
Current Sale Paid: 504.61, Remaining: 102.76
Advance Payment: 102.76
No batch data to process
Total Summary:
Grand Total: 504.61
Wish to Pay: 1300
Total Paid: 1300
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-228
            [amount] => 188.02
            [type] => Previous Sale Due Payment
            [date] => 2026-06-12
        )

    [1] => Array
        (
            [ref] => sel-230
            [amount] => 504.61
            [type] => Previous Sale Due Payment
            [date] => 2026-06-12
        )

    [2] => Array
        (
            [ref] => sel-230
            [amount] => 504.61
            [type] => Current Sale Payment
            [date] => 2026-06-12
        )

    [3] => Array
        (
            [ref] => adv
            [amount] => 102.76
            [type] => Advance Payment
            [date] => 2026-06-12
        )

)

=== FORM DATA REQUEST ===
Processing file upload...
Files count: 1
File uploaded successfully: Doc1.docx -> 1781291623_6a2c5a6733949.docx
Customer ID: 18
Items count: 2
Files uploaded: 1
Payment Info - Prev Due: 188.02, To Pay: 692.63, Wish To Pay: 1300, Received: 1500, Change: 200
Customer found: Anowar Auto Garage
Error: Duplicate entry 'SO-2026-5' for key 'so_number'
Script execution completed at: 2026-06-12 21:13:43

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 18
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 570.03, Wish To Pay: 1200, Received: 1200, Change: 0
Customer found: Anowar Auto Garage
Sale Order Inserted. ID: 232
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 4
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 10
    [quantity] => 3
    [unit_price] => 150.01
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 450.03
    [item_type] => product
    [serials] => Array
        (
        )

)

Serial_products table updated: product_id=10, Old Stock: 131, Sold: 3, New Stock: 128
Previous Sale Due Paid for sel-232: 570.03, Remaining: 629.97
Current Sale Paid: 570.03, Remaining: 59.94
Advance Payment: 59.94
Total Summary:
Grand Total: 570.03
Wish to Pay: 1200
Total Paid: 1200
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-232
            [amount] => 570.03
            [type] => Previous Sale Due Payment
            [date] => 2026-06-12
        )

    [1] => Array
        (
            [ref] => sel-232
            [amount] => 570.03
            [type] => Current Sale Payment
            [date] => 2026-06-12
        )

    [2] => Array
        (
            [ref] => adv
            [amount] => 59.94
            [type] => Advance Payment
            [date] => 2026-06-12
        )

)

Script execution completed at: 2026-06-12 21:14:46

=== FORM DATA REQUEST ===
Processing file upload...
Batch Data Received: Array
(
)

Error: Insufficient stock! Raw Material ID: 5645
Script execution completed at: 2026-06-12 21:29:03

=== FORM DATA REQUEST ===
Processing file upload...
Batch Data Received: Array
(
)

Error: Insufficient stock! Raw Material ID: 5645
Script execution completed at: 2026-06-12 21:29:57

=== FORM DATA REQUEST ===
Processing file upload...
Batch Data Received: Array
(
)

Script execution completed at: 2026-06-12 21:30:41

=== FORM DATA REQUEST ===
Processing file upload...
Batch Data Received: Array
(
)

Script execution completed at: 2026-06-12 21:36:03

=== FORM DATA REQUEST ===
Raw batch_data POST: {}
Decoded batch_data: Array
(
)

=== BATCH UPDATE START ===
Batch Data Type: array
Batch Data: Array
(
)

No batch data to process
=== BATCH UPDATE END ===

Script execution completed at: 2026-06-12 21:44:59

=== FORM DATA REQUEST ===
Raw batch_data POST: {}
Decoded batch_data: Array
(
)

=== BATCH UPDATE START ===
Batch Data Type: array
Batch Data: Array
(
)

No batch data to process
=== BATCH UPDATE END ===

Script execution completed at: 2026-06-12 21:56:48

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 18
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1050.01, Wish To Pay: 12, Received: 15, Change: 3
Customer found: Anowar Auto Garage
Sale Order Inserted. ID: 239
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 30
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 900
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 10
    [quantity] => 1
    [unit_price] => 150.01
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150.01
    [item_type] => product
    [serials] => Array
        (
            [0] => 234
        )

)

Serial_products table updated: product_id=10, Old Stock: 127, Sold: 1, New Stock: 126
Serial '234' status updated to 'sold'
Previous Sale Due Paid for sel-239: 12, Remaining: 0
Error: Table 'propharma.purchase_details_expiry' doesn't exist
Script execution completed at: 2026-06-12 22:41:09

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 18
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1050.01, Wish To Pay: 12, Received: 15, Change: 3
Customer found: Anowar Auto Garage
Sale Order Inserted. ID: 240
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 30
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 900
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 10
    [quantity] => 1
    [unit_price] => 150.01
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150.01
    [item_type] => product
    [serials] => Array
        (
            [0] => 234
        )

)

Serial_products table updated: product_id=10, Old Stock: 127, Sold: 1, New Stock: 126
Serial '234' status updated to 'sold'
Previous Sale Due Paid for sel-240: 12, Remaining: 0
Total Summary:
Grand Total: 1050.01
Wish to Pay: 12
Total Paid: 12
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-240
            [amount] => 12
            [type] => Previous Sale Due Payment
            [date] => 2026-06-10
        )

)

Script execution completed at: 2026-06-12 22:42:28

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 18
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1050.01, Wish To Pay: 12, Received: 15, Change: 3
Customer found: Anowar Auto Garage
Error: Duplicate entry 'SO-2026-5' for key 'so_number'
Script execution completed at: 2026-06-12 22:43:04

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 28, To Pay: 928, Wish To Pay: 10, Received: 20, Change: 10
Customer found: Walk In
Sale Order Inserted. ID: 242
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 30
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 900
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-238: 10, Remaining: 0
Total Summary:
Grand Total: 900
Wish to Pay: 10
Total Paid: 10
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-238
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-06-12
        )

)

Script execution completed at: 2026-06-12 22:43:54

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 918, To Pay: 1787.4, Wish To Pay: 1500, Received: 1550, Change: 50
Customer found: Walk In
Sale Order Inserted. ID: 243
Inserting Item: Array
(
    [material_id] => 2499
    [quantity] => 20
    [unit_price] => 6.02
    [discount_percent] => 0.83
    [discount_amount] => 1
    [total_price] => 119.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 2499, Available: 0, Requested: 20
Script execution completed at: 2026-06-15 10:42:20

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 918, To Pay: 1037.4, Wish To Pay: 1500, Received: 1550, Change: 50
Customer found: Walk In
Sale Order Inserted. ID: 244
Inserting Item: Array
(
    [material_id] => 2499
    [quantity] => 20
    [unit_price] => 6.02
    [discount_percent] => 0.83
    [discount_amount] => 1
    [total_price] => 119.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 2499, Available: 0, Requested: 20
Script execution completed at: 2026-06-15 10:42:33

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 918, To Pay: 977, Wish To Pay: 1500, Received: 1550, Change: 50
Customer found: Walk In
Sale Order Inserted. ID: 245
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 30
    [unit_price] => 2
    [discount_percent] => 0.83
    [discount_amount] => 1
    [total_price] => 59
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-238: 18, Remaining: 1482
Previous Sale Due Paid for sel-242: 900, Remaining: 582
Previous Sale Due Paid for sel-245: 59, Remaining: 523
Current Sale Paid: 59, Remaining: 464
Advance Payment: 464
Total Summary:
Grand Total: 59
Wish to Pay: 1500
Total Paid: 1500
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-238
            [amount] => 18
            [type] => Previous Sale Due Payment
            [date] => 2026-06-15
        )

    [1] => Array
        (
            [ref] => sel-242
            [amount] => 900
            [type] => Previous Sale Due Payment
            [date] => 2026-06-15
        )

    [2] => Array
        (
            [ref] => sel-245
            [amount] => 59
            [type] => Previous Sale Due Payment
            [date] => 2026-06-15
        )

    [3] => Array
        (
            [ref] => sel-245
            [amount] => 59
            [type] => Current Sale Payment
            [date] => 2026-06-15
        )

    [4] => Array
        (
            [ref] => adv
            [amount] => 464
            [type] => Advance Payment
            [date] => 2026-06-15
        )

)

Script execution completed at: 2026-06-15 10:42:58

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 19, Wish To Pay: 30, Received: 50, Change: 20
Customer found: Walk In
Sale Order Inserted. ID: 246
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 5
    [discount_amount] => 1
    [total_price] => 19
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-246: 19, Remaining: 11
Current Sale Paid: 11, Remaining: 0
Total Summary:
Grand Total: 19
Wish to Pay: 30
Total Paid: 30
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-246
            [amount] => 19
            [type] => Previous Sale Due Payment
            [date] => 2026-06-15
        )

    [1] => Array
        (
            [ref] => sel-246
            [amount] => 11
            [type] => Current Sale Payment
            [date] => 2026-06-15
        )

)

Script execution completed at: 2026-06-15 11:01:30

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 25, Wish To Pay: 25, Received: 25, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 247
Inserting Item: Array
(
    [material_id] => 5455
    [quantity] => 10
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 5455, Available: 4, Requested: 10
Script execution completed at: 2026-06-15 11:02:25

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 4400, Wish To Pay: 4000, Received: 4500, Change: 500
Customer found: Walk In
Sale Order Inserted. ID: 248
Inserting Item: Array
(
    [material_id] => 5233
    [quantity] => 100
    [unit_price] => 44
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 4400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-248: 4000, Remaining: 0
Total Summary:
Grand Total: 4400
Wish to Pay: 4000
Total Paid: 4000
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-248
            [amount] => 4000
            [type] => Previous Sale Due Payment
            [date] => 2026-06-15
        )

)

Script execution completed at: 2026-06-15 11:03:24

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 400, To Pay: 440, Wish To Pay: 20, Received: 25, Change: 5
Customer found: Walk In
Sale Order Inserted. ID: 249
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 20
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-248: 20, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 20
Total Paid: 20
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-248
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-06-15
        )

)

Script execution completed at: 2026-06-15 11:11:20

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 420, To Pay: 445, Wish To Pay: 300, Received: 400, Change: 100
Customer found: Walk In
Sale Order Inserted. ID: 250
Inserting Item: Array
(
    [material_id] => 5455
    [quantity] => 10
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 5455, Available: 4, Requested: 10
Script execution completed at: 2026-06-15 13:20:20

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 420, To Pay: 620, Wish To Pay: 300, Received: 400, Change: 100
Customer found: Walk In
Sale Order Inserted. ID: 251
Inserting Item: Array
(
    [material_id] => 5235
    [quantity] => 10
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-248: 300, Remaining: 0
Total Summary:
Grand Total: 200
Wish to Pay: 300
Total Paid: 300
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-248
            [amount] => 300
            [type] => Previous Sale Due Payment
            [date] => 2026-06-15
        )

)

Script execution completed at: 2026-06-15 13:20:36

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 320, To Pay: 670, Wish To Pay: 20, Received: 30, Change: 10
Customer found: Walk In
Sale Order Inserted. ID: 252
Inserting Item: Array
(
    [material_id] => 5236
    [quantity] => 10
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 350
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-248: 20, Remaining: 0
Total Summary:
Grand Total: 350
Wish to Pay: 20
Total Paid: 20
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-248
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-06-15
        )

)

Script execution completed at: 2026-06-15 15:23:38

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 320, To Pay: 670, Wish To Pay: 20, Received: 30, Change: 10
Customer found: Walk In
Error: Duplicate entry 'SO-2026-12' for key 'so_number'
Script execution completed at: 2026-06-15 15:24:56

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 650, To Pay: 670, Wish To Pay: 800, Received: 900, Change: 100
Customer found: Walk In
Sale Order Inserted. ID: 254
Inserting Item: Array
(
    [material_id] => 5234
    [quantity] => 4
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-248: 60, Remaining: 740
Previous Sale Due Paid for sel-249: 40, Remaining: 700
Previous Sale Due Paid for sel-251: 200, Remaining: 500
Previous Sale Due Paid for sel-252: 350, Remaining: 150
Previous Sale Due Paid for sel-254: 20, Remaining: 130
Current Sale Paid: 20, Remaining: 110
Advance Payment: 110
Total Summary:
Grand Total: 20
Wish to Pay: 800
Total Paid: 800
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-248
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-06-15
        )

    [1] => Array
        (
            [ref] => sel-249
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-06-15
        )

    [2] => Array
        (
            [ref] => sel-251
            [amount] => 200
            [type] => Previous Sale Due Payment
            [date] => 2026-06-15
        )

    [3] => Array
        (
            [ref] => sel-252
            [amount] => 350
            [type] => Previous Sale Due Payment
            [date] => 2026-06-15
        )

    [4] => Array
        (
            [ref] => sel-254
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-06-15
        )

    [5] => Array
        (
            [ref] => sel-254
            [amount] => 20
            [type] => Current Sale Payment
            [date] => 2026-06-15
        )

    [6] => Array
        (
            [ref] => adv
            [amount] => 110
            [type] => Advance Payment
            [date] => 2026-06-15
        )

)

Script execution completed at: 2026-06-15 15:28:02

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 2, Wish To Pay: 2, Received: 5, Change: 3
Customer found: Walk In
Sale Order Inserted. ID: 255
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 1
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-255: 2, Remaining: 0
Total Summary:
Grand Total: 2
Wish to Pay: 2
Total Paid: 2
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-255
            [amount] => 2
            [type] => Previous Sale Due Payment
            [date] => 2026-06-16
        )

)

Script execution completed at: 2026-06-16 14:47:43

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 750, Wish To Pay: 120, Received: 500, Change: 380
Customer found: Walk In
Sale Order Inserted. ID: 256
Inserting Item: Array
(
    [material_id] => 5455
    [quantity] => 20
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 5455, Available: 4, Requested: 20
Script execution completed at: 2026-06-16 17:27:25

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 120, Received: 500, Change: 380
Customer found: Walk In
Sale Order Inserted. ID: 257
Inserting Item: Array
(
    [material_id] => 5455
    [quantity] => 4
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5236
    [quantity] => 4
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-257: 120, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 120
Total Paid: 120
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-257
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-06-16
        )

)

Script execution completed at: 2026-06-16 17:27:37

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => CQ_32_
    [supplier_id] => 82
    [purchase_date] => 17-06-2026
    [payment_term] => cash
    [subtotal] => 31420.00
    [notes] => 104100
    [amount_to_pay] => 31420.00
    [acc] => 1
    [items] => [{"material_id":"30818","item_type":"raw","quantity":"120.00","unit_price":"1.00","total_price":"120"},{"material_id":"30820","item_type":"raw","quantity":"120.00","unit_price":"257.00","total_price":"30840"},{"material_id":"30811","item_type":"raw","quantity":"46.00","unit_price":"10.00","total_price":"460"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
    [attachments] => Array
        (
            [name] => Array
                (
                    [0] => 721574842_990717450332515_2175103965621547501_n.jpg
                )

            [full_path] => Array
                (
                    [0] => 721574842_990717450332515_2175103965621547501_n.jpg
                )

            [type] => Array
                (
                    [0] => image/jpeg
                )

            [tmp_name] => Array
                (
                    [0] => C:\xampp\tmp\php5240.tmp
                )

            [error] => Array
                (
                    [0] => 0
                )

            [size] => Array
                (
                    [0] => 25709
                )

        )

)

Payment Term: cash, Amount to Pay: 31420, Account ID: 1
Inserted PO ID: 153
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 30818, Qty: 120
History inserted for raw material: 30818
Products stock updated: +120
No batch data found for material_id: 30818
Processing item 1 - Type: raw, ID: 30820, Qty: 120
History inserted for raw material: 30820
Products stock updated: +120
No batch data found for material_id: 30820
Processing item 2 - Type: raw, ID: 30811, Qty: 46
History inserted for raw material: 30811
Products stock updated: +46
No batch data found for material_id: 30811
Purchase Pay record inserted with ID: 128
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => CQ_32_
    [supplier_id] => 82
    [purchase_date] => 17-06-2026
    [payment_term] => cash
    [subtotal] => 31420.00
    [notes] => 104100
    [amount_to_pay] => 31420.00
    [acc] => 1
    [items] => [{"material_id":"30818","item_type":"raw","quantity":"120.00","unit_price":"1.00","total_price":"120"},{"material_id":"30820","item_type":"raw","quantity":"120.00","unit_price":"257.00","total_price":"30840"},{"material_id":"30811","item_type":"raw","quantity":"46.00","unit_price":"10.00","total_price":"460"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
    [attachments] => Array
        (
            [name] => Array
                (
                    [0] => 721574842_990717450332515_2175103965621547501_n.jpg
                )

            [full_path] => Array
                (
                    [0] => 721574842_990717450332515_2175103965621547501_n.jpg
                )

            [type] => Array
                (
                    [0] => image/jpeg
                )

            [tmp_name] => Array
                (
                    [0] => C:\xampp\tmp\php7643.tmp
                )

            [error] => Array
                (
                    [0] => 0
                )

            [size] => Array
                (
                    [0] => 25709
                )

        )

)

Payment Term: cash, Amount to Pay: 31420, Account ID: 1
Error: PO Number already exists
=== NEW PURCHASE ORDER ===
POST: Array
(
    [po_number] => CQ_32_
    [supplier_id] => 82
    [purchase_date] => 17-06-2026
    [payment_term] => cash
    [subtotal] => 31420.00
    [notes] => 
    [amount_to_pay] => 31420.00
    [acc] => 1
    [items] => [{"material_id":"30818","item_type":"raw","quantity":"120.00","unit_price":"1.00","total_price":"120"},{"material_id":"30820","item_type":"raw","quantity":"120.00","unit_price":"257.00","total_price":"30840"},{"material_id":"30811","item_type":"raw","quantity":"46.00","unit_price":"10.00","total_price":"460"}]
    [batch_data] => {}
    [serial_data] => {}
)

PO: CQ_32_, Supplier: 82, Date: 17-06-2026
Subtotal: 31420, Grand Total: 31420
ERROR: PO Number 'CQ_32_' already exists
TRACE: #0 {main}
=== NEW PURCHASE ORDER ===
POST: Array
(
    [po_number] => CQ_32_3254
    [supplier_id] => 82
    [purchase_date] => 17-06-2026
    [payment_term] => cash
    [subtotal] => 31420.00
    [notes] => ষগট
    [amount_to_pay] => 31420.00
    [acc] => 1
    [items] => [{"material_id":"30818","item_type":"raw","quantity":"120.00","unit_price":"1.00","total_price":"120"},{"material_id":"30820","item_type":"raw","quantity":"120.00","unit_price":"257.00","total_price":"30840"},{"material_id":"30811","item_type":"raw","quantity":"46.00","unit_price":"10.00","total_price":"460"}]
    [batch_data] => {}
    [serial_data] => {}
)

PO: CQ_32_3254, Supplier: 82, Date: 17-06-2026
Subtotal: 31420, Grand Total: 31420
PO ID inserted: 154
Total items: 3
Processing item: Type=raw, ID=30818, Qty=120
Processing item: Type=raw, ID=30820, Qty=120
Processing item: Type=raw, ID=30811, Qty=46
SUCCESS: PO 154 created
=== NEW PURCHASE ORDER ===
POST: Array
(
    [po_number] => CQ_32_
    [supplier_id] => 82
    [purchase_date] => 17-06-2026
    [payment_term] => cash
    [subtotal] => 30960.00
    [notes] => 
    [amount_to_pay] => 30960.00
    [acc] => 1
    [items] => [{"material_id":"30818","item_type":"raw","quantity":"120.00","unit_price":"1.00","total_price":"120"},{"material_id":"30820","item_type":"raw","quantity":"120.00","unit_price":"257.00","total_price":"30840"}]
    [batch_data] => {}
    [serial_data] => {}
)

PO: CQ_32_, Supplier: 82, Date: 17-06-2026
Subtotal: 30960, Grand Total: 30960
ERROR: PO Number 'CQ_32_' already exists
TRACE: #0 {main}
=== NEW PURCHASE ORDER ===
POST: Array
(
    [po_number] => CQ_32_587
    [supplier_id] => 82
    [purchase_date] => 17-06-2026
    [payment_term] => cash
    [subtotal] => 30960.00
    [notes] => 
    [amount_to_pay] => 30960.00
    [acc] => 1
    [items] => [{"material_id":"30818","item_type":"raw","quantity":"120.00","unit_price":"1.00","total_price":"120"},{"material_id":"30820","item_type":"raw","quantity":"120.00","unit_price":"257.00","total_price":"30840"}]
    [batch_data] => {}
    [serial_data] => {}
)

PO: CQ_32_587, Supplier: 82, Date: 17-06-2026
Subtotal: 30960, Grand Total: 30960
PO ID inserted: 155
Total items: 2
Processing item: Type=raw, ID=30818, Qty=120
Processing item: Type=raw, ID=30820, Qty=120
SUCCESS: PO 155 created
=== NEW PURCHASE ORDER ===
POST: Array
(
    [po_number] => CQ_32_
    [supplier_id] => 82
    [purchase_date] => 17-06-2026
    [payment_term] => cash
    [subtotal] => 120.00
    [notes] => ডপ
    [amount_to_pay] => 120.00
    [acc] => 1
    [items] => [{"material_id":"30818","item_type":"raw","quantity":"120.00","unit_price":"1.00","total_price":"120"}]
    [batch_data] => {}
    [serial_data] => {}
)

PO: CQ_32_, Supplier: 82, Date: 17-06-2026
Subtotal: 120, Grand Total: 120
ERROR: PO Number 'CQ_32_' already exists
TRACE: #0 {main}
=== NEW PURCHASE ORDER ===
POST: Array
(
    [po_number] => CQ_32_587
    [supplier_id] => 82
    [purchase_date] => 17-06-2026
    [payment_term] => cash
    [subtotal] => 120.00
    [notes] => ডপ
    [amount_to_pay] => 120.00
    [acc] => 1
    [items] => [{"material_id":"30818","item_type":"raw","quantity":"120.00","unit_price":"1.00","total_price":"120"}]
    [batch_data] => {}
    [serial_data] => {}
)

PO: CQ_32_587, Supplier: 82, Date: 17-06-2026
Subtotal: 120, Grand Total: 120
ERROR: PO Number 'CQ_32_587' already exists
TRACE: #0 {main}
=== NEW PURCHASE ORDER ===
POST: Array
(
    [po_number] => CQ_32_5870
    [supplier_id] => 82
    [purchase_date] => 17-06-2026
    [payment_term] => cash
    [subtotal] => 120.00
    [notes] => ডপ
    [amount_to_pay] => 120.00
    [acc] => 1
    [items] => [{"material_id":"30818","item_type":"raw","quantity":"120.00","unit_price":"1.00","total_price":"120"}]
    [batch_data] => {}
    [serial_data] => {}
)

PO: CQ_32_5870, Supplier: 82, Date: 17-06-2026
Subtotal: 120, Grand Total: 120
PO ID inserted: 156
Total items: 1
Processing item: Type=raw, ID=30818, Qty=120
SUCCESS: PO 156 created
=== NEW PURCHASE ORDER ===
POST: Array
(
    [po_number] => CQ_32_
    [supplier_id] => 82
    [purchase_date] => 2026-06-17
    [payment_term] => cash
    [subtotal] => 31144.00
    [notes] => 
    [amount_to_pay] => 31144.00
    [acc] => 1
    [items] => [{"material_id":"30818","item_type":"raw","quantity":"120.00","unit_price":"1.00","total_price":"120"},{"material_id":"30820","item_type":"raw","quantity":"120.00","unit_price":"257.00","total_price":"30840"},{"material_id":"30811","item_type":"raw","quantity":"46.00","unit_price":"4.00","total_price":"184.00"}]
    [batch_data] => {}
    [serial_data] => {}
)

PO: CQ_32_, Supplier: 82, Date: 2026-06-17
Subtotal: 31144, Grand Total: 31144
ERROR: PO Number 'CQ_32_' already exists
TRACE: #0 {main}
=== NEW PURCHASE ORDER ===
POST: Array
(
    [po_number] => CQ_32_5747
    [supplier_id] => 82
    [purchase_date] => 2026-06-17
    [payment_term] => cash
    [subtotal] => 31144.00
    [notes] => 
    [amount_to_pay] => 31144.00
    [acc] => 1
    [items] => [{"material_id":"30818","item_type":"raw","quantity":"120.00","unit_price":"1.00","total_price":"120"},{"material_id":"30820","item_type":"raw","quantity":"120.00","unit_price":"257.00","total_price":"30840"},{"material_id":"30811","item_type":"raw","quantity":"46.00","unit_price":"4.00","total_price":"184.00"}]
    [batch_data] => {}
    [serial_data] => {}
)

PO: CQ_32_5747, Supplier: 82, Date: 2026-06-17
Subtotal: 31144, Grand Total: 31144
PO ID inserted: 157
Total items: 3
Processing item: Type=raw, ID=30818, Qty=120
Processing item: Type=raw, ID=30820, Qty=120
Processing item: Type=raw, ID=30811, Qty=46
SUCCESS: PO 157 created
=== NEW PURCHASE ORDER ===
POST: Array
(
    [po_number] => CQ_33_54789
    [supplier_id] => 82
    [purchase_date] => 2026-06-17
    [payment_term] => cash
    [subtotal] => 7770.00
    [notes] => dsf
    [amount_to_pay] => 7770.00
    [acc] => 1
    [items] => [{"material_id":"15","item_type":"product","quantity":"3.00","unit_price":"20.00","total_price":"60"},{"material_id":"30820","item_type":"raw","quantity":"30.00","unit_price":"257.00","total_price":"7710"}]
    [batch_data] => {"2":{"material_id":"30820","batches":[{"batch_no":"120","qty":"30.00","expiry_date":"2028-06-17"}]}}
    [serial_data] => {"1":{"material_id":"15","serials":["120120120","130130","130130"]}}
)

PO: CQ_33_54789, Supplier: 82, Date: 2026-06-17
Subtotal: 7770, Grand Total: 7770
PO ID inserted: 158
Total items: 2
Processing item: Type=product, ID=15, Qty=3
Found serial for material: 15
Serial inserted: 120120120
Serial inserted: 130130
ERROR: Duplicate entry '130130' for key 'serial_no'
TRACE: #0 C:\xampp\htdocs\propharmacy\quotation_insert.php(312): mysqli_query(Object(mysqli), 'INSERT INTO pro...')
#1 {main}
=== NEW PURCHASE ORDER ===
POST: Array
(
    [po_number] => CQ_33_54789
    [supplier_id] => 82
    [purchase_date] => 2026-06-17
    [payment_term] => cash
    [subtotal] => 7770.00
    [notes] => dsf
    [amount_to_pay] => 7770.00
    [acc] => 1
    [items] => [{"material_id":"15","item_type":"product","quantity":"3.00","unit_price":"20.00","total_price":"60"},{"material_id":"30820","item_type":"raw","quantity":"30.00","unit_price":"257.00","total_price":"7710"}]
    [batch_data] => {"2":{"material_id":"30820","batches":[{"batch_no":"120","qty":"30.00","expiry_date":"2028-06-17"}]}}
    [serial_data] => {"1":{"material_id":"15","serials":["120120120","130130","13013014"]}}
)

PO: CQ_33_54789, Supplier: 82, Date: 2026-06-17
Subtotal: 7770, Grand Total: 7770
PO ID inserted: 159
Total items: 2
Processing item: Type=product, ID=15, Qty=3
Found serial for material: 15
Serial inserted: 120120120
Serial inserted: 130130
Serial inserted: 13013014
Processing item: Type=raw, ID=30820, Qty=30
Found batch for material: 30820
Batch inserted: 120
SUCCESS: PO 159 created
=== NEW PURCHASE ORDER ===
POST: Array
(
    [po_number] => CQ_33_
    [supplier_id] => 82
    [purchase_date] => 2026-06-17
    [payment_term] => cash
    [subtotal] => 18050.00
    [notes] => 
    [amount_to_pay] => 18050.00
    [acc] => 1
    [items] => [{"material_id":"15","item_type":"product","quantity":"3.00","unit_price":"20.00","total_price":"60"},{"material_id":"30820","item_type":"raw","quantity":"70","unit_price":"257.00","total_price":"17990.00"}]
    [batch_data] => {"2":{"material_id":"30820","batches":[{"batch_no":"100000","qty":"30.00","expiry_date":"2028-06-17"},{"batch_no":"32414","qty":"040","expiry_date":"2028-06-17"}]}}
    [serial_data] => {"1":{"material_id":"15","serials":["130130587","130130697","3214787"]}}
)

PO: CQ_33_, Supplier: 82, Date: 2026-06-17
Subtotal: 18050, Grand Total: 18050
PO ID inserted: 160
Total items: 2
Processing item: Type=product, ID=15, Qty=3
Found serial for material: 15
Serial inserted: 130130587
Serial inserted: 130130697
Serial inserted: 3214787
Processing item: Type=raw, ID=30820, Qty=70
Found batch for material: 30820
Batch inserted into expiry: 100000
Batch inserted into expiry: 32414
SUCCESS: PO 160 created
=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 30, To Pay: 90, Wish To Pay: 90, Received: 100, Change: 10
Customer found: Walk In
Sale Order Inserted. ID: 258
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 30
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-257: 30, Remaining: 60
Previous Sale Due Paid for sel-258: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 90
Total Paid: 90
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-257
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-06-17
        )

    [1] => Array
        (
            [ref] => sel-258
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-06-17
        )

)

Script execution completed at: 2026-06-17 16:39:56

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 310, Change: 10
Customer found: Walk In
Sale Order Inserted. ID: 259
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 10
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-259: 300, Remaining: 0
Total Summary:
Grand Total: 300
Wish to Pay: 300
Total Paid: 300
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-259
            [amount] => 300
            [type] => Previous Sale Due Payment
            [date] => 2026-06-17
        )

)

Script execution completed at: 2026-06-17 16:55:08

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 30, To Pay: 90, Wish To Pay: 90, Received: 100, Change: 10
Customer found: Walk In
Error: Duplicate entry 'SO-2026-16' for key 'so_number'
Script execution completed at: 2026-06-17 18:10:34

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 1200, Change: 900
Customer found: Walk In
Sale Order Inserted. ID: 261
Inserting Item: Array
(
    [material_id] => 5455
    [quantity] => 120
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 5455, Available: 0, Requested: 120
Script execution completed at: 2026-06-17 18:10:51

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 1200, Change: 1170
Customer found: Walk In
Sale Order Inserted. ID: 262
Inserting Item: Array
(
    [material_id] => 5455
    [quantity] => 12
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 5455, Available: 0, Requested: 12
Script execution completed at: 2026-06-17 18:10:59

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 528, Wish To Pay: 528, Received: 1200, Change: 672
Customer found: Walk In
Sale Order Inserted. ID: 263
Inserting Item: Array
(
    [material_id] => 5233
    [quantity] => 12
    [unit_price] => 44
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 528
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-263: 528, Remaining: 0
Total Summary:
Grand Total: 528
Wish to Pay: 528
Total Paid: 528
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-263
            [amount] => 528
            [type] => Previous Sale Due Payment
            [date] => 2026-06-17
        )

)

Script execution completed at: 2026-06-17 18:11:15

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 300, Change: 240
Customer found: Walk In
Sale Order Inserted. ID: 264
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 30
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-264: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-264
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-06-17
        )

)

Script execution completed at: 2026-06-17 18:21:44

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 300, Change: 240
Customer found: Walk In
Error: Duplicate entry 'SO-2026-19' for key 'so_number'
Script execution completed at: 2026-06-17 18:41:57

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 266
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-266: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-266
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-06-17
        )

)

Script execution completed at: 2026-06-17 18:42:11

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 267
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-267: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-267
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-06-17
        )

)

Script execution completed at: 2026-06-17 18:44:52

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 268
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 20
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-268: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-268
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-06-17
        )

)

Script execution completed at: 2026-06-17 18:46:42

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-22' for key 'so_number'
Script execution completed at: 2026-06-17 18:47:13

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-22' for key 'so_number'
Script execution completed at: 2026-06-17 18:47:56

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-22' for key 'so_number'
Script execution completed at: 2026-06-17 18:48:01

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 272
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-272: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-272
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-06-17
        )

)

Script execution completed at: 2026-06-17 18:48:17

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 14
    [supplier_id] => 82
    [purchase_date] => 2026-06-18
    [payment_term] => cash
    [subtotal] => 205.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 205.00
    [notes] => 
    [amount_to_pay] => 205.00
    [acc] => 1
    [items] => [{"material_id":"5645","item_type":"raw","quantity":"10","unit_price":"20.5","discount_percent":"0.00","discount_flat":"0","total_price":"205.00"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 205, Account ID: 1
Inserted PO ID: 130
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 5645, Qty: 10
History inserted for raw material: 5645
Products stock updated: +10
No batch data found for material_id: 5645
Purchase Pay record inserted with ID: 111
=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 350, Change: 50
Customer found: Walk In
Sale Order Inserted. ID: 160
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 10
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-160: 300, Remaining: 0
Total Summary:
Grand Total: 300
Wish to Pay: 300
Total Paid: 300
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-160
            [amount] => 300
            [type] => Previous Sale Due Payment
            [date] => 2026-06-18
        )

)

Script execution completed at: 2026-06-18 12:36:04

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 22.5, Wish To Pay: 22.5, Received: 30, Change: 7.5
Customer found: Walk In
Sale Order Inserted. ID: 161
Inserting Item: Array
(
    [material_id] => 5868
    [quantity] => 10
    [unit_price] => 2.25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-161: 22.5, Remaining: 0
Total Summary:
Grand Total: 22.5
Wish to Pay: 22.5
Total Paid: 22.5
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-161
            [amount] => 22.5
            [type] => Previous Sale Due Payment
            [date] => 2026-06-18
        )

)

Script execution completed at: 2026-06-18 14:09:48

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 30
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 105.2, Wish To Pay: 105.2, Received: 0, Change: 0
Customer found: Al-Hera Healthcare & pharma
Sale Order Inserted. ID: 162
Inserting Item: Array
(
    [material_id] => 1237
    [quantity] => 2
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 14
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30558
    [quantity] => 2
    [unit_price] => 45
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 2250
    [quantity] => 1
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 2250, Available: 0, Requested: 1
Script execution completed at: 2026-06-18 14:15:08

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 30
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 161, Wish To Pay: 161, Received: 0, Change: 0
Customer found: Al-Hera Healthcare & pharma
Sale Order Inserted. ID: 163
Inserting Item: Array
(
    [material_id] => 1860
    [quantity] => 10
    [unit_price] => 17.5
    [discount_percent] => 8
    [discount_amount] => 14
    [total_price] => 161
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-163: 161, Remaining: 0
Total Summary:
Grand Total: 161
Wish to Pay: 161
Total Paid: 161
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-163
            [amount] => 161
            [type] => Previous Sale Due Payment
            [date] => 2026-06-18
        )

)

Script execution completed at: 2026-06-18 14:17:15

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 30
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 320, Wish To Pay: 320, Received: 0, Change: 0
Customer found: Al-Hera Healthcare & pharma
Sale Order Inserted. ID: 164
Inserting Item: Array
(
    [material_id] => 19387
    [quantity] => 1
    [unit_price] => 320
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 320
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-164: 320, Remaining: 0
Total Summary:
Grand Total: 320
Wish to Pay: 320
Total Paid: 320
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-164
            [amount] => 320
            [type] => Previous Sale Due Payment
            [date] => 2026-06-18
        )

)

Script execution completed at: 2026-06-18 14:22:57

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 216, Wish To Pay: 216, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 165
Inserting Item: Array
(
    [material_id] => 3994
    [quantity] => 10
    [unit_price] => 14
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 3994, Available: 0, Requested: 10
Script execution completed at: 2026-06-19 10:45:39

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1.2, Wish To Pay: 1.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 166
Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 1
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-166: 1.2, Remaining: 0
Total Summary:
Grand Total: 1.2
Wish to Pay: 1.2
Total Paid: 1.2
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-166
            [amount] => 1.2
            [type] => Previous Sale Due Payment
            [date] => 2026-06-20
        )

)

Script execution completed at: 2026-06-20 14:01:31

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 215, Wish To Pay: 215, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 167
Inserting Item: Array
(
    [material_id] => 30790
    [quantity] => 1
    [unit_price] => 215
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 215
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-167: 215, Remaining: 0
Total Summary:
Grand Total: 215
Wish to Pay: 215
Total Paid: 215
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-167
            [amount] => 215
            [type] => Previous Sale Due Payment
            [date] => 2026-06-20
        )

)

Script execution completed at: 2026-06-20 15:20:26

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 215, Wish To Pay: 215, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-27' for key 'so_number'
Script execution completed at: 2026-06-20 15:30:52

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 215, Wish To Pay: 215, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-27' for key 'so_number'
Script execution completed at: 2026-06-20 15:30:59

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 215, Wish To Pay: 215, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-27' for key 'so_number'
Script execution completed at: 2026-06-20 15:31:02

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 215, Wish To Pay: 215, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-27' for key 'so_number'
Script execution completed at: 2026-06-20 15:31:26

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 215, Wish To Pay: 215, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 172
Inserting Item: Array
(
    [material_id] => 30790
    [quantity] => 1
    [unit_price] => 215
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 215
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-172: 215, Remaining: 0
Total Summary:
Grand Total: 215
Wish to Pay: 215
Total Paid: 215
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-172
            [amount] => 215
            [type] => Previous Sale Due Payment
            [date] => 2026-06-20
        )

)

Script execution completed at: 2026-06-20 15:31:58

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 215, Wish To Pay: 215, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-28' for key 'so_number'
Script execution completed at: 2026-06-20 15:32:11

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 174
Inserting Item: Array
(
    [material_id] => 7300
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-174: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-174
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-06-20
        )

)

Script execution completed at: 2026-06-20 15:43:29

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 260, Wish To Pay: 260, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-29' for key 'so_number'
Script execution completed at: 2026-06-20 15:55:17

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 260, Wish To Pay: 260, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 176
Inserting Item: Array
(
    [material_id] => 13212
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7300
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17582
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-176: 260, Remaining: 0
Total Summary:
Grand Total: 260
Wish to Pay: 260
Total Paid: 260
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-176
            [amount] => 260
            [type] => Previous Sale Due Payment
            [date] => 2026-06-20
        )

)

Script execution completed at: 2026-06-20 15:56:52

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 5
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 202.33, Wish To Pay: 202.33, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 177
Inserting Item: Array
(
    [material_id] => 1858
    [quantity] => 12
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 108
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19002
    [quantity] => 12
    [unit_price] => 2.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 27.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 339
    [quantity] => 1
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 339, Available: 0, Requested: 1
Script execution completed at: 2026-06-21 05:49:45

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 4
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 196.8, Wish To Pay: 196.8, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 178
Inserting Item: Array
(
    [material_id] => 1858
    [quantity] => 12
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 108
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19002
    [quantity] => 12
    [unit_price] => 2.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 27.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 339
    [quantity] => 1
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 339, Available: 0, Requested: 1
Script execution completed at: 2026-06-21 05:50:04

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 135.6, Wish To Pay: 135.6, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 179
Inserting Item: Array
(
    [material_id] => 1858
    [quantity] => 12
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 108
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19002
    [quantity] => 12
    [unit_price] => 2.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 27.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-179: 135.6, Remaining: 0
Total Summary:
Grand Total: 135.6
Wish to Pay: 135.6
Total Paid: 135.6
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-179
            [amount] => 135.6
            [type] => Previous Sale Due Payment
            [date] => 2026-06-21
        )

)

Script execution completed at: 2026-06-21 05:50:14

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 396.5, Wish To Pay: 396.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 180
Inserting Item: Array
(
    [material_id] => 24463
    [quantity] => 6
    [unit_price] => 45.25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 271.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30105
    [quantity] => 10
    [unit_price] => 12.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 125
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-180: 396.5, Remaining: 0
Total Summary:
Grand Total: 396.5
Wish to Pay: 396.5
Total Paid: 396.5
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-180
            [amount] => 396.5
            [type] => Previous Sale Due Payment
            [date] => 2026-06-22
        )

)

Script execution completed at: 2026-06-22 13:26:11

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 485, Wish To Pay: 485, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 181
Inserting Item: Array
(
    [material_id] => 24463
    [quantity] => 6
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24463, Available: 0, Requested: 6
Script execution completed at: 2026-06-22 13:29:47

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 485, Wish To Pay: 485, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 182
Inserting Item: Array
(
    [material_id] => 24463
    [quantity] => 6
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24463, Available: 0, Requested: 6
Script execution completed at: 2026-06-22 13:29:52

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 485, Wish To Pay: 485, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 183
Inserting Item: Array
(
    [material_id] => 24463
    [quantity] => 6
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24463, Available: 0, Requested: 6
Script execution completed at: 2026-06-22 13:30:07

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 16
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 17.5, Wish To Pay: 17.5, Received: 0, Change: 0
Customer found: Nahar Enterprise
Sale Order Inserted. ID: 184
Inserting Item: Array
(
    [material_id] => 1860
    [quantity] => 1
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 17.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-184: 17.5, Remaining: 0
Total Summary:
Grand Total: 17.5
Wish to Pay: 17.5
Total Paid: 17.5
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-184
            [amount] => 17.5
            [type] => Previous Sale Due Payment
            [date] => 2026-06-23
        )

)

Script execution completed at: 2026-06-23 10:00:56

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 55.1, Wish To Pay: 55.1, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 185
Inserting Item: Array
(
    [material_id] => 25032
    [quantity] => 10
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24361
    [quantity] => 10
    [unit_price] => 2.51
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25.1
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 23111
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-185: 55.1, Remaining: 0
Total Summary:
Grand Total: 55.1
Wish to Pay: 55.1
Total Paid: 55.1
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-185
            [amount] => 55.1
            [type] => Previous Sale Due Payment
            [date] => 2026-06-23
        )

)

Script execution completed at: 2026-06-23 16:22:55

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 440, Wish To Pay: 440, Received: 500, Change: 60
Customer found: Walk In
Sale Order Inserted. ID: 186
Inserting Item: Array
(
    [material_id] => 5233
    [quantity] => 10
    [unit_price] => 44
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 440
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-186: 440, Remaining: 0
Total Summary:
Grand Total: 440
Wish to Pay: 440
Total Paid: 440
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-186
            [amount] => 440
            [type] => Previous Sale Due Payment
            [date] => 2026-06-23
        )

)

Script execution completed at: 2026-06-23 16:48:21

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 530, Wish To Pay: 530, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 187
Inserting Item: Array
(
    [material_id] => 29554
    [quantity] => 1
    [unit_price] => 530
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 530
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-187: 530, Remaining: 0
Total Summary:
Grand Total: 530
Wish to Pay: 530
Total Paid: 530
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-187
            [amount] => 530
            [type] => Previous Sale Due Payment
            [date] => 2026-06-23
        )

)

Script execution completed at: 2026-06-23 16:59:39

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 188
Inserting Item: Array
(
    [material_id] => 12966
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-188: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-188
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-06-23
        )

)

Script execution completed at: 2026-06-23 17:34:54

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 440, Wish To Pay: 440, Received: 500, Change: 60
Customer found: Walk In
Error: Duplicate entry 'SO-2026-36' for key 'so_number'
Script execution completed at: 2026-06-24 01:49:40

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 440, Wish To Pay: 440, Received: 1000, Change: 560
Customer found: Walk In
Sale Order Inserted. ID: 190
Inserting Item: Array
(
    [material_id] => 5233
    [quantity] => 10
    [unit_price] => 44
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 440
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-190: 440, Remaining: 0
Total Summary:
Grand Total: 440
Wish to Pay: 440
Total Paid: 440
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-190
            [amount] => 440
            [type] => Previous Sale Due Payment
            [date] => 2026-06-24
        )

)

Script execution completed at: 2026-06-24 01:57:18

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 4
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 412, Wish To Pay: 412, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 191
Inserting Item: Array
(
    [material_id] => 19851
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31262
    [quantity] => 6
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 72
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25400
    [quantity] => 5
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22386
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-191: 412, Remaining: 0
Total Summary:
Grand Total: 412
Wish to Pay: 412
Total Paid: 412
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-191
            [amount] => 412
            [type] => Previous Sale Due Payment
            [date] => 2026-06-24
        )

)

Script execution completed at: 2026-06-24 17:26:18

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 31, Wish To Pay: 31, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 192
Inserting Item: Array
(
    [material_id] => 29176
    [quantity] => 2
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 2
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-192: 31, Remaining: 0
Total Summary:
Grand Total: 31
Wish to Pay: 31
Total Paid: 31
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-192
            [amount] => 31
            [type] => Previous Sale Due Payment
            [date] => 2026-06-25
        )

)

Script execution completed at: 2026-06-25 04:32:14

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 56.33, Wish To Pay: 56.33, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 193
Inserting Item: Array
(
    [material_id] => 7895
    [quantity] => 4
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 7895, Available: 0, Requested: 4
Script execution completed at: 2026-06-25 04:55:42

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 56.33, Wish To Pay: 56.33, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 194
Inserting Item: Array
(
    [material_id] => 7895
    [quantity] => 4
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 7895, Available: 0, Requested: 4
Script execution completed at: 2026-06-25 04:55:56

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 56.33, Wish To Pay: 56.33, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 195
Inserting Item: Array
(
    [material_id] => 7895
    [quantity] => 4
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 7895, Available: 0, Requested: 4
Script execution completed at: 2026-06-25 05:15:25

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 56.33, Wish To Pay: 56.33, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 196
Inserting Item: Array
(
    [material_id] => 7895
    [quantity] => 4
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 7895, Available: 0, Requested: 4
Script execution completed at: 2026-06-25 06:05:28

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 876, Wish To Pay: 876, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 197
Inserting Item: Array
(
    [material_id] => 5732
    [quantity] => 30
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18845
    [quantity] => 20
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 18845, Available: 0, Requested: 20
Script execution completed at: 2026-06-25 06:16:17

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 876, Wish To Pay: 876, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 198
Inserting Item: Array
(
    [material_id] => 5732
    [quantity] => 30
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18845
    [quantity] => 20
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 18845, Available: 0, Requested: 20
Script execution completed at: 2026-06-25 06:16:34

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 876, Wish To Pay: 876, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 199
Inserting Item: Array
(
    [material_id] => 5732
    [quantity] => 30
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18845
    [quantity] => 20
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 18845, Available: 0, Requested: 20
Script execution completed at: 2026-06-25 06:17:33

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 876, Wish To Pay: 876, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 200
Inserting Item: Array
(
    [material_id] => 5732
    [quantity] => 30
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18845
    [quantity] => 20
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 18845, Available: 0, Requested: 20
Script execution completed at: 2026-06-25 06:19:34

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 876, Wish To Pay: 876, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 201
Inserting Item: Array
(
    [material_id] => 18845
    [quantity] => 20
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 18845, Available: 0, Requested: 20
Script execution completed at: 2026-06-25 06:21:16

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 876, Wish To Pay: 876, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 202
Inserting Item: Array
(
    [material_id] => 18845
    [quantity] => 20
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 18845, Available: 0, Requested: 20
Script execution completed at: 2026-06-25 06:22:16

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 440, Wish To Pay: 440, Received: 500, Change: 60
Customer found: Walk In
Sale Order Inserted. ID: 203
Inserting Item: Array
(
    [material_id] => 5233
    [quantity] => 10
    [unit_price] => 44
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 440
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 5233, Available: 0, Requested: 10
Script execution completed at: 2026-06-26 08:50:27

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 44, Wish To Pay: 44, Received: 500, Change: 456
Customer found: Walk In
Sale Order Inserted. ID: 204
Inserting Item: Array
(
    [material_id] => 5233
    [quantity] => 1
    [unit_price] => 44
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 44
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 5233, Available: 0, Requested: 1
Script execution completed at: 2026-06-26 08:50:39

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 5, Wish To Pay: 5, Received: 500, Change: 495
Customer found: Walk In
Sale Order Inserted. ID: 205
Inserting Item: Array
(
    [material_id] => 7244
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-205: 5, Remaining: 0
Total Summary:
Grand Total: 5
Wish to Pay: 5
Total Paid: 5
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-205
            [amount] => 5
            [type] => Previous Sale Due Payment
            [date] => 2026-06-26
        )

)

Script execution completed at: 2026-06-26 08:51:05

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 85, Wish To Pay: 85, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 206
Inserting Item: Array
(
    [material_id] => 24981
    [quantity] => 4
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 48
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24981, Available: 0, Requested: 4
Script execution completed at: 2026-06-27 05:33:58

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 85, Wish To Pay: 85, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 207
Inserting Item: Array
(
    [material_id] => 24981
    [quantity] => 4
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 48
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24981, Available: 0, Requested: 4
Script execution completed at: 2026-06-27 05:34:11

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 85, Wish To Pay: 85, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 208
Inserting Item: Array
(
    [material_id] => 24981
    [quantity] => 4
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 48
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24981, Available: 0, Requested: 4
Script execution completed at: 2026-06-27 05:34:31

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 85, Wish To Pay: 85, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 209
Inserting Item: Array
(
    [material_id] => 24981
    [quantity] => 4
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 48
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24981, Available: 0, Requested: 4
Script execution completed at: 2026-06-27 05:34:55

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 85, Wish To Pay: 85, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 210
Inserting Item: Array
(
    [material_id] => 24981
    [quantity] => 4
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 48
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24981, Available: 0, Requested: 4
Script execution completed at: 2026-06-27 05:35:34

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 75, Wish To Pay: 75, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 211
Inserting Item: Array
(
    [material_id] => 5236
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 1
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29695
    [quantity] => 4
    [unit_price] => 9.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 38
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-211: 75, Remaining: 0
Total Summary:
Grand Total: 75
Wish to Pay: 75
Total Paid: 75
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-211
            [amount] => 75
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 05:38:08

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 69.6, Wish To Pay: 69.6, Received: 100, Change: 30.4
Customer found: Walk In
Sale Order Inserted. ID: 212
Inserting Item: Array
(
    [material_id] => 18561
    [quantity] => 12
    [unit_price] => 5.8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 69.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 1
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-212: 69.6, Remaining: 0
Total Summary:
Grand Total: 69.6
Wish to Pay: 69.6
Total Paid: 69.6
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-212
            [amount] => 69.6
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 06:02:36

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 213
Inserting Item: Array
(
    [material_id] => 24981
    [quantity] => 5
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24981, Available: 0, Requested: 5
Script execution completed at: 2026-06-27 06:08:08

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1099.46, Wish To Pay: 1099.46, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-3' for key 'so_number'
Script execution completed at: 2026-06-27 06:31:00

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1099.46, Wish To Pay: 1099.46, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-3' for key 'so_number'
Script execution completed at: 2026-06-27 06:31:11

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1099.46, Wish To Pay: 1099.46, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-3' for key 'so_number'
Script execution completed at: 2026-06-27 06:34:14

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1099.46, Wish To Pay: 1099.46, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-3' for key 'so_number'
Script execution completed at: 2026-06-27 06:34:43

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1099.46, Wish To Pay: 1099.46, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-3' for key 'so_number'
Script execution completed at: 2026-06-27 06:35:06

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1099.46, Wish To Pay: 1099.46, Received: 1200, Change: 100.54
Customer found: Walk In
Error: Duplicate entry 'SO-2026-3' for key 'so_number'
Script execution completed at: 2026-06-27 06:37:26

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1099.46, Wish To Pay: 1099.46, Received: 1200, Change: 100.54
Customer found: Walk In
Error: Duplicate entry 'SO-2026-3' for key 'so_number'
Script execution completed at: 2026-06-27 06:37:41

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 200.64, Wish To Pay: 200.64, Received: 200, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 221
Inserting Item: Array
(
    [material_id] => 28802
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1179
    [quantity] => 10
    [unit_price] => 0.8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 862
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-221: 200.64, Remaining: 0
Total Summary:
Grand Total: 200.64
Wish to Pay: 200.64
Total Paid: 200.64
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-221
            [amount] => 200.64
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 06:43:06

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-4' for key 'so_number'
Script execution completed at: 2026-06-27 06:56:46

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-4' for key 'so_number'
Script execution completed at: 2026-06-27 06:59:11

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-4' for key 'so_number'
Script execution completed at: 2026-06-27 06:59:33

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-4' for key 'so_number'
Script execution completed at: 2026-06-27 07:00:57

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-4' for key 'so_number'
Script execution completed at: 2026-06-27 07:02:47

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 15, Wish To Pay: 15, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 227
Inserting Item: Array
(
    [material_id] => 30207
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-227: 15, Remaining: 0
Total Summary:
Grand Total: 15
Wish to Pay: 15
Total Paid: 15
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-227
            [amount] => 15
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 07:04:10

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1126.5, Wish To Pay: 1126.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 228
Inserting Item: Array
(
    [material_id] => 1860
    [quantity] => 15
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 262.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1738
    [quantity] => 14
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 840
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 20
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-228: 1126.5, Remaining: 0
Total Summary:
Grand Total: 1126.5
Wish to Pay: 1126.5
Total Paid: 1126.5
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-228
            [amount] => 1126.5
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 07:08:59

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 2.3, Wish To Pay: 2.3, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 229
Inserting Item: Array
(
    [material_id] => 19002
    [quantity] => 1
    [unit_price] => 2.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 2.3
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-229: 2.3, Remaining: 0
Total Summary:
Grand Total: 2.3
Wish to Pay: 2.3
Total Paid: 2.3
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-229
            [amount] => 2.3
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 07:27:12

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 175, Wish To Pay: 175, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 230
Inserting Item: Array
(
    [material_id] => 24438
    [quantity] => 10
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 175
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-230: 175, Remaining: 0
Total Summary:
Grand Total: 175
Wish to Pay: 175
Total Paid: 175
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-230
            [amount] => 175
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 07:50:51

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 455, Wish To Pay: 455, Received: 620, Change: 165
Customer found: Walk In
Sale Order Inserted. ID: 231
Inserting Item: Array
(
    [material_id] => 28215
    [quantity] => 1
    [unit_price] => 250
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5888
    [quantity] => 10
    [unit_price] => 12.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 125
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17582
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-231: 455, Remaining: 0
Total Summary:
Grand Total: 455
Wish to Pay: 455
Total Paid: 455
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-231
            [amount] => 455
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 08:04:15

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 232
Inserting Item: Array
(
    [material_id] => 24569
    [quantity] => 10
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24896
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-232: 90, Remaining: 0
Total Summary:
Grand Total: 90
Wish to Pay: 90
Total Paid: 90
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-232
            [amount] => 90
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 08:22:16

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 7, Wish To Pay: 7, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 233
Inserting Item: Array
(
    [material_id] => 7245
    [quantity] => 1
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-233: 7, Remaining: 0
Total Summary:
Grand Total: 7
Wish to Pay: 7
Total Paid: 7
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-233
            [amount] => 7
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 09:20:07

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 241.3, Wish To Pay: 241.3, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 234
Inserting Item: Array
(
    [material_id] => 21657
    [quantity] => 10
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8213
    [quantity] => 7
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 84
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-234: 241.3, Remaining: 0
Total Summary:
Grand Total: 241.3
Wish to Pay: 241.3
Total Paid: 241.3
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-234
            [amount] => 241.3
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 10:11:47

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 235
Inserting Item: Array
(
    [material_id] => 2199
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 2199, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 10:38:58

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 236
Inserting Item: Array
(
    [material_id] => 25400
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 2199
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 2199, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 10:39:20

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 237
Inserting Item: Array
(
    [material_id] => 25400
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 2199
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 2199, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 10:39:56

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 238
Inserting Item: Array
(
    [material_id] => 25400
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-238: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-238
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 10:43:23

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 239
Inserting Item: Array
(
    [material_id] => 25400
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 2199
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 2199, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 10:44:05

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 240
Inserting Item: Array
(
    [material_id] => 25400
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-240: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-240
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 10:44:12

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 7, Wish To Pay: 7, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 241
Inserting Item: Array
(
    [material_id] => 15472
    [quantity] => 1
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-241: 7, Remaining: 0
Total Summary:
Grand Total: 7
Wish to Pay: 7
Total Paid: 7
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-241
            [amount] => 7
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 10:44:54

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 44, Wish To Pay: 44, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 242
Inserting Item: Array
(
    [material_id] => 5233
    [quantity] => 1
    [unit_price] => 44
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 44
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-242: 44, Remaining: 0
Total Summary:
Grand Total: 44
Wish to Pay: 44
Total Paid: 44
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-242
            [amount] => 44
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 10:46:04

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 81, Wish To Pay: 81, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 243
Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 4
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 14
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18799
    [quantity] => 6
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 42
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24338
    [quantity] => 10
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-243: 81, Remaining: 0
Total Summary:
Grand Total: 81
Wish to Pay: 81
Total Paid: 81
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-243
            [amount] => 81
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 10:51:58

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 244
Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 4
    [unit_price] => 11
    [discount_percent] => 9.09
    [discount_amount] => 4
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-244: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-244
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 11:02:45

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 4, Wish To Pay: 4, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 245
Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 4
    [unit_price] => 11
    [discount_percent] => 90.91
    [discount_amount] => 40
    [total_price] => 4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-245: 4, Remaining: 0
Total Summary:
Grand Total: 4
Wish to Pay: 4
Total Paid: 4
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-245
            [amount] => 4
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 11:04:03

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 5, Wish To Pay: 5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 246
Inserting Item: Array
(
    [material_id] => 5234
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-246: 5, Remaining: 0
Total Summary:
Grand Total: 5
Wish to Pay: 5
Total Paid: 5
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-246
            [amount] => 5
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 11:29:35

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 184, Wish To Pay: 184, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 247
Inserting Item: Array
(
    [material_id] => 26821
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 8
    [discount_amount] => 16
    [total_price] => 184
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-247: 184, Remaining: 0
Total Summary:
Grand Total: 184
Wish to Pay: 184
Total Paid: 184
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-247
            [amount] => 184
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 11:33:03

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 248
Inserting Item: Array
(
    [material_id] => 24569
    [quantity] => 10
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-248: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-248
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 11:34:18

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 249
Inserting Item: Array
(
    [material_id] => 7160
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-249: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-249
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 11:48:29

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 250
Inserting Item: Array
(
    [material_id] => 8239
    [quantity] => 10
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-250: 35, Remaining: 0
Total Summary:
Grand Total: 35
Wish to Pay: 35
Total Paid: 35
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-250
            [amount] => 35
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 11:51:46

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 4
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 578.68, Wish To Pay: 578.68, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 251
Inserting Item: Array
(
    [material_id] => 22158
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13309
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13280
    [quantity] => 10
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 175
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25391
    [quantity] => 12
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 264
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-251: 578.68, Remaining: 0
Total Summary:
Grand Total: 578.68
Wish to Pay: 578.68
Total Paid: 578.68
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-251
            [amount] => 578.68
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 12:10:42

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 160, Wish To Pay: 160, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 252
Inserting Item: Array
(
    [material_id] => 25376
    [quantity] => 10
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-252: 160, Remaining: 0
Total Summary:
Grand Total: 160
Wish to Pay: 160
Total Paid: 160
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-252
            [amount] => 160
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 12:29:14

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 28, Wish To Pay: 28, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 253
Inserting Item: Array
(
    [material_id] => 7809
    [quantity] => 4
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 28
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-253: 28, Remaining: 0
Total Summary:
Grand Total: 28
Wish to Pay: 28
Total Paid: 28
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-253
            [amount] => 28
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 12:30:01

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 590, Wish To Pay: 590, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 254
Inserting Item: Array
(
    [material_id] => 27963
    [quantity] => 30
    [unit_price] => 20
    [discount_percent] => 1.67
    [discount_amount] => 10
    [total_price] => 590
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-254: 590, Remaining: 0
Total Summary:
Grand Total: 590
Wish to Pay: 590
Total Paid: 590
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-254
            [amount] => 590
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 12:30:34

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 255
Inserting Item: Array
(
    [material_id] => 1936
    [quantity] => 20
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-255: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-255
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 12:31:17

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 5
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 540.08, Wish To Pay: 540.08, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 256
Inserting Item: Array
(
    [material_id] => 1569
    [quantity] => 10
    [unit_price] => 0.85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28979
    [quantity] => 5
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17070
    [quantity] => 10
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5265
    [quantity] => 5
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30077
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-256: 540.08, Remaining: 0
Total Summary:
Grand Total: 540.08
Wish to Pay: 540.08
Total Paid: 540.08
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-256
            [amount] => 540.08
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 12:54:12

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 902.1, Wish To Pay: 902.1, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 257
Inserting Item: Array
(
    [material_id] => 22573
    [quantity] => 10
    [unit_price] => 32
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 320
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22424
    [quantity] => 10
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 350
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30241
    [quantity] => 10
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-257: 902.1, Remaining: 0
Total Summary:
Grand Total: 902.1
Wish to Pay: 902.1
Total Paid: 902.1
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-257
            [amount] => 902.1
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 12:55:11

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 258
Inserting Item: Array
(
    [material_id] => 29280
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 29280, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 13:11:15

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 259
Inserting Item: Array
(
    [material_id] => 29280
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 29280, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 13:11:21

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 260
Inserting Item: Array
(
    [material_id] => 29280
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 29280, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 13:11:34

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 960, Wish To Pay: 960, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 261
Inserting Item: Array
(
    [material_id] => 13675
    [quantity] => 20
    [unit_price] => 48
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 960
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-261: 960, Remaining: 0
Total Summary:
Grand Total: 960
Wish to Pay: 960
Total Paid: 960
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-261
            [amount] => 960
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 13:20:52

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 262
Inserting Item: Array
(
    [material_id] => 1852
    [quantity] => 4
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-262: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-262
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 13:41:07

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 62, Wish To Pay: 62, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 263
Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28726
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28726, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 13:45:55

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 177.88, Wish To Pay: 177.88, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 264
Inserting Item: Array
(
    [material_id] => 24770
    [quantity] => 1
    [unit_price] => 130.88
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130.88
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30234
    [quantity] => 1
    [unit_price] => 47
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 47
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30234, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 13:52:51

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 177.88, Wish To Pay: 177.88, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 265
Inserting Item: Array
(
    [material_id] => 24770
    [quantity] => 1
    [unit_price] => 130.88
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130.88
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30234
    [quantity] => 1
    [unit_price] => 47
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 47
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30234, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 13:52:56

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1.2, Wish To Pay: 1.2, Received: 5, Change: 3.8
Customer found: Walk In
Sale Order Inserted. ID: 266
Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 1
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-266: 1.2, Remaining: 0
Total Summary:
Grand Total: 1.2
Wish to Pay: 1.2
Total Paid: 1.2
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-266
            [amount] => 1.2
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 13:56:28

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 267
Inserting Item: Array
(
    [material_id] => 17537
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-267: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-267
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 13:58:28

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 95, Wish To Pay: 95, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 268
Inserting Item: Array
(
    [material_id] => 22193
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 3.06
    [discount_amount] => 3
    [total_price] => 95
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-268: 95, Remaining: 0
Total Summary:
Grand Total: 95
Wish to Pay: 95
Total Paid: 95
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-268
            [amount] => 95
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 14:05:39

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 269
Inserting Item: Array
(
    [material_id] => 19625
    [quantity] => 20
    [unit_price] => 8
    [discount_percent] => 6.25
    [discount_amount] => 10
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-269: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-269
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 14:06:59

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 220, Wish To Pay: 220, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 270
Inserting Item: Array
(
    [material_id] => 30226
    [quantity] => 1
    [unit_price] => 236.33
    [discount_percent] => 6.91
    [discount_amount] => 16.33
    [total_price] => 220
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30226, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 14:10:21

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 271
Inserting Item: Array
(
    [material_id] => 30226
    [quantity] => 1
    [unit_price] => 236.33
    [discount_percent] => 15.37
    [discount_amount] => 36.33
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30226, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 14:15:07

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 330, Wish To Pay: 330, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 272
Inserting Item: Array
(
    [material_id] => 29220
    [quantity] => 1
    [unit_price] => 300
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27901
    [quantity] => 5
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-272: 330, Remaining: 0
Total Summary:
Grand Total: 330
Wish to Pay: 330
Total Paid: 330
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-272
            [amount] => 330
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 14:27:02

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 8, Wish To Pay: 8, Received: 8, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 273
Inserting Item: Array
(
    [material_id] => 13212
    [quantity] => 1
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-273: 8, Remaining: 0
Total Summary:
Grand Total: 8
Wish to Pay: 8
Total Paid: 8
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-273
            [amount] => 8
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 14:30:43

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1.2, Wish To Pay: 1.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 274
Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 1
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-274: 1.2, Remaining: 0
Total Summary:
Grand Total: 1.2
Wish to Pay: 1.2
Total Paid: 1.2
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-274
            [amount] => 1.2
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 14:32:54

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 320, Wish To Pay: 320, Received: 320, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 275
Inserting Item: Array
(
    [material_id] => 30045
    [quantity] => 1
    [unit_price] => 325
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 325
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-275: 320, Remaining: 0
Total Summary:
Grand Total: 320
Wish to Pay: 320
Total Paid: 320
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-275
            [amount] => 320
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 14:35:14

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 235, Wish To Pay: 235, Received: 235, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 276
Inserting Item: Array
(
    [material_id] => 28755
    [quantity] => 1
    [unit_price] => 210
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 210
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24338
    [quantity] => 10
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-276: 235, Remaining: 0
Total Summary:
Grand Total: 235
Wish to Pay: 235
Total Paid: 235
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-276
            [amount] => 235
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 14:50:18

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 120, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 277
Inserting Item: Array
(
    [material_id] => 30407
    [quantity] => 20
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-277: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-277
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 15:12:55

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 200, Change: 120
Customer found: Walk In
Sale Order Inserted. ID: 278
Inserting Item: Array
(
    [material_id] => 28934
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-278: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-278
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 15:15:08

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 30, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 279
Inserting Item: Array
(
    [material_id] => 1987
    [quantity] => 2
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 16
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 15472
    [quantity] => 2
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 14
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-279: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-279
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 15:18:45

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 22, Wish To Pay: 22, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 280
Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 2
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-280: 22, Remaining: 0
Total Summary:
Grand Total: 22
Wish to Pay: 22
Total Paid: 22
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-280
            [amount] => 22
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 15:26:45

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 4
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 560, Wish To Pay: 560, Received: 560, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 281
Inserting Item: Array
(
    [material_id] => 13799
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31629
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14178
    [quantity] => 1
    [unit_price] => 325
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 325
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31283
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-281: 560, Remaining: 0
Total Summary:
Grand Total: 560
Wish to Pay: 560
Total Paid: 560
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-281
            [amount] => 560
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 15:38:10

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 140, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 282
Inserting Item: Array
(
    [material_id] => 3781
    [quantity] => 20
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-282: 140, Remaining: 0
Total Summary:
Grand Total: 140
Wish to Pay: 140
Total Paid: 140
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-282
            [amount] => 140
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 15:51:00

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 340, Wish To Pay: 340, Received: 340, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 283
Inserting Item: Array
(
    [material_id] => 31229
    [quantity] => 1
    [unit_price] => 340
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 340
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-283: 340, Remaining: 0
Total Summary:
Grand Total: 340
Wish to Pay: 340
Total Paid: 340
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-283
            [amount] => 340
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 15:54:06

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 105, Wish To Pay: 105, Received: 105, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 284
Inserting Item: Array
(
    [material_id] => 21594
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24580
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-284: 105, Remaining: 0
Total Summary:
Grand Total: 105
Wish to Pay: 105
Total Paid: 105
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-284
            [amount] => 105
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 16:08:27

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 4
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 2200, Wish To Pay: 2200, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 285
Inserting Item: Array
(
    [material_id] => 30763
    [quantity] => 1
    [unit_price] => 1200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30115
    [quantity] => 2
    [unit_price] => 475
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 950
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30280
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31656
    [quantity] => 1
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-285: 2200, Remaining: 0
Total Summary:
Grand Total: 2200
Wish to Pay: 2200
Total Paid: 2200
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-285
            [amount] => 2200
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 16:16:50

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 450.2, Wish To Pay: 450.2, Received: 450, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 286
Inserting Item: Array
(
    [material_id] => 28103
    [quantity] => 1
    [unit_price] => 160
    [discount_percent] => 6.25
    [discount_amount] => 10
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21679
    [quantity] => 10
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17161
    [quantity] => 10
    [unit_price] => 13.32
    [discount_percent] => 2.25
    [discount_amount] => 3
    [total_price] => 130.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-286: 450.2, Remaining: 0
Total Summary:
Grand Total: 450.2
Wish to Pay: 450.2
Total Paid: 450.2
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-286
            [amount] => 450.2
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 16:21:18

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 4
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 303, Wish To Pay: 303, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 287
Inserting Item: Array
(
    [material_id] => 28345
    [quantity] => 5
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28345, Available: 0, Requested: 5
Script execution completed at: 2026-06-27 16:27:48

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 4
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 303, Wish To Pay: 303, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 288
Inserting Item: Array
(
    [material_id] => 28345
    [quantity] => 5
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28345, Available: 0, Requested: 5
Script execution completed at: 2026-06-27 16:29:09

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 4
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 303, Wish To Pay: 303, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 289
Inserting Item: Array
(
    [material_id] => 28345
    [quantity] => 5
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28345, Available: 0, Requested: 5
Script execution completed at: 2026-06-27 16:29:21

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-51' for key 'so_number'
Script execution completed at: 2026-06-27 16:30:17

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 291
Inserting Item: Array
(
    [material_id] => 1987
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-291: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-291
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 16:31:08

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 350, Wish To Pay: 350, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 292
Inserting Item: Array
(
    [material_id] => 17606
    [quantity] => 15
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 375
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-292: 350, Remaining: 0
Total Summary:
Grand Total: 350
Wish to Pay: 350
Total Paid: 350
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-292
            [amount] => 350
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 16:32:49

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 135, Wish To Pay: 135, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 293
Inserting Item: Array
(
    [material_id] => 24338
    [quantity] => 10
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9180
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-293: 135, Remaining: 0
Total Summary:
Grand Total: 135
Wish to Pay: 135
Total Paid: 135
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-293
            [amount] => 135
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 16:36:18

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 650, Wish To Pay: 650, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-53' for key 'so_number'
Script execution completed at: 2026-06-27 16:44:23

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 295
Inserting Item: Array
(
    [material_id] => 28429
    [quantity] => 1
    [unit_price] => 150
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-295: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-295
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 16:47:29

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 296
Inserting Item: Array
(
    [material_id] => 13490
    [quantity] => 15
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-296: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-296
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 16:48:10

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-57' for key 'so_number'
Script execution completed at: 2026-06-27 16:49:53

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 298
Inserting Item: Array
(
    [material_id] => 25196
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-298: 90, Remaining: 0
Total Summary:
Grand Total: 90
Wish to Pay: 90
Total Paid: 90
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-298
            [amount] => 90
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 16:50:07

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 65, Wish To Pay: 65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 299
Inserting Item: Array
(
    [material_id] => 28469
    [quantity] => 1
    [unit_price] => 65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 65
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28469, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 17:04:22

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 65, Wish To Pay: 65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 300
Inserting Item: Array
(
    [material_id] => 28468
    [quantity] => 1
    [unit_price] => 65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 65
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-300: 65, Remaining: 0
Total Summary:
Grand Total: 65
Wish to Pay: 65
Total Paid: 65
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-300
            [amount] => 65
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 17:04:50

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 620, Wish To Pay: 620, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 301
Inserting Item: Array
(
    [material_id] => 29849
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8313
    [quantity] => 12
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 420
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-301: 620, Remaining: 0
Total Summary:
Grand Total: 620
Wish to Pay: 620
Total Paid: 620
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-301
            [amount] => 620
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 17:05:48

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 7
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 1056.8, Wish To Pay: 1056.8, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 302
Inserting Item: Array
(
    [material_id] => 13287
    [quantity] => 20
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30408
    [quantity] => 10
    [unit_price] => 10.12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 101.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25445
    [quantity] => 20
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27877
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19085
    [quantity] => 30
    [unit_price] => 2.52
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 75.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30101
    [quantity] => 1
    [unit_price] => 415
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 415
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13359
    [quantity] => 10
    [unit_price] => 11.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 115
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-302: 1056.8, Remaining: 0
Total Summary:
Grand Total: 1056.8
Wish to Pay: 1056.8
Total Paid: 1056.8
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-302
            [amount] => 1056.8
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 17:23:40

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 783.75, Wish To Pay: 783.75, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 303
Inserting Item: Array
(
    [material_id] => 24438
    [quantity] => 10
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 175
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29658
    [quantity] => 10
    [unit_price] => 65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 650
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-303: 783.75, Remaining: 0
Total Summary:
Grand Total: 783.75
Wish to Pay: 783.75
Total Paid: 783.75
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-303
            [amount] => 783.75
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 17:25:17

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 21.8, Wish To Pay: 21.8, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 304
Inserting Item: Array
(
    [material_id] => 28220
    [quantity] => 2
    [unit_price] => 11
    [discount_percent] => 0.9
    [discount_amount] => 0.2
    [total_price] => 21.8
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-304: 21.8, Remaining: 0
Total Summary:
Grand Total: 21.8
Wish to Pay: 21.8
Total Paid: 21.8
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-304
            [amount] => 21.8
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 17:34:06

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 305
Inserting Item: Array
(
    [material_id] => 31498
    [quantity] => 1
    [unit_price] => 150
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-305: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-305
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 17:45:14

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 306
Inserting Item: Array
(
    [material_id] => 9131
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-306: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-306
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 17:47:46

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 307
Inserting Item: Array
(
    [material_id] => 28345
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-307: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-307
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 18:06:23

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-66' for key 'so_number'
Script execution completed at: 2026-06-27 18:07:58

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 309
Inserting Item: Array
(
    [material_id] => 28101
    [quantity] => 1
    [unit_price] => 150
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-309: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-309
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 18:11:23

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 347, Wish To Pay: 347, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 310
Inserting Item: Array
(
    [material_id] => 24505
    [quantity] => 5
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25092
    [quantity] => 5
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-310: 347, Remaining: 0
Total Summary:
Grand Total: 347
Wish to Pay: 347
Total Paid: 347
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-310
            [amount] => 347
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 18:21:32

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 311
Inserting Item: Array
(
    [material_id] => 24738
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-311: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-311
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 18:22:33

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 312
Inserting Item: Array
(
    [material_id] => 30548
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-312: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-312
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 18:25:07

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 625.6, Wish To Pay: 625.6, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 313
Inserting Item: Array
(
    [material_id] => 29860
    [quantity] => 10
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18928
    [quantity] => 20
    [unit_price] => 19
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 380
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-313: 625.6, Remaining: 0
Total Summary:
Grand Total: 625.6
Wish to Pay: 625.6
Total Paid: 625.6
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-313
            [amount] => 625.6
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 18:36:52

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 314
Inserting Item: Array
(
    [material_id] => 22347
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24383
    [quantity] => 20
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-314: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-314
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 18:39:30

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 315
Inserting Item: Array
(
    [material_id] => 28709
    [quantity] => 5
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-315: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-315
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 18:40:37

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 45, Wish To Pay: 45, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 316
Inserting Item: Array
(
    [material_id] => 30004
    [quantity] => 10
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 5
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-316: 45, Remaining: 0
Total Summary:
Grand Total: 45
Wish to Pay: 45
Total Paid: 45
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-316
            [amount] => 45
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 19:16:51

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 8, Wish To Pay: 8, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 317
Inserting Item: Array
(
    [material_id] => 28345
    [quantity] => 1
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-317: 8, Remaining: 0
Total Summary:
Grand Total: 8
Wish to Pay: 8
Total Paid: 8
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-317
            [amount] => 8
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 19:19:27

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 55, Wish To Pay: 55, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 318
Inserting Item: Array
(
    [material_id] => 30985
    [quantity] => 1
    [unit_price] => 57
    [discount_percent] => 3.51
    [discount_amount] => 2
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-318: 55, Remaining: 0
Total Summary:
Grand Total: 55
Wish to Pay: 55
Total Paid: 55
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-318
            [amount] => 55
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 19:23:55

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 39.5, Wish To Pay: 39.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 319
Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 5
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 17.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 2
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-319: 39.5, Remaining: 0
Total Summary:
Grand Total: 39.5
Wish to Pay: 39.5
Total Paid: 39.5
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-319
            [amount] => 39.5
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 19:33:54

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 399, Wish To Pay: 399, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 320
Inserting Item: Array
(
    [material_id] => 5579
    [quantity] => 15
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5797
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28183
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28183, Available: 0, Requested: 10
Script execution completed at: 2026-06-27 19:41:29

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 399, Wish To Pay: 399, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 321
Inserting Item: Array
(
    [material_id] => 5579
    [quantity] => 15
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5797
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28183
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28183, Available: 0, Requested: 10
Script execution completed at: 2026-06-27 19:44:45

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 249, Wish To Pay: 249, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 322
Inserting Item: Array
(
    [material_id] => 5579
    [quantity] => 15
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5797
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-322: 249, Remaining: 0
Total Summary:
Grand Total: 249
Wish to Pay: 249
Total Paid: 249
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-322
            [amount] => 249
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 19:50:21

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 5
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 445, Wish To Pay: 445, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 323
Inserting Item: Array
(
    [material_id] => 28183
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28183, Available: 0, Requested: 10
Script execution completed at: 2026-06-27 19:58:31

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 5
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 500, Wish To Pay: 500, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 324
Inserting Item: Array
(
    [material_id] => 28183
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28183, Available: 0, Requested: 10
Script execution completed at: 2026-06-27 19:59:13

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 4
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 405, Wish To Pay: 405, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 325
Inserting Item: Array
(
    [material_id] => 28183
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28183, Available: 0, Requested: 10
Script execution completed at: 2026-06-27 19:59:26

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 400, Wish To Pay: 400, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 326
Inserting Item: Array
(
    [material_id] => 28183
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28183, Available: 0, Requested: 10
Script execution completed at: 2026-06-27 19:59:36

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 400, Wish To Pay: 400, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 327
Inserting Item: Array
(
    [material_id] => 28183
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28183, Available: 0, Requested: 10
Script execution completed at: 2026-06-27 19:59:44

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 399, Wish To Pay: 399, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 328
Inserting Item: Array
(
    [material_id] => 5579
    [quantity] => 15
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5797
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28183
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28183, Available: 0, Requested: 10
Script execution completed at: 2026-06-27 20:00:40

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 249, Wish To Pay: 249, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 329
Inserting Item: Array
(
    [material_id] => 5579
    [quantity] => 15
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5797
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-329: 249, Remaining: 0
Total Summary:
Grand Total: 249
Wish to Pay: 249
Total Paid: 249
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-329
            [amount] => 249
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 20:00:51

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 330
Inserting Item: Array
(
    [material_id] => 28183
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28183, Available: 0, Requested: 10
Script execution completed at: 2026-06-27 20:02:24

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 331
Inserting Item: Array
(
    [material_id] => 31659
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-331: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-331
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 20:04:00

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 95, Wish To Pay: 95, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-80' for key 'so_number'
Script execution completed at: 2026-06-27 20:05:06

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 95, Wish To Pay: 95, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-80' for key 'so_number'
Script execution completed at: 2026-06-27 20:05:13

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 4
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 199, Wish To Pay: 199, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 334
Inserting Item: Array
(
    [material_id] => 30414
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30414, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 20:12:23

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 3
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 139, Wish To Pay: 139, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 335
Inserting Item: Array
(
    [material_id] => 30414
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30414, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 20:14:32

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 135, Wish To Pay: 135, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 336
Inserting Item: Array
(
    [material_id] => 30414
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30414, Available: 0, Requested: 1
Script execution completed at: 2026-06-27 20:14:39

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 337
Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-337: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-337
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 20:15:43

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 4, Wish To Pay: 4, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 338
Inserting Item: Array
(
    [material_id] => 18771
    [quantity] => 2
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-338: 4, Remaining: 0
Total Summary:
Grand Total: 4
Wish to Pay: 4
Total Paid: 4
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-338
            [amount] => 4
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 20:16:32

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 95, Wish To Pay: 95, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-80' for key 'so_number'
Script execution completed at: 2026-06-27 20:21:43

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 340
Inserting Item: Array
(
    [material_id] => 31308
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-340: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-340
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 20:22:09

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 341
Inserting Item: Array
(
    [material_id] => 28365
    [quantity] => 5
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-341: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-341
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 20:22:23

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 342
Inserting Item: Array
(
    [material_id] => 13313
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 1
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-342: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-342
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 20:48:26

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 5, Wish To Pay: 5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 343
Inserting Item: Array
(
    [material_id] => 28615
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-343: 5, Remaining: 0
Total Summary:
Grand Total: 5
Wish to Pay: 5
Total Paid: 5
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-343
            [amount] => 5
            [type] => Previous Sale Due Payment
            [date] => 2026-06-27
        )

)

Script execution completed at: 2026-06-27 20:56:37

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 5
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 858, Wish To Pay: 858, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 344
Inserting Item: Array
(
    [material_id] => 22192
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31367
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30834
    [quantity] => 1
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28107
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31231
    [quantity] => 1
    [unit_price] => 650
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 650
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-344: 858, Remaining: 0
Total Summary:
Grand Total: 858
Wish to Pay: 858
Total Paid: 858
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-344
            [amount] => 858
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 03:14:15

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 149.69, Wish To Pay: 149.69, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 345
Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 15
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 52.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13212
    [quantity] => 14
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 112
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-345: 149.69, Remaining: 0
Total Summary:
Grand Total: 149.69
Wish to Pay: 149.69
Total Paid: 149.69
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-345
            [amount] => 149.69
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 03:51:16

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 346
Inserting Item: Array
(
    [material_id] => 5455
    [quantity] => 12
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-346: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-346
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 04:00:28

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 2
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 108, Wish To Pay: 108, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 347
Inserting Item: Array
(
    [material_id] => 31160
    [quantity] => 1
    [unit_price] => 58
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 58
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30206
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-347: 108, Remaining: 0
Total Summary:
Grand Total: 108
Wish to Pay: 108
Total Paid: 108
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-347
            [amount] => 108
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 04:06:19

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 348
Inserting Item: Array
(
    [material_id] => 29402
    [quantity] => 1
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-348: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-348
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 04:33:38

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 349
Inserting Item: Array
(
    [material_id] => 30569
    [quantity] => 3
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-349: 300, Remaining: 0
Total Summary:
Grand Total: 300
Wish to Pay: 300
Total Paid: 300
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-349
            [amount] => 300
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 04:36:17

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 350
Inserting Item: Array
(
    [material_id] => 24255
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-350: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-350
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 04:55:17

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 9
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 945.31, Wish To Pay: 945.31, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 351
Inserting Item: Array
(
    [material_id] => 24274
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25653
    [quantity] => 10
    [unit_price] => 10.03
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100.3
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 850
    [quantity] => 8
    [unit_price] => 30.09
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240.72
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5700
    [quantity] => 20
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13136
    [quantity] => 10
    [unit_price] => 9.99
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 99.9
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17046
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30415
    [quantity] => 1
    [unit_price] => 65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 65
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7813
    [quantity] => 10
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-351: 945.31, Remaining: 0
Total Summary:
Grand Total: 945.31
Wish to Pay: 945.31
Total Paid: 945.31
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-351
            [amount] => 945.31
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 05:31:14

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 6
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 968.13, Wish To Pay: 968.13, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 352
Inserting Item: Array
(
    [material_id] => 1405
    [quantity] => 28
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 196
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13309
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22158
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13280
    [quantity] => 10
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 175
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22228
    [quantity] => 10
    [unit_price] => 14
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29388
    [quantity] => 8
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-352: 968.13, Remaining: 0
Total Summary:
Grand Total: 968.13
Wish to Pay: 968.13
Total Paid: 968.13
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-352
            [amount] => 968.13
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 05:39:38

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 353
Inserting Item: Array
(
    [material_id] => 31648
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-353: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-353
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 05:53:10

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 410, Wish To Pay: 410, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 354
Inserting Item: Array
(
    [material_id] => 13982
    [quantity] => 7
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 420
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-354: 410, Remaining: 0
Total Summary:
Grand Total: 410
Wish to Pay: 410
Total Paid: 410
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-354
            [amount] => 410
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 05:54:13

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 1
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 400, Change: 40
Customer found: Walk In
Sale Order Inserted. ID: 279
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 12
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-279: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Items Inserted: 1
Lot Raw Entries: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-279
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 09:51:48

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 280
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 12
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-280: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Items Inserted: 1
Lot Raw Entries: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-280
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 09:54:56

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 281
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 12
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-281: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Items Inserted: 1
Lot Raw Entries: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-281
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 09:56:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
    [1782634803698] => Array
        (
            [material_id] => 5645
            [batches] => Array
                (
                    [0] => Array
                        (
                            [expiry_id] => 19
                            [batch_no] => 202020
                            [qty] => 12
                        )

                )

        )

)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 1
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 282
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 12
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
    [1782634803698] => Array
        (
            [material_id] => 5645
            [batches] => Array
                (
                    [0] => Array
                        (
                            [expiry_id] => 19
                            [batch_no] => 202020
                            [qty] => 12
                        )

                )

        )

)

Processing rowData at index 1782634803698: Array
(
    [material_id] => 5645
    [batches] => Array
        (
            [0] => Array
                (
                    [expiry_id] => 19
                    [batch_no] => 202020
                    [qty] => 12
                )

        )

)

Batches found: 1
Batches: Array
(
    [0] => Array
        (
            [expiry_id] => 19
            [batch_no] => 202020
            [qty] => 12
        )

)

Batch 0 - lot: '202020', qty: 12, expiry_id: 19
Sale lot raw inserted: lot=202020, product_id=5645, qty=12
Expiry table updated: expiry_id=19, Old Qty: 45, New Qty: 33
Lot Raw Inserted: 1, Expiry Updated: 1
Previous Sale Due Paid for sel-282: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Items Inserted: 1
Lot Raw Entries: 1
Expiry Updated: 1
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-282
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 10:20:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 283
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 12
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-283: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-283
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 12:03:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 284
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 12
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

Raw batch items from items: Array
(
)

Final batch data to process: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-284: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-284
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 12:13:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 285
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 12
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-285: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-285
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 12:22:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 286
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 12
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-286: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-286
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 12:26:57

=== FORM DATA REQUEST ===
No files uploaded
Customer ID: 29
Items count: 1
Files uploaded: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 287
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 12
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Previous Sale Due Paid for sel-287: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-287
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 12:28:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
    [1782642580484] => Array
        (
            [material_id] => 5645
            [batches] => Array
                (
                    [0] => Array
                        (
                            [expiry_id] => 19
                            [batch_no] => 202020
                            [qty] => 11
                        )

                )

        )

)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 1
Payment Info - Prev Due: 0, To Pay: 330, Wish To Pay: 330, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 288
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 11
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 330
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
    [1782642580484] => Array
        (
            [material_id] => 5645
            [batches] => Array
                (
                    [0] => Array
                        (
                            [expiry_id] => 19
                            [batch_no] => 202020
                            [qty] => 11
                        )

                )

        )

)

Processing rowData at index 1782642580484: Array
(
    [material_id] => 5645
    [batches] => Array
        (
            [0] => Array
                (
                    [expiry_id] => 19
                    [batch_no] => 202020
                    [qty] => 11
                )

        )

)

Batches found: 1
Batches: Array
(
    [0] => Array
        (
            [expiry_id] => 19
            [batch_no] => 202020
            [qty] => 11
        )

)

Batch 0 - lot: '202020', qty: 11, expiry_id: 19
Sale lot raw inserted: lot=202020, product_id=5645, qty=11
Expiry table updated: expiry_id=19, Old Qty: 33, New Qty: 22
Lot Raw Inserted: 1, Expiry Updated: 1
Previous Sale Due Paid for sel-288: 330, Remaining: 0
Total Summary:
Grand Total: 330
Wish to Pay: 330
Total Paid: 330
Items Inserted: 1
Lot Raw Entries: 1
Expiry Updated: 1
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-288
            [amount] => 330
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 12:29:57

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => PO-287012
    [supplier_id] => 3
    [purchase_date] => 2026-06-28
    [payment_term] => cash
    [subtotal] => 162.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 162.00
    [notes] => 
    [amount_to_pay] => 162.00
    [acc] => 1
    [items] => [{"material_id":"9","item_type":"product","quantity":"3","unit_price":"54","discount_percent":"0.00","discount_flat":"0","total_price":"162.00"}]
    [batch_data] => {}
    [serial_data] => {"1782648605986":{"material_id":"9","serials":["25647","56987","456987"]}}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 162, Account ID: 1
Inserted PO ID: 162
Serials data received: Array
(
    [1782648605986] => Array
        (
            [material_id] => 9
            [serials] => Array
                (
                    [0] => 25647
                    [1] => 56987
                    [2] => 456987
                )

        )

)

Batch data received: Array
(
)

Processing item 0 - Type: product, ID: 9, Qty: 3
Product stock inserted for ID: 9
Serial_products stock updated: +3
Serial inserted: 25647
Serial inserted: 56987
Serial inserted: 456987
Purchase Pay record inserted with ID: 136
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => PO-28708749
    [supplier_id] => 3
    [purchase_date] => 2026-06-28
    [payment_term] => cash
    [subtotal] => 162.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 162.00
    [notes] => 
    [amount_to_pay] => 162.00
    [acc] => 1
    [items] => [{"material_id":"9","item_type":"product","quantity":"3","unit_price":"54","discount_percent":"0.00","discount_flat":"0","total_price":"162.00"}]
    [batch_data] => {}
    [serial_data] => {"1782649707526":{"material_id":"9","serials":["9632587","47145325","654123987"]}}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 162, Account ID: 1
Inserted PO ID: 163
Serials data received: Array
(
    [1782649707526] => Array
        (
            [material_id] => 9
            [serials] => Array
                (
                    [0] => 9632587
                    [1] => 47145325
                    [2] => 654123987
                )

        )

)

Batch data received: Array
(
)

Processing item 0 - Type: product, ID: 9, Qty: 3
Product stock inserted for ID: 9
Serial_products stock updated: +3
Serial inserted: 9632587
Serial inserted: 47145325
Serial inserted: 654123987
Purchase Pay record inserted with ID: 137
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
    [1782652101075] => Array
        (
            [material_id] => 5645
            [batches] => Array
                (
                    [0] => Array
                        (
                            [expiry_id] => 19
                            [batch_no] => 202020
                            [qty] => 5
                        )

                )

        )

)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 1
Payment Info - Prev Due: 0, To Pay: 285, Wish To Pay: 285, Received: 300, Change: 15
Customer found: Walk In
Sale Order Inserted. ID: 289
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 5
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9
    [quantity] => 2
    [unit_price] => 67.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 135
    [item_type] => product
    [serials] => Array
        (
            [0] => 25647
            [1] => 456987
        )

)

Serial_products table updated: product_id=9, Old Stock: 183, Sold: 2, New Stock: 181
Serial '25647' status updated to 'sold'
Serial '456987' status updated to 'sold'
=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
    [1782652101075] => Array
        (
            [material_id] => 5645
            [batches] => Array
                (
                    [0] => Array
                        (
                            [expiry_id] => 19
                            [batch_no] => 202020
                            [qty] => 5
                        )

                )

        )

)

Processing rowData at index 1782652101075: Array
(
    [material_id] => 5645
    [batches] => Array
        (
            [0] => Array
                (
                    [expiry_id] => 19
                    [batch_no] => 202020
                    [qty] => 5
                )

        )

)

Batches found: 1
Batches: Array
(
    [0] => Array
        (
            [expiry_id] => 19
            [batch_no] => 202020
            [qty] => 5
        )

)

Batch 0 - lot: '202020', qty: 5, expiry_id: 19
Sale lot raw inserted: lot=202020, product_id=5645, qty=5
Expiry table updated: expiry_id=19, Old Qty: 22, New Qty: 17
Lot Raw Inserted: 1, Expiry Updated: 1
Previous Sale Due Paid for sel-289: 285, Remaining: 0
Total Summary:
Grand Total: 285
Wish to Pay: 285
Total Paid: 285
Items Inserted: 2
Lot Raw Entries: 1
Expiry Updated: 1
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-289
            [amount] => 285
            [type] => Previous Sale Due Payment
            [date] => 2026-06-28
        )

)

Script execution completed at: 2026-06-28 15:09:15

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => pooe256
    [supplier_id] => 3
    [purchase_date] => 2026-06-29
    [payment_term] => cash
    [subtotal] => 12324.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 12324.00
    [notes] => 
    [amount_to_pay] => 12324.00
    [acc] => 1
    [items] => [{"material_id":"9","item_type":"product","quantity":"6","unit_price":"54","discount_percent":"0.00","discount_flat":"0","total_price":"324.00"},{"material_id":"5645","item_type":"raw","quantity":"1000.00","unit_price":"20","discount_percent":"0.00","discount_flat":"0","total_price":"12000.00"}]
    [batch_data] => {"1782734736440":{"material_id":"5645","batches":[{"batch_no":"650578","qty":"0325","expiry_date":"2028-06-29"},{"batch_no":"6987452","qty":"0100","expiry_date":"2028-06-29"},{"batch_no":"9874152","qty":"0575","expiry_date":"2028-06-29"}]}}
    [serial_data] => {"1782734687840":{"material_id":"9","serials":["7896546","7896545","7896544","7896543","7896542","7896541"]}}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 12324, Account ID: 1
Inserted PO ID: 164
Serials data received: Array
(
    [1782734687840] => Array
        (
            [material_id] => 9
            [serials] => Array
                (
                    [0] => 7896546
                    [1] => 7896545
                    [2] => 7896544
                    [3] => 7896543
                    [4] => 7896542
                    [5] => 7896541
                )

        )

)

Batch data received: Array
(
    [1782734736440] => Array
        (
            [material_id] => 5645
            [batches] => Array
                (
                    [0] => Array
                        (
                            [batch_no] => 650578
                            [qty] => 0325
                            [expiry_date] => 2028-06-29
                        )

                    [1] => Array
                        (
                            [batch_no] => 6987452
                            [qty] => 0100
                            [expiry_date] => 2028-06-29
                        )

                    [2] => Array
                        (
                            [batch_no] => 9874152
                            [qty] => 0575
                            [expiry_date] => 2028-06-29
                        )

                )

        )

)

Processing item 0 - Type: product, ID: 9, Qty: 6
Product stock inserted for ID: 9
Serial_products stock updated: +6
Serial inserted: 7896546
Serial inserted: 7896545
Serial inserted: 7896544
Serial inserted: 7896543
Serial inserted: 7896542
Serial inserted: 7896541
Processing item 1 - Type: raw, ID: 5645, Qty: 1000
History inserted for raw material: 5645
Products stock updated: +1000
Found batch data for material_id: 5645
Expiry SQL: INSERT INTO expiry (po_id, product_id, lot, quantity, item_type, expier_date) 
                                          VALUES (164, 5645, '650578', 325, 'raw', '2028-06-29')
Batch inserted: 650578
Expiry SQL: INSERT INTO expiry (po_id, product_id, lot, quantity, item_type, expier_date) 
                                          VALUES (164, 5645, '6987452', 100, 'raw', '2028-06-29')
Batch inserted: 6987452
Expiry SQL: INSERT INTO expiry (po_id, product_id, lot, quantity, item_type, expier_date) 
                                          VALUES (164, 5645, '9874152', 575, 'raw', '2028-06-29')
Batch inserted: 9874152
Purchase Pay record inserted with ID: 138
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
    [1782734984700] => Array
        (
            [material_id] => 5645
            [batches] => Array
                (
                    [0] => Array
                        (
                            [expiry_id] => 19
                            [batch_no] => 202020
                            [qty] => 10
                        )

                    [1] => Array
                        (
                            [expiry_id] => 23
                            [batch_no] => 650578
                            [qty] => 30
                        )

                )

        )

)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 1
Payment Info - Prev Due: 0, To Pay: 1402.5, Wish To Pay: 1402.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 290
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 40
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9
    [quantity] => 3
    [unit_price] => 67.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 202.5
    [item_type] => product
    [serials] => Array
        (
            [0] => 1234562
            [1] => 1234563
            [2] => 1234564
        )

)

Serial_products table updated: product_id=9, Old Stock: 297, Sold: 3, New Stock: 294
Serial '1234562' status updated to 'sold'
Serial '1234563' status updated to 'sold'
Serial '1234564' status updated to 'sold'
=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
    [1782734984700] => Array
        (
            [material_id] => 5645
            [batches] => Array
                (
                    [0] => Array
                        (
                            [expiry_id] => 19
                            [batch_no] => 202020
                            [qty] => 10
                        )

                    [1] => Array
                        (
                            [expiry_id] => 23
                            [batch_no] => 650578
                            [qty] => 30
                        )

                )

        )

)

Processing rowData at index 1782734984700: Array
(
    [material_id] => 5645
    [batches] => Array
        (
            [0] => Array
                (
                    [expiry_id] => 19
                    [batch_no] => 202020
                    [qty] => 10
                )

            [1] => Array
                (
                    [expiry_id] => 23
                    [batch_no] => 650578
                    [qty] => 30
                )

        )

)

Batches found: 2
Batches: Array
(
    [0] => Array
        (
            [expiry_id] => 19
            [batch_no] => 202020
            [qty] => 10
        )

    [1] => Array
        (
            [expiry_id] => 23
            [batch_no] => 650578
            [qty] => 30
        )

)

Batch 0 - lot: '202020', qty: 10, expiry_id: 19
Sale lot raw inserted: lot=202020, product_id=5645, qty=10
Expiry table updated: expiry_id=19, Old Qty: 17, New Qty: 7
Batch 1 - lot: '650578', qty: 30, expiry_id: 23
Sale lot raw inserted: lot=650578, product_id=5645, qty=30
Expiry table updated: expiry_id=23, Old Qty: 325, New Qty: 295
Lot Raw Inserted: 2, Expiry Updated: 2
Previous Sale Due Paid for sel-290: 1402.5, Remaining: 0
Total Summary:
Grand Total: 1402.5
Wish to Pay: 1402.5
Total Paid: 1402.5
Items Inserted: 2
Lot Raw Entries: 2
Expiry Updated: 2
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-290
            [amount] => 1402.5
            [type] => Previous Sale Due Payment
            [date] => 2026-06-29
        )

)

Script execution completed at: 2026-06-29 14:10:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
    [1782754070803] => Array
        (
            [material_id] => 5645
            [batches] => Array
                (
                    [0] => Array
                        (
                            [expiry_id] => 19
                            [batch_no] => 202020
                            [qty] => 5
                        )

                    [1] => Array
                        (
                            [expiry_id] => 23
                            [batch_no] => 650578
                            [qty] => 10
                        )

                )

        )

)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 1
Payment Info - Prev Due: 0, To Pay: 787.5, Wish To Pay: 787.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 291
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 15
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 450
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9
    [quantity] => 5
    [unit_price] => 67.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 337.5
    [item_type] => product
    [serials] => Array
        (
            [0] => 7896541
            [1] => 7896542
            [2] => 7896543
            [3] => 7896544
            [4] => 7896545
        )

)

Serial_products table updated: product_id=9, Old Stock: 294, Sold: 5, New Stock: 289
Serial '7896541' status updated to 'sold'
Serial '7896542' status updated to 'sold'
Serial '7896543' status updated to 'sold'
Serial '7896544' status updated to 'sold'
Serial '7896545' status updated to 'sold'
=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
    [1782754070803] => Array
        (
            [material_id] => 5645
            [batches] => Array
                (
                    [0] => Array
                        (
                            [expiry_id] => 19
                            [batch_no] => 202020
                            [qty] => 5
                        )

                    [1] => Array
                        (
                            [expiry_id] => 23
                            [batch_no] => 650578
                            [qty] => 10
                        )

                )

        )

)

Processing rowData at index 1782754070803: Array
(
    [material_id] => 5645
    [batches] => Array
        (
            [0] => Array
                (
                    [expiry_id] => 19
                    [batch_no] => 202020
                    [qty] => 5
                )

            [1] => Array
                (
                    [expiry_id] => 23
                    [batch_no] => 650578
                    [qty] => 10
                )

        )

)

Batches found: 2
Batches: Array
(
    [0] => Array
        (
            [expiry_id] => 19
            [batch_no] => 202020
            [qty] => 5
        )

    [1] => Array
        (
            [expiry_id] => 23
            [batch_no] => 650578
            [qty] => 10
        )

)

Batch 0 - lot: '202020', qty: 5, expiry_id: 19
Sale lot raw inserted: lot=202020, product_id=5645, qty=5
Expiry table updated: expiry_id=19, Old Qty: 10, New Qty: 5
Batch 1 - lot: '650578', qty: 10, expiry_id: 23
Sale lot raw inserted: lot=650578, product_id=5645, qty=10
Expiry table updated: expiry_id=23, Old Qty: 300, New Qty: 290
Lot Raw Inserted: 2, Expiry Updated: 2
Previous Sale Due Paid for sel-291: 787.5, Remaining: 0
Total Summary:
Grand Total: 787.5
Wish to Pay: 787.5
Total Paid: 787.5
Items Inserted: 2
Lot Raw Entries: 2
Expiry Updated: 2
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-291
            [amount] => 787.5
            [type] => Previous Sale Due Payment
            [date] => 2026-06-29
        )

)

Script execution completed at: 2026-06-29 19:31:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 487
Inserting Item: Array
(
    [material_id] => 29509
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30661
    [quantity] => 4
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-487: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-487
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-06-29
        )

)

Script execution completed at: 2026-06-29 18:05:09

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 468.9, Wish To Pay: 468.9, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 488
Inserting Item: Array
(
    [material_id] => 22734
    [quantity] => 7
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 420
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30542
    [quantity] => 4
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30542, Available: 0, Requested: 4
Stack trace: #0 {main}
Script execution completed at: 2026-06-29 18:14:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 489
Inserting Item: Array
(
    [material_id] => 26542
    [quantity] => 5
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31259
    [quantity] => 5
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5064
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-489: 180, Remaining: 0
Total Summary:
Grand Total: 180
Wish to Pay: 180
Total Paid: 180
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-489
            [amount] => 180
            [type] => Previous Sale Due Payment
            [date] => 2026-06-29
        )

)

Script execution completed at: 2026-06-29 18:27:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 574.98, Wish To Pay: 574.98, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 490
Inserting Item: Array
(
    [material_id] => 30542
    [quantity] => 6
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19132
    [quantity] => 4
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 32
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22734
    [quantity] => 7
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 420
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 4
    [unit_price] => 3.9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13778
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 5
    [discount_amount] => 5
    [total_price] => 95
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8851
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28615
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-490: 574.98, Remaining: 0
Total Summary:
Grand Total: 574.98
Wish to Pay: 574.98
Total Paid: 574.98
Items Inserted: 7
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-490
            [amount] => 574.98
            [type] => Previous Sale Due Payment
            [date] => 2026-06-29
        )

)

Script execution completed at: 2026-06-29 18:39:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 491
Inserting Item: Array
(
    [material_id] => 4169
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-491: 90, Remaining: 0
Total Summary:
Grand Total: 90
Wish to Pay: 90
Total Paid: 90
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-491
            [amount] => 90
            [type] => Previous Sale Due Payment
            [date] => 2026-06-29
        )

)

Script execution completed at: 2026-06-29 18:40:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 163, Wish To Pay: 163, Received: 60, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 492
Inserting Item: Array
(
    [material_id] => 27884
    [quantity] => 1
    [unit_price] => 150
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-492: 163, Remaining: 0
Total Summary:
Grand Total: 163
Wish to Pay: 163
Total Paid: 163
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-492
            [amount] => 163
            [type] => Previous Sale Due Payment
            [date] => 2026-06-29
        )

)

Script execution completed at: 2026-06-29 18:43:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 760, Wish To Pay: 760, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 493
Inserting Item: Array
(
    [material_id] => 26897
    [quantity] => 1
    [unit_price] => 695
    [discount_percent] => 0.72
    [discount_amount] => 5
    [total_price] => 690
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-493: 760, Remaining: 0
Total Summary:
Grand Total: 760
Wish to Pay: 760
Total Paid: 760
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-493
            [amount] => 760
            [type] => Previous Sale Due Payment
            [date] => 2026-06-29
        )

)

Script execution completed at: 2026-06-29 18:56:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 765, Wish To Pay: 765, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 494
Inserting Item: Array
(
    [material_id] => 3846
    [quantity] => 1
    [unit_price] => 850
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 850
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-494: 765, Remaining: 0
Total Summary:
Grand Total: 765
Wish to Pay: 765
Total Paid: 765
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-494
            [amount] => 765
            [type] => Previous Sale Due Payment
            [date] => 2026-06-29
        )

)

Script execution completed at: 2026-06-29 19:01:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180.5, Wish To Pay: 180.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 495
Inserting Item: Array
(
    [material_id] => 24861
    [quantity] => 10
    [unit_price] => 2.8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 28
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5064
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28696
    [quantity] => 10
    [unit_price] => 1.75
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 17.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13375
    [quantity] => 10
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19069
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30733
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 50
    [discount_amount] => 5
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-495: 180.5, Remaining: 0
Total Summary:
Grand Total: 180.5
Wish to Pay: 180.5
Total Paid: 180.5
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-495
            [amount] => 180.5
            [type] => Previous Sale Due Payment
            [date] => 2026-06-29
        )

)

Script execution completed at: 2026-06-29 19:12:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 496
Inserting Item: Array
(
    [material_id] => 31733
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-496: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-496
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-06-29
        )

)

Script execution completed at: 2026-06-29 19:18:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 27, Wish To Pay: 27, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 497
Inserting Item: Array
(
    [material_id] => 21594
    [quantity] => 3
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 27
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-497: 27, Remaining: 0
Total Summary:
Grand Total: 27
Wish to Pay: 27
Total Paid: 27
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-497
            [amount] => 27
            [type] => Previous Sale Due Payment
            [date] => 2026-06-29
        )

)

Script execution completed at: 2026-06-29 19:24:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 498
Inserting Item: Array
(
    [material_id] => 12412
    [quantity] => 1
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-498: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-498
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 03:31:36

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 36, Wish To Pay: 36, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 499
Inserting Item: Array
(
    [material_id] => 18772
    [quantity] => 40
    [unit_price] => 0.65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 26
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24378
    [quantity] => 10
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-499: 36, Remaining: 0
Total Summary:
Grand Total: 36
Wish to Pay: 36
Total Paid: 36
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-499
            [amount] => 36
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 04:06:50

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 500
Inserting Item: Array
(
    [material_id] => 28886
    [quantity] => 18
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-500: 90, Remaining: 0
Total Summary:
Grand Total: 90
Wish to Pay: 90
Total Paid: 90
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-500
            [amount] => 90
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 04:21:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 15.4, Wish To Pay: 15.4, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 501
Inserting Item: Array
(
    [material_id] => 1912
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18437
    [quantity] => 4
    [unit_price] => 0.85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 3.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-501: 15.4, Remaining: 0
Total Summary:
Grand Total: 15.4
Wish to Pay: 15.4
Total Paid: 15.4
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-501
            [amount] => 15.4
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 05:00:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 88, Wish To Pay: 88, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 502
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12098
    [quantity] => 4
    [unit_price] => 4.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 18
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-502: 88, Remaining: 0
Total Summary:
Grand Total: 88
Wish to Pay: 88
Total Paid: 88
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-502
            [amount] => 88
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 05:31:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2, Wish To Pay: 2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 503
Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 1
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-503: 2, Remaining: 0
Total Summary:
Grand Total: 2
Wish to Pay: 2
Total Paid: 2
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-503
            [amount] => 2
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 05:33:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 504
Inserting Item: Array
(
    [material_id] => 31152
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 11.11
    [discount_amount] => 10
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-504: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-504
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 05:37:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 505
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 20
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24258
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-505: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-505
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 05:38:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 506
Inserting Item: Array
(
    [material_id] => 31659
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 6.67
    [discount_amount] => 10
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-506: 140, Remaining: 0
Total Summary:
Grand Total: 140
Wish to Pay: 140
Total Paid: 140
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-506
            [amount] => 140
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 05:43:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 295, Wish To Pay: 295, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 507
Inserting Item: Array
(
    [material_id] => 3887
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24752
    [quantity] => 1
    [unit_price] => 55
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-507: 295, Remaining: 0
Total Summary:
Grand Total: 295
Wish to Pay: 295
Total Paid: 295
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-507
            [amount] => 295
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 05:48:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 121, Wish To Pay: 121, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 508
Inserting Item: Array
(
    [material_id] => 28602
    [quantity] => 1
    [unit_price] => 95
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 95
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5235
    [quantity] => 1
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18771
    [quantity] => 3
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-508: 121, Remaining: 0
Total Summary:
Grand Total: 121
Wish to Pay: 121
Total Paid: 121
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-508
            [amount] => 121
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 05:58:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 210, Wish To Pay: 210, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 509
Inserting Item: Array
(
    [material_id] => 24787
    [quantity] => 14
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 210
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-509: 210, Remaining: 0
Total Summary:
Grand Total: 210
Wish to Pay: 210
Total Paid: 210
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-509
            [amount] => 210
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 06:19:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 45, Wish To Pay: 45, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 510
Inserting Item: Array
(
    [material_id] => 8891
    [quantity] => 3
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-510: 45, Remaining: 0
Total Summary:
Grand Total: 45
Wish to Pay: 45
Total Paid: 45
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-510
            [amount] => 45
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 06:40:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 170, Wish To Pay: 170, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 511
Inserting Item: Array
(
    [material_id] => 31103
    [quantity] => 1
    [unit_price] => 165
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 165
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-511: 170, Remaining: 0
Total Summary:
Grand Total: 170
Wish to Pay: 170
Total Paid: 170
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-511
            [amount] => 170
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 06:41:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 45, Wish To Pay: 45, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 512
Inserting Item: Array
(
    [material_id] => 27991
    [quantity] => 2
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5860
    [quantity] => 10
    [unit_price] => 1.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-512: 45, Remaining: 0
Total Summary:
Grand Total: 45
Wish to Pay: 45
Total Paid: 45
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-512
            [amount] => 45
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 07:18:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-229' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-06-30 07:19:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 514
Inserting Item: Array
(
    [material_id] => 7992
    [quantity] => 14
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25248
    [quantity] => 10
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21594
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-514: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-514
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 07:20:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 515
Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 1
    [unit_price] => 11
    [discount_percent] => 9.09
    [discount_amount] => 1
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-515: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-515
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 07:51:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 230.5, Wish To Pay: 230.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 516
Inserting Item: Array
(
    [material_id] => 24345
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9004
    [quantity] => 10
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28435
    [quantity] => 2
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29182
    [quantity] => 35
    [unit_price] => 0.7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 2
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 4
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-516: 230.5, Remaining: 0
Total Summary:
Grand Total: 230.5
Wish to Pay: 230.5
Total Paid: 230.5
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-516
            [amount] => 230.5
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 08:01:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 134, Wish To Pay: 134, Received: 12, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 517
Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 100
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-517: 134, Remaining: 0
Total Summary:
Grand Total: 134
Wish to Pay: 134
Total Paid: 134
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-517
            [amount] => 134
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 08:05:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 580, Wish To Pay: 580, Received: 1000, Change: 420
Customer found: Walk In
Sale Order Inserted. ID: 518
Inserting Item: Array
(
    [material_id] => 12102
    [quantity] => 50
    [unit_price] => 12
    [discount_percent] => 3.33
    [discount_amount] => 20
    [total_price] => 580
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-518: 580, Remaining: 0
Total Summary:
Grand Total: 580
Wish to Pay: 580
Total Paid: 580
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-518
            [amount] => 580
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 08:49:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 519
Inserting Item: Array
(
    [material_id] => 294
    [quantity] => 10
    [unit_price] => 1.43
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 14.3
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22158
    [quantity] => 3
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 27
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28934
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-519: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-519
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 09:17:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 92.65, Wish To Pay: 92.65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 520
Inserting Item: Array
(
    [material_id] => 12725
    [quantity] => 5
    [unit_price] => 18.53
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 92.65
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-520: 92.65, Remaining: 0
Total Summary:
Grand Total: 92.65
Wish to Pay: 92.65
Total Paid: 92.65
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-520
            [amount] => 92.65
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 09:44:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 880.12, Wish To Pay: 880.12, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 521
Inserting Item: Array
(
    [material_id] => 13426
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5700
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5860
    [quantity] => 10
    [unit_price] => 1.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 26741
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 26581
    [quantity] => 9
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 157.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31737
    [quantity] => 1
    [unit_price] => 500
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 500
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-521: 880.12, Remaining: 0
Total Summary:
Grand Total: 880.12
Wish to Pay: 880.12
Total Paid: 880.12
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-521
            [amount] => 880.12
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 10:20:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 65, Wish To Pay: 65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 522
Inserting Item: Array
(
    [material_id] => 7808
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25401
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17016
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-522: 65, Remaining: 0
Total Summary:
Grand Total: 65
Wish to Pay: 65
Total Paid: 65
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-522
            [amount] => 65
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 10:24:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 700, Wish To Pay: 700, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 523
Inserting Item: Array
(
    [material_id] => 28319
    [quantity] => 1
    [unit_price] => 23
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 23
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28319, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-06-30 10:29:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 700, Wish To Pay: 700, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 524
Inserting Item: Array
(
    [material_id] => 31242
    [quantity] => 1
    [unit_price] => 720.01
    [discount_percent] => 5.56
    [discount_amount] => 40
    [total_price] => 680.01
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30524
    [quantity] => 1
    [unit_price] => 25.8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25.8
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-524: 700, Remaining: 0
Total Summary:
Grand Total: 700
Wish to Pay: 700
Total Paid: 700
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-524
            [amount] => 700
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 10:30:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 45, Wish To Pay: 45, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 525
Inserting Item: Array
(
    [material_id] => 5645
    [quantity] => 2
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 16
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5455
    [quantity] => 4
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 4
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-525: 45, Remaining: 0
Total Summary:
Grand Total: 45
Wish to Pay: 45
Total Paid: 45
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-525
            [amount] => 45
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 10:48:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 74, Wish To Pay: 74, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 526
Inserting Item: Array
(
    [material_id] => 18561
    [quantity] => 10
    [unit_price] => 5.8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 58
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 3
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 1
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-526: 74, Remaining: 0
Total Summary:
Grand Total: 74
Wish to Pay: 74
Total Paid: 74
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-526
            [amount] => 74
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 11:03:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100.3, Wish To Pay: 100.3, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 527
Inserting Item: Array
(
    [material_id] => 528
    [quantity] => 10
    [unit_price] => 10.03
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100.3
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-527: 100.3, Remaining: 0
Total Summary:
Grand Total: 100.3
Wish to Pay: 100.3
Total Paid: 100.3
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-527
            [amount] => 100.3
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 11:09:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 528
Inserting Item: Array
(
    [material_id] => 21625
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-528: 90, Remaining: 0
Total Summary:
Grand Total: 90
Wish to Pay: 90
Total Paid: 90
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-528
            [amount] => 90
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 11:54:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 78, Wish To Pay: 78, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 529
Inserting Item: Array
(
    [material_id] => 5267
    [quantity] => 1
    [unit_price] => 78
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 78
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-529: 78, Remaining: 0
Total Summary:
Grand Total: 78
Wish to Pay: 78
Total Paid: 78
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-529
            [amount] => 78
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 13:19:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 530
Inserting Item: Array
(
    [material_id] => 5236
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30517
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31348
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-530: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-530
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 13:31:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 531
Inserting Item: Array
(
    [material_id] => 28473
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-531: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-531
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 13:33:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 532
Inserting Item: Array
(
    [material_id] => 13229
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-532: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-532
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 13:35:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 533
Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 2
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-533: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-533
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 13:44:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 55, Wish To Pay: 55, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 534
Inserting Item: Array
(
    [material_id] => 28030
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17582
    [quantity] => 5
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-534: 55, Remaining: 0
Total Summary:
Grand Total: 55
Wish to Pay: 55
Total Paid: 55
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-534
            [amount] => 55
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 13:46:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 535
Inserting Item: Array
(
    [material_id] => 28364
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-535: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-535
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 13:48:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 117, Wish To Pay: 117, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 536
Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25196
    [quantity] => 5
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8891
    [quantity] => 4
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-536: 117, Remaining: 0
Total Summary:
Grand Total: 117
Wish to Pay: 117
Total Paid: 117
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-536
            [amount] => 117
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 13:49:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1.2, Wish To Pay: 1.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 537
Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 1
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-537: 1.2, Remaining: 0
Total Summary:
Grand Total: 1.2
Wish to Pay: 1.2
Total Paid: 1.2
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-537
            [amount] => 1.2
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 13:53:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 450, Wish To Pay: 450, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 538
Inserting Item: Array
(
    [material_id] => 30449
    [quantity] => 1
    [unit_price] => 475
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 475
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-538: 450, Remaining: 0
Total Summary:
Grand Total: 450
Wish to Pay: 450
Total Paid: 450
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-538
            [amount] => 450
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 13:55:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 539
Inserting Item: Array
(
    [material_id] => 24277
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-539: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-539
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 13:58:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 620, Wish To Pay: 620, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 540
Inserting Item: Array
(
    [material_id] => 31230
    [quantity] => 1
    [unit_price] => 620
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 620
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-540: 620, Remaining: 0
Total Summary:
Grand Total: 620
Wish to Pay: 620
Total Paid: 620
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-540
            [amount] => 620
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 14:13:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 307.8, Wish To Pay: 307.8, Received: 500, Change: 192.2
Customer found: Walk In
Sale Order Inserted. ID: 541
Inserting Item: Array
(
    [material_id] => 25377
    [quantity] => 18
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 324
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-541: 307.8, Remaining: 0
Total Summary:
Grand Total: 307.8
Wish to Pay: 307.8
Total Paid: 307.8
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-541
            [amount] => 307.8
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 14:28:10

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 150, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 542
Inserting Item: Array
(
    [material_id] => 18979
    [quantity] => 14
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 77
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5230
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-542: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-542
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 14:30:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1000, Wish To Pay: 1000, Received: 1000, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 543
Inserting Item: Array
(
    [material_id] => 24223
    [quantity] => 14
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 840
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13313
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9413
    [quantity] => 4
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 28
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24965
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-543: 1000, Remaining: 0
Total Summary:
Grand Total: 1000
Wish to Pay: 1000
Total Paid: 1000
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-543
            [amount] => 1000
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 14:50:45

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 22, Wish To Pay: 22, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 544
Inserting Item: Array
(
    [material_id] => 29757
    [quantity] => 2
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-544: 22, Remaining: 0
Total Summary:
Grand Total: 22
Wish to Pay: 22
Total Paid: 22
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-544
            [amount] => 22
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 15:05:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 100, Change: 10
Customer found: Walk In
Sale Order Inserted. ID: 545
Inserting Item: Array
(
    [material_id] => 25100
    [quantity] => 10
    [unit_price] => 1.8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 18
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28246
    [quantity] => 10
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24904
    [quantity] => 20
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-545: 90, Remaining: 0
Total Summary:
Grand Total: 90
Wish to Pay: 90
Total Paid: 90
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-545
            [amount] => 90
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 15:10:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 520.9, Wish To Pay: 520.9, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 546
Inserting Item: Array
(
    [material_id] => 18743
    [quantity] => 6
    [unit_price] => 1.15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6.9
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31576
    [quantity] => 1
    [unit_price] => 550
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 550
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-546: 520.9, Remaining: 0
Total Summary:
Grand Total: 520.9
Wish to Pay: 520.9
Total Paid: 520.9
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-546
            [amount] => 520.9
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 15:18:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 547
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-547: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-547
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 15:19:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 470, Wish To Pay: 470, Received: 500, Change: 30
Customer found: Walk In
Sale Order Inserted. ID: 548
Inserting Item: Array
(
    [material_id] => 17607
    [quantity] => 10
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 500
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-548: 470, Remaining: 0
Total Summary:
Grand Total: 470
Wish to Pay: 470
Total Paid: 470
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-548
            [amount] => 470
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 15:22:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 418, Wish To Pay: 418, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 549
Inserting Item: Array
(
    [material_id] => 21661
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21650
    [quantity] => 10
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 21650, Available: 0, Requested: 10
Stack trace: #0 {main}
Script execution completed at: 2026-06-30 15:26:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 418, Wish To Pay: 418, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 550
Inserting Item: Array
(
    [material_id] => 21661
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21650
    [quantity] => 10
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 21650, Available: 0, Requested: 10
Stack trace: #0 {main}
Script execution completed at: 2026-06-30 15:26:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 418, Wish To Pay: 418, Received: 1000, Change: 582
Customer found: Walk In
Sale Order Inserted. ID: 551
Inserting Item: Array
(
    [material_id] => 21661
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21650
    [quantity] => 10
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18928
    [quantity] => 10
    [unit_price] => 19
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 190
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-551: 418, Remaining: 0
Total Summary:
Grand Total: 418
Wish to Pay: 418
Total Paid: 418
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-551
            [amount] => 418
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 15:29:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 910, Wish To Pay: 910, Received: 1000, Change: 90
Customer found: Walk In
Sale Order Inserted. ID: 552
Inserting Item: Array
(
    [material_id] => 5673
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30655
    [quantity] => 10
    [unit_price] => 14
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21679
    [quantity] => 10
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29370
    [quantity] => 5
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 125
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8142
    [quantity] => 14
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 252
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28384
    [quantity] => 10
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-552: 910, Remaining: 0
Total Summary:
Grand Total: 910
Wish to Pay: 910
Total Paid: 910
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-552
            [amount] => 910
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 15:36:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 280, Wish To Pay: 280, Received: 300, Change: 20
Customer found: Walk In
Sale Order Inserted. ID: 553
Inserting Item: Array
(
    [material_id] => 16650
    [quantity] => 10
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-553: 280, Remaining: 0
Total Summary:
Grand Total: 280
Wish to Pay: 280
Total Paid: 280
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-553
            [amount] => 280
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 15:37:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 554
Inserting Item: Array
(
    [material_id] => 13390
    [quantity] => 20
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-554: 140, Remaining: 0
Total Summary:
Grand Total: 140
Wish to Pay: 140
Total Paid: 140
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-554
            [amount] => 140
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 15:46:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 500, Change: 400
Customer found: Walk In
Sale Order Inserted. ID: 555
Inserting Item: Array
(
    [material_id] => 22192
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-555: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-555
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 15:47:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 556
Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-556: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-556
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 15:53:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 65, Wish To Pay: 65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 557
Inserting Item: Array
(
    [material_id] => 5830
    [quantity] => 1
    [unit_price] => 65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 65
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-557: 65, Remaining: 0
Total Summary:
Grand Total: 65
Wish to Pay: 65
Total Paid: 65
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-557
            [amount] => 65
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 16:06:45

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 250, Wish To Pay: 250, Received: 250, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 558
Inserting Item: Array
(
    [material_id] => 29111
    [quantity] => 1
    [unit_price] => 260
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 260
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-558: 250, Remaining: 0
Total Summary:
Grand Total: 250
Wish to Pay: 250
Total Paid: 250
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-558
            [amount] => 250
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 16:26:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 559
Inserting Item: Array
(
    [material_id] => 3703
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-559: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-559
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 16:35:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 890, Wish To Pay: 890, Received: 1000, Change: 110
Customer found: Walk In
Error: Duplicate entry 'SO-2026-271' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-06-30 16:46:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 890, Wish To Pay: 890, Received: 1000, Change: 110
Customer found: Walk In
Error: Duplicate entry 'SO-2026-271' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-06-30 16:46:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 755, Wish To Pay: 755, Received: 1000, Change: 245
Customer found: Walk In
Error: Duplicate entry 'SO-2026-271' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-06-30 16:46:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 660, Wish To Pay: 660, Received: 660, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 563
Inserting Item: Array
(
    [material_id] => 29935
    [quantity] => 1
    [unit_price] => 680
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 680
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-563: 660, Remaining: 0
Total Summary:
Grand Total: 660
Wish to Pay: 660
Total Paid: 660
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-563
            [amount] => 660
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 16:50:36

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 890, Wish To Pay: 890, Received: 1000, Change: 110
Customer found: Walk In
Sale Order Inserted. ID: 564
Inserting Item: Array
(
    [material_id] => 12532
    [quantity] => 1
    [unit_price] => 710
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 710
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27754
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25196
    [quantity] => 4
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 36
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31388
    [quantity] => 1
    [unit_price] => 135
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 135
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-564: 890, Remaining: 0
Total Summary:
Grand Total: 890
Wish to Pay: 890
Total Paid: 890
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-564
            [amount] => 890
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 16:52:45

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 565
Inserting Item: Array
(
    [material_id] => 29978
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-565: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-565
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 16:55:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 566
Inserting Item: Array
(
    [material_id] => 5269
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-566: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-566
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 17:01:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 567
Inserting Item: Array
(
    [material_id] => 18757
    [quantity] => 4
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 28
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18684
    [quantity] => 2
    [unit_price] => 6.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 13
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-567: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-567
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 17:19:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 568
Inserting Item: Array
(
    [material_id] => 27893
    [quantity] => 5
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-568: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-568
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 17:22:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 530.3, Wish To Pay: 530.3, Received: 530, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 569
Inserting Item: Array
(
    [material_id] => 31504
    [quantity] => 10
    [unit_price] => 53.33
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 533.3
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-569: 530.3, Remaining: 0
Total Summary:
Grand Total: 530.3
Wish to Pay: 530.3
Total Paid: 530.3
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-569
            [amount] => 530.3
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 17:41:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 570
Inserting Item: Array
(
    [material_id] => 4687
    [quantity] => 4
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-570: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-570
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 17:42:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 800, Wish To Pay: 800, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 571
Inserting Item: Array
(
    [material_id] => 5085
    [quantity] => 10
    [unit_price] => 85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 850
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-571: 800, Remaining: 0
Total Summary:
Grand Total: 800
Wish to Pay: 800
Total Paid: 800
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-571
            [amount] => 800
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 18:06:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 49, Wish To Pay: 49, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 572
Inserting Item: Array
(
    [material_id] => 30004
    [quantity] => 10
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 15472
    [quantity] => 2
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 14
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-572: 49, Remaining: 0
Total Summary:
Grand Total: 49
Wish to Pay: 49
Total Paid: 49
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-572
            [amount] => 49
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 18:12:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 645, Wish To Pay: 645, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 573
Inserting Item: Array
(
    [material_id] => 29939
    [quantity] => 1
    [unit_price] => 645
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 645
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-573: 645, Remaining: 0
Total Summary:
Grand Total: 645
Wish to Pay: 645
Total Paid: 645
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-573
            [amount] => 645
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 18:42:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 574
Inserting Item: Array
(
    [material_id] => 31739
    [quantity] => 1
    [unit_price] => 105
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 105
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-574: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-574
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 19:10:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 32, Wish To Pay: 32, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 575
Inserting Item: Array
(
    [material_id] => 18771
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-575: 32, Remaining: 0
Total Summary:
Grand Total: 32
Wish to Pay: 32
Total Paid: 32
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-575
            [amount] => 32
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 19:18:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 576
Inserting Item: Array
(
    [material_id] => 28321
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-576: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-576
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 19:26:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 65, Wish To Pay: 65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 577
Inserting Item: Array
(
    [material_id] => 25092
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-577: 65, Remaining: 0
Total Summary:
Grand Total: 65
Wish to Pay: 65
Total Paid: 65
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-577
            [amount] => 65
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 19:28:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 578
Inserting Item: Array
(
    [material_id] => 30414
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-578: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-578
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 19:28:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 84, Wish To Pay: 84, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 579
Inserting Item: Array
(
    [material_id] => 18563
    [quantity] => 6
    [unit_price] => 14
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 84
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-579: 84, Remaining: 0
Total Summary:
Grand Total: 84
Wish to Pay: 84
Total Paid: 84
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-579
            [amount] => 84
            [type] => Previous Sale Due Payment
            [date] => 2026-06-30
        )

)

Script execution completed at: 2026-06-30 19:57:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 65, Wish To Pay: 65, Received: 65, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 580
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-580: 65, Remaining: 0
Total Summary:
Grand Total: 65
Wish to Pay: 65
Total Paid: 65
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-580
            [amount] => 65
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 04:15:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 350, Wish To Pay: 350, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 581
Inserting Item: Array
(
    [material_id] => 19851
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29111
    [quantity] => 1
    [unit_price] => 260
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 260
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-581: 350, Remaining: 0
Total Summary:
Grand Total: 350
Wish to Pay: 350
Total Paid: 350
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-581
            [amount] => 350
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 04:23:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 50, Change: 20
Customer found: Walk In
Sale Order Inserted. ID: 582
Inserting Item: Array
(
    [material_id] => 22146
    [quantity] => 10
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 3
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-582: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-582
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 04:25:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 230, Wish To Pay: 230, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 583
Inserting Item: Array
(
    [material_id] => 24438
    [quantity] => 10
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 175
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13192
    [quantity] => 10
    [unit_price] => 6.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 63
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-583: 230, Remaining: 0
Total Summary:
Grand Total: 230
Wish to Pay: 230
Total Paid: 230
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-583
            [amount] => 230
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 04:33:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 40, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 584
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 6
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 42
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-584: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-584
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 05:28:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 40, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 585
Inserting Item: Array
(
    [material_id] => 8049
    [quantity] => 28
    [unit_price] => 1.55
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 43.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-585: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-585
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 05:40:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 10, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 586
Inserting Item: Array
(
    [material_id] => 22355
    [quantity] => 1
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-586: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-586
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 05:46:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 21, Wish To Pay: 21, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 587
Inserting Item: Array
(
    [material_id] => 9172
    [quantity] => 1
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18554
    [quantity] => 1
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 9
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-587: 21, Remaining: 0
Total Summary:
Grand Total: 21
Wish to Pay: 21
Total Paid: 21
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-587
            [amount] => 21
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 05:58:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-297' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-01 06:10:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-297' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-01 06:39:50

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-297' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-01 06:40:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 591
Inserting Item: Array
(
    [material_id] => 13271
    [quantity] => 20
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24378
    [quantity] => 10
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-591: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-591
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 06:40:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1140.52, Wish To Pay: 1140.52, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 592
Inserting Item: Array
(
    [material_id] => 18563
    [quantity] => 9
    [unit_price] => 14
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 126
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29133
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30414
    [quantity] => 2
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30414, Available: 0, Requested: 2
Stack trace: #0 {main}
Script execution completed at: 2026-07-01 07:40:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1150.52, Wish To Pay: 1150.52, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 593
Inserting Item: Array
(
    [material_id] => 1860
    [quantity] => 15
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 262.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1179
    [quantity] => 22
    [unit_price] => 0.8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 17.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29133
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17582
    [quantity] => 30
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18563
    [quantity] => 9
    [unit_price] => 14
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 126
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22355
    [quantity] => 5
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28364
    [quantity] => 2
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12789
    [quantity] => 3
    [unit_price] => 35.14
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 105.42
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13405
    [quantity] => 1
    [unit_price] => 75
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 75
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-593: 1150.52, Remaining: 0
Total Summary:
Grand Total: 1150.52
Wish to Pay: 1150.52
Total Paid: 1150.52
Items Inserted: 10
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-593
            [amount] => 1150.52
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 07:50:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 1000, Change: 640
Customer found: Walk In
Sale Order Inserted. ID: 594
Inserting Item: Array
(
    [material_id] => 21594
    [quantity] => 2
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 18
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24277
    [quantity] => 7
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24569
    [quantity] => 5
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28370
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9162
    [quantity] => 1
    [unit_price] => 65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 65
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 26724
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-594: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-594
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 08:39:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 200, Change: 140
Customer found: Walk In
Sale Order Inserted. ID: 595
Inserting Item: Array
(
    [material_id] => 30985
    [quantity] => 1
    [unit_price] => 57
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 57
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31617
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-595: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-595
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 08:49:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 240, Wish To Pay: 240, Received: 500, Change: 260
Customer found: Walk In
Sale Order Inserted. ID: 596
Inserting Item: Array
(
    [material_id] => 27941
    [quantity] => 14
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29709
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-596: 240, Remaining: 0
Total Summary:
Grand Total: 240
Wish to Pay: 240
Total Paid: 240
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-596
            [amount] => 240
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 08:53:52

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01304240767
    [supplier_id] => 89
    [purchase_date] => 2026-07-01
    [payment_term] => cash
    [subtotal] => 69.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 69.00
    [notes] => 
    [amount_to_pay] => 69.00
    [acc] => 1
    [items] => [{"material_id":"29300","item_type":"raw","quantity":"15","unit_price":"5","discount_percent":"8","discount_flat":"0.40","total_price":"69.00"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 69, Account ID: 1
Inserted PO ID: 131
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 29300, Qty: 15
History inserted for raw material: 29300
Products stock updated: +15
No batch data found for material_id: 29300
Purchase Pay record inserted with ID: 112
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 275, Wish To Pay: 275, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 597
Inserting Item: Array
(
    [material_id] => 25406
    [quantity] => 4
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27945
    [quantity] => 3
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 27
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28004
    [quantity] => 6
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9430
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22378
    [quantity] => 6
    [unit_price] => 8.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 51
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29300
    [quantity] => 15
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 75
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-597: 275, Remaining: 0
Total Summary:
Grand Total: 275
Wish to Pay: 275
Total Paid: 275
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-597
            [amount] => 275
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 09:31:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 598
Inserting Item: Array
(
    [material_id] => 30667
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 23111
    [quantity] => 6
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-598: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-598
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 11:47:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 599
Inserting Item: Array
(
    [material_id] => 29041
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 29041, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-01 11:53:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 600
Inserting Item: Array
(
    [material_id] => 24379
    [quantity] => 10
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-600: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-600
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 12:13:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 45.76, Wish To Pay: 45.76, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 601
Inserting Item: Array
(
    [material_id] => 1973
    [quantity] => 4
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 52
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-601: 45.76, Remaining: 0
Total Summary:
Grand Total: 45.76
Wish to Pay: 45.76
Total Paid: 45.76
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-601
            [amount] => 45.76
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 12:21:13

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 68, Wish To Pay: 68, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 602
Inserting Item: Array
(
    [material_id] => 25003
    [quantity] => 1
    [unit_price] => 28
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 28
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24738
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-602: 68, Remaining: 0
Total Summary:
Grand Total: 68
Wish to Pay: 68
Total Paid: 68
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-602
            [amount] => 68
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 12:32:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 82.5, Wish To Pay: 82.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 603
Inserting Item: Array
(
    [material_id] => 1860
    [quantity] => 5
    [unit_price] => 17.5
    [discount_percent] => 5.71
    [discount_amount] => 5
    [total_price] => 82.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-603: 82.5, Remaining: 0
Total Summary:
Grand Total: 82.5
Wish to Pay: 82.5
Total Paid: 82.5
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-603
            [amount] => 82.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 12:33:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 604
Inserting Item: Array
(
    [material_id] => 28965
    [quantity] => 20
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19368
    [quantity] => 28
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 224
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-604: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-604
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 12:43:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1100, Wish To Pay: 1100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 605
Inserting Item: Array
(
    [material_id] => 391
    [quantity] => 14
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 245
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27901
    [quantity] => 25
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 275
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31741
    [quantity] => 15
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 450
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17582
    [quantity] => 20
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-605: 1100, Remaining: 0
Total Summary:
Grand Total: 1100
Wish to Pay: 1100
Total Paid: 1100
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-605
            [amount] => 1100
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 12:46:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 913.5, Wish To Pay: 913.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 606
Inserting Item: Array
(
    [material_id] => 21682
    [quantity] => 10
    [unit_price] => 85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 850
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13361
    [quantity] => 1
    [unit_price] => 145
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 145
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-606: 913.5, Remaining: 0
Total Summary:
Grand Total: 913.5
Wish to Pay: 913.5
Total Paid: 913.5
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-606
            [amount] => 913.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 12:47:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 5, Wish To Pay: 5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 607
Inserting Item: Array
(
    [material_id] => 14696
    [quantity] => 10
    [unit_price] => 0.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-607: 5, Remaining: 0
Total Summary:
Grand Total: 5
Wish to Pay: 5
Total Paid: 5
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-607
            [amount] => 5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 12:50:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 608
Inserting Item: Array
(
    [material_id] => 29041
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-608: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-608
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 12:52:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1210, Wish To Pay: 1210, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 609
Inserting Item: Array
(
    [material_id] => 25321
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25390
    [quantity] => 24
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 480
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30698
    [quantity] => 1
    [unit_price] => 600
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-609: 1210, Remaining: 0
Total Summary:
Grand Total: 1210
Wish to Pay: 1210
Total Paid: 1210
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-609
            [amount] => 1210
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 13:06:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1.2, Wish To Pay: 1.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 610
Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 1
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-610: 1.2, Remaining: 0
Total Summary:
Grand Total: 1.2
Wish to Pay: 1.2
Total Paid: 1.2
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-610
            [amount] => 1.2
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 13:18:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1.2, Wish To Pay: 1.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 611
Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 1
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-611: 1.2, Remaining: 0
Total Summary:
Grand Total: 1.2
Wish to Pay: 1.2
Total Paid: 1.2
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-611
            [amount] => 1.2
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 13:18:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-315' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-01 13:28:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-315' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-01 13:29:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-315' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-01 13:29:47

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 615
Inserting Item: Array
(
    [material_id] => 31397
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-615: 200, Remaining: 0
Total Summary:
Grand Total: 200
Wish to Pay: 200
Total Paid: 200
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-615
            [amount] => 200
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 13:33:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1500, Wish To Pay: 1500, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 616
Inserting Item: Array
(
    [material_id] => 29833
    [quantity] => 28
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 560
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22734
    [quantity] => 14
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 840
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24963
    [quantity] => 1
    [unit_price] => 120
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-616: 1500, Remaining: 0
Total Summary:
Grand Total: 1500
Wish to Pay: 1500
Total Paid: 1500
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-616
            [amount] => 1500
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 13:38:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 617
Inserting Item: Array
(
    [material_id] => 26844
    [quantity] => 5
    [unit_price] => 23
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 115
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-617: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-617
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 13:43:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150.7, Wish To Pay: 150.7, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 618
Inserting Item: Array
(
    [material_id] => 22436
    [quantity] => 10
    [unit_price] => 16.07
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160.7
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-618: 150.7, Remaining: 0
Total Summary:
Grand Total: 150.7
Wish to Pay: 150.7
Total Paid: 150.7
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-618
            [amount] => 150.7
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 13:44:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 619
Inserting Item: Array
(
    [material_id] => 28728
    [quantity] => 5
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-619: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-619
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 13:46:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 620
Inserting Item: Array
(
    [material_id] => 7796
    [quantity] => 14
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 112
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-620: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-620
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 14:00:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 12, Wish To Pay: 12, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 621
Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-621: 12, Remaining: 0
Total Summary:
Grand Total: 12
Wish to Pay: 12
Total Paid: 12
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-621
            [amount] => 12
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 14:00:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1.2, Wish To Pay: 1.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 622
Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 1
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-622: 1.2, Remaining: 0
Total Summary:
Grand Total: 1.2
Wish to Pay: 1.2
Total Paid: 1.2
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-622
            [amount] => 1.2
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 14:01:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 0, Wish To Pay: 0, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-323' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-01 14:26:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2014.65, Wish To Pay: 2014.65, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-323' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-01 14:29:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2014.65, Wish To Pay: 2014.65, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-323' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-01 14:29:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2014.65, Wish To Pay: 2014.65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 626
Inserting Item: Array
(
    [material_id] => 9131
    [quantity] => 30
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7754
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18981
    [quantity] => 28
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 196
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28697
    [quantity] => 28
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5578
    [quantity] => 30
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24337
    [quantity] => 30
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24337, Available: 15, Requested: 30
Stack trace: #0 {main}
Script execution completed at: 2026-07-01 14:38:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2014.65, Wish To Pay: 2014.65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 627
Inserting Item: Array
(
    [material_id] => 9131
    [quantity] => 30
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7754
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18981
    [quantity] => 28
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 196
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28697
    [quantity] => 28
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5578
    [quantity] => 30
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24337
    [quantity] => 30
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24337, Available: 15, Requested: 30
Stack trace: #0 {main}
Script execution completed at: 2026-07-01 14:44:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2014.65, Wish To Pay: 2014.65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 628
Inserting Item: Array
(
    [material_id] => 9131
    [quantity] => 30
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7754
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18981
    [quantity] => 28
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 196
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28697
    [quantity] => 28
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5578
    [quantity] => 30
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24337
    [quantity] => 30
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24337, Available: 15, Requested: 30
Stack trace: #0 {main}
Script execution completed at: 2026-07-01 14:45:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2014.65, Wish To Pay: 2014.65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 629
Inserting Item: Array
(
    [material_id] => 9131
    [quantity] => 30
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7754
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18981
    [quantity] => 28
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 196
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28697
    [quantity] => 28
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5578
    [quantity] => 30
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 45
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 157.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17606
    [quantity] => 15
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 375
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13300
    [quantity] => 20
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25091
    [quantity] => 1
    [unit_price] => 300
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24337
    [quantity] => 30
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-629: 2014.65, Remaining: 0
Total Summary:
Grand Total: 2014.65
Wish to Pay: 2014.65
Total Paid: 2014.65
Items Inserted: 10
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-629
            [amount] => 2014.65
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 14:49:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 630
Inserting Item: Array
(
    [material_id] => 8044
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-630: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-630
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 15:16:47

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1219.61, Wish To Pay: 1219.61, Received: 1500, Change: 280.39
Customer found: Walk In
Sale Order Inserted. ID: 631
Inserting Item: Array
(
    [material_id] => 31280
    [quantity] => 14
    [unit_price] => 95
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1330
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-631: 1219.61, Remaining: 0
Total Summary:
Grand Total: 1219.61
Wish to Pay: 1219.61
Total Paid: 1219.61
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-631
            [amount] => 1219.61
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 15:20:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 910, Wish To Pay: 910, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-326' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-01 15:31:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 910, Wish To Pay: 910, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-326' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-01 15:31:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-326' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-01 15:38:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 635
Inserting Item: Array
(
    [material_id] => 31313
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-635: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-635
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 15:39:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 420, Wish To Pay: 420, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 636
Inserting Item: Array
(
    [material_id] => 18799
    [quantity] => 60
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 420
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-636: 420, Remaining: 0
Total Summary:
Grand Total: 420
Wish to Pay: 420
Total Paid: 420
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-636
            [amount] => 420
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 15:40:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 95, Wish To Pay: 95, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 637
Inserting Item: Array
(
    [material_id] => 22347
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 5
    [discount_amount] => 5
    [total_price] => 95
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-637: 95, Remaining: 0
Total Summary:
Grand Total: 95
Wish to Pay: 95
Total Paid: 95
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-637
            [amount] => 95
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 16:06:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 99.9, Wish To Pay: 99.9, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 638
Inserting Item: Array
(
    [material_id] => 25418
    [quantity] => 90
    [unit_price] => 1.11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 99.9
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 25418, Available: 75, Requested: 90
Stack trace: #0 {main}
Script execution completed at: 2026-07-01 16:17:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 639
Inserting Item: Array
(
    [material_id] => 4398
    [quantity] => 4
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 4398, Available: 0, Requested: 4
Stack trace: #0 {main}
Script execution completed at: 2026-07-01 16:28:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 48, Wish To Pay: 48, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 640
Inserting Item: Array
(
    [material_id] => 24247
    [quantity] => 4
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 48
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-640: 48, Remaining: 0
Total Summary:
Grand Total: 48
Wish to Pay: 48
Total Paid: 48
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-640
            [amount] => 48
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 16:29:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 641
Inserting Item: Array
(
    [material_id] => 26690
    [quantity] => 10
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-641: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-641
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 16:35:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 99.9, Wish To Pay: 99.9, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 642
Inserting Item: Array
(
    [material_id] => 25418
    [quantity] => 90
    [unit_price] => 1.11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 99.9
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-642: 99.9, Remaining: 0
Total Summary:
Grand Total: 99.9
Wish to Pay: 99.9
Total Paid: 99.9
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-642
            [amount] => 99.9
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 16:38:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 643
Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-643: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-643
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 16:39:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 349.2, Wish To Pay: 349.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 644
Inserting Item: Array
(
    [material_id] => 5087
    [quantity] => 30
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-644: 349.2, Remaining: 0
Total Summary:
Grand Total: 349.2
Wish to Pay: 349.2
Total Paid: 349.2
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-644
            [amount] => 349.2
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 16:43:50

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 645
Inserting Item: Array
(
    [material_id] => 3719
    [quantity] => 1
    [unit_price] => 150
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-645: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-645
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 16:45:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 646
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 5
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-646: 35, Remaining: 0
Total Summary:
Grand Total: 35
Wish to Pay: 35
Total Paid: 35
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-646
            [amount] => 35
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 16:59:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 200, Change: 130
Customer found: Walk In
Sale Order Inserted. ID: 647
Inserting Item: Array
(
    [material_id] => 1860
    [quantity] => 4
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-647: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-647
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 17:04:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 130, Wish To Pay: 130, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 648
Inserting Item: Array
(
    [material_id] => 18799
    [quantity] => 20
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-648: 130, Remaining: 0
Total Summary:
Grand Total: 130
Wish to Pay: 130
Total Paid: 130
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-648
            [amount] => 130
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 17:10:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 649
Inserting Item: Array
(
    [material_id] => 24896
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-649: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-649
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 17:11:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 650
Inserting Item: Array
(
    [material_id] => 13153
    [quantity] => 10
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-650: 35, Remaining: 0
Total Summary:
Grand Total: 35
Wish to Pay: 35
Total Paid: 35
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-650
            [amount] => 35
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 17:27:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 651
Inserting Item: Array
(
    [material_id] => 31226
    [quantity] => 1
    [unit_price] => 180
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-651: 180, Remaining: 0
Total Summary:
Grand Total: 180
Wish to Pay: 180
Total Paid: 180
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-651
            [amount] => 180
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 17:32:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 652
Inserting Item: Array
(
    [material_id] => 31400
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-652: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-652
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 17:34:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 530, Wish To Pay: 530, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 653
Inserting Item: Array
(
    [material_id] => 18476
    [quantity] => 10
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 350
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 20
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27941
    [quantity] => 14
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9492
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-653: 530, Remaining: 0
Total Summary:
Grand Total: 530
Wish to Pay: 530
Total Paid: 530
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-653
            [amount] => 530
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 18:06:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 654
Inserting Item: Array
(
    [material_id] => 17797
    [quantity] => 6
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-654: 180, Remaining: 0
Total Summary:
Grand Total: 180
Wish to Pay: 180
Total Paid: 180
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-654
            [amount] => 180
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 18:10:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 38, Wish To Pay: 38, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 655
Inserting Item: Array
(
    [material_id] => 26773
    [quantity] => 1
    [unit_price] => 38
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 38
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-655: 38, Remaining: 0
Total Summary:
Grand Total: 38
Wish to Pay: 38
Total Paid: 38
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-655
            [amount] => 38
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 18:12:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 65, Wish To Pay: 65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 656
Inserting Item: Array
(
    [material_id] => 12172
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-656: 65, Remaining: 0
Total Summary:
Grand Total: 65
Wish to Pay: 65
Total Paid: 65
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-656
            [amount] => 65
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 18:13:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 12, Wish To Pay: 12, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 657
Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-657: 12, Remaining: 0
Total Summary:
Grand Total: 12
Wish to Pay: 12
Total Paid: 12
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-657
            [amount] => 12
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 18:13:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 468.5, Wish To Pay: 468.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 658
Inserting Item: Array
(
    [material_id] => 29652
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5746
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9406
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29812
    [quantity] => 6
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 78
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 2
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 5
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 17.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28144
    [quantity] => 15
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-658: 468.5, Remaining: 0
Total Summary:
Grand Total: 468.5
Wish to Pay: 468.5
Total Paid: 468.5
Items Inserted: 7
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-658
            [amount] => 468.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 18:42:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 1000, Change: 940
Customer found: Walk In
Sale Order Inserted. ID: 659
Inserting Item: Array
(
    [material_id] => 28206
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-659: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-659
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 18:43:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 21, Wish To Pay: 21, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 660
Inserting Item: Array
(
    [material_id] => 30329
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 3
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-660: 21, Remaining: 0
Total Summary:
Grand Total: 21
Wish to Pay: 21
Total Paid: 21
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-660
            [amount] => 21
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 18:44:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 45, Wish To Pay: 45, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 661
Inserting Item: Array
(
    [material_id] => 29035
    [quantity] => 5
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-661: 45, Remaining: 0
Total Summary:
Grand Total: 45
Wish to Pay: 45
Total Paid: 45
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-661
            [amount] => 45
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 18:56:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 160, Wish To Pay: 160, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 662
Inserting Item: Array
(
    [material_id] => 18980
    [quantity] => 14
    [unit_price] => 11.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 161
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-662: 160, Remaining: 0
Total Summary:
Grand Total: 160
Wish to Pay: 160
Total Paid: 160
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-662
            [amount] => 160
            [type] => Previous Sale Due Payment
            [date] => 2026-07-01
        )

)

Script execution completed at: 2026-07-01 19:04:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 117, Wish To Pay: 117, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 663
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 1
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5236
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5322
    [quantity] => 1
    [unit_price] => 75
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 75
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-663: 117, Remaining: 0
Total Summary:
Grand Total: 117
Wish to Pay: 117
Total Paid: 117
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-663
            [amount] => 117
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 02:32:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 250, Wish To Pay: 250, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 664
Inserting Item: Array
(
    [material_id] => 30206
    [quantity] => 2
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31386
    [quantity] => 1
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30417
    [quantity] => 1
    [unit_price] => 48
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 48
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30318
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-664: 250, Remaining: 0
Total Summary:
Grand Total: 250
Wish to Pay: 250
Total Paid: 250
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-664
            [amount] => 250
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 02:42:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 100, Change: 60
Customer found: Walk In
Sale Order Inserted. ID: 665
Inserting Item: Array
(
    [material_id] => 5455
    [quantity] => 2
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 2
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31617
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 3
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-665: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-665
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 03:03:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 95, Wish To Pay: 95, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 666
Inserting Item: Array
(
    [material_id] => 18981
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-666: 95, Remaining: 0
Total Summary:
Grand Total: 95
Wish to Pay: 95
Total Paid: 95
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-666
            [amount] => 95
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 03:35:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 667
Inserting Item: Array
(
    [material_id] => 21236
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-667: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-667
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 03:39:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 50, Change: 20
Customer found: Walk In
Sale Order Inserted. ID: 668
Inserting Item: Array
(
    [material_id] => 28510
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28510, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-02 03:56:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 50, Change: 20
Customer found: Walk In
Sale Order Inserted. ID: 669
Inserting Item: Array
(
    [material_id] => 28510
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-669: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-669
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 03:57:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 250, Wish To Pay: 250, Received: 500, Change: 250
Customer found: Walk In
Sale Order Inserted. ID: 670
Inserting Item: Array
(
    [material_id] => 10509
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25196
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30891
    [quantity] => 2
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24348
    [quantity] => 15
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-670: 250, Remaining: 0
Total Summary:
Grand Total: 250
Wish to Pay: 250
Total Paid: 250
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-670
            [amount] => 250
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 04:52:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 671
Inserting Item: Array
(
    [material_id] => 5455
    [quantity] => 24
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-671: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-671
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 04:54:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 380, Wish To Pay: 380, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 672
Inserting Item: Array
(
    [material_id] => 29642
    [quantity] => 1
    [unit_price] => 290
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 290
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25196
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-672: 380, Remaining: 0
Total Summary:
Grand Total: 380
Wish to Pay: 380
Total Paid: 380
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-672
            [amount] => 380
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 05:09:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 440, Wish To Pay: 440, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 673
Inserting Item: Array
(
    [material_id] => 28236
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 6.67
    [discount_amount] => 10
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9000
    [quantity] => 1
    [unit_price] => 240
    [discount_percent] => 5
    [discount_amount] => 12
    [total_price] => 228
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1281
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-673: 440, Remaining: 0
Total Summary:
Grand Total: 440
Wish to Pay: 440
Total Paid: 440
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-673
            [amount] => 440
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 05:12:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 35
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 3, To Pay: 703, Wish To Pay: 703, Received: 0, Change: 0
Customer found: kabir humaun
Error: Duplicate entry 'SO-2026-362' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-02 05:15:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 35
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 3, To Pay: 703, Wish To Pay: 703, Received: 0, Change: 0
Customer found: kabir humaun
Error: Duplicate entry 'SO-2026-362' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-02 05:15:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 688, Wish To Pay: 688, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-360' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-02 05:15:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 688, Wish To Pay: 688, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-360' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-02 05:16:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 35
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 3, To Pay: 691, Wish To Pay: 691, Received: 0, Change: 0
Customer found: kabir humaun
Sale Order Inserted. ID: 678
Inserting Item: Array
(
    [material_id] => 29811
    [quantity] => 10
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5087
    [quantity] => 14
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 168
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29652
    [quantity] => 30
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27941
    [quantity] => 14
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3703
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Opening Balance Paid: 691, Remaining: 0
Total Summary:
Grand Total: 688
Wish to Pay: 691
Total Paid: 691
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => OB_Paid
            [amount] => 691
            [type] => Opening Balance Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 05:21:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 170, Wish To Pay: 170, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 679
Inserting Item: Array
(
    [material_id] => 5867
    [quantity] => 1
    [unit_price] => 85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 85
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28370
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1956
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14611
    [quantity] => 20
    [unit_price] => 0.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-679: 170, Remaining: 0
Total Summary:
Grand Total: 170
Wish to Pay: 170
Total Paid: 170
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-679
            [amount] => 170
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 05:37:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 290, Wish To Pay: 290, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 680
Inserting Item: Array
(
    [material_id] => 28037
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28817
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-680: 290, Remaining: 0
Total Summary:
Grand Total: 290
Wish to Pay: 290
Total Paid: 290
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-680
            [amount] => 290
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 05:52:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 33
Items count: 9
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1550.5, Wish To Pay: 1550.5, Received: 0, Change: 0
Customer found: wahab vai bariwala
Sale Order Inserted. ID: 681
Inserting Item: Array
(
    [material_id] => 14007
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 322
    [quantity] => 20
    [unit_price] => 0.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 23149
    [quantity] => 20
    [unit_price] => 0.65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 13
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27760
    [quantity] => 15
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1860
    [quantity] => 15
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 262.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 756
    [quantity] => 15
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 225
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21216
    [quantity] => 30
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 210
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3580
    [quantity] => 96
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 480
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24261
    [quantity] => 15
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-681: 1550.5, Remaining: 0
Total Summary:
Grand Total: 1550.5
Wish to Pay: 1550.5
Total Paid: 1550.5
Items Inserted: 9
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-681
            [amount] => 1550.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 06:21:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 33
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1010, Wish To Pay: 1010, Received: 0, Change: 0
Customer found: wahab vai bariwala
Sale Order Inserted. ID: 682
Inserting Item: Array
(
    [material_id] => 17586
    [quantity] => 10
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17607
    [quantity] => 10
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 500
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28255
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18808
    [quantity] => 1
    [unit_price] => 270
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 270
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-682: 1010, Remaining: 0
Total Summary:
Grand Total: 1010
Wish to Pay: 1010
Total Paid: 1010
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-682
            [amount] => 1010
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 06:24:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 390, Wish To Pay: 390, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 683
Inserting Item: Array
(
    [material_id] => 29699
    [quantity] => 10
    [unit_price] => 4.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24277
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30458
    [quantity] => 10
    [unit_price] => 24
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24383
    [quantity] => 10
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-683: 390, Remaining: 0
Total Summary:
Grand Total: 390
Wish to Pay: 390
Total Paid: 390
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-683
            [amount] => 390
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 06:52:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 750, Wish To Pay: 750, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 684
Inserting Item: Array
(
    [material_id] => 30605
    [quantity] => 1
    [unit_price] => 890
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 890
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-684: 750, Remaining: 0
Total Summary:
Grand Total: 750
Wish to Pay: 750
Total Paid: 750
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-684
            [amount] => 750
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 06:58:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 890, Wish To Pay: 890, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-370' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-02 07:00:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 195, Wish To Pay: 195, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 686
Inserting Item: Array
(
    [material_id] => 29814
    [quantity] => 4
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-686: 195, Remaining: 0
Total Summary:
Grand Total: 195
Wish to Pay: 195
Total Paid: 195
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-686
            [amount] => 195
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 07:17:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 690, Wish To Pay: 690, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 687
Inserting Item: Array
(
    [material_id] => 28044
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8918
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13977
    [quantity] => 18
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 324
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-687: 690, Remaining: 0
Total Summary:
Grand Total: 690
Wish to Pay: 690
Total Paid: 690
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-687
            [amount] => 690
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 07:31:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 310, Wish To Pay: 310, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-372' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-02 07:36:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 310, Wish To Pay: 310, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 689
Inserting Item: Array
(
    [material_id] => 30212
    [quantity] => 1
    [unit_price] => 350
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 350
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-689: 310, Remaining: 0
Total Summary:
Grand Total: 310
Wish to Pay: 310
Total Paid: 310
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-689
            [amount] => 310
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 07:36:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 315, Wish To Pay: 315, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 690
Inserting Item: Array
(
    [material_id] => 22426
    [quantity] => 90
    [unit_price] => 2.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 198
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27941
    [quantity] => 14
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-690: 315, Remaining: 0
Total Summary:
Grand Total: 315
Wish to Pay: 315
Total Paid: 315
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-690
            [amount] => 315
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 07:40:16

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01764143394
    [supplier_id] => 90
    [purchase_date] => 2026-07-02
    [payment_term] => credit
    [subtotal] => 1332.24
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 1332.24
    [notes] => 
    [items] => [{"material_id":"29512","item_type":"raw","quantity":"10","unit_price":"8.1","discount_percent":"0.00","discount_flat":"0","total_price":"81.00"},{"material_id":"13932","item_type":"raw","quantity":"4","unit_price":"40","discount_percent":"0.00","discount_flat":"0","total_price":"160.00"},{"material_id":"14297","item_type":"raw","quantity":"1","unit_price":"25","discount_percent":"0.00","discount_flat":"0","total_price":"25.00"},{"material_id":"28989","item_type":"raw","quantity":"6","unit_price":"2","discount_percent":"0.00","discount_flat":"0","total_price":"12.00"},{"material_id":"19160","item_type":"raw","quantity":"1","unit_price":"18.92","discount_percent":"0.00","discount_flat":"0","total_price":"18.92"},{"material_id":"30495","item_type":"raw","quantity":"1","unit_price":"94.6","discount_percent":"0.00","discount_flat":"0","total_price":"94.60"},{"material_id":"3725","item_type":"raw","quantity":"14","unit_price":"8.8","discount_percent":"0.00","discount_flat":"0","total_price":"123.20"},{"material_id":"19169","item_type":"raw","quantity":"1","unit_price":"7.52","discount_percent":"0.00","discount_flat":"0","total_price":"7.52"},{"material_id":"13816","item_type":"raw","quantity":"7","unit_price":"30","discount_percent":"0.00","discount_flat":"0","total_price":"210.00"},{"material_id":"3791","item_type":"raw","quantity":"60","unit_price":"10","discount_percent":"0.00","discount_flat":"0","total_price":"600.00"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: credit, Amount to Pay: 0, Account ID: 0
Inserted PO ID: 132
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 29512, Qty: 10
History inserted for raw material: 29512
Products stock updated: +10
No batch data found for material_id: 29512
Processing item 1 - Type: raw, ID: 13932, Qty: 4
History inserted for raw material: 13932
Products stock updated: +4
No batch data found for material_id: 13932
Processing item 2 - Type: raw, ID: 14297, Qty: 1
History inserted for raw material: 14297
Products stock updated: +1
No batch data found for material_id: 14297
Processing item 3 - Type: raw, ID: 28989, Qty: 6
History inserted for raw material: 28989
Products stock updated: +6
No batch data found for material_id: 28989
Processing item 4 - Type: raw, ID: 19160, Qty: 1
History inserted for raw material: 19160
Products stock updated: +1
No batch data found for material_id: 19160
Processing item 5 - Type: raw, ID: 30495, Qty: 1
History inserted for raw material: 30495
Products stock updated: +1
No batch data found for material_id: 30495
Processing item 6 - Type: raw, ID: 3725, Qty: 14
History inserted for raw material: 3725
Products stock updated: +14
No batch data found for material_id: 3725
Processing item 7 - Type: raw, ID: 19169, Qty: 1
History inserted for raw material: 19169
Products stock updated: +1
No batch data found for material_id: 19169
Processing item 8 - Type: raw, ID: 13816, Qty: 7
History inserted for raw material: 13816
Products stock updated: +7
No batch data found for material_id: 13816
Processing item 9 - Type: raw, ID: 3791, Qty: 60
History inserted for raw material: 3791
Products stock updated: +60
No batch data found for material_id: 3791
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 691
Inserting Item: Array
(
    [material_id] => 13314
    [quantity] => 14
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 5
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-691: 140, Remaining: 0
Total Summary:
Grand Total: 140
Wish to Pay: 140
Total Paid: 140
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-691
            [amount] => 140
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 08:38:13

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 220, Wish To Pay: 220, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 692
Inserting Item: Array
(
    [material_id] => 25400
    [quantity] => 4
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7809
    [quantity] => 4
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 28
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28640
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 1
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-692: 220, Remaining: 0
Total Summary:
Grand Total: 220
Wish to Pay: 220
Total Paid: 220
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-692
            [amount] => 220
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 08:40:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 693
Inserting Item: Array
(
    [material_id] => 5868
    [quantity] => 10
    [unit_price] => 2.25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-693: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-693
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 08:41:09

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01828877676
    [supplier_id] => 91
    [purchase_date] => 2026-07-02
    [payment_term] => cash
    [subtotal] => 88.05
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 88.05
    [notes] => 
    [amount_to_pay] => 88.05
    [acc] => 1
    [items] => [{"material_id":"31753","item_type":"raw","quantity":"5","unit_price":"17.61","discount_percent":"0.00","discount_flat":"0","total_price":"88.05"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 88.05, Account ID: 1
Inserted PO ID: 133
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 31753, Qty: 5
History inserted for raw material: 31753
Products stock updated: +5
No batch data found for material_id: 31753
Purchase Pay record inserted with ID: 113
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 694
Inserting Item: Array
(
    [material_id] => 31540
    [quantity] => 1
    [unit_price] => 120
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-694: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-694
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 09:22:38

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01928096442
    [supplier_id] => 92
    [purchase_date] => 2026-07-02
    [payment_term] => cash
    [subtotal] => 4846.18
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 4846.18
    [notes] => 
    [amount_to_pay] => 4846.18
    [acc] => 1
    [items] => [{"material_id":"21661","item_type":"raw","quantity":"50","unit_price":"10.56","discount_percent":"0.00","discount_flat":"0","total_price":"528.04"},{"material_id":"21594","item_type":"raw","quantity":"80","unit_price":"7.92","discount_percent":"0.00","discount_flat":"0","total_price":"633.64"},{"material_id":"29282","item_type":"raw","quantity":"1","unit_price":"264.02","discount_percent":"0.00","discount_flat":"0","total_price":"264.02"},{"material_id":"27877","item_type":"raw","quantity":"80","unit_price":"9.68","discount_percent":"0.00","discount_flat":"0","total_price":"774.45"},{"material_id":"28384","item_type":"raw","quantity":"30","unit_price":"18.97","discount_percent":"0.00","discount_flat":"0","total_price":"569"},{"material_id":"27963","item_type":"raw","quantity":"30","unit_price":"17.23","discount_percent":"0.00","discount_flat":"0","total_price":"517"},{"material_id":"28761","item_type":"raw","quantity":"30","unit_price":"38.80","discount_percent":"0.00","discount_flat":"0","total_price":"1164"},{"material_id":"29821","item_type":"raw","quantity":"30","unit_price":"13.20","discount_percent":"0.00","discount_flat":"0","total_price":"396.03"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 4846.18, Account ID: 1
Inserted PO ID: 134
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 21661, Qty: 50
History inserted for raw material: 21661
Products stock updated: +50
No batch data found for material_id: 21661
Processing item 1 - Type: raw, ID: 21594, Qty: 80
History inserted for raw material: 21594
Products stock updated: +80
No batch data found for material_id: 21594
Processing item 2 - Type: raw, ID: 29282, Qty: 1
History inserted for raw material: 29282
Products stock updated: +1
No batch data found for material_id: 29282
Processing item 3 - Type: raw, ID: 27877, Qty: 80
History inserted for raw material: 27877
Products stock updated: +80
No batch data found for material_id: 27877
Processing item 4 - Type: raw, ID: 28384, Qty: 30
History inserted for raw material: 28384
Products stock updated: +30
No batch data found for material_id: 28384
Processing item 5 - Type: raw, ID: 27963, Qty: 30
History inserted for raw material: 27963
Products stock updated: +30
No batch data found for material_id: 27963
Processing item 6 - Type: raw, ID: 28761, Qty: 30
History inserted for raw material: 28761
Products stock updated: +30
No batch data found for material_id: 28761
Processing item 7 - Type: raw, ID: 29821, Qty: 30
History inserted for raw material: 29821
Products stock updated: +30
No batch data found for material_id: 29821
Purchase Pay record inserted with ID: 114
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 126, Wish To Pay: 126, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 695
Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 1
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 11
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29978
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5236
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-695: 126, Remaining: 0
Total Summary:
Grand Total: 126
Wish to Pay: 126
Total Paid: 126
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-695
            [amount] => 126
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 09:43:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 52.5, Wish To Pay: 52.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 696
Inserting Item: Array
(
    [material_id] => 23919
    [quantity] => 5
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 23919, Available: 0, Requested: 5
Stack trace: #0 {main}
Script execution completed at: 2026-07-02 09:51:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 620.5, Wish To Pay: 620.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 697
Inserting Item: Array
(
    [material_id] => 23919
    [quantity] => 5
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 23919, Available: 0, Requested: 5
Stack trace: #0 {main}
Script execution completed at: 2026-07-02 10:03:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 620.5, Wish To Pay: 620.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 698
Inserting Item: Array
(
    [material_id] => 23919
    [quantity] => 5
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 23919, Available: 0, Requested: 5
Stack trace: #0 {main}
Script execution completed at: 2026-07-02 10:04:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 631.75, Wish To Pay: 631.75, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 699
Inserting Item: Array
(
    [material_id] => 29567
    [quantity] => 10
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28179
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7808
    [quantity] => 15
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 75
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30707
    [quantity] => 15
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25195
    [quantity] => 10
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-699: 631.75, Remaining: 0
Total Summary:
Grand Total: 631.75
Wish to Pay: 631.75
Total Paid: 631.75
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-699
            [amount] => 631.75
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 10:38:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1360, Wish To Pay: 1360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 700
Inserting Item: Array
(
    [material_id] => 3966
    [quantity] => 20
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 340
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30758
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29409
    [quantity] => 20
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27765
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27945
    [quantity] => 14
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 126
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 806
    [quantity] => 10
    [unit_price] => 21
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 210
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-700: 1360, Remaining: 0
Total Summary:
Grand Total: 1360
Wish to Pay: 1360
Total Paid: 1360
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-700
            [amount] => 1360
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 11:00:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 420.32, Wish To Pay: 420.32, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 701
Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 8
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 9.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21143
    [quantity] => 20
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 850
    [quantity] => 8
    [unit_price] => 30.09
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240.72
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25691
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-701: 420.32, Remaining: 0
Total Summary:
Grand Total: 420.32
Wish to Pay: 420.32
Total Paid: 420.32
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-701
            [amount] => 420.32
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 11:19:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 702
Inserting Item: Array
(
    [material_id] => 24277
    [quantity] => 5
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-702: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-702
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 11:30:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 650, Wish To Pay: 650, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 703
Inserting Item: Array
(
    [material_id] => 30219
    [quantity] => 1
    [unit_price] => 780
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 780
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-703: 650, Remaining: 0
Total Summary:
Grand Total: 650
Wish to Pay: 650
Total Paid: 650
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-703
            [amount] => 650
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 11:37:34

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01304240767
    [supplier_id] => 89
    [purchase_date] => 2026-07-02
    [payment_term] => cash
    [subtotal] => 734.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 734.00
    [notes] => 
    [amount_to_pay] => 734.00
    [acc] => 1
    [items] => [{"material_id":"31755","item_type":"raw","quantity":"1","unit_price":"734","discount_percent":"0.00","discount_flat":"0","total_price":"734.00"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 734, Account ID: 1
Error: PO Number already exists
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01236458555
    [supplier_id] => 89
    [purchase_date] => 2026-07-02
    [payment_term] => cash
    [subtotal] => 734.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 734.00
    [notes] => 
    [amount_to_pay] => 734.00
    [acc] => 1
    [items] => [{"material_id":"31755","item_type":"raw","quantity":"1","unit_price":"734","discount_percent":"0.00","discount_flat":"0","total_price":"734.00"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 734, Account ID: 1
Inserted PO ID: 135
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 31755, Qty: 1
History inserted for raw material: 31755
Products stock updated: +1
No batch data found for material_id: 31755
Purchase Pay record inserted with ID: 115
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 704
Inserting Item: Array
(
    [material_id] => 19068
    [quantity] => 2
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25215
    [quantity] => 2
    [unit_price] => 55
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30329
    [quantity] => 4
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28592
    [quantity] => 1
    [unit_price] => 130
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-704: 300, Remaining: 0
Total Summary:
Grand Total: 300
Wish to Pay: 300
Total Paid: 300
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-704
            [amount] => 300
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 11:59:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 705
Inserting Item: Array
(
    [material_id] => 31386
    [quantity] => 2
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-705: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-705
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 12:01:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 706
Inserting Item: Array
(
    [material_id] => 13159
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-706: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-706
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 12:05:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 126, Wish To Pay: 126, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 707
Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 1
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 11
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5236
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29978
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-707: 126, Remaining: 0
Total Summary:
Grand Total: 126
Wish to Pay: 126
Total Paid: 126
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-707
            [amount] => 126
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 12:49:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 680, Wish To Pay: 680, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-388' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-02 12:57:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 680, Wish To Pay: 680, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-388' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-02 12:58:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 770, Wish To Pay: 770, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 710
Inserting Item: Array
(
    [material_id] => 30618
    [quantity] => 1
    [unit_price] => 890
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 890
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-710: 770, Remaining: 0
Total Summary:
Grand Total: 770
Wish to Pay: 770
Total Paid: 770
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-710
            [amount] => 770
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 12:58:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 800.2, Wish To Pay: 800.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 711
Inserting Item: Array
(
    [material_id] => 30099
    [quantity] => 1
    [unit_price] => 415
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 415
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 15322
    [quantity] => 10
    [unit_price] => 7.02
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29758
    [quantity] => 1
    [unit_price] => 415
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 415
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-711: 800.2, Remaining: 0
Total Summary:
Grand Total: 800.2
Wish to Pay: 800.2
Total Paid: 800.2
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-711
            [amount] => 800.2
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 13:06:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2000, Wish To Pay: 2000, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 712
Inserting Item: Array
(
    [material_id] => 30580
    [quantity] => 1
    [unit_price] => 250
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5273
    [quantity] => 1
    [unit_price] => 45
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30010
    [quantity] => 1
    [unit_price] => 350
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 350
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31238
    [quantity] => 1
    [unit_price] => 1450
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1450
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-712: 2000, Remaining: 0
Total Summary:
Grand Total: 2000
Wish to Pay: 2000
Total Paid: 2000
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-712
            [amount] => 2000
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 13:11:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 755, Wish To Pay: 755, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 713
Inserting Item: Array
(
    [material_id] => 8851
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1331
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9514
    [quantity] => 4
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29041
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3964
    [quantity] => 1
    [unit_price] => 325
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 325
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 20
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-713: 755, Remaining: 0
Total Summary:
Grand Total: 755
Wish to Pay: 755
Total Paid: 755
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-713
            [amount] => 755
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 13:13:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 240, Wish To Pay: 240, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 714
Inserting Item: Array
(
    [material_id] => 30853
    [quantity] => 2
    [unit_price] => 120
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-714: 240, Remaining: 0
Total Summary:
Grand Total: 240
Wish to Pay: 240
Total Paid: 240
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-714
            [amount] => 240
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 13:14:45

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 0152-488
    [supplier_id] => 94
    [purchase_date] => 2026-07-02
    [payment_term] => cash
    [subtotal] => 1779.31
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 1779.31
    [notes] => Note
    [amount_to_pay] => 1779.31
    [acc] => 1
    [items] => [{"material_id":"8049","item_type":"raw","quantity":"98","unit_price":"1.36","discount_percent":"0.00","discount_flat":"0","total_price":"133.68"},{"material_id":"7754","item_type":"raw","quantity":"30","unit_price":"10.56","discount_percent":"0.00","discount_flat":"0","total_price":"316.82"},{"material_id":"8212","item_type":"raw","quantity":"28","unit_price":"15.84","discount_percent":"0.00","discount_flat":"0","total_price":"443.55"},{"material_id":"2532","item_type":"raw","quantity":"28","unit_price":"10.56","discount_percent":"0.00","discount_flat":"0","total_price":"295.68"},{"material_id":"8142","item_type":"raw","quantity":"14","unit_price":"15.84","discount_percent":"0.00","discount_flat":"0","total_price":"221.78"},{"material_id":"28095","item_type":"raw","quantity":"2","unit_price":"48.40","discount_percent":"0.00","discount_flat":"0","total_price":"96.80"},{"material_id":"8125","item_type":"raw","quantity":"28","unit_price":"9.68","discount_percent":"0.00","discount_flat":"0","total_price":"271"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 1779.31, Account ID: 1
Inserted PO ID: 136
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 8049, Qty: 98
History inserted for raw material: 8049
Products stock updated: +98
No batch data found for material_id: 8049
Processing item 1 - Type: raw, ID: 7754, Qty: 30
History inserted for raw material: 7754
Products stock updated: +30
No batch data found for material_id: 7754
Processing item 2 - Type: raw, ID: 8212, Qty: 28
History inserted for raw material: 8212
Products stock updated: +28
No batch data found for material_id: 8212
Processing item 3 - Type: raw, ID: 2532, Qty: 28
History inserted for raw material: 2532
Products stock updated: +28
No batch data found for material_id: 2532
Processing item 4 - Type: raw, ID: 8142, Qty: 14
History inserted for raw material: 8142
Products stock updated: +14
No batch data found for material_id: 8142
Processing item 5 - Type: raw, ID: 28095, Qty: 2
History inserted for raw material: 28095
Products stock updated: +2
No batch data found for material_id: 28095
Processing item 6 - Type: raw, ID: 8125, Qty: 28
History inserted for raw material: 8125
Products stock updated: +28
No batch data found for material_id: 8125
Purchase Pay record inserted with ID: 116
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 160, Wish To Pay: 160, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 715
Inserting Item: Array
(
    [material_id] => 24916
    [quantity] => 4
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13287
    [quantity] => 6
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 54
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 4
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 28
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30206
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-715: 160, Remaining: 0
Total Summary:
Grand Total: 160
Wish to Pay: 160
Total Paid: 160
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-715
            [amount] => 160
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 14:14:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 510, Wish To Pay: 510, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 716
Inserting Item: Array
(
    [material_id] => 25713
    [quantity] => 30
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 510
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 25713, Available: 0, Requested: 30
Stack trace: #0 {main}
Script execution completed at: 2026-07-02 14:21:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 680, Wish To Pay: 680, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 717
Inserting Item: Array
(
    [material_id] => 25713
    [quantity] => 30
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 510
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18981
    [quantity] => 28
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 196
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-717: 680, Remaining: 0
Total Summary:
Grand Total: 680
Wish to Pay: 680
Total Paid: 680
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-717
            [amount] => 680
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 14:22:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 718
Inserting Item: Array
(
    [material_id] => 9047
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-718: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-718
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 14:48:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 390, Wish To Pay: 390, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 719
Inserting Item: Array
(
    [material_id] => 24671
    [quantity] => 40
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13212
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13135
    [quantity] => 20
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-719: 390, Remaining: 0
Total Summary:
Grand Total: 390
Wish to Pay: 390
Total Paid: 390
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-719
            [amount] => 390
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 14:50:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 390, Wish To Pay: 390, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-397' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-02 14:50:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 721
Inserting Item: Array
(
    [material_id] => 28408
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-721: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-721
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 15:03:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 310, Wish To Pay: 310, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 722
Inserting Item: Array
(
    [material_id] => 22574
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12102
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28346
    [quantity] => 7
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 42
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-722: 310, Remaining: 0
Total Summary:
Grand Total: 310
Wish to Pay: 310
Total Paid: 310
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-722
            [amount] => 310
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 15:11:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 197, Wish To Pay: 197, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 723
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 24
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 48
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28127
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28650
    [quantity] => 1
    [unit_price] => 55
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28650, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-02 15:18:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 243, Wish To Pay: 243, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 724
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 24
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 48
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28127
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 261
    [quantity] => 20
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28650
    [quantity] => 1
    [unit_price] => 55
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-724: 243, Remaining: 0
Total Summary:
Grand Total: 243
Wish to Pay: 243
Total Paid: 243
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-724
            [amount] => 243
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 15:21:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 725
Inserting Item: Array
(
    [material_id] => 29838
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 23321
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-725: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-725
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 15:31:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 726
Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 15
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 52.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-726: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-726
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 15:37:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 540.08, Wish To Pay: 540.08, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 727
Inserting Item: Array
(
    [material_id] => 30077
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5265
    [quantity] => 5
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28979
    [quantity] => 5
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1569
    [quantity] => 10
    [unit_price] => 0.85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17070
    [quantity] => 10
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-727: 540.08, Remaining: 0
Total Summary:
Grand Total: 540.08
Wish to Pay: 540.08
Total Paid: 540.08
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-727
            [amount] => 540.08
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 15:45:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 340, Wish To Pay: 340, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 728
Inserting Item: Array
(
    [material_id] => 22424
    [quantity] => 10
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 350
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-728: 340, Remaining: 0
Total Summary:
Grand Total: 340
Wish to Pay: 340
Total Paid: 340
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-728
            [amount] => 340
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 15:50:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 160, Wish To Pay: 160, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 729
Inserting Item: Array
(
    [material_id] => 9199
    [quantity] => 1
    [unit_price] => 170
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-729: 160, Remaining: 0
Total Summary:
Grand Total: 160
Wish to Pay: 160
Total Paid: 160
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-729
            [amount] => 160
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 16:00:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 730
Inserting Item: Array
(
    [material_id] => 31400
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-730: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-730
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 16:01:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 500, Change: 200
Customer found: Walk In
Sale Order Inserted. ID: 731
Inserting Item: Array
(
    [material_id] => 13460
    [quantity] => 1
    [unit_price] => 250
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1236
    [quantity] => 20
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-731: 300, Remaining: 0
Total Summary:
Grand Total: 300
Wish to Pay: 300
Total Paid: 300
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-731
            [amount] => 300
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 16:09:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1070, Wish To Pay: 1070, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 732
Inserting Item: Array
(
    [material_id] => 3935
    [quantity] => 1
    [unit_price] => 275
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 275
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5393
    [quantity] => 1
    [unit_price] => 795
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 795
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-732: 1070, Remaining: 0
Total Summary:
Grand Total: 1070
Wish to Pay: 1070
Total Paid: 1070
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-732
            [amount] => 1070
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 16:14:36

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 145, Wish To Pay: 145, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 733
Inserting Item: Array
(
    [material_id] => 29053
    [quantity] => 5
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 75
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7346
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-733: 145, Remaining: 0
Total Summary:
Grand Total: 145
Wish to Pay: 145
Total Paid: 145
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-733
            [amount] => 145
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 16:17:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 734
Inserting Item: Array
(
    [material_id] => 24580
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-734: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-734
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 16:19:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 400, Wish To Pay: 400, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 735
Inserting Item: Array
(
    [material_id] => 28986
    [quantity] => 1
    [unit_price] => 415
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 415
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-735: 400, Remaining: 0
Total Summary:
Grand Total: 400
Wish to Pay: 400
Total Paid: 400
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-735
            [amount] => 400
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 16:23:45

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 736
Inserting Item: Array
(
    [material_id] => 8213
    [quantity] => 7
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 84
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-736: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-736
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 16:25:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 737
Inserting Item: Array
(
    [material_id] => 28934
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-737: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-737
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 16:27:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 220, Wish To Pay: 220, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 738
Inserting Item: Array
(
    [material_id] => 24271
    [quantity] => 10
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 220
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-738: 220, Remaining: 0
Total Summary:
Grand Total: 220
Wish to Pay: 220
Total Paid: 220
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-738
            [amount] => 220
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 16:32:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 460, Wish To Pay: 460, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 739
Inserting Item: Array
(
    [material_id] => 24569
    [quantity] => 10
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31404
    [quantity] => 1
    [unit_price] => 235
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 235
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30779
    [quantity] => 2
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-739: 460, Remaining: 0
Total Summary:
Grand Total: 460
Wish to Pay: 460
Total Paid: 460
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-739
            [amount] => 460
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 16:54:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 520, Wish To Pay: 520, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 740
Inserting Item: Array
(
    [material_id] => 31232
    [quantity] => 1
    [unit_price] => 530
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 530
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-740: 520, Remaining: 0
Total Summary:
Grand Total: 520
Wish to Pay: 520
Total Paid: 520
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-740
            [amount] => 520
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 17:19:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1233.13, Wish To Pay: 1233.13, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 741
Inserting Item: Array
(
    [material_id] => 850
    [quantity] => 4
    [unit_price] => 30.09
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120.36
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3966
    [quantity] => 20
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 340
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3846
    [quantity] => 1
    [unit_price] => 850
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 850
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14123
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-741: 1233.13, Remaining: 0
Total Summary:
Grand Total: 1233.13
Wish to Pay: 1233.13
Total Paid: 1233.13
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-741
            [amount] => 1233.13
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 17:32:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 742
Inserting Item: Array
(
    [material_id] => 18771
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13798
    [quantity] => 1
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31283
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-742: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-742
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 17:39:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 170, Wish To Pay: 170, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 743
Inserting Item: Array
(
    [material_id] => 28438
    [quantity] => 1
    [unit_price] => 175
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 175
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28438, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-02 17:42:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 1000, Change: 800
Customer found: Walk In
Sale Order Inserted. ID: 744
Inserting Item: Array
(
    [material_id] => 28438
    [quantity] => 1
    [unit_price] => 175
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 175
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28438, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-02 17:44:36

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 745
Inserting Item: Array
(
    [material_id] => 28409
    [quantity] => 1
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28438
    [quantity] => 1
    [unit_price] => 175
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 175
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-745: 200, Remaining: 0
Total Summary:
Grand Total: 200
Wish to Pay: 200
Total Paid: 200
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-745
            [amount] => 200
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 17:58:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 746
Inserting Item: Array
(
    [material_id] => 12997
    [quantity] => 10
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28408
    [quantity] => 2
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-746: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-746
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 17:59:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 45, Wish To Pay: 45, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 747
Inserting Item: Array
(
    [material_id] => 29976
    [quantity] => 1
    [unit_price] => 45
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 29976, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-02 18:00:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 230, Wish To Pay: 230, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 748
Inserting Item: Array
(
    [material_id] => 28224
    [quantity] => 1
    [unit_price] => 250
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-748: 230, Remaining: 0
Total Summary:
Grand Total: 230
Wish to Pay: 230
Total Paid: 230
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-748
            [amount] => 230
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 18:07:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 45, Wish To Pay: 45, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 749
Inserting Item: Array
(
    [material_id] => 29976
    [quantity] => 1
    [unit_price] => 45
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-749: 45, Remaining: 0
Total Summary:
Grand Total: 45
Wish to Pay: 45
Total Paid: 45
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-749
            [amount] => 45
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 18:08:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 9
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1739, Wish To Pay: 1739, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 750
Inserting Item: Array
(
    [material_id] => 22386
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30001
    [quantity] => 1
    [unit_price] => 530
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 530
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30440
    [quantity] => 1
    [unit_price] => 720
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 720
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 2
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 1
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21679
    [quantity] => 10
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25557
    [quantity] => 1
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29652
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9251
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-750: 1739, Remaining: 0
Total Summary:
Grand Total: 1739
Wish to Pay: 1739
Total Paid: 1739
Items Inserted: 9
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-750
            [amount] => 1739
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 18:15:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 299, Wish To Pay: 299, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 751
Inserting Item: Array
(
    [material_id] => 18898
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 593
    [quantity] => 15
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7174
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 7
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 49
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-751: 299, Remaining: 0
Total Summary:
Grand Total: 299
Wish to Pay: 299
Total Paid: 299
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-751
            [amount] => 299
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 18:23:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 63, Wish To Pay: 63, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 752
Inserting Item: Array
(
    [material_id] => 29314
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24576
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24576, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-02 18:53:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 753
Inserting Item: Array
(
    [material_id] => 29314
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24575
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-753: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-753
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 18:55:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 135, Wish To Pay: 135, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 754
Inserting Item: Array
(
    [material_id] => 24227
    [quantity] => 1
    [unit_price] => 135
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 135
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-754: 135, Remaining: 0
Total Summary:
Grand Total: 135
Wish to Pay: 135
Total Paid: 135
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-754
            [amount] => 135
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 19:02:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 59, Wish To Pay: 59, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 755
Inserting Item: Array
(
    [material_id] => 24751
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18771
    [quantity] => 2
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28618
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-755: 59, Remaining: 0
Total Summary:
Grand Total: 59
Wish to Pay: 59
Total Paid: 59
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-755
            [amount] => 59
            [type] => Previous Sale Due Payment
            [date] => 2026-07-02
        )

)

Script execution completed at: 2026-07-02 19:24:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 480, Wish To Pay: 480, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 756
Inserting Item: Array
(
    [material_id] => 24335
    [quantity] => 50
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 500
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-756: 480, Remaining: 0
Total Summary:
Grand Total: 480
Wish to Pay: 480
Total Paid: 480
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-756
            [amount] => 480
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 06:02:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 470, Wish To Pay: 470, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 757
Inserting Item: Array
(
    [material_id] => 13287
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28909
    [quantity] => 10
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 20984
    [quantity] => 20
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-757: 470, Remaining: 0
Total Summary:
Grand Total: 470
Wish to Pay: 470
Total Paid: 470
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-757
            [amount] => 470
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 06:48:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 470, Wish To Pay: 470, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 758
Inserting Item: Array
(
    [material_id] => 30745
    [quantity] => 1
    [unit_price] => 480
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 480
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-758: 470, Remaining: 0
Total Summary:
Grand Total: 470
Wish to Pay: 470
Total Paid: 470
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-758
            [amount] => 470
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 06:52:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 759
Inserting Item: Array
(
    [material_id] => 13952
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-759: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-759
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 06:53:09

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 800, Wish To Pay: 800, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 760
Inserting Item: Array
(
    [material_id] => 31640
    [quantity] => 1
    [unit_price] => 850
    [discount_percent] => 5.88
    [discount_amount] => 50
    [total_price] => 800
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-760: 800, Remaining: 0
Total Summary:
Grand Total: 800
Wish to Pay: 800
Total Paid: 800
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-760
            [amount] => 800
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 07:02:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 320, Wish To Pay: 320, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 761
Inserting Item: Array
(
    [material_id] => 31136
    [quantity] => 1
    [unit_price] => 320
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 320
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-761: 320, Remaining: 0
Total Summary:
Grand Total: 320
Wish to Pay: 320
Total Paid: 320
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-761
            [amount] => 320
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 07:03:47

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01304240767
    [supplier_id] => 89
    [purchase_date] => 2026-07-03
    [payment_term] => cash
    [subtotal] => 200.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 200.00
    [notes] => 
    [amount_to_pay] => 200.00
    [acc] => 1
    [items] => [{"material_id":"31764","item_type":"raw","quantity":"20","unit_price":"10","discount_percent":"0.00","discount_flat":"0","total_price":"200.00"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 200, Account ID: 1
Error: PO Number already exists
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 0130424076
    [supplier_id] => 89
    [purchase_date] => 2026-07-03
    [payment_term] => cash
    [subtotal] => 200.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 200.00
    [notes] => 
    [amount_to_pay] => 200.00
    [acc] => 1
    [items] => [{"material_id":"31764","item_type":"raw","quantity":"20","unit_price":"10","discount_percent":"0.00","discount_flat":"0","total_price":"200.00"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 200, Account ID: 1
Inserted PO ID: 137
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 31764, Qty: 20
History inserted for raw material: 31764
Products stock updated: +20
No batch data found for material_id: 31764
Purchase Pay record inserted with ID: 119
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 706.8, Wish To Pay: 706.8, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 762
Inserting Item: Array
(
    [material_id] => 27902
    [quantity] => 10
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30373
    [quantity] => 10
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29726
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31764
    [quantity] => 20
    [unit_price] => 11.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 230
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-762: 706.8, Remaining: 0
Total Summary:
Grand Total: 706.8
Wish to Pay: 706.8
Total Paid: 706.8
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-762
            [amount] => 706.8
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 07:13:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 257.4, Wish To Pay: 257.4, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 763
Inserting Item: Array
(
    [material_id] => 28033
    [quantity] => 14
    [unit_price] => 11.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 161
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28033, Available: 0, Requested: 14
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 07:43:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 257.4, Wish To Pay: 257.4, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 764
Inserting Item: Array
(
    [material_id] => 28033
    [quantity] => 14
    [unit_price] => 11.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 161
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28033, Available: 0, Requested: 14
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 07:43:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 765
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 2
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 14
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1702
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-765: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-765
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 08:00:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 111.6, Wish To Pay: 111.6, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 766
Inserting Item: Array
(
    [material_id] => 25365
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-766: 111.6, Remaining: 0
Total Summary:
Grand Total: 111.6
Wish to Pay: 111.6
Total Paid: 111.6
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-766
            [amount] => 111.6
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 08:01:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 500, Change: 320
Customer found: Walk In
Sale Order Inserted. ID: 767
Inserting Item: Array
(
    [material_id] => 25403
    [quantity] => 5
    [unit_price] => 36
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-767: 180, Remaining: 0
Total Summary:
Grand Total: 180
Wish to Pay: 180
Total Paid: 180
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-767
            [amount] => 180
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 08:06:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 651, Wish To Pay: 651, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 768
Inserting Item: Array
(
    [material_id] => 31757
    [quantity] => 10
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 500
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28252
    [quantity] => 10
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-768: 651, Remaining: 0
Total Summary:
Grand Total: 651
Wish to Pay: 651
Total Paid: 651
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-768
            [amount] => 651
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 08:09:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1163.75, Wish To Pay: 1163.75, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 769
Inserting Item: Array
(
    [material_id] => 13440
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17774
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22627
    [quantity] => 20
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 500
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24259
    [quantity] => 20
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7809
    [quantity] => 15
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 105
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-769: 1163.75, Remaining: 0
Total Summary:
Grand Total: 1163.75
Wish to Pay: 1163.75
Total Paid: 1163.75
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-769
            [amount] => 1163.75
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 08:19:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 940, Wish To Pay: 940, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 770
Inserting Item: Array
(
    [material_id] => 30216
    [quantity] => 1
    [unit_price] => 930
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 930
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31721
    [quantity] => 1
    [unit_price] => 165
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 165
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-770: 940, Remaining: 0
Total Summary:
Grand Total: 940
Wish to Pay: 940
Total Paid: 940
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-770
            [amount] => 940
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 08:31:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 61.5, Wish To Pay: 61.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 771
Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 5
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 17.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 4
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 44
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-771: 61.5, Remaining: 0
Total Summary:
Grand Total: 61.5
Wish to Pay: 61.5
Total Paid: 61.5
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-771
            [amount] => 61.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 08:37:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 71, Wish To Pay: 71, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 772
Inserting Item: Array
(
    [material_id] => 28364
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 2
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21811
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 21811, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 08:42:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 71, Wish To Pay: 71, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 773
Inserting Item: Array
(
    [material_id] => 28364
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 2
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21811
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-773: 71, Remaining: 0
Total Summary:
Grand Total: 71
Wish to Pay: 71
Total Paid: 71
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-773
            [amount] => 71
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 08:43:45

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 280, Wish To Pay: 280, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 774
Inserting Item: Array
(
    [material_id] => 28409
    [quantity] => 12
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-774: 280, Remaining: 0
Total Summary:
Grand Total: 280
Wish to Pay: 280
Total Paid: 280
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-774
            [amount] => 280
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 10:04:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 260, Wish To Pay: 260, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 775
Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 10
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21811
    [quantity] => 3
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29674
    [quantity] => 5
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 85
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30667
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-775: 260, Remaining: 0
Total Summary:
Grand Total: 260
Wish to Pay: 260
Total Paid: 260
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-775
            [amount] => 260
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 10:12:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 240, Wish To Pay: 240, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 776
Inserting Item: Array
(
    [material_id] => 5291
    [quantity] => 60
    [unit_price] => 4.02
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 241.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-776: 240, Remaining: 0
Total Summary:
Grand Total: 240
Wish to Pay: 240
Total Paid: 240
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-776
            [amount] => 240
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 10:46:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 301.76, Wish To Pay: 301.76, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 777
Inserting Item: Array
(
    [material_id] => 2532
    [quantity] => 14
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 168
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25196
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1860
    [quantity] => 4
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-777: 301.76, Remaining: 0
Total Summary:
Grand Total: 301.76
Wish to Pay: 301.76
Total Paid: 301.76
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-777
            [amount] => 301.76
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 10:57:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-445' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 11:05:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-445' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 11:06:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 780
Inserting Item: Array
(
    [material_id] => 29978
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-780: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-780
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 11:06:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 781
Inserting Item: Array
(
    [material_id] => 1936
    [quantity] => 20
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-781: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-781
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 11:17:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 38.9, Wish To Pay: 38.9, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 782
Inserting Item: Array
(
    [material_id] => 30162
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 1
    [unit_price] => 3.9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 3.9
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-782: 38.9, Remaining: 0
Total Summary:
Grand Total: 38.9
Wish to Pay: 38.9
Total Paid: 38.9
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-782
            [amount] => 38.9
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 11:23:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 38.9, Wish To Pay: 38.9, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-449' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 11:23:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 784
Inserting Item: Array
(
    [material_id] => 29086
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 29086, Available: 0, Requested: 2
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 11:24:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 785
Inserting Item: Array
(
    [material_id] => 29086
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 29086, Available: 0, Requested: 2
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 11:24:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-447' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 11:51:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-447' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 11:52:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 788
Inserting Item: Array
(
    [material_id] => 13313
    [quantity] => 5
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29906
    [quantity] => 1
    [unit_price] => 87.4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 87.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-788: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-788
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 11:53:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-450' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 12:07:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 790
Inserting Item: Array
(
    [material_id] => 29568
    [quantity] => 10
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-790: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-790
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 12:08:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 550, Wish To Pay: 550, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 791
Inserting Item: Array
(
    [material_id] => 27646
    [quantity] => 1
    [unit_price] => 550
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 550
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-791: 550, Remaining: 0
Total Summary:
Grand Total: 550
Wish to Pay: 550
Total Paid: 550
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-791
            [amount] => 550
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 12:41:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 792
Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 2
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-792: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-792
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 12:43:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 793
Inserting Item: Array
(
    [material_id] => 21882
    [quantity] => 4
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 52
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-793: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-793
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 12:49:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 430, Wish To Pay: 430, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 794
Inserting Item: Array
(
    [material_id] => 18148
    [quantity] => 10
    [unit_price] => 43
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 430
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-794: 430, Remaining: 0
Total Summary:
Grand Total: 430
Wish to Pay: 430
Total Paid: 430
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-794
            [amount] => 430
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 12:55:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 795
Inserting Item: Array
(
    [material_id] => 9514
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-795: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-795
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 13:08:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-456' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 13:08:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 797
Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 2
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 3
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-797: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-797
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 13:17:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 5.15, Wish To Pay: 5.15, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 798
Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30543, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 13:21:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 799
Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30543, Available: 0, Requested: 2
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 13:22:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 55, Wish To Pay: 55, Received: 500, Change: 445
Customer found: Walk In
Sale Order Inserted. ID: 800
Inserting Item: Array
(
    [material_id] => 22512
    [quantity] => 1
    [unit_price] => 55
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-800: 55, Remaining: 0
Total Summary:
Grand Total: 55
Wish to Pay: 55
Total Paid: 55
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-800
            [amount] => 55
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 13:35:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 335, Wish To Pay: 335, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 801
Inserting Item: Array
(
    [material_id] => 17774
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9585
    [quantity] => 1
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9034
    [quantity] => 1
    [unit_price] => 105
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 105
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-801: 335, Remaining: 0
Total Summary:
Grand Total: 335
Wish to Pay: 335
Total Paid: 335
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-801
            [amount] => 335
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 13:45:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 730, Wish To Pay: 730, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 802
Inserting Item: Array
(
    [material_id] => 22193
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 3.06
    [discount_amount] => 3
    [total_price] => 95
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29936
    [quantity] => 1
    [unit_price] => 650
    [discount_percent] => 2.31
    [discount_amount] => 15
    [total_price] => 635
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-802: 730, Remaining: 0
Total Summary:
Grand Total: 730
Wish to Pay: 730
Total Paid: 730
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-802
            [amount] => 730
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 13:55:47

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 803
Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-803: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-803
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 13:57:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 100, Change: 30
Customer found: Walk In
Sale Order Inserted. ID: 804
Inserting Item: Array
(
    [material_id] => 5163
    [quantity] => 2
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 32
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25167
    [quantity] => 4
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-804: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-804
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 14:00:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 490, Wish To Pay: 490, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 805
Inserting Item: Array
(
    [material_id] => 30439
    [quantity] => 1
    [unit_price] => 510
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 510
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-805: 490, Remaining: 0
Total Summary:
Grand Total: 490
Wish to Pay: 490
Total Paid: 490
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-805
            [amount] => 490
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 14:02:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 280, Wish To Pay: 280, Received: 400, Change: 120
Customer found: Walk In
Sale Order Inserted. ID: 806
Inserting Item: Array
(
    [material_id] => 21650
    [quantity] => 10
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5644
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-806: 280, Remaining: 0
Total Summary:
Grand Total: 280
Wish to Pay: 280
Total Paid: 280
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-806
            [amount] => 280
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 14:10:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 255, Wish To Pay: 255, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 807
Inserting Item: Array
(
    [material_id] => 18923
    [quantity] => 8
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13848
    [quantity] => 10
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28091
    [quantity] => 7
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 49
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28091, Available: 0, Requested: 7
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 14:21:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 415, Wish To Pay: 415, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 808
Inserting Item: Array
(
    [material_id] => 18923
    [quantity] => 8
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13848
    [quantity] => 10
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7809
    [quantity] => 7
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 49
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24896
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5724
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-808: 415, Remaining: 0
Total Summary:
Grand Total: 415
Wish to Pay: 415
Total Paid: 415
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-808
            [amount] => 415
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 14:23:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 745.5, Wish To Pay: 745.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 809
Inserting Item: Array
(
    [material_id] => 9041
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13212
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28236
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28160
    [quantity] => 12
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29225
    [quantity] => 1
    [unit_price] => 230
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 230
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5868
    [quantity] => 10
    [unit_price] => 2.25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-809: 745.5, Remaining: 0
Total Summary:
Grand Total: 745.5
Wish to Pay: 745.5
Total Paid: 745.5
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-809
            [amount] => 745.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 14:31:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 380, Wish To Pay: 380, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 810
Inserting Item: Array
(
    [material_id] => 30116
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29522
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-810: 380, Remaining: 0
Total Summary:
Grand Total: 380
Wish to Pay: 380
Total Paid: 380
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-810
            [amount] => 380
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 14:33:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 811
Inserting Item: Array
(
    [material_id] => 28984
    [quantity] => 1
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-811: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-811
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 14:40:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 130, Wish To Pay: 130, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 812
Inserting Item: Array
(
    [material_id] => 3547
    [quantity] => 6
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 132
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-812: 130, Remaining: 0
Total Summary:
Grand Total: 130
Wish to Pay: 130
Total Paid: 130
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-812
            [amount] => 130
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 14:44:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 9, Wish To Pay: 9, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 813
Inserting Item: Array
(
    [material_id] => 5868
    [quantity] => 4
    [unit_price] => 2.25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 9
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-813: 9, Remaining: 0
Total Summary:
Grand Total: 9
Wish to Pay: 9
Total Paid: 9
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-813
            [amount] => 9
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 15:05:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 320, Wish To Pay: 320, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 814
Inserting Item: Array
(
    [material_id] => 483
    [quantity] => 14
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 252
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-814: 320, Remaining: 0
Total Summary:
Grand Total: 320
Wish to Pay: 320
Total Paid: 320
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-814
            [amount] => 320
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 15:08:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 750.6, Wish To Pay: 750.6, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 815
Inserting Item: Array
(
    [material_id] => 21640
    [quantity] => 45
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 585
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 21640, Available: 18, Requested: 45
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 15:24:10

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 750.6, Wish To Pay: 750.6, Received: 1000, Change: 249.4
Customer found: Walk In
Sale Order Inserted. ID: 816
Inserting Item: Array
(
    [material_id] => 21640
    [quantity] => 45
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 585
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 21640, Available: 18, Requested: 45
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 15:25:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 750.6, Wish To Pay: 750.6, Received: 1000, Change: 249.4
Customer found: Walk In
Sale Order Inserted. ID: 817
Inserting Item: Array
(
    [material_id] => 21640
    [quantity] => 45
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 585
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 21640, Available: 18, Requested: 45
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 15:26:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 750.6, Wish To Pay: 750.6, Received: 1000, Change: 249.4
Customer found: Walk In
Sale Order Inserted. ID: 818
Inserting Item: Array
(
    [material_id] => 9172
    [quantity] => 14
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 168
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 5
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 1
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21640
    [quantity] => 45
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 585
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-818: 750.6, Remaining: 0
Total Summary:
Grand Total: 750.6
Wish to Pay: 750.6
Total Paid: 750.6
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-818
            [amount] => 750.6
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 15:26:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 550, Wish To Pay: 550, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 819
Inserting Item: Array
(
    [material_id] => 31191
    [quantity] => 1
    [unit_price] => 451
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 451
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30796
    [quantity] => 1
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-819: 550, Remaining: 0
Total Summary:
Grand Total: 550
Wish to Pay: 550
Total Paid: 550
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-819
            [amount] => 550
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 15:28:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 820
Inserting Item: Array
(
    [material_id] => 28144
    [quantity] => 30
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 4733
    [quantity] => 50
    [unit_price] => 1.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 65
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19009
    [quantity] => 1
    [unit_price] => 3.24
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 3.24
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-820: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-820
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 15:33:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 245, Wish To Pay: 245, Received: 500, Change: 255
Customer found: Walk In
Sale Order Inserted. ID: 821
Inserting Item: Array
(
    [material_id] => 28530
    [quantity] => 30
    [unit_price] => 1.22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 36.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28220
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7278
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-821: 245, Remaining: 0
Total Summary:
Grand Total: 245
Wish to Pay: 245
Total Paid: 245
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-821
            [amount] => 245
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 15:36:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 340.2, Wish To Pay: 340.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 822
Inserting Item: Array
(
    [material_id] => 24505
    [quantity] => 6
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-822: 340.2, Remaining: 0
Total Summary:
Grand Total: 340.2
Wish to Pay: 340.2
Total Paid: 340.2
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-822
            [amount] => 340.2
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 15:41:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 500, Change: 350
Customer found: Walk In
Sale Order Inserted. ID: 823
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13229
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-823: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-823
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 15:44:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 500, Change: 350
Customer found: Walk In
Sale Order Inserted. ID: 824
Inserting Item: Array
(
    [material_id] => 475
    [quantity] => 14
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 154
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 475, Available: 0, Requested: 14
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 15:49:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 500, Change: 350
Customer found: Walk In
Sale Order Inserted. ID: 825
Inserting Item: Array
(
    [material_id] => 475
    [quantity] => 14
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 154
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 475, Available: 0, Requested: 14
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 15:53:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 500, Change: 360
Customer found: Walk In
Sale Order Inserted. ID: 826
Inserting Item: Array
(
    [material_id] => 28312
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 4
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 28
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24741
    [quantity] => 2
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 14
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-826: 140, Remaining: 0
Total Summary:
Grand Total: 140
Wish to Pay: 140
Total Paid: 140
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-826
            [amount] => 140
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 15:54:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 827
Inserting Item: Array
(
    [material_id] => 475
    [quantity] => 14
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 154
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-827: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-827
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 15:56:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 82, Wish To Pay: 82, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 828
Inserting Item: Array
(
    [material_id] => 1912
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28640
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-828: 82, Remaining: 0
Total Summary:
Grand Total: 82
Wish to Pay: 82
Total Paid: 82
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-828
            [amount] => 82
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 16:01:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 25, Wish To Pay: 25, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 829
Inserting Item: Array
(
    [material_id] => 28409
    [quantity] => 1
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-829: 25, Remaining: 0
Total Summary:
Grand Total: 25
Wish to Pay: 25
Total Paid: 25
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-829
            [amount] => 25
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 16:01:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 320, Wish To Pay: 320, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 830
Inserting Item: Array
(
    [material_id] => 27906
    [quantity] => 10
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 27906, Available: 0, Requested: 10
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 16:08:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 320, Wish To Pay: 320, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 831
Inserting Item: Array
(
    [material_id] => 27906
    [quantity] => 10
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 27906, Available: 0, Requested: 10
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 16:09:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 320, Wish To Pay: 320, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 832
Inserting Item: Array
(
    [material_id] => 25376
    [quantity] => 10
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27906
    [quantity] => 10
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-832: 320, Remaining: 0
Total Summary:
Grand Total: 320
Wish to Pay: 320
Total Paid: 320
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-832
            [amount] => 320
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 16:10:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 130, Wish To Pay: 130, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 833
Inserting Item: Array
(
    [material_id] => 31064
    [quantity] => 1
    [unit_price] => 65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 65
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5830
    [quantity] => 1
    [unit_price] => 65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 65
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-833: 130, Remaining: 0
Total Summary:
Grand Total: 130
Wish to Pay: 130
Total Paid: 130
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-833
            [amount] => 130
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 16:23:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 834
Inserting Item: Array
(
    [material_id] => 29024
    [quantity] => 2
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-834: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-834
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 16:26:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1000.05, Wish To Pay: 1000.05, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 835
Inserting Item: Array
(
    [material_id] => 30507
    [quantity] => 10
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 500
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28506
    [quantity] => 1
    [unit_price] => 180
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19060
    [quantity] => 1
    [unit_price] => 230
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 230
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18742
    [quantity] => 1
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 18
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18743
    [quantity] => 6
    [unit_price] => 1.15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6.9
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 4665
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-835: 1000.05, Remaining: 0
Total Summary:
Grand Total: 1000.05
Wish to Pay: 1000.05
Total Paid: 1000.05
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-835
            [amount] => 1000.05
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 17:04:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 400, Wish To Pay: 400, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 836
Inserting Item: Array
(
    [material_id] => 29844
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-836: 400, Remaining: 0
Total Summary:
Grand Total: 400
Wish to Pay: 400
Total Paid: 400
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-836
            [amount] => 400
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 17:09:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 240, Wish To Pay: 240, Received: 500, Change: 260
Customer found: Walk In
Sale Order Inserted. ID: 837
Inserting Item: Array
(
    [material_id] => 300
    [quantity] => 10
    [unit_price] => 14
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29873
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-837: 240, Remaining: 0
Total Summary:
Grand Total: 240
Wish to Pay: 240
Total Paid: 240
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-837
            [amount] => 240
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 17:13:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 838
Inserting Item: Array
(
    [material_id] => 24631
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-838: 35, Remaining: 0
Total Summary:
Grand Total: 35
Wish to Pay: 35
Total Paid: 35
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-838
            [amount] => 35
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 17:16:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 839
Inserting Item: Array
(
    [material_id] => 9181
    [quantity] => 10
    [unit_price] => 12.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 125
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-839: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-839
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 17:18:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 650, Wish To Pay: 650, Received: 700, Change: 50
Customer found: Walk In
Sale Order Inserted. ID: 840
Inserting Item: Array
(
    [material_id] => 29667
    [quantity] => 10
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30453
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29383
    [quantity] => 1
    [unit_price] => 300
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-840: 650, Remaining: 0
Total Summary:
Grand Total: 650
Wish to Pay: 650
Total Paid: 650
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-840
            [amount] => 650
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 17:26:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 665, Wish To Pay: 665, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 841
Inserting Item: Array
(
    [material_id] => 29938
    [quantity] => 1
    [unit_price] => 665
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 665
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-841: 665, Remaining: 0
Total Summary:
Grand Total: 665
Wish to Pay: 665
Total Paid: 665
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-841
            [amount] => 665
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 17:31:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 842
Inserting Item: Array
(
    [material_id] => 3577
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-842: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-842
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 17:35:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 843
Inserting Item: Array
(
    [material_id] => 29012
    [quantity] => 10
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-843: 300, Remaining: 0
Total Summary:
Grand Total: 300
Wish to Pay: 300
Total Paid: 300
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-843
            [amount] => 300
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 17:38:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 844
Inserting Item: Array
(
    [material_id] => 25650
    [quantity] => 30
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-844: 180, Remaining: 0
Total Summary:
Grand Total: 180
Wish to Pay: 180
Total Paid: 180
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-844
            [amount] => 180
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 18:18:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-494' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 18:18:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50.2, Wish To Pay: 50.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 846
Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1912
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 8
    [unit_price] => 3.9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 31.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30543, Available: 0, Requested: 8
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 18:30:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50.2, Wish To Pay: 50.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 847
Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1912
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 8
    [unit_price] => 3.9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 31.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30543, Available: 0, Requested: 8
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 18:30:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50.2, Wish To Pay: 50.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 848
Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1912
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 8
    [unit_price] => 3.9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 31.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30543, Available: 0, Requested: 8
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 18:55:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50.2, Wish To Pay: 50.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 849
Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1912
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14611
    [quantity] => 10
    [unit_price] => 0.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 3
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 8
    [unit_price] => 3.9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 31.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30543, Available: 0, Requested: 8
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 18:55:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50.2, Wish To Pay: 50.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 850
Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1912
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14611
    [quantity] => 10
    [unit_price] => 0.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 3
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 8
    [unit_price] => 3.9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 31.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30543, Available: 0, Requested: 8
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 18:55:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50.2, Wish To Pay: 50.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 851
Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1912
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14611
    [quantity] => 10
    [unit_price] => 0.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 3
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 8
    [unit_price] => 3.9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 31.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-851: 50.2, Remaining: 0
Total Summary:
Grand Total: 50.2
Wish to Pay: 50.2
Total Paid: 50.2
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-851
            [amount] => 50.2
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 18:57:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50.2, Wish To Pay: 50.2, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-495' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 18:57:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 415.5, Wish To Pay: 415.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 853
Inserting Item: Array
(
    [material_id] => 22568
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5502
    [quantity] => 1
    [unit_price] => 220
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 220
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28346
    [quantity] => 4
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 3
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 16.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30017
    [quantity] => 1
    [unit_price] => 85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 85
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-853: 415.5, Remaining: 0
Total Summary:
Grand Total: 415.5
Wish to Pay: 415.5
Total Paid: 415.5
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-853
            [amount] => 415.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 19:05:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 17.5, Wish To Pay: 17.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 854
Inserting Item: Array
(
    [material_id] => 22355
    [quantity] => 1
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 1
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-854: 17.5, Remaining: 0
Total Summary:
Grand Total: 17.5
Wish to Pay: 17.5
Total Paid: 17.5
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-854
            [amount] => 17.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 19:10:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 17.5, Wish To Pay: 17.5, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-497' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 19:10:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 856
Inserting Item: Array
(
    [material_id] => 28485
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-856: 90, Remaining: 0
Total Summary:
Grand Total: 90
Wish to Pay: 90
Total Paid: 90
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-856
            [amount] => 90
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 19:13:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-498' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 19:13:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 39.5, Wish To Pay: 39.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 858
Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 5
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 17.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 2
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-858: 39.5, Remaining: 0
Total Summary:
Grand Total: 39.5
Wish to Pay: 39.5
Total Paid: 39.5
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-858
            [amount] => 39.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 19:13:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 39.5, Wish To Pay: 39.5, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-499' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 19:13:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 860
Inserting Item: Array
(
    [material_id] => 18516
    [quantity] => 2
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 18516, Available: 0, Requested: 2
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 19:15:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 861
Inserting Item: Array
(
    [material_id] => 18516
    [quantity] => 2
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 18516, Available: 0, Requested: 2
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 19:15:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 34, Wish To Pay: 34, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 862
Inserting Item: Array
(
    [material_id] => 24249
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24249, Available: 0, Requested: 2
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 19:18:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 34, Wish To Pay: 34, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 863
Inserting Item: Array
(
    [material_id] => 24249
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24249, Available: 0, Requested: 2
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 19:18:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 124.27, Wish To Pay: 124.27, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 864
Inserting Item: Array
(
    [material_id] => 24249
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24249, Available: 0, Requested: 2
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 19:20:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 516.27, Wish To Pay: 516.27, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 865
Inserting Item: Array
(
    [material_id] => 24249
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24249, Available: 0, Requested: 2
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 19:29:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 458.67, Wish To Pay: 458.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 866
Inserting Item: Array
(
    [material_id] => 24249
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24249, Available: 0, Requested: 2
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 19:29:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 458.67, Wish To Pay: 458.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 867
Inserting Item: Array
(
    [material_id] => 24249
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24249, Available: 0, Requested: 2
Stack trace: #0 {main}
Script execution completed at: 2026-07-03 19:29:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 514.67, Wish To Pay: 514.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 868
Inserting Item: Array
(
    [material_id] => 24896
    [quantity] => 4
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18881
    [quantity] => 1
    [unit_price] => 90.27
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90.27
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18980
    [quantity] => 14
    [unit_price] => 11.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 161
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29355
    [quantity] => 14
    [unit_price] => 11.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 161
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22355
    [quantity] => 3
    [unit_price] => 12
    [discount_percent] => 44.44
    [discount_amount] => 16
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24346
    [quantity] => 2
    [unit_price] => 4.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 6
    [unit_price] => 11
    [discount_percent] => 24.24
    [discount_amount] => 16
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-868: 514.67, Remaining: 0
Total Summary:
Grand Total: 514.67
Wish to Pay: 514.67
Total Paid: 514.67
Items Inserted: 7
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-868
            [amount] => 514.67
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 19:31:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 514.67, Wish To Pay: 514.67, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-500' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 19:31:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 3, Wish To Pay: 3, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 870
Inserting Item: Array
(
    [material_id] => 14611
    [quantity] => 10
    [unit_price] => 0.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 3
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-870: 3, Remaining: 0
Total Summary:
Grand Total: 3
Wish to Pay: 3
Total Paid: 3
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-870
            [amount] => 3
            [type] => Previous Sale Due Payment
            [date] => 2026-07-03
        )

)

Script execution completed at: 2026-07-03 19:50:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 3, Wish To Pay: 3, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-501' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-03 19:50:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 104, Wish To Pay: 104, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 872
Inserting Item: Array
(
    [material_id] => 31367
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 2
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 4
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-872: 104, Remaining: 0
Total Summary:
Grand Total: 104
Wish to Pay: 104
Total Paid: 104
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-872
            [amount] => 104
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 02:48:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 578, Wish To Pay: 578, Received: 1000, Change: 422
Customer found: Walk In
Sale Order Inserted. ID: 873
Inserting Item: Array
(
    [material_id] => 7962
    [quantity] => 20
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29032
    [quantity] => 10
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27941
    [quantity] => 14
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30302
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30834
    [quantity] => 1
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-873: 578, Remaining: 0
Total Summary:
Grand Total: 578
Wish to Pay: 578
Total Paid: 578
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-873
            [amount] => 578
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 03:03:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 874
Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-874: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-874
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 03:04:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 340, Wish To Pay: 340, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 875
Inserting Item: Array
(
    [material_id] => 30690
    [quantity] => 1
    [unit_price] => 340
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 340
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-875: 340, Remaining: 0
Total Summary:
Grand Total: 340
Wish to Pay: 340
Total Paid: 340
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-875
            [amount] => 340
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 03:14:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 876
Inserting Item: Array
(
    [material_id] => 28510
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-876: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-876
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 03:24:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 877
Inserting Item: Array
(
    [material_id] => 28468
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-877: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-877
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 03:48:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 878
Inserting Item: Array
(
    [material_id] => 31367
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-878: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-878
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 03:50:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 879
Inserting Item: Array
(
    [material_id] => 31617
    [quantity] => 4
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-879: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-879
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 03:54:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 220, Wish To Pay: 220, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 880
Inserting Item: Array
(
    [material_id] => 12182
    [quantity] => 2
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28485
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-880: 220, Remaining: 0
Total Summary:
Grand Total: 220
Wish to Pay: 220
Total Paid: 220
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-880
            [amount] => 220
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 04:30:46

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01313781311
    [supplier_id] => 96
    [purchase_date] => 2026-07-04
    [payment_term] => credit
    [subtotal] => 2119.84
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 2119.84
    [notes] => 
    [items] => [{"material_id":"28359","item_type":"raw","quantity":"12","unit_price":"60.56","discount_percent":"0.00","discount_flat":"0","total_price":"726.72"},{"material_id":"28358","item_type":"raw","quantity":"2","unit_price":"149.39","discount_percent":"0.00","discount_flat":"0","total_price":"298.78"},{"material_id":"28362","item_type":"raw","quantity":"2","unit_price":"242.25","discount_percent":"0.00","discount_flat":"0","total_price":"484.50"},{"material_id":"31767","item_type":"raw","quantity":"3","unit_price":"56.52","discount_percent":"0.00","discount_flat":"0","total_price":"169.56"},{"material_id":"29666","item_type":"raw","quantity":"25","unit_price":"12.12","discount_percent":"0.00","discount_flat":"0","total_price":"303.00"},{"material_id":"28623","item_type":"raw","quantity":"2","unit_price":"68.64","discount_percent":"0.00","discount_flat":"0","total_price":"137.28"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: credit, Amount to Pay: 0, Account ID: 0
Inserted PO ID: 138
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 28359, Qty: 12
History inserted for raw material: 28359
Products stock updated: +12
No batch data found for material_id: 28359
Processing item 1 - Type: raw, ID: 28358, Qty: 2
History inserted for raw material: 28358
Products stock updated: +2
No batch data found for material_id: 28358
Processing item 2 - Type: raw, ID: 28362, Qty: 2
History inserted for raw material: 28362
Products stock updated: +2
No batch data found for material_id: 28362
Processing item 3 - Type: raw, ID: 31767, Qty: 3
History inserted for raw material: 31767
Products stock updated: +3
No batch data found for material_id: 31767
Processing item 4 - Type: raw, ID: 29666, Qty: 25
History inserted for raw material: 29666
Products stock updated: +25
No batch data found for material_id: 29666
Processing item 5 - Type: raw, ID: 28623, Qty: 2
History inserted for raw material: 28623
Products stock updated: +2
No batch data found for material_id: 28623
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10.04, Wish To Pay: 10.04, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 881
Inserting Item: Array
(
    [material_id] => 24361
    [quantity] => 4
    [unit_price] => 2.51
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10.04
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-881: 10.04, Remaining: 0
Total Summary:
Grand Total: 10.04
Wish to Pay: 10.04
Total Paid: 10.04
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-881
            [amount] => 10.04
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 05:18:14

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01723546480
    [supplier_id] => 97
    [purchase_date] => 2026-07-04
    [payment_term] => cash
    [subtotal] => 1390.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0.72
    [discount] => 10
    [shipping] => 0
    [grand_total] => 1380.00
    [notes] => 
    [amount_to_pay] => 1380.00
    [acc] => 1
    [items] => [{"material_id":"30605","item_type":"raw","quantity":"1","unit_price":"625","discount_percent":"0.00","discount_flat":"0","total_price":"625.00"},{"material_id":"30261","item_type":"raw","quantity":"1","unit_price":"625","discount_percent":"0.00","discount_flat":"0","total_price":"625.00"},{"material_id":"31768","item_type":"raw","quantity":"1","unit_price":"140","discount_percent":"0.00","discount_flat":"0","total_price":"140.00"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 1380, Account ID: 1
Inserted PO ID: 139
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 30605, Qty: 1
History inserted for raw material: 30605
Products stock updated: +1
No batch data found for material_id: 30605
Processing item 1 - Type: raw, ID: 30261, Qty: 1
History inserted for raw material: 30261
Products stock updated: +1
No batch data found for material_id: 30261
Processing item 2 - Type: raw, ID: 31768, Qty: 1
History inserted for raw material: 31768
Products stock updated: +1
No batch data found for material_id: 31768
Purchase Pay record inserted with ID: 120
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01718563808
    [supplier_id] => 98
    [purchase_date] => 2026-07-04
    [payment_term] => cash
    [subtotal] => 1264.00
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 1264.00
    [notes] => 
    [amount_to_pay] => 1264.00
    [acc] => 1
    [items] => [{"material_id":"29935","item_type":"raw","quantity":"2","unit_price":"632","discount_percent":"0.00","discount_flat":"0","total_price":"1264.00"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 1264, Account ID: 1
Inserted PO ID: 140
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 29935, Qty: 2
History inserted for raw material: 29935
Products stock updated: +2
No batch data found for material_id: 29935
Purchase Pay record inserted with ID: 121
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 882
Inserting Item: Array
(
    [material_id] => 8886
    [quantity] => 20
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-882: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-882
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 06:19:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 840, Wish To Pay: 840, Received: 1000, Change: 160
Customer found: Walk In
Sale Order Inserted. ID: 883
Inserting Item: Array
(
    [material_id] => 3674
    [quantity] => 1
    [unit_price] => 65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 65
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29110
    [quantity] => 1
    [unit_price] => 220
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 220
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30175
    [quantity] => 1
    [unit_price] => 550
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 550
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30832
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24425
    [quantity] => 1
    [unit_price] => 120
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-883: 840, Remaining: 0
Total Summary:
Grand Total: 840
Wish to Pay: 840
Total Paid: 840
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-883
            [amount] => 840
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 07:12:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 95, Wish To Pay: 95, Received: 500, Change: 405
Customer found: Walk In
Sale Order Inserted. ID: 884
Inserting Item: Array
(
    [material_id] => 13136
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-884: 95, Remaining: 0
Total Summary:
Grand Total: 95
Wish to Pay: 95
Total Paid: 95
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-884
            [amount] => 95
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 07:37:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2650.5, Wish To Pay: 2650.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 885
Inserting Item: Array
(
    [material_id] => 22739
    [quantity] => 10
    [unit_price] => 120
    [discount_percent] => 1.33
    [discount_amount] => 16
    [total_price] => 1184
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1860
    [quantity] => 15
    [unit_price] => 17.5
    [discount_percent] => 4.57
    [discount_amount] => 12
    [total_price] => 250.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3961
    [quantity] => 20
    [unit_price] => 8
    [discount_percent] => 5
    [discount_amount] => 8
    [total_price] => 152
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 4573
    [quantity] => 30
    [unit_price] => 11
    [discount_percent] => 4.55
    [discount_amount] => 15
    [total_price] => 315
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12098
    [quantity] => 20
    [unit_price] => 4.5
    [discount_percent] => 4.44
    [discount_amount] => 4
    [total_price] => 86
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5617
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 4.17
    [discount_amount] => 5
    [total_price] => 115
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30271
    [quantity] => 1
    [unit_price] => 600
    [discount_percent] => 8.67
    [discount_amount] => 52
    [total_price] => 548
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-885: 2650.5, Remaining: 0
Total Summary:
Grand Total: 2650.5
Wish to Pay: 2650.5
Total Paid: 2650.5
Items Inserted: 7
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-885
            [amount] => 2650.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 07:59:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 760.4, Wish To Pay: 760.4, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 886
Inserting Item: Array
(
    [material_id] => 1981
    [quantity] => 30
    [unit_price] => 0.33
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 9.9
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30637
    [quantity] => 30
    [unit_price] => 5.25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 157.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1952
    [quantity] => 2
    [unit_price] => 210
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 420
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3743
    [quantity] => 10
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 30
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 165
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-886: 760.4, Remaining: 0
Total Summary:
Grand Total: 760.4
Wish to Pay: 760.4
Total Paid: 760.4
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-886
            [amount] => 760.4
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 08:25:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 310, Wish To Pay: 310, Received: 1020, Change: 710
Customer found: Walk In
Sale Order Inserted. ID: 887
Inserting Item: Array
(
    [material_id] => 30032
    [quantity] => 1
    [unit_price] => 325
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 325
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-887: 310, Remaining: 0
Total Summary:
Grand Total: 310
Wish to Pay: 310
Total Paid: 310
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-887
            [amount] => 310
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 08:48:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 30
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 51.88, Wish To Pay: 51.88, Received: 0, Change: 0
Customer found: Al-Hera Healthcare & pharma
Sale Order Inserted. ID: 888
Inserting Item: Array
(
    [material_id] => 18727
    [quantity] => 10
    [unit_price] => 5.23
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 52.3
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-888: 51.88, Remaining: 0
Total Summary:
Grand Total: 51.88
Wish to Pay: 51.88
Total Paid: 51.88
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-888
            [amount] => 51.88
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 09:02:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 240, Wish To Pay: 240, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 889
Inserting Item: Array
(
    [material_id] => 28231
    [quantity] => 1
    [unit_price] => 240
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28231, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 09:34:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 240, Wish To Pay: 240, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 890
Inserting Item: Array
(
    [material_id] => 28232
    [quantity] => 1
    [unit_price] => 240
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-890: 240, Remaining: 0
Total Summary:
Grand Total: 240
Wish to Pay: 240
Total Paid: 240
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-890
            [amount] => 240
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 09:34:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 275, Wish To Pay: 275, Received: 500, Change: 225
Customer found: Walk In
Sale Order Inserted. ID: 891
Inserting Item: Array
(
    [material_id] => 28383
    [quantity] => 1
    [unit_price] => 275
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 275
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-891: 275, Remaining: 0
Total Summary:
Grand Total: 275
Wish to Pay: 275
Total Paid: 275
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-891
            [amount] => 275
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 09:40:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 892
Inserting Item: Array
(
    [material_id] => 30679
    [quantity] => 10
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-892: 180, Remaining: 0
Total Summary:
Grand Total: 180
Wish to Pay: 180
Total Paid: 180
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-892
            [amount] => 180
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 09:52:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 100, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 893
Inserting Item: Array
(
    [material_id] => 24595
    [quantity] => 1
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 4
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1973
    [quantity] => 4
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 52
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-893: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-893
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 10:00:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 894
Inserting Item: Array
(
    [material_id] => 31617
    [quantity] => 4
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-894: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-894
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 10:05:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 895
Inserting Item: Array
(
    [material_id] => 26581
    [quantity] => 4
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 26542
    [quantity] => 5
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-895: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-895
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 10:50:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 896
Inserting Item: Array
(
    [material_id] => 28510
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-896: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-896
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 10:55:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 897
Inserting Item: Array
(
    [material_id] => 28364
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-897: 35, Remaining: 0
Total Summary:
Grand Total: 35
Wish to Pay: 35
Total Paid: 35
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-897
            [amount] => 35
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 10:57:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 898
Inserting Item: Array
(
    [material_id] => 25064
    [quantity] => 5
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30833
    [quantity] => 4
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30833, Available: 0, Requested: 4
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 11:01:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 899
Inserting Item: Array
(
    [material_id] => 25064
    [quantity] => 5
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30833
    [quantity] => 4
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30833, Available: 0, Requested: 4
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 11:01:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 900
Inserting Item: Array
(
    [material_id] => 25064
    [quantity] => 5
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30833
    [quantity] => 4
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30833, Available: 0, Requested: 4
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 11:01:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 901
Inserting Item: Array
(
    [material_id] => 25064
    [quantity] => 5
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30832
    [quantity] => 4
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31400
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-901: 180, Remaining: 0
Total Summary:
Grand Total: 180
Wish to Pay: 180
Total Paid: 180
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-901
            [amount] => 180
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 11:03:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 48, Wish To Pay: 48, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 902
Inserting Item: Array
(
    [material_id] => 13383
    [quantity] => 2
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31386
    [quantity] => 1
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 6
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 21
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-902: 48, Remaining: 0
Total Summary:
Grand Total: 48
Wish to Pay: 48
Total Paid: 48
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-902
            [amount] => 48
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 11:25:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 540, Wish To Pay: 540, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 903
Inserting Item: Array
(
    [material_id] => 17606
    [quantity] => 15
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 375
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25377
    [quantity] => 6
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 108
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 25377, Available: 0, Requested: 6
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 11:36:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 520, Wish To Pay: 520, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 904
Inserting Item: Array
(
    [material_id] => 17606
    [quantity] => 15
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 375
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25377
    [quantity] => 6
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 108
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24351
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-904: 520, Remaining: 0
Total Summary:
Grand Total: 520
Wish to Pay: 520
Total Paid: 520
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-904
            [amount] => 520
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 11:42:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 905
Inserting Item: Array
(
    [material_id] => 27760
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-905: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-905
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 11:42:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 66, Wish To Pay: 66, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 906
Inserting Item: Array
(
    [material_id] => 4726
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25403
    [quantity] => 1
    [unit_price] => 36
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 36
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-906: 66, Remaining: 0
Total Summary:
Grand Total: 66
Wish to Pay: 66
Total Paid: 66
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-906
            [amount] => 66
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 11:57:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 570.9, Wish To Pay: 570.9, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 907
Inserting Item: Array
(
    [material_id] => 1981
    [quantity] => 30
    [unit_price] => 0.33
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 9.9
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18980
    [quantity] => 28
    [unit_price] => 11.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 322
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5888
    [quantity] => 20
    [unit_price] => 12.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-907: 570.9, Remaining: 0
Total Summary:
Grand Total: 570.9
Wish to Pay: 570.9
Total Paid: 570.9
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-907
            [amount] => 570.9
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 12:08:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 260.1, Wish To Pay: 260.1, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 908
Inserting Item: Array
(
    [material_id] => 30077
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 3
    [discount_amount] => 3
    [total_price] => 97
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22386
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 2
    [discount_amount] => 2
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 10
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 23332
    [quantity] => 5
    [unit_price] => 2.02
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10.1
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 23332, Available: 0, Requested: 5
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 12:47:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 260, Wish To Pay: 260, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 909
Inserting Item: Array
(
    [material_id] => 30077
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 3
    [discount_amount] => 3
    [total_price] => 97
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22386
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 2
    [discount_amount] => 2
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 10
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 23341
    [quantity] => 5
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-909: 260, Remaining: 0
Total Summary:
Grand Total: 260
Wish to Pay: 260
Total Paid: 260
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-909
            [amount] => 260
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 12:48:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 130, Wish To Pay: 130, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 910
Inserting Item: Array
(
    [material_id] => 30213
    [quantity] => 1
    [unit_price] => 140
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-910: 130, Remaining: 0
Total Summary:
Grand Total: 130
Wish to Pay: 130
Total Paid: 130
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-910
            [amount] => 130
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 13:10:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 911
Inserting Item: Array
(
    [material_id] => 13285
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-911: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-911
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 13:53:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 12, Wish To Pay: 12, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 912
Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-912: 12, Remaining: 0
Total Summary:
Grand Total: 12
Wish to Pay: 12
Total Paid: 12
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-912
            [amount] => 12
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 14:00:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 12, Wish To Pay: 12, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-536' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 14:00:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 400, Wish To Pay: 400, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 914
Inserting Item: Array
(
    [material_id] => 31777
    [quantity] => 1
    [unit_price] => 412
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 412
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-914: 400, Remaining: 0
Total Summary:
Grand Total: 400
Wish to Pay: 400
Total Paid: 400
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-914
            [amount] => 400
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 14:10:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1225.5, Wish To Pay: 1225.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 915
Inserting Item: Array
(
    [material_id] => 5769
    [quantity] => 15
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 330
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5578
    [quantity] => 15
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13300
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17586
    [quantity] => 20
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 260
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30312
    [quantity] => 1
    [unit_price] => 450
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 450
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-915: 1225.5, Remaining: 0
Total Summary:
Grand Total: 1225.5
Wish to Pay: 1225.5
Total Paid: 1225.5
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-915
            [amount] => 1225.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 14:24:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1225.5, Wish To Pay: 1225.5, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-538' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 14:24:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 917
Inserting Item: Array
(
    [material_id] => 29559
    [quantity] => 1
    [unit_price] => 140
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-917: 140, Remaining: 0
Total Summary:
Grand Total: 140
Wish to Pay: 140
Total Paid: 140
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-917
            [amount] => 140
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 14:25:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-539' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 14:25:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 399, Wish To Pay: 399, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 919
Inserting Item: Array
(
    [material_id] => 28206
    [quantity] => 7
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 420
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-919: 399, Remaining: 0
Total Summary:
Grand Total: 399
Wish to Pay: 399
Total Paid: 399
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-919
            [amount] => 399
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 14:28:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 920
Inserting Item: Array
(
    [material_id] => 24822
    [quantity] => 14
    [unit_price] => 7.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 105
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18612
    [quantity] => 7
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 112
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 18612, Available: 0, Requested: 7
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 14:29:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 921
Inserting Item: Array
(
    [material_id] => 24822
    [quantity] => 14
    [unit_price] => 7.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 105
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18612
    [quantity] => 7
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 112
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-921: 200, Remaining: 0
Total Summary:
Grand Total: 200
Wish to Pay: 200
Total Paid: 200
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-921
            [amount] => 200
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 14:30:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 507, Wish To Pay: 507, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 922
Inserting Item: Array
(
    [material_id] => 28224
    [quantity] => 1
    [unit_price] => 250
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31649
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30364
    [quantity] => 1
    [unit_price] => 57
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 57
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-922: 507, Remaining: 0
Total Summary:
Grand Total: 507
Wish to Pay: 507
Total Paid: 507
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-922
            [amount] => 507
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 14:35:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 507, Wish To Pay: 507, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-542' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 14:35:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 8, Wish To Pay: 8, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 924
Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 4
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-924: 8, Remaining: 0
Total Summary:
Grand Total: 8
Wish to Pay: 8
Total Paid: 8
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-924
            [amount] => 8
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 14:37:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 8, Wish To Pay: 8, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-543' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 14:37:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 349.22, Wish To Pay: 349.22, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 926
Inserting Item: Array
(
    [material_id] => 30407
    [quantity] => 20
    [unit_price] => 5.28
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 105.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31289
    [quantity] => 1
    [unit_price] => 222
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 222
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28709
    [quantity] => 4
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-926: 349.22, Remaining: 0
Total Summary:
Grand Total: 349.22
Wish to Pay: 349.22
Total Paid: 349.22
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-926
            [amount] => 349.22
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 14:41:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 349.22, Wish To Pay: 349.22, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-544' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 14:41:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 670, Wish To Pay: 670, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 928
Inserting Item: Array
(
    [material_id] => 22232
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28220
    [quantity] => 50
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 550
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-928: 670, Remaining: 0
Total Summary:
Grand Total: 670
Wish to Pay: 670
Total Paid: 670
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-928
            [amount] => 670
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 14:45:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 630, Wish To Pay: 630, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 929
Inserting Item: Array
(
    [material_id] => 30260
    [quantity] => 1
    [unit_price] => 450
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 450
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30260, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 14:55:36

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 620, Wish To Pay: 620, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 930
Inserting Item: Array
(
    [material_id] => 30260
    [quantity] => 1
    [unit_price] => 425
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 425
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30260, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 14:59:10

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 620, Wish To Pay: 620, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 931
Inserting Item: Array
(
    [material_id] => 28473
    [quantity] => 20
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28473, Available: 3, Requested: 20
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 15:04:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 620, Wish To Pay: 620, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 932
Inserting Item: Array
(
    [material_id] => 24896
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30260
    [quantity] => 1
    [unit_price] => 425
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 425
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28473
    [quantity] => 20
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28890
    [quantity] => 2
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-932: 620, Remaining: 0
Total Summary:
Grand Total: 620
Wish to Pay: 620
Total Paid: 620
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-932
            [amount] => 620
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 15:06:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 830, Wish To Pay: 830, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 933
Inserting Item: Array
(
    [material_id] => 29040
    [quantity] => 20
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13309
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13287
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7796
    [quantity] => 14
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 112
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30152
    [quantity] => 10
    [unit_price] => 14
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29487
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18618
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-933: 830, Remaining: 0
Total Summary:
Grand Total: 830
Wish to Pay: 830
Total Paid: 830
Items Inserted: 7
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-933
            [amount] => 830
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 15:11:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 830, Wish To Pay: 830, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-547' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 15:11:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 935
Inserting Item: Array
(
    [material_id] => 12120
    [quantity] => 10
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-935: 200, Remaining: 0
Total Summary:
Grand Total: 200
Wish to Pay: 200
Total Paid: 200
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-935
            [amount] => 200
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 15:12:47

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-548' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 15:12:47

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 500, Change: 310
Customer found: Walk In
Sale Order Inserted. ID: 937
Inserting Item: Array
(
    [material_id] => 12120
    [quantity] => 10
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-937: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-937
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 15:14:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 784.55, Wish To Pay: 784.55, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 938
Inserting Item: Array
(
    [material_id] => 5085
    [quantity] => 10
    [unit_price] => 85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 850
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-938: 784.55, Remaining: 0
Total Summary:
Grand Total: 784.55
Wish to Pay: 784.55
Total Paid: 784.55
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-938
            [amount] => 784.55
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 15:20:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 784.55, Wish To Pay: 784.55, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-550' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 15:20:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 250, Wish To Pay: 250, Received: 500, Change: 250
Customer found: Walk In
Sale Order Inserted. ID: 940
Inserting Item: Array
(
    [material_id] => 5707
    [quantity] => 1
    [unit_price] => 250
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-940: 250, Remaining: 0
Total Summary:
Grand Total: 250
Wish to Pay: 250
Total Paid: 250
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-940
            [amount] => 250
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 15:21:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 250, Wish To Pay: 250, Received: 500, Change: 250
Customer found: Walk In
Error: Duplicate entry 'SO-2026-551' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 15:21:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1500.14, Wish To Pay: 1500.14, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 942
Inserting Item: Array
(
    [material_id] => 7813
    [quantity] => 20
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3994
    [quantity] => 20
    [unit_price] => 14
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 280
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13359
    [quantity] => 20
    [unit_price] => 11.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 230
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22346
    [quantity] => 28
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 196
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24601
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9172
    [quantity] => 28
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 336
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13440
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-942: 1500.14, Remaining: 0
Total Summary:
Grand Total: 1500.14
Wish to Pay: 1500.14
Total Paid: 1500.14
Items Inserted: 7
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-942
            [amount] => 1500.14
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 15:51:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 1000, Change: 810
Customer found: Walk In
Sale Order Inserted. ID: 943
Inserting Item: Array
(
    [material_id] => 28345
    [quantity] => 24
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 192
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-943: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-943
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 15:54:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 600, Wish To Pay: 600, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 944
Inserting Item: Array
(
    [material_id] => 26844
    [quantity] => 10
    [unit_price] => 23
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 230
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25401
    [quantity] => 2
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 704
    [quantity] => 20
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 220
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30206
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-944: 600, Remaining: 0
Total Summary:
Grand Total: 600
Wish to Pay: 600
Total Paid: 600
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-944
            [amount] => 600
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 16:00:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 600, Wish To Pay: 600, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-554' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 16:00:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 14.2, Wish To Pay: 14.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 946
Inserting Item: Array
(
    [material_id] => 18536
    [quantity] => 20
    [unit_price] => 0.71
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 14.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-946: 14.2, Remaining: 0
Total Summary:
Grand Total: 14.2
Wish to Pay: 14.2
Total Paid: 14.2
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-946
            [amount] => 14.2
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 16:03:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 14.2, Wish To Pay: 14.2, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-555' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 16:03:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 6, Wish To Pay: 6, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 948
Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 3
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-948: 6, Remaining: 0
Total Summary:
Grand Total: 6
Wish to Pay: 6
Total Paid: 6
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-948
            [amount] => 6
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 16:03:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 6, Wish To Pay: 6, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-556' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 16:03:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 950
Inserting Item: Array
(
    [material_id] => 9008
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-950: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-950
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 16:10:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-557' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 16:10:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 628.9, Wish To Pay: 628.9, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 952
Inserting Item: Array
(
    [material_id] => 25663
    [quantity] => 20
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 500
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25079
    [quantity] => 1
    [unit_price] => 150
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-952: 628.9, Remaining: 0
Total Summary:
Grand Total: 628.9
Wish to Pay: 628.9
Total Paid: 628.9
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-952
            [amount] => 628.9
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 16:25:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 628.9, Wish To Pay: 628.9, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-558' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 16:25:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 204, Wish To Pay: 204, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 954
Inserting Item: Array
(
    [material_id] => 28485
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 10
    [discount_amount] => 10
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29047
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 10
    [discount_amount] => 1
    [total_price] => 99
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27955
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-954: 204, Remaining: 0
Total Summary:
Grand Total: 204
Wish to Pay: 204
Total Paid: 204
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-954
            [amount] => 204
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 16:41:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 265, Wish To Pay: 265, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 955
Inserting Item: Array
(
    [material_id] => 27955
    [quantity] => 1
    [unit_price] => 55
    [discount_percent] => 18.18
    [discount_amount] => 10
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29047
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 10
    [discount_amount] => 10
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28483
    [quantity] => 1
    [unit_price] => 130
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28483, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 16:44:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 265, Wish To Pay: 265, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 956
Inserting Item: Array
(
    [material_id] => 27955
    [quantity] => 1
    [unit_price] => 55
    [discount_percent] => 18.18
    [discount_amount] => 10
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29047
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 10
    [discount_amount] => 10
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28483
    [quantity] => 1
    [unit_price] => 130
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28483, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 16:44:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 418.05, Wish To Pay: 418.05, Received: 500, Change: 81.95
Customer found: Walk In
Sale Order Inserted. ID: 957
Inserting Item: Array
(
    [material_id] => 13757
    [quantity] => 20
    [unit_price] => 6.7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 134
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12997
    [quantity] => 20
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19682
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13444
    [quantity] => 20
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1179
    [quantity] => 28
    [unit_price] => 0.8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-957: 418.05, Remaining: 0
Total Summary:
Grand Total: 418.05
Wish to Pay: 418.05
Total Paid: 418.05
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-957
            [amount] => 418.05
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 16:57:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 418.05, Wish To Pay: 418.05, Received: 500, Change: 81.95
Customer found: Walk In
Error: Duplicate entry 'SO-2026-560' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 16:57:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 0, Wish To Pay: 0, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 959
Inserting Item: Array
(
    [material_id] => 12210
    [quantity] => 1
    [unit_price] => 270
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 270
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Total Summary:
Grand Total: 270
Wish to Pay: 0
Total Paid: 0
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
)

Script execution completed at: 2026-07-04 17:24:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 270, To Pay: 1459.88, Wish To Pay: 1459.88, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 960
Inserting Item: Array
(
    [material_id] => 22734
    [quantity] => 14
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 840
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28273
    [quantity] => 14
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5868
    [quantity] => 10
    [unit_price] => 2.25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31778
    [quantity] => 10
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-959: 270, Remaining: 1189.88
Previous Sale Due Paid for sel-960: 1189.88, Remaining: 0
Total Summary:
Grand Total: 1189.88
Wish to Pay: 1459.88
Total Paid: 1459.88
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-959
            [amount] => 270
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

    [1] => Array
        (
            [ref] => sel-960
            [amount] => 1189.88
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 17:36:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 270, To Pay: 1459.88, Wish To Pay: 1459.88, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-562' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 17:36:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 962
Inserting Item: Array
(
    [material_id] => 22513
    [quantity] => 20
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-962: 180, Remaining: 0
Total Summary:
Grand Total: 180
Wish to Pay: 180
Total Paid: 180
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-962
            [amount] => 180
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 17:37:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 963
Inserting Item: Array
(
    [material_id] => 7810
    [quantity] => 14
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 42
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-963: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-963
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 18:23:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 102, Wish To Pay: 102, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 964
Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 2
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7881
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-964: 102, Remaining: 0
Total Summary:
Grand Total: 102
Wish to Pay: 102
Total Paid: 102
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-964
            [amount] => 102
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 18:39:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 102, Wish To Pay: 102, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-565' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 18:39:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 720, Wish To Pay: 720, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 966
Inserting Item: Array
(
    [material_id] => 30710
    [quantity] => 60
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30710, Available: 20, Requested: 60
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 18:52:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 720, Wish To Pay: 720, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 967
Inserting Item: Array
(
    [material_id] => 30710
    [quantity] => 60
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30710, Available: 20, Requested: 60
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 18:52:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 810, Wish To Pay: 810, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 968
Inserting Item: Array
(
    [material_id] => 30710
    [quantity] => 60
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30710, Available: 20, Requested: 60
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 18:52:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 810, Wish To Pay: 810, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 969
Inserting Item: Array
(
    [material_id] => 30710
    [quantity] => 60
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30710, Available: 20, Requested: 60
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 18:52:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1120, Wish To Pay: 1120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 970
Inserting Item: Array
(
    [material_id] => 30710
    [quantity] => 60
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30710, Available: 20, Requested: 60
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 18:55:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1120, Wish To Pay: 1120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 971
Inserting Item: Array
(
    [material_id] => 30710
    [quantity] => 60
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30710, Available: 20, Requested: 60
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 18:55:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1030, Wish To Pay: 1030, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 972
Inserting Item: Array
(
    [material_id] => 30710
    [quantity] => 60
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30710, Available: 20, Requested: 60
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 18:56:36

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1030, Wish To Pay: 1030, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 973
Inserting Item: Array
(
    [material_id] => 30710
    [quantity] => 60
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30710, Available: 20, Requested: 60
Stack trace: #0 {main}
Script execution completed at: 2026-07-04 18:56:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1116, Wish To Pay: 1116, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 974
Inserting Item: Array
(
    [material_id] => 3703
    [quantity] => 8
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 96
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 689
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31779
    [quantity] => 10
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3970
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30710
    [quantity] => 60
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7300
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3550
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-974: 1116, Remaining: 0
Total Summary:
Grand Total: 1116
Wish to Pay: 1116
Total Paid: 1116
Items Inserted: 7
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-974
            [amount] => 1116
            [type] => Previous Sale Due Payment
            [date] => 2026-07-04
        )

)

Script execution completed at: 2026-07-04 18:59:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1116, Wish To Pay: 1116, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-566' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 18:59:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 9
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 990, Wish To Pay: 990, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-566' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 19:03:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 810, Wish To Pay: 810, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-566' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 19:18:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 810, Wish To Pay: 810, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-566' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 19:18:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 810, Wish To Pay: 810, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-566' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 19:20:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 810, Wish To Pay: 810, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-566' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-04 19:20:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 981
Inserting Item: Array
(
    [material_id] => 28890
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-981: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-981
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 02:16:10

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-567' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 02:16:10

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 983
Inserting Item: Array
(
    [material_id] => 5455
    [quantity] => 4
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28729
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31362
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-983: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-983
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 02:19:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 984
Inserting Item: Array
(
    [material_id] => 29402
    [quantity] => 2
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-984: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-984
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 02:37:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 985
Inserting Item: Array
(
    [material_id] => 13306
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-985: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-985
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 02:44:50

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 25, Wish To Pay: 25, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 986
Inserting Item: Array
(
    [material_id] => 28567
    [quantity] => 1
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-986: 25, Remaining: 0
Total Summary:
Grand Total: 25
Wish to Pay: 25
Total Paid: 25
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-986
            [amount] => 25
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 02:56:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 987
Inserting Item: Array
(
    [material_id] => 24772
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-987: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-987
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 03:25:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 191.6, Wish To Pay: 191.6, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 988
Inserting Item: Array
(
    [material_id] => 25196
    [quantity] => 4
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 36
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21811
    [quantity] => 4
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 4
    [unit_price] => 3.9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31235
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-988: 191.6, Remaining: 0
Total Summary:
Grand Total: 191.6
Wish to Pay: 191.6
Total Paid: 191.6
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-988
            [amount] => 191.6
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 03:32:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2720, Wish To Pay: 2720, Received: 3000, Change: 280
Customer found: Walk In
Sale Order Inserted. ID: 989
Inserting Item: Array
(
    [material_id] => 3958
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3469
    [quantity] => 2
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 26943
    [quantity] => 20
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18981
    [quantity] => 28
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 196
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8142
    [quantity] => 28
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 504
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29270
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13309
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 8
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 16
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-989: 2720, Remaining: 0
Total Summary:
Grand Total: 2720
Wish to Pay: 2720
Total Paid: 2720
Items Inserted: 8
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-989
            [amount] => 2720
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 04:00:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 240.4, Wish To Pay: 240.4, Received: 70, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 990
Inserting Item: Array
(
    [material_id] => 21811
    [quantity] => 2
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 3
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28770
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5169
    [quantity] => 4
    [unit_price] => 1.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 15472
    [quantity] => 4
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 28
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-990: 240.4, Remaining: 0
Total Summary:
Grand Total: 240.4
Wish to Pay: 240.4
Total Paid: 240.4
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-990
            [amount] => 240.4
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 04:06:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 991
Inserting Item: Array
(
    [material_id] => 22192
    [quantity] => 7
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-991: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-991
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 04:06:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 75, Wish To Pay: 75, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-569' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 04:56:36

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 75, Wish To Pay: 75, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-569' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 04:56:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 75, Wish To Pay: 75, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 994
Inserting Item: Array
(
    [material_id] => 10272
    [quantity] => 1
    [unit_price] => 75
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 75
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-994: 75, Remaining: 0
Total Summary:
Grand Total: 75
Wish to Pay: 75
Total Paid: 75
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-994
            [amount] => 75
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 04:57:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 264.12, Wish To Pay: 264.12, Received: 300, Change: 35.88
Customer found: Walk In
Sale Order Inserted. ID: 995
Inserting Item: Array
(
    [material_id] => 25391
    [quantity] => 12
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 264
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 25391, Available: 0, Requested: 12
Stack trace: #0 {main}
Script execution completed at: 2026-07-05 05:07:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 560, Wish To Pay: 560, Received: 600, Change: 40
Customer found: Walk In
Sale Order Inserted. ID: 996
Inserting Item: Array
(
    [material_id] => 30000
    [quantity] => 1
    [unit_price] => 690
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 690
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-996: 560, Remaining: 0
Total Summary:
Grand Total: 560
Wish to Pay: 560
Total Paid: 560
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-996
            [amount] => 560
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 05:18:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 160, Wish To Pay: 160, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 997
Inserting Item: Array
(
    [material_id] => 31524
    [quantity] => 10
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-997: 160, Remaining: 0
Total Summary:
Grand Total: 160
Wish to Pay: 160
Total Paid: 160
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-997
            [amount] => 160
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 05:19:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 145, Wish To Pay: 145, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 998
Inserting Item: Array
(
    [material_id] => 13361
    [quantity] => 1
    [unit_price] => 145
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 145
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-998: 145, Remaining: 0
Total Summary:
Grand Total: 145
Wish to Pay: 145
Total Paid: 145
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-998
            [amount] => 145
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 05:20:18

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01611416502
    [supplier_id] => 82
    [purchase_date] => 2026-07-05
    [payment_term] => cash
    [subtotal] => 4178.90
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 1.70
    [discount] => 71
    [shipping] => 0
    [grand_total] => 4107.90
    [notes] => 
    [amount_to_pay] => 4107.90
    [acc] => 1
    [items] => [{"material_id":"29798","item_type":"raw","quantity":"1","unit_price":"221.80","discount_percent":"0.00","discount_flat":"0","total_price":"221.80"},{"material_id":"30229","item_type":"raw","quantity":"2","unit_price":"215.60","discount_percent":"0.00","discount_flat":"0","total_price":"431.2"},{"material_id":"31780","item_type":"raw","quantity":"1","unit_price":"281.60","discount_percent":"0.00","discount_flat":"0","total_price":"281.6"},{"material_id":"888","item_type":"raw","quantity":"14","unit_price":"30.80","discount_percent":"0.00","discount_flat":"0","total_price":"431.2"},{"material_id":"889","item_type":"raw","quantity":"14","unit_price":"52.81","discount_percent":"0.00","discount_flat":"0","total_price":"739.3"},{"material_id":"953","item_type":"raw","quantity":"40","unit_price":"14.08","discount_percent":"0.00","discount_flat":"0","total_price":"563.2"},{"material_id":"30099","item_type":"raw","quantity":"1","unit_price":"357.70","discount_percent":"0.00","discount_flat":"0","total_price":"357.7"},{"material_id":"757","item_type":"raw","quantity":"30","unit_price":"22.00","discount_percent":"0.00","discount_flat":"0","total_price":"660.1"},{"material_id":"495","item_type":"raw","quantity":"1","unit_price":"96.80","discount_percent":"0.00","discount_flat":"0","total_price":"96.8"},{"material_id":"30174","item_type":"raw","quantity":"30","unit_price":"13.20","discount_percent":"0.00","discount_flat":"0","total_price":"396.00"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 4107.9, Account ID: 1
Inserted PO ID: 141
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 29798, Qty: 1
History inserted for raw material: 29798
Products stock updated: +1
No batch data found for material_id: 29798
Processing item 1 - Type: raw, ID: 30229, Qty: 2
History inserted for raw material: 30229
Products stock updated: +2
No batch data found for material_id: 30229
Processing item 2 - Type: raw, ID: 31780, Qty: 1
History inserted for raw material: 31780
Products stock updated: +1
No batch data found for material_id: 31780
Processing item 3 - Type: raw, ID: 888, Qty: 14
History inserted for raw material: 888
Products stock updated: +14
No batch data found for material_id: 888
Processing item 4 - Type: raw, ID: 889, Qty: 14
History inserted for raw material: 889
Products stock updated: +14
No batch data found for material_id: 889
Processing item 5 - Type: raw, ID: 953, Qty: 40
History inserted for raw material: 953
Products stock updated: +40
No batch data found for material_id: 953
Processing item 6 - Type: raw, ID: 30099, Qty: 1
History inserted for raw material: 30099
Products stock updated: +1
No batch data found for material_id: 30099
Processing item 7 - Type: raw, ID: 757, Qty: 30
History inserted for raw material: 757
Products stock updated: +30
No batch data found for material_id: 757
Processing item 8 - Type: raw, ID: 495, Qty: 1
History inserted for raw material: 495
Products stock updated: +1
No batch data found for material_id: 495
Processing item 9 - Type: raw, ID: 30174, Qty: 30
History inserted for raw material: 30174
Products stock updated: +30
No batch data found for material_id: 30174
Purchase Pay record inserted with ID: 122
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 75, Wish To Pay: 75, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 999
Inserting Item: Array
(
    [material_id] => 29024
    [quantity] => 5
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 75
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-999: 75, Remaining: 0
Total Summary:
Grand Total: 75
Wish to Pay: 75
Total Paid: 75
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-999
            [amount] => 75
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 06:07:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 276, Wish To Pay: 276, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1000
Inserting Item: Array
(
    [material_id] => 25210
    [quantity] => 30
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1000: 276, Remaining: 0
Total Summary:
Grand Total: 276
Wish to Pay: 276
Total Paid: 276
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1000
            [amount] => 276
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 06:09:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 477.52, Wish To Pay: 477.52, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1001
Inserting Item: Array
(
    [material_id] => 26775
    [quantity] => 15
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 270
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24271
    [quantity] => 10
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 220
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 26775
    [quantity] => 1
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 18
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1001: 477.52, Remaining: 0
Total Summary:
Grand Total: 477.52
Wish to Pay: 477.52
Total Paid: 477.52
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1001
            [amount] => 477.52
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 06:34:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1002
Inserting Item: Array
(
    [material_id] => 29487
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1002: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1002
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 06:37:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1003
Inserting Item: Array
(
    [material_id] => 31398
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1003: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1003
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 06:45:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1004
Inserting Item: Array
(
    [material_id] => 28320
    [quantity] => 4
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24896
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1004: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1004
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 06:49:13

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 258.4, Wish To Pay: 258.4, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1005
Inserting Item: Array
(
    [material_id] => 24896
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13287
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27878
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1005: 258.4, Remaining: 0
Total Summary:
Grand Total: 258.4
Wish to Pay: 258.4
Total Paid: 258.4
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1005
            [amount] => 258.4
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 06:50:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 37
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 230, Wish To Pay: 230, Received: 0, Change: 0
Customer found: Md Harun Ur Rashid
Sale Order Inserted. ID: 1006
Inserting Item: Array
(
    [material_id] => 3902
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29643
    [quantity] => 1
    [unit_price] => 130
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1006: 230, Remaining: 0
Total Summary:
Grand Total: 230
Wish to Pay: 230
Total Paid: 230
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1006
            [amount] => 230
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 07:03:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 269.75, Wish To Pay: 269.75, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1007
Inserting Item: Array
(
    [material_id] => 21594
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 23149
    [quantity] => 15
    [unit_price] => 0.65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 9.75
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24378
    [quantity] => 20
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27760
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14007
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1007: 269.75, Remaining: 0
Total Summary:
Grand Total: 269.75
Wish to Pay: 269.75
Total Paid: 269.75
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1007
            [amount] => 269.75
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 07:18:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1008
Inserting Item: Array
(
    [material_id] => 2020
    [quantity] => 1
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 1
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1008: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1008
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 07:20:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 21, Wish To Pay: 21, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1009
Inserting Item: Array
(
    [material_id] => 13313
    [quantity] => 3
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 21
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1009: 21, Remaining: 0
Total Summary:
Grand Total: 21
Wish to Pay: 21
Total Paid: 21
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1009
            [amount] => 21
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 07:31:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 36, Wish To Pay: 36, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1010
Inserting Item: Array
(
    [material_id] => 25196
    [quantity] => 4
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 36
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1010: 36, Remaining: 0
Total Summary:
Grand Total: 36
Wish to Pay: 36
Total Paid: 36
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1010
            [amount] => 36
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 07:36:19

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01756120531
    [supplier_id] => 99
    [purchase_date] => 2026-07-05
    [payment_term] => cash
    [subtotal] => 924.07
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 924.07
    [notes] => 
    [amount_to_pay] => 924.07
    [acc] => 1
    [items] => [{"material_id":"30032","item_type":"raw","quantity":"1","unit_price":"286.02","discount_percent":"0.00","discount_flat":"0","total_price":"286.02"},{"material_id":"29628","item_type":"raw","quantity":"1","unit_price":"198.02","discount_percent":"0.00","discount_flat":"0","total_price":"198.02"},{"material_id":"31781","item_type":"raw","quantity":"1","unit_price":"440.03","discount_percent":"0.00","discount_flat":"0","total_price":"440.03"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 924.07, Account ID: 1
Inserted PO ID: 142
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 30032, Qty: 1
History inserted for raw material: 30032
Products stock updated: +1
No batch data found for material_id: 30032
Processing item 1 - Type: raw, ID: 29628, Qty: 1
History inserted for raw material: 29628
Products stock updated: +1
No batch data found for material_id: 29628
Processing item 2 - Type: raw, ID: 31781, Qty: 1
History inserted for raw material: 31781
Products stock updated: +1
No batch data found for material_id: 31781
Purchase Pay record inserted with ID: 123
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1230, Wish To Pay: 1230, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1011
Inserting Item: Array
(
    [material_id] => 21241
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 294
    [quantity] => 14
    [unit_price] => 1.43
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20.02
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3781
    [quantity] => 20
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3748
    [quantity] => 14
    [unit_price] => 65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 910
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1011: 1230, Remaining: 0
Total Summary:
Grand Total: 1230
Wish to Pay: 1230
Total Paid: 1230
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1011
            [amount] => 1230
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 08:06:39

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01764143394
    [supplier_id] => 100
    [purchase_date] => 2026-07-05
    [payment_term] => cash
    [subtotal] => 2490.58
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 
    [discount] => 0.00
    [shipping] => 0
    [grand_total] => 2490.58
    [notes] => 
    [amount_to_pay] => 2490.58
    [acc] => 1
    [items] => [{"material_id":"28231","item_type":"raw","quantity":"1","unit_price":"211.22","discount_percent":"0.00","discount_flat":"0","total_price":"211.22"},{"material_id":"28206","item_type":"raw","quantity":"24","unit_price":"52.80","discount_percent":"0.00","discount_flat":"0","total_price":"1267.29"},{"material_id":"28220","item_type":"raw","quantity":"50","unit_price":"9.68","discount_percent":"0.00","discount_flat":"0","total_price":"484.03"},{"material_id":"29040","item_type":"raw","quantity":"30","unit_price":"13.20","discount_percent":"0.00","discount_flat":"0","total_price":"396.03"},{"material_id":"12510","item_type":"raw","quantity":"50","unit_price":"2.64","discount_percent":"0.00","discount_flat":"0","total_price":"132.01"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 2490.58, Account ID: 1
Error: PO Number already exists
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01764143394
    [supplier_id] => 100
    [purchase_date] => 2026-07-05
    [payment_term] => cash
    [subtotal] => 2490.58
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 
    [discount] => 0.00
    [shipping] => 0
    [grand_total] => 2490.58
    [notes] => 
    [amount_to_pay] => 2490.58
    [acc] => 1
    [items] => [{"material_id":"28231","item_type":"raw","quantity":"1","unit_price":"211.22","discount_percent":"0.00","discount_flat":"0","total_price":"211.22"},{"material_id":"28206","item_type":"raw","quantity":"24","unit_price":"52.80","discount_percent":"0.00","discount_flat":"0","total_price":"1267.29"},{"material_id":"28220","item_type":"raw","quantity":"50","unit_price":"9.68","discount_percent":"0.00","discount_flat":"0","total_price":"484.03"},{"material_id":"29040","item_type":"raw","quantity":"30","unit_price":"13.20","discount_percent":"0.00","discount_flat":"0","total_price":"396.03"},{"material_id":"12510","item_type":"raw","quantity":"50","unit_price":"2.64","discount_percent":"0.00","discount_flat":"0","total_price":"132.01"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 2490.58, Account ID: 1
Error: PO Number already exists
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01764143394
    [supplier_id] => 100
    [purchase_date] => 2026-07-05
    [payment_term] => cash
    [subtotal] => 2490.58
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 
    [discount] => 0.00
    [shipping] => 0
    [grand_total] => 2490.58
    [notes] => 
    [amount_to_pay] => 2490.58
    [acc] => 1
    [items] => [{"material_id":"28231","item_type":"raw","quantity":"1","unit_price":"211.22","discount_percent":"0.00","discount_flat":"0","total_price":"211.22"},{"material_id":"28206","item_type":"raw","quantity":"24","unit_price":"52.80","discount_percent":"0.00","discount_flat":"0","total_price":"1267.29"},{"material_id":"28220","item_type":"raw","quantity":"50","unit_price":"9.68","discount_percent":"0.00","discount_flat":"0","total_price":"484.03"},{"material_id":"29040","item_type":"raw","quantity":"30","unit_price":"13.20","discount_percent":"0.00","discount_flat":"0","total_price":"396.03"},{"material_id":"12510","item_type":"raw","quantity":"50","unit_price":"2.64","discount_percent":"0.00","discount_flat":"0","total_price":"132.01"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 2490.58, Account ID: 1
Error: PO Number already exists
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => +88029632176
    [supplier_id] => 100
    [purchase_date] => 2026-07-05
    [payment_term] => cash
    [subtotal] => 2490.58
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 
    [discount] => 0.00
    [shipping] => 0
    [grand_total] => 2490.58
    [notes] => 
    [amount_to_pay] => 2490.58
    [acc] => 1
    [items] => [{"material_id":"28231","item_type":"raw","quantity":"1","unit_price":"211.22","discount_percent":"0.00","discount_flat":"0","total_price":"211.22"},{"material_id":"28206","item_type":"raw","quantity":"24","unit_price":"52.80","discount_percent":"0.00","discount_flat":"0","total_price":"1267.29"},{"material_id":"28220","item_type":"raw","quantity":"50","unit_price":"9.68","discount_percent":"0.00","discount_flat":"0","total_price":"484.03"},{"material_id":"29040","item_type":"raw","quantity":"30","unit_price":"13.20","discount_percent":"0.00","discount_flat":"0","total_price":"396.03"},{"material_id":"12510","item_type":"raw","quantity":"50","unit_price":"2.64","discount_percent":"0.00","discount_flat":"0","total_price":"132.01"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 2490.58, Account ID: 1
Inserted PO ID: 143
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 28231, Qty: 1
History inserted for raw material: 28231
Products stock updated: +1
No batch data found for material_id: 28231
Processing item 1 - Type: raw, ID: 28206, Qty: 24
History inserted for raw material: 28206
Products stock updated: +24
No batch data found for material_id: 28206
Processing item 2 - Type: raw, ID: 28220, Qty: 50
History inserted for raw material: 28220
Products stock updated: +50
No batch data found for material_id: 28220
Processing item 3 - Type: raw, ID: 29040, Qty: 30
History inserted for raw material: 29040
Products stock updated: +30
No batch data found for material_id: 29040
Processing item 4 - Type: raw, ID: 12510, Qty: 50
History inserted for raw material: 12510
Products stock updated: +50
No batch data found for material_id: 12510
Purchase Pay record inserted with ID: 124
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 260, Wish To Pay: 260, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1012
Inserting Item: Array
(
    [material_id] => 5578
    [quantity] => 14
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 168
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22346
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1012: 260, Remaining: 0
Total Summary:
Grand Total: 260
Wish to Pay: 260
Total Paid: 260
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1012
            [amount] => 260
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 09:22:10

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 429.86, Wish To Pay: 429.86, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1013
Inserting Item: Array
(
    [material_id] => 24388
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24388, Available: 0, Requested: 10
Stack trace: #0 {main}
Script execution completed at: 2026-07-05 09:25:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 429.86, Wish To Pay: 429.86, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1014
Inserting Item: Array
(
    [material_id] => 24388
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24388, Available: 0, Requested: 10
Stack trace: #0 {main}
Script execution completed at: 2026-07-05 09:25:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 429.86, Wish To Pay: 429.86, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1015
Inserting Item: Array
(
    [material_id] => 22530
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5169
    [quantity] => 15
    [unit_price] => 1.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 850
    [quantity] => 8
    [unit_price] => 30.09
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240.72
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24274
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31412
    [quantity] => 1
    [unit_price] => 38
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 38
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1015: 429.86, Remaining: 0
Total Summary:
Grand Total: 429.86
Wish to Pay: 429.86
Total Paid: 429.86
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1015
            [amount] => 429.86
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 09:27:21

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01304240767
    [supplier_id] => 101
    [purchase_date] => 2026-07-05
    [payment_term] => cash
    [subtotal] => 2609.90
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 2.7
    [discount] => 70.47
    [shipping] => 0
    [grand_total] => 2539.43
    [notes] => 
    [amount_to_pay] => 2539.43
    [acc] => 1
    [items] => [{"material_id":"31783","item_type":"raw","quantity":"28","unit_price":"13.20","discount_percent":"0.00","discount_flat":"0","total_price":"369.60"},{"material_id":"18463","item_type":"raw","quantity":"1","unit_price":"61.62","discount_percent":"0.00","discount_flat":"0","total_price":"61.62"},{"material_id":"28984","item_type":"raw","quantity":"1","unit_price":"96.81","discount_percent":"0.00","discount_flat":"0","total_price":"96.81"},{"material_id":"19044","item_type":"raw","quantity":"1","unit_price":"77.44","discount_percent":"0.00","discount_flat":"0","total_price":"77.44"},{"material_id":"18648","item_type":"raw","quantity":"1","unit_price":"26.58","discount_percent":"0.00","discount_flat":"0","total_price":"26.58"},{"material_id":"18958","item_type":"raw","quantity":"20","unit_price":"7.92","discount_percent":"0.00","discount_flat":"0","total_price":"158.40"},{"material_id":"18873","item_type":"raw","quantity":"30","unit_price":"5.28","discount_percent":"0.00","discount_flat":"0","total_price":"158.40"},{"material_id":"18555","item_type":"raw","quantity":"30","unit_price":"8.80","discount_percent":"0.00","discount_flat":"0","total_price":"264"},{"material_id":"18612","item_type":"raw","quantity":"20","unit_price":"14.08","discount_percent":"0.00","discount_flat":"0","total_price":"281.60"},{"material_id":"30497","item_type":"raw","quantity":"60","unit_price":"10.31","discount_percent":"0.00","discount_flat":"0","total_price":"618.6"},{"material_id":"19009","item_type":"raw","quantity":"100","unit_price":"2.85","discount_percent":"0.00","discount_flat":"0","total_price":"285"},{"material_id":"19110","item_type":"raw","quantity":"1","unit_price":"105.93","discount_percent":"0.00","discount_flat":"0","total_price":"105.93"},{"material_id":"31782","item_type":"raw","quantity":"2","unit_price":"52.96","discount_percent":"0.00","discount_flat":"0","total_price":"105.92"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 2539.43, Account ID: 1
Error: PO Number already exists
=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01756544431
    [supplier_id] => 101
    [purchase_date] => 2026-07-05
    [payment_term] => cash
    [subtotal] => 2609.90
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 2.7
    [discount] => 70.47
    [shipping] => 0
    [grand_total] => 2539.43
    [notes] => 
    [amount_to_pay] => 2539.43
    [acc] => 1
    [items] => [{"material_id":"31783","item_type":"raw","quantity":"28","unit_price":"13.20","discount_percent":"0.00","discount_flat":"0","total_price":"369.60"},{"material_id":"18463","item_type":"raw","quantity":"1","unit_price":"61.62","discount_percent":"0.00","discount_flat":"0","total_price":"61.62"},{"material_id":"28984","item_type":"raw","quantity":"1","unit_price":"96.81","discount_percent":"0.00","discount_flat":"0","total_price":"96.81"},{"material_id":"19044","item_type":"raw","quantity":"1","unit_price":"77.44","discount_percent":"0.00","discount_flat":"0","total_price":"77.44"},{"material_id":"18648","item_type":"raw","quantity":"1","unit_price":"26.58","discount_percent":"0.00","discount_flat":"0","total_price":"26.58"},{"material_id":"18958","item_type":"raw","quantity":"20","unit_price":"7.92","discount_percent":"0.00","discount_flat":"0","total_price":"158.40"},{"material_id":"18873","item_type":"raw","quantity":"30","unit_price":"5.28","discount_percent":"0.00","discount_flat":"0","total_price":"158.40"},{"material_id":"18555","item_type":"raw","quantity":"30","unit_price":"8.80","discount_percent":"0.00","discount_flat":"0","total_price":"264"},{"material_id":"18612","item_type":"raw","quantity":"20","unit_price":"14.08","discount_percent":"0.00","discount_flat":"0","total_price":"281.60"},{"material_id":"30497","item_type":"raw","quantity":"60","unit_price":"10.31","discount_percent":"0.00","discount_flat":"0","total_price":"618.6"},{"material_id":"19009","item_type":"raw","quantity":"100","unit_price":"2.85","discount_percent":"0.00","discount_flat":"0","total_price":"285"},{"material_id":"19110","item_type":"raw","quantity":"1","unit_price":"105.93","discount_percent":"0.00","discount_flat":"0","total_price":"105.93"},{"material_id":"31782","item_type":"raw","quantity":"2","unit_price":"52.96","discount_percent":"0.00","discount_flat":"0","total_price":"105.92"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 2539.43, Account ID: 1
Inserted PO ID: 144
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 31783, Qty: 28
History inserted for raw material: 31783
Products stock updated: +28
No batch data found for material_id: 31783
Processing item 1 - Type: raw, ID: 18463, Qty: 1
History inserted for raw material: 18463
Products stock updated: +1
No batch data found for material_id: 18463
Processing item 2 - Type: raw, ID: 28984, Qty: 1
History inserted for raw material: 28984
Products stock updated: +1
No batch data found for material_id: 28984
Processing item 3 - Type: raw, ID: 19044, Qty: 1
History inserted for raw material: 19044
Products stock updated: +1
No batch data found for material_id: 19044
Processing item 4 - Type: raw, ID: 18648, Qty: 1
History inserted for raw material: 18648
Products stock updated: +1
No batch data found for material_id: 18648
Processing item 5 - Type: raw, ID: 18958, Qty: 20
History inserted for raw material: 18958
Products stock updated: +20
No batch data found for material_id: 18958
Processing item 6 - Type: raw, ID: 18873, Qty: 30
History inserted for raw material: 18873
Products stock updated: +30
No batch data found for material_id: 18873
Processing item 7 - Type: raw, ID: 18555, Qty: 30
History inserted for raw material: 18555
Products stock updated: +30
No batch data found for material_id: 18555
Processing item 8 - Type: raw, ID: 18612, Qty: 20
History inserted for raw material: 18612
Products stock updated: +20
No batch data found for material_id: 18612
Processing item 9 - Type: raw, ID: 30497, Qty: 60
History inserted for raw material: 30497
Products stock updated: +60
No batch data found for material_id: 30497
Processing item 10 - Type: raw, ID: 19009, Qty: 100
History inserted for raw material: 19009
Products stock updated: +100
No batch data found for material_id: 19009
Processing item 11 - Type: raw, ID: 19110, Qty: 1
History inserted for raw material: 19110
Products stock updated: +1
No batch data found for material_id: 19110
Processing item 12 - Type: raw, ID: 31782, Qty: 2
History inserted for raw material: 31782
Products stock updated: +2
No batch data found for material_id: 31782
Purchase Pay record inserted with ID: 125
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 59.5, Wish To Pay: 59.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1016
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 12
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 5
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 27.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 4
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 8
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1016: 59.5, Remaining: 0
Total Summary:
Grand Total: 59.5
Wish to Pay: 59.5
Total Paid: 59.5
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1016
            [amount] => 59.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 09:49:32

=== NEW PURCHASE ORDER ===
Received POST data: Array
(
    [po_number] => 01723462703
    [supplier_id] => 92
    [purchase_date] => 2026-07-05
    [payment_term] => cash
    [subtotal] => 272.81
    [tax_percent] => 0
    [tax_amount] => 0.00
    [discount_percent] => 0
    [discount] => 0
    [shipping] => 0
    [grand_total] => 272.81
    [notes] => 
    [amount_to_pay] => 272.81
    [acc] => 1
    [items] => [{"material_id":"17732","item_type":"raw","quantity":"10","unit_price":"27.28","discount_percent":"0.00","discount_flat":"0","total_price":"272.81"}]
    [batch_data] => {}
    [serial_data] => {}
)

Received FILES data: Array
(
)

Payment Term: cash, Amount to Pay: 272.81, Account ID: 1
Inserted PO ID: 145
Serials data received: Array
(
)

Batch data received: Array
(
)

Processing item 0 - Type: raw, ID: 17732, Qty: 10
History inserted for raw material: 17732
Products stock updated: +10
No batch data found for material_id: 17732
Purchase Pay record inserted with ID: 126
=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 12, Wish To Pay: 12, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1017
Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1017: 12, Remaining: 0
Total Summary:
Grand Total: 12
Wish to Pay: 12
Total Paid: 12
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1017
            [amount] => 12
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 10:28:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 650, Wish To Pay: 650, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1018
Inserting Item: Array
(
    [material_id] => 31247
    [quantity] => 1
    [unit_price] => 690
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 690
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1018: 650, Remaining: 0
Total Summary:
Grand Total: 650
Wish to Pay: 650
Total Paid: 650
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1018
            [amount] => 650
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 10:46:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 660, Wish To Pay: 660, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1019
Inserting Item: Array
(
    [material_id] => 18618
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27881
    [quantity] => 10
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27941
    [quantity] => 14
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31791
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28965
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1019: 660, Remaining: 0
Total Summary:
Grand Total: 660
Wish to Pay: 660
Total Paid: 660
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1019
            [amount] => 660
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 11:01:09

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 185, Wish To Pay: 185, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1020
Inserting Item: Array
(
    [material_id] => 28032
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24671
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22585
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1020: 185, Remaining: 0
Total Summary:
Grand Total: 185
Wish to Pay: 185
Total Paid: 185
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1020
            [amount] => 185
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 11:11:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 257.6, Wish To Pay: 257.6, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1021
Inserting Item: Array
(
    [material_id] => 30190
    [quantity] => 1
    [unit_price] => 280
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 280
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1021: 257.6, Remaining: 0
Total Summary:
Grand Total: 257.6
Wish to Pay: 257.6
Total Paid: 257.6
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1021
            [amount] => 257.6
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 11:38:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 5, Wish To Pay: 5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1022
Inserting Item: Array
(
    [material_id] => 28615
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1022: 5, Remaining: 0
Total Summary:
Grand Total: 5
Wish to Pay: 5
Total Paid: 5
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1022
            [amount] => 5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 11:40:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 5, Wish To Pay: 5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1023
Inserting Item: Array
(
    [material_id] => 14696
    [quantity] => 20
    [unit_price] => 0.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1023: 5, Remaining: 0
Total Summary:
Grand Total: 5
Wish to Pay: 5
Total Paid: 5
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1023
            [amount] => 5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 11:49:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 950, Wish To Pay: 950, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1024
Inserting Item: Array
(
    [material_id] => 5255
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31792
    [quantity] => 1
    [unit_price] => 230
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 230
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30495
    [quantity] => 6
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 660
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1024: 950, Remaining: 0
Total Summary:
Grand Total: 950
Wish to Pay: 950
Total Paid: 950
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1024
            [amount] => 950
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 11:52:10

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 950, Wish To Pay: 950, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-604' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 11:52:10

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 330, Wish To Pay: 330, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1026
Inserting Item: Array
(
    [material_id] => 13229
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17783
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22193
    [quantity] => 6
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 42
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18437
    [quantity] => 3
    [unit_price] => 0.85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 2.55
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18923
    [quantity] => 6
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 15498
    [quantity] => 6
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1026: 330, Remaining: 0
Total Summary:
Grand Total: 330
Wish to Pay: 330
Total Paid: 330
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1026
            [amount] => 330
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 12:03:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 330, Wish To Pay: 330, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-605' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 12:03:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 511, Wish To Pay: 511, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1028
Inserting Item: Array
(
    [material_id] => 31314
    [quantity] => 1
    [unit_price] => 199
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 199
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31543
    [quantity] => 1
    [unit_price] => 300
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1028: 511, Remaining: 0
Total Summary:
Grand Total: 511
Wish to Pay: 511
Total Paid: 511
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1028
            [amount] => 511
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 12:07:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 511, Wish To Pay: 511, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-606' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 12:07:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 16.8, Wish To Pay: 16.8, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1030
Inserting Item: Array
(
    [material_id] => 27784
    [quantity] => 14
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 16.8
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1030: 16.8, Remaining: 0
Total Summary:
Grand Total: 16.8
Wish to Pay: 16.8
Total Paid: 16.8
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1030
            [amount] => 16.8
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 12:25:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 16.8, Wish To Pay: 16.8, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-607' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 12:25:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1032
Inserting Item: Array
(
    [material_id] => 5236
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1032: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1032
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 12:27:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-608' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 12:27:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1034
Inserting Item: Array
(
    [material_id] => 5619
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30778
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30778, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-05 12:39:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1035
Inserting Item: Array
(
    [material_id] => 5619
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30778
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30778, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-05 12:39:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 379, Wish To Pay: 379, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1036
Inserting Item: Array
(
    [material_id] => 5619
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30778
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30778, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-05 12:44:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 379, Wish To Pay: 379, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1037
Inserting Item: Array
(
    [material_id] => 5619
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30778
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30778, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-05 12:44:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1038
Inserting Item: Array
(
    [material_id] => 5619
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30778
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30778, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-05 12:49:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1039
Inserting Item: Array
(
    [material_id] => 5619
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30778
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30778, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-05 12:49:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1040
Inserting Item: Array
(
    [material_id] => 5619
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1040: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1040
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 12:56:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-609' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 12:56:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1042
Inserting Item: Array
(
    [material_id] => 27784
    [quantity] => 8
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1042: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1042
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 13:27:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-610' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 13:27:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1044
Inserting Item: Array
(
    [material_id] => 31630
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1044: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1044
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 13:28:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-611' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 13:28:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 170, Wish To Pay: 170, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1046
Inserting Item: Array
(
    [material_id] => 5085
    [quantity] => 2
    [unit_price] => 85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1046: 170, Remaining: 0
Total Summary:
Grand Total: 170
Wish to Pay: 170
Total Paid: 170
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1046
            [amount] => 170
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 13:28:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 170, Wish To Pay: 170, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-612' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 13:28:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 129, Wish To Pay: 129, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1048
Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 2
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22346
    [quantity] => 2
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 14
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13977
    [quantity] => 6
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 108
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1048: 129, Remaining: 0
Total Summary:
Grand Total: 129
Wish to Pay: 129
Total Paid: 129
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1048
            [amount] => 129
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 13:31:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 129, Wish To Pay: 129, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-613' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 13:31:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1050
Inserting Item: Array
(
    [material_id] => 19672
    [quantity] => 4
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1050: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1050
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 13:33:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-614' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 13:33:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 670, Wish To Pay: 670, Received: 1000, Change: 330
Customer found: Walk In
Sale Order Inserted. ID: 1052
Inserting Item: Array
(
    [material_id] => 28815
    [quantity] => 1
    [unit_price] => 675
    [discount_percent] => 0.74
    [discount_amount] => 5
    [total_price] => 670
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1052: 670, Remaining: 0
Total Summary:
Grand Total: 670
Wish to Pay: 670
Total Paid: 670
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1052
            [amount] => 670
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 13:42:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 0, Wish To Pay: 0, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1053
Inserting Item: Array
(
    [material_id] => 5235
    [quantity] => 1
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28124
    [quantity] => 1
    [unit_price] => 45
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1972
    [quantity] => 1
    [unit_price] => 140
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25525
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25003
    [quantity] => 1
    [unit_price] => 28
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 28
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Total Summary:
Grand Total: 283
Wish to Pay: 0
Total Paid: 0
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
)

Script execution completed at: 2026-07-05 13:46:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 0, Wish To Pay: 0, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-616' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 13:46:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 283, To Pay: 378, Wish To Pay: 378, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1055
Inserting Item: Array
(
    [material_id] => 28300
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 5
    [discount_amount] => 5
    [total_price] => 95
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1053: 283, Remaining: 95
Previous Sale Due Paid for sel-1055: 95, Remaining: 0
Total Summary:
Grand Total: 95
Wish to Pay: 378
Total Paid: 378
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1053
            [amount] => 283
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

    [1] => Array
        (
            [ref] => sel-1055
            [amount] => 95
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 13:49:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 283, To Pay: 378, Wish To Pay: 378, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-617' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 13:49:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2169, Wish To Pay: 2169, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1057
Inserting Item: Array
(
    [material_id] => 19002
    [quantity] => 30
    [unit_price] => 2.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 69
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29833
    [quantity] => 30
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30507
    [quantity] => 30
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1500
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1057: 2169, Remaining: 0
Total Summary:
Grand Total: 2169
Wish to Pay: 2169
Total Paid: 2169
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1057
            [amount] => 2169
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 13:55:45

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2169, Wish To Pay: 2169, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-618' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 13:55:45

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 218, Wish To Pay: 218, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1059
Inserting Item: Array
(
    [material_id] => 13440
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22193
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1059: 218, Remaining: 0
Total Summary:
Grand Total: 218
Wish to Pay: 218
Total Paid: 218
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1059
            [amount] => 218
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 14:03:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 218, Wish To Pay: 218, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-619' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 14:03:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1061
Inserting Item: Array
(
    [material_id] => 22755
    [quantity] => 5
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1061: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1061
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 14:03:50

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-620' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 14:03:50

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 270, Wish To Pay: 270, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1063
Inserting Item: Array
(
    [material_id] => 1865
    [quantity] => 10
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28909
    [quantity] => 10
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1063: 270, Remaining: 0
Total Summary:
Grand Total: 270
Wish to Pay: 270
Total Paid: 270
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1063
            [amount] => 270
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 14:06:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1350, Wish To Pay: 1350, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1064
Inserting Item: Array
(
    [material_id] => 31793
    [quantity] => 30
    [unit_price] => 45
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1350
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1064: 1350, Remaining: 0
Total Summary:
Grand Total: 1350
Wish to Pay: 1350
Total Paid: 1350
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1064
            [amount] => 1350
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 14:12:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1350, Wish To Pay: 1350, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-622' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 14:12:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 210, Wish To Pay: 210, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1066
Inserting Item: Array
(
    [material_id] => 28592
    [quantity] => 1
    [unit_price] => 130
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1066: 210, Remaining: 0
Total Summary:
Grand Total: 210
Wish to Pay: 210
Total Paid: 210
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1066
            [amount] => 210
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 14:15:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 84, Wish To Pay: 84, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1067
Inserting Item: Array
(
    [material_id] => 19996
    [quantity] => 6
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28860
    [quantity] => 3
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 48
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28346
    [quantity] => 2
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1067: 84, Remaining: 0
Total Summary:
Grand Total: 84
Wish to Pay: 84
Total Paid: 84
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1067
            [amount] => 84
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 14:22:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 84, Wish To Pay: 84, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-624' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 14:22:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 250, Wish To Pay: 250, Received: 300, Change: 50
Customer found: Walk In
Sale Order Inserted. ID: 1069
Inserting Item: Array
(
    [material_id] => 29080
    [quantity] => 1
    [unit_price] => 260
    [discount_percent] => 3.85
    [discount_amount] => 10
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1069: 250, Remaining: 0
Total Summary:
Grand Total: 250
Wish to Pay: 250
Total Paid: 250
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1069
            [amount] => 250
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 14:27:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 250, Wish To Pay: 250, Received: 300, Change: 50
Customer found: Walk In
Error: Duplicate entry 'SO-2026-625' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 14:27:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1240.65, Wish To Pay: 1240.65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1071
Inserting Item: Array
(
    [material_id] => 31793
    [quantity] => 30
    [unit_price] => 45
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1350
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1071: 1240.65, Remaining: 0
Total Summary:
Grand Total: 1240.65
Wish to Pay: 1240.65
Total Paid: 1240.65
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1071
            [amount] => 1240.65
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 14:39:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1240.65, Wish To Pay: 1240.65, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-626' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 14:39:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 145.88, Wish To Pay: 145.88, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1073
Inserting Item: Array
(
    [material_id] => 24770
    [quantity] => 1
    [unit_price] => 130.88
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130.88
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30666
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1073: 145.88, Remaining: 0
Total Summary:
Grand Total: 145.88
Wish to Pay: 145.88
Total Paid: 145.88
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1073
            [amount] => 145.88
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 14:53:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 427.5, Wish To Pay: 427.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1074
Inserting Item: Array
(
    [material_id] => 17582
    [quantity] => 20
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 15
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 52.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13403
    [quantity] => 10
    [unit_price] => 12.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 125
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13964
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1074: 427.5, Remaining: 0
Total Summary:
Grand Total: 427.5
Wish to Pay: 427.5
Total Paid: 427.5
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1074
            [amount] => 427.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 14:54:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 370, Wish To Pay: 370, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1075
Inserting Item: Array
(
    [material_id] => 24575
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31169
    [quantity] => 1
    [unit_price] => 330
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 330
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1075: 370, Remaining: 0
Total Summary:
Grand Total: 370
Wish to Pay: 370
Total Paid: 370
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1075
            [amount] => 370
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 14:59:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 200, Change: 60
Customer found: Walk In
Sale Order Inserted. ID: 1076
Inserting Item: Array
(
    [material_id] => 26741
    [quantity] => 20
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1076: 140, Remaining: 0
Total Summary:
Grand Total: 140
Wish to Pay: 140
Total Paid: 140
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1076
            [amount] => 140
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 15:04:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 22, Wish To Pay: 22, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1077
Inserting Item: Array
(
    [material_id] => 19303
    [quantity] => 4
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1077: 22, Remaining: 0
Total Summary:
Grand Total: 22
Wish to Pay: 22
Total Paid: 22
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1077
            [amount] => 22
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 15:08:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 22, Wish To Pay: 22, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-631' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 15:08:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 380, Wish To Pay: 380, Received: 1000, Change: 620
Customer found: Walk In
Sale Order Inserted. ID: 1079
Inserting Item: Array
(
    [material_id] => 29711
    [quantity] => 20
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1079: 380, Remaining: 0
Total Summary:
Grand Total: 380
Wish to Pay: 380
Total Paid: 380
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1079
            [amount] => 380
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 15:15:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 380, Wish To Pay: 380, Received: 1000, Change: 620
Customer found: Walk In
Error: Duplicate entry 'SO-2026-632' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 15:15:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 490.8, Wish To Pay: 490.8, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1081
Inserting Item: Array
(
    [material_id] => 30160
    [quantity] => 1
    [unit_price] => 310
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 310
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30418
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29485
    [quantity] => 10
    [unit_price] => 2.08
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20.8
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1081: 490.8, Remaining: 0
Total Summary:
Grand Total: 490.8
Wish to Pay: 490.8
Total Paid: 490.8
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1081
            [amount] => 490.8
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 15:25:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 490.8, Wish To Pay: 490.8, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-633' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 15:25:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 415, Wish To Pay: 415, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1083
Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 10
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31774
    [quantity] => 10
    [unit_price] => 14
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30458
    [quantity] => 10
    [unit_price] => 24
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1083: 415, Remaining: 0
Total Summary:
Grand Total: 415
Wish to Pay: 415
Total Paid: 415
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1083
            [amount] => 415
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 16:00:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1084
Inserting Item: Array
(
    [material_id] => 28346
    [quantity] => 6
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 36
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5169
    [quantity] => 10
    [unit_price] => 1.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1084: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1084
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 16:06:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-635' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 16:06:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 226, Wish To Pay: 226, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1086
Inserting Item: Array
(
    [material_id] => 13309
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8142
    [quantity] => 7
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 126
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 8142, Available: 0, Requested: 7
Stack trace: #0 {main}
Script execution completed at: 2026-07-05 16:09:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 226, Wish To Pay: 226, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1087
Inserting Item: Array
(
    [material_id] => 13309
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8142
    [quantity] => 7
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 126
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 8142, Available: 0, Requested: 7
Stack trace: #0 {main}
Script execution completed at: 2026-07-05 16:09:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 339.79, Wish To Pay: 339.79, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1088
Inserting Item: Array
(
    [material_id] => 8142
    [quantity] => 10
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13309
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24681
    [quantity] => 1
    [unit_price] => 65.79
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 65.79
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1088: 339.79, Remaining: 0
Total Summary:
Grand Total: 339.79
Wish to Pay: 339.79
Total Paid: 339.79
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1088
            [amount] => 339.79
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 16:18:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 339.79, Wish To Pay: 339.79, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-636' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 16:18:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 220, Wish To Pay: 220, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1090
Inserting Item: Array
(
    [material_id] => 28159
    [quantity] => 20
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9004
    [quantity] => 20
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7809
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1090: 220, Remaining: 0
Total Summary:
Grand Total: 220
Wish to Pay: 220
Total Paid: 220
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1090
            [amount] => 220
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 16:27:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 220, Wish To Pay: 220, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-637' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 16:27:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 410, Wish To Pay: 410, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1092
Inserting Item: Array
(
    [material_id] => 30308
    [quantity] => 1
    [unit_price] => 420
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 420
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1092: 410, Remaining: 0
Total Summary:
Grand Total: 410
Wish to Pay: 410
Total Paid: 410
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1092
            [amount] => 410
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 16:29:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 410, Wish To Pay: 410, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-638' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 16:29:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1094
Inserting Item: Array
(
    [material_id] => 7809
    [quantity] => 5
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1094: 35, Remaining: 0
Total Summary:
Grand Total: 35
Wish to Pay: 35
Total Paid: 35
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1094
            [amount] => 35
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 16:30:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-639' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 16:30:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 534, Wish To Pay: 534, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-624' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 16:45:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 534, Wish To Pay: 534, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-624' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 16:45:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 524, Wish To Pay: 524, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-624' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 16:46:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 492, Wish To Pay: 492, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-624' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 16:46:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 492, Wish To Pay: 492, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-624' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 16:46:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 480, Wish To Pay: 480, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-624' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 16:46:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 97, Wish To Pay: 97, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1102
Inserting Item: Array
(
    [material_id] => 17687
    [quantity] => 10
    [unit_price] => 3.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 32
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13305
    [quantity] => 1
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24738
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1102: 97, Remaining: 0
Total Summary:
Grand Total: 97
Wish to Pay: 97
Total Paid: 97
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1102
            [amount] => 97
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 16:48:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80.8, Wish To Pay: 80.8, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1103
Inserting Item: Array
(
    [material_id] => 8198
    [quantity] => 10
    [unit_price] => 8.08
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80.8
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1103: 80.8, Remaining: 0
Total Summary:
Grand Total: 80.8
Wish to Pay: 80.8
Total Paid: 80.8
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1103
            [amount] => 80.8
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 16:50:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80.8, Wish To Pay: 80.8, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-641' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 16:50:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1105
Inserting Item: Array
(
    [material_id] => 1936
    [quantity] => 30
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1105: 90, Remaining: 0
Total Summary:
Grand Total: 90
Wish to Pay: 90
Total Paid: 90
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1105
            [amount] => 90
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 17:03:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-642' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 17:03:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 3969, Wish To Pay: 3969, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1107
Inserting Item: Array
(
    [material_id] => 19002
    [quantity] => 30
    [unit_price] => 2.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 69
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29833
    [quantity] => 30
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30495
    [quantity] => 30
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 3300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30495, Available: 0, Requested: 30
Stack trace: #0 {main}
Script execution completed at: 2026-07-05 17:07:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 3969, Wish To Pay: 3969, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1108
Inserting Item: Array
(
    [material_id] => 19002
    [quantity] => 30
    [unit_price] => 2.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 69
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29833
    [quantity] => 30
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30495
    [quantity] => 30
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 3300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30495, Available: 0, Requested: 30
Stack trace: #0 {main}
Script execution completed at: 2026-07-05 17:07:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1109
Inserting Item: Array
(
    [material_id] => 5236
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1109: 35, Remaining: 0
Total Summary:
Grand Total: 35
Wish to Pay: 35
Total Paid: 35
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1109
            [amount] => 35
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 17:21:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 160, Wish To Pay: 160, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1110
Inserting Item: Array
(
    [material_id] => 16935
    [quantity] => 1
    [unit_price] => 160
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1110: 160, Remaining: 0
Total Summary:
Grand Total: 160
Wish to Pay: 160
Total Paid: 160
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1110
            [amount] => 160
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 17:23:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1111
Inserting Item: Array
(
    [material_id] => 25166
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1111: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1111
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-07-05
        )

)

Script execution completed at: 2026-07-05 17:29:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-645' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-05 17:29:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1113
Inserting Item: Array
(
    [material_id] => 28640
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1113: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1113
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 02:27:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 54, Wish To Pay: 54, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1114
Inserting Item: Array
(
    [material_id] => 22355
    [quantity] => 3
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 36
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24259
    [quantity] => 2
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 18
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1114: 54, Remaining: 0
Total Summary:
Grand Total: 54
Wish to Pay: 54
Total Paid: 54
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1114
            [amount] => 54
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 02:36:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 290, Wish To Pay: 290, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1115
Inserting Item: Array
(
    [material_id] => 29814
    [quantity] => 6
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1115: 290, Remaining: 0
Total Summary:
Grand Total: 290
Wish to Pay: 290
Total Paid: 290
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1115
            [amount] => 290
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 02:39:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 37.4, Wish To Pay: 37.4, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1116
Inserting Item: Array
(
    [material_id] => 345
    [quantity] => 2
    [unit_price] => 4.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 9
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18536
    [quantity] => 40
    [unit_price] => 0.71
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 28.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1116: 37.4, Remaining: 0
Total Summary:
Grand Total: 37.4
Wish to Pay: 37.4
Total Paid: 37.4
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1116
            [amount] => 37.4
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 02:57:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1433.88, Wish To Pay: 1433.88, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1117
Inserting Item: Array
(
    [material_id] => 7883
    [quantity] => 30
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1179
    [quantity] => 38
    [unit_price] => 0.8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21594
    [quantity] => 30
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 270
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12158
    [quantity] => 50
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5791
    [quantity] => 8
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1764
    [quantity] => 30
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28103
    [quantity] => 1
    [unit_price] => 160
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 10
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1117: 1433.88, Remaining: 0
Total Summary:
Grand Total: 1433.88
Wish to Pay: 1433.88
Total Paid: 1433.88
Items Inserted: 8
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1117
            [amount] => 1433.88
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 03:28:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1118
Inserting Item: Array
(
    [material_id] => 5589
    [quantity] => 30
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 5589, Available: 2, Requested: 30
Stack trace: #0 {main}
Script execution completed at: 2026-07-06 03:33:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1119
Inserting Item: Array
(
    [material_id] => 5589
    [quantity] => 1
    [unit_price] => 360
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1119: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1119
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 03:38:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1120
Inserting Item: Array
(
    [material_id] => 12761
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1120: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1120
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 03:38:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1121
Inserting Item: Array
(
    [material_id] => 31345
    [quantity] => 1
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12761
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1121: 140, Remaining: 0
Total Summary:
Grand Total: 140
Wish to Pay: 140
Total Paid: 140
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1121
            [amount] => 140
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 03:40:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1122
Inserting Item: Array
(
    [material_id] => 31367
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1122: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1122
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 04:12:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1123
Inserting Item: Array
(
    [material_id] => 31617
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1123: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1123
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 04:27:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1124
Inserting Item: Array
(
    [material_id] => 3640
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1124: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1124
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 04:29:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 49, Wish To Pay: 49, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1125
Inserting Item: Array
(
    [material_id] => 7842
    [quantity] => 14
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 49
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1125: 49, Remaining: 0
Total Summary:
Grand Total: 49
Wish to Pay: 49
Total Paid: 49
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1125
            [amount] => 49
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 04:32:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1126
Inserting Item: Array
(
    [material_id] => 5790
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1126: 35, Remaining: 0
Total Summary:
Grand Total: 35
Wish to Pay: 35
Total Paid: 35
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1126
            [amount] => 35
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 04:39:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 410, Wish To Pay: 410, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1127
Inserting Item: Array
(
    [material_id] => 21328
    [quantity] => 7
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 420
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1127: 410, Remaining: 0
Total Summary:
Grand Total: 410
Wish to Pay: 410
Total Paid: 410
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1127
            [amount] => 410
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 04:46:13

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1128
Inserting Item: Array
(
    [material_id] => 29296
    [quantity] => 50
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1128: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1128
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 04:48:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20.4, Wish To Pay: 20.4, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1129
Inserting Item: Array
(
    [material_id] => 1179
    [quantity] => 28
    [unit_price] => 0.8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1129: 20.4, Remaining: 0
Total Summary:
Grand Total: 20.4
Wish to Pay: 20.4
Total Paid: 20.4
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1129
            [amount] => 20.4
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 04:50:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 869.5, Wish To Pay: 869.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1130
Inserting Item: Array
(
    [material_id] => 592
    [quantity] => 20
    [unit_price] => 1.25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22212
    [quantity] => 30
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 480
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29402
    [quantity] => 18
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29572
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1130: 869.5, Remaining: 0
Total Summary:
Grand Total: 869.5
Wish to Pay: 869.5
Total Paid: 869.5
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1130
            [amount] => 869.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 05:14:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1131
Inserting Item: Array
(
    [material_id] => 21159
    [quantity] => 20
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1131: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1131
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 05:36:09

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 130, Wish To Pay: 130, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1132
Inserting Item: Array
(
    [material_id] => 29674
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19002
    [quantity] => 20
    [unit_price] => 2.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 46
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1132: 130, Remaining: 0
Total Summary:
Grand Total: 130
Wish to Pay: 130
Total Paid: 130
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1132
            [amount] => 130
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 06:07:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 14.3, Wish To Pay: 14.3, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1133
Inserting Item: Array
(
    [material_id] => 294
    [quantity] => 10
    [unit_price] => 1.43
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 14.3
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1133: 14.3, Remaining: 0
Total Summary:
Grand Total: 14.3
Wish to Pay: 14.3
Total Paid: 14.3
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1133
            [amount] => 14.3
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 06:18:45

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1134
Inserting Item: Array
(
    [material_id] => 29711
    [quantity] => 10
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1134: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1134
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 06:20:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1677.9, Wish To Pay: 1677.9, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1135
Inserting Item: Array
(
    [material_id] => 30370
    [quantity] => 1
    [unit_price] => 500
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 500
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14203
    [quantity] => 1
    [unit_price] => 400
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28144
    [quantity] => 30
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30684
    [quantity] => 10
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 350
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28965
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13999
    [quantity] => 10
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1135: 1677.9, Remaining: 0
Total Summary:
Grand Total: 1677.9
Wish to Pay: 1677.9
Total Paid: 1677.9
Items Inserted: 7
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1135
            [amount] => 1677.9
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 06:46:36

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100.5, Wish To Pay: 100.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1136
Inserting Item: Array
(
    [material_id] => 7909
    [quantity] => 30
    [unit_price] => 3.55
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 106.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1136: 100.5, Remaining: 0
Total Summary:
Grand Total: 100.5
Wish to Pay: 100.5
Total Paid: 100.5
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1136
            [amount] => 100.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 06:56:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 810, Wish To Pay: 810, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1137
Inserting Item: Array
(
    [material_id] => 14104
    [quantity] => 30
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 900
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1137: 810, Remaining: 0
Total Summary:
Grand Total: 810
Wish to Pay: 810
Total Paid: 810
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1137
            [amount] => 810
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 07:24:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 455, Wish To Pay: 455, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1138
Inserting Item: Array
(
    [material_id] => 28860
    [quantity] => 10
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19387
    [quantity] => 1
    [unit_price] => 320
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 320
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1138: 455, Remaining: 0
Total Summary:
Grand Total: 455
Wish to Pay: 455
Total Paid: 455
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1138
            [amount] => 455
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 08:23:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 26, Wish To Pay: 26, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1139
Inserting Item: Array
(
    [material_id] => 18772
    [quantity] => 40
    [unit_price] => 0.65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 26
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1139: 26, Remaining: 0
Total Summary:
Grand Total: 26
Wish to Pay: 26
Total Paid: 26
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1139
            [amount] => 26
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 08:27:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 95, Wish To Pay: 95, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1140
Inserting Item: Array
(
    [material_id] => 14007
    [quantity] => 20
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1140: 95, Remaining: 0
Total Summary:
Grand Total: 95
Wish to Pay: 95
Total Paid: 95
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1140
            [amount] => 95
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 08:49:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1141
Inserting Item: Array
(
    [material_id] => 13342
    [quantity] => 20
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1141: 140, Remaining: 0
Total Summary:
Grand Total: 140
Wish to Pay: 140
Total Paid: 140
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1141
            [amount] => 140
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 09:33:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 22.5, Wish To Pay: 22.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1142
Inserting Item: Array
(
    [material_id] => 25032
    [quantity] => 10
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13403
    [quantity] => 1
    [unit_price] => 12.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1142: 22.5, Remaining: 0
Total Summary:
Grand Total: 22.5
Wish to Pay: 22.5
Total Paid: 22.5
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1142
            [amount] => 22.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 10:07:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1143
Inserting Item: Array
(
    [material_id] => 17783
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1143: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1143
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 10:10:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1144
Inserting Item: Array
(
    [material_id] => 30671
    [quantity] => 10
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1144: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1144
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 10:15:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1145
Inserting Item: Array
(
    [material_id] => 1582
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 1582, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-06 10:22:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1146
Inserting Item: Array
(
    [material_id] => 28947
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1146: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1146
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 10:24:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 160, Wish To Pay: 160, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1147
Inserting Item: Array
(
    [material_id] => 4743
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 5
    [discount_amount] => 5
    [total_price] => 95
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14297
    [quantity] => 1
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28577
    [quantity] => 1
    [unit_price] => 45
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1147: 160, Remaining: 0
Total Summary:
Grand Total: 160
Wish to Pay: 160
Total Paid: 160
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1147
            [amount] => 160
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 10:31:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 500, Change: 310
Customer found: Walk In
Sale Order Inserted. ID: 1148
Inserting Item: Array
(
    [material_id] => 29824
    [quantity] => 6
    [unit_price] => 32
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 192
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1148: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1148
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 10:42:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 125, Wish To Pay: 125, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-679' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-06 11:31:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-679' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-06 11:31:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-679' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-06 11:31:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1152
Inserting Item: Array
(
    [material_id] => 26844
    [quantity] => 5
    [unit_price] => 23
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 115
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1152: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1152
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 11:32:10

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 18, Wish To Pay: 18, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1153
Inserting Item: Array
(
    [material_id] => 18586
    [quantity] => 20
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1153: 18, Remaining: 0
Total Summary:
Grand Total: 18
Wish to Pay: 18
Total Paid: 18
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1153
            [amount] => 18
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 11:32:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 807.76, Wish To Pay: 807.76, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1154
Inserting Item: Array
(
    [material_id] => 13977
    [quantity] => 12
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 216
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27941
    [quantity] => 21
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 210
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21300
    [quantity] => 10
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 12
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28982
    [quantity] => 8
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 128
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28982, Available: 0, Requested: 8
Stack trace: #0 {main}
Script execution completed at: 2026-07-06 12:02:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 807.76, Wish To Pay: 807.76, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1155
Inserting Item: Array
(
    [material_id] => 13977
    [quantity] => 12
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 216
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27941
    [quantity] => 21
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 210
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21300
    [quantity] => 10
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 12
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28982
    [quantity] => 8
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 128
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28982, Available: 0, Requested: 8
Stack trace: #0 {main}
Script execution completed at: 2026-07-06 12:02:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 818.76, Wish To Pay: 818.76, Received: 1000, Change: 181.24
Customer found: Walk In
Sale Order Inserted. ID: 1156
Inserting Item: Array
(
    [material_id] => 13977
    [quantity] => 12
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 216
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27941
    [quantity] => 21
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 210
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21300
    [quantity] => 10
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13976
    [quantity] => 8
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 128
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1860
    [quantity] => 2
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1156: 818.76, Remaining: 0
Total Summary:
Grand Total: 818.76
Wish to Pay: 818.76
Total Paid: 818.76
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1156
            [amount] => 818.76
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 12:08:45

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1157
Inserting Item: Array
(
    [material_id] => 19132
    [quantity] => 14
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 112
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1157: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1157
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 12:29:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1158
Inserting Item: Array
(
    [material_id] => 18799
    [quantity] => 5
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1158: 35, Remaining: 0
Total Summary:
Grand Total: 35
Wish to Pay: 35
Total Paid: 35
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1158
            [amount] => 35
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 12:39:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 234.5, Wish To Pay: 234.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1159
Inserting Item: Array
(
    [material_id] => 22146
    [quantity] => 10
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31617
    [quantity] => 5
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 15472
    [quantity] => 6
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 42
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1860
    [quantity] => 7
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 122.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30733
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1159: 234.5, Remaining: 0
Total Summary:
Grand Total: 234.5
Wish to Pay: 234.5
Total Paid: 234.5
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1159
            [amount] => 234.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 12:48:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 310, Wish To Pay: 310, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1160
Inserting Item: Array
(
    [material_id] => 18923
    [quantity] => 4
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31261
    [quantity] => 10
    [unit_price] => 5.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 52
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13848
    [quantity] => 10
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 959
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1160: 310, Remaining: 0
Total Summary:
Grand Total: 310
Wish to Pay: 310
Total Paid: 310
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1160
            [amount] => 310
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 12:58:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 530.5, Wish To Pay: 530.5, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-684' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-06 13:14:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 540.5, Wish To Pay: 540.5, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-684' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-06 13:16:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 540.5, Wish To Pay: 540.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1163
Inserting Item: Array
(
    [material_id] => 21726
    [quantity] => 15
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21695
    [quantity] => 20
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 340
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13192
    [quantity] => 15
    [unit_price] => 6.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 94.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28615
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1163: 540.5, Remaining: 0
Total Summary:
Grand Total: 540.5
Wish to Pay: 540.5
Total Paid: 540.5
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1163
            [amount] => 540.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 13:17:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 115, Wish To Pay: 115, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1164
Inserting Item: Array
(
    [material_id] => 31575
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5455
    [quantity] => 6
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1164: 115, Remaining: 0
Total Summary:
Grand Total: 115
Wish to Pay: 115
Total Paid: 115
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1164
            [amount] => 115
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 13:31:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1165
Inserting Item: Array
(
    [material_id] => 31661
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1165: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1165
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 13:32:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 136, Wish To Pay: 136, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1166
Inserting Item: Array
(
    [material_id] => 31811
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24983
    [quantity] => 1
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29314
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1166: 136, Remaining: 0
Total Summary:
Grand Total: 136
Wish to Pay: 136
Total Paid: 136
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1166
            [amount] => 136
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 13:35:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 32, Wish To Pay: 32, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1167
Inserting Item: Array
(
    [material_id] => 5163
    [quantity] => 2
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 32
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1167: 32, Remaining: 0
Total Summary:
Grand Total: 32
Wish to Pay: 32
Total Paid: 32
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1167
            [amount] => 32
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 13:40:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 620, Wish To Pay: 620, Received: 1000, Change: 380
Customer found: Walk In
Sale Order Inserted. ID: 1168
Inserting Item: Array
(
    [material_id] => 19182
    [quantity] => 4
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30370
    [quantity] => 1
    [unit_price] => 500
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 500
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1168: 620, Remaining: 0
Total Summary:
Grand Total: 620
Wish to Pay: 620
Total Paid: 620
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1168
            [amount] => 620
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 13:44:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1169
Inserting Item: Array
(
    [material_id] => 30507
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3887
    [quantity] => 1
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1169: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1169
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 13:53:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40.7, Wish To Pay: 40.7, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1170
Inserting Item: Array
(
    [material_id] => 1850
    [quantity] => 10
    [unit_price] => 0.77
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7.7
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5709
    [quantity] => 5
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1170: 40.7, Remaining: 0
Total Summary:
Grand Total: 40.7
Wish to Pay: 40.7
Total Paid: 40.7
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1170
            [amount] => 40.7
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 13:56:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1171
Inserting Item: Array
(
    [material_id] => 13251
    [quantity] => 1
    [unit_price] => 65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 65
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25147
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 12
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1171: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1171
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 14:17:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1172
Inserting Item: Array
(
    [material_id] => 29705
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1172: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1172
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 14:25:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 11.2, Wish To Pay: 11.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1173
Inserting Item: Array
(
    [material_id] => 1179
    [quantity] => 14
    [unit_price] => 0.8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 11.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1173: 11.2, Remaining: 0
Total Summary:
Grand Total: 11.2
Wish to Pay: 11.2
Total Paid: 11.2
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1173
            [amount] => 11.2
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 14:28:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 500, Change: 310
Customer found: Walk In
Sale Order Inserted. ID: 1174
Inserting Item: Array
(
    [material_id] => 20002
    [quantity] => 20
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24335
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22347
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1174: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1174
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 14:30:10

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1175
Inserting Item: Array
(
    [material_id] => 28368
    [quantity] => 2
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1175: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1175
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 14:32:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1176
Inserting Item: Array
(
    [material_id] => 5455
    [quantity] => 10
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5236
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1176: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1176
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 14:38:09

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1177
Inserting Item: Array
(
    [material_id] => 31176
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24738
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9430
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1177: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1177
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 14:45:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-701' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-06 14:45:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 394, Wish To Pay: 394, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1179
Inserting Item: Array
(
    [material_id] => 28097
    [quantity] => 1
    [unit_price] => 360
    [discount_percent] => 5.56
    [discount_amount] => 20
    [total_price] => 340
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12817
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 5
    [discount_amount] => 3
    [total_price] => 57
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1179: 394, Remaining: 0
Total Summary:
Grand Total: 394
Wish to Pay: 394
Total Paid: 394
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1179
            [amount] => 394
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 15:01:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 9
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1883, Wish To Pay: 1883, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1180
Inserting Item: Array
(
    [material_id] => 29998
    [quantity] => 1
    [unit_price] => 690
    [discount_percent] => 13.04
    [discount_amount] => 90
    [total_price] => 600
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3977
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 25
    [discount_amount] => 20
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29407
    [quantity] => 10
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22386
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22193
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28528
    [quantity] => 1
    [unit_price] => 45
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14615
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3781
    [quantity] => 20
    [unit_price] => 7
    [discount_percent] => 7.14
    [discount_amount] => 10
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31245
    [quantity] => 1
    [unit_price] => 690
    [discount_percent] => 20.29
    [discount_amount] => 140
    [total_price] => 550
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1180: 1883, Remaining: 0
Total Summary:
Grand Total: 1883
Wish to Pay: 1883
Total Paid: 1883
Items Inserted: 9
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1180
            [amount] => 1883
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 15:23:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1181
Inserting Item: Array
(
    [material_id] => 28890
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1181: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1181
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 15:24:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1182
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1182: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1182
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 15:28:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1183
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1183: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1183
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 15:33:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 690, Wish To Pay: 690, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1184
Inserting Item: Array
(
    [material_id] => 9000
    [quantity] => 1
    [unit_price] => 240
    [discount_percent] => 8.33
    [discount_amount] => 20
    [total_price] => 220
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5107
    [quantity] => 1
    [unit_price] => 360
    [discount_percent] => 6.94
    [discount_amount] => 25
    [total_price] => 335
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30789
    [quantity] => 1
    [unit_price] => 140
    [discount_percent] => 3.57
    [discount_amount] => 5
    [total_price] => 135
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30789, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-06 15:39:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 690, Wish To Pay: 690, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1185
Inserting Item: Array
(
    [material_id] => 9000
    [quantity] => 1
    [unit_price] => 240
    [discount_percent] => 8.33
    [discount_amount] => 20
    [total_price] => 220
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5107
    [quantity] => 1
    [unit_price] => 360
    [discount_percent] => 6.94
    [discount_amount] => 25
    [total_price] => 335
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30789
    [quantity] => 1
    [unit_price] => 140
    [discount_percent] => 3.57
    [discount_amount] => 5
    [total_price] => 135
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 30789, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-06 15:41:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 740, Wish To Pay: 740, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1186
Inserting Item: Array
(
    [material_id] => 5107
    [quantity] => 1
    [unit_price] => 360
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9000
    [quantity] => 1
    [unit_price] => 240
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28432
    [quantity] => 1
    [unit_price] => 140
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1186: 740, Remaining: 0
Total Summary:
Grand Total: 740
Wish to Pay: 740
Total Paid: 740
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1186
            [amount] => 740
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 15:57:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1187
Inserting Item: Array
(
    [material_id] => 7796
    [quantity] => 14
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 112
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1187: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1187
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 16:03:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 220, Wish To Pay: 220, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1188
Inserting Item: Array
(
    [material_id] => 7796
    [quantity] => 28
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 224
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1188: 220, Remaining: 0
Total Summary:
Grand Total: 220
Wish to Pay: 220
Total Paid: 220
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1188
            [amount] => 220
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 16:07:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1189
Inserting Item: Array
(
    [material_id] => 31625
    [quantity] => 1
    [unit_price] => 170
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1189: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1189
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 16:09:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 45, Wish To Pay: 45, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1190
Inserting Item: Array
(
    [material_id] => 1157
    [quantity] => 1
    [unit_price] => 45
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1190: 45, Remaining: 0
Total Summary:
Grand Total: 45
Wish to Pay: 45
Total Paid: 45
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1190
            [amount] => 45
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 16:12:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1191
Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 26775
    [quantity] => 1
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 18
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1191: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1191
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 16:20:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1192
Inserting Item: Array
(
    [material_id] => 28259
    [quantity] => 1
    [unit_price] => 300
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1192: 300, Remaining: 0
Total Summary:
Grand Total: 300
Wish to Pay: 300
Total Paid: 300
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1192
            [amount] => 300
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 16:24:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 130, Wish To Pay: 130, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1193
Inserting Item: Array
(
    [material_id] => 13287
    [quantity] => 4
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 36
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18923
    [quantity] => 4
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 2328
    [quantity] => 4
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1193: 130, Remaining: 0
Total Summary:
Grand Total: 130
Wish to Pay: 130
Total Paid: 130
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1193
            [amount] => 130
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 16:28:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1194
Inserting Item: Array
(
    [material_id] => 26957
    [quantity] => 10
    [unit_price] => 12.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 125
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1267
    [quantity] => 1
    [unit_price] => 47
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 47
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27877
    [quantity] => 2
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1194: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1194
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 16:30:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 420, Wish To Pay: 420, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1195
Inserting Item: Array
(
    [material_id] => 31250
    [quantity] => 1
    [unit_price] => 450
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 450
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1195: 420, Remaining: 0
Total Summary:
Grand Total: 420
Wish to Pay: 420
Total Paid: 420
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1195
            [amount] => 420
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 16:34:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40.05, Wish To Pay: 40.05, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1196
Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 5
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 27.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24361
    [quantity] => 5
    [unit_price] => 2.51
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12.55
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1196: 40.05, Remaining: 0
Total Summary:
Grand Total: 40.05
Wish to Pay: 40.05
Total Paid: 40.05
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1196
            [amount] => 40.05
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 16:35:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 280, Wish To Pay: 280, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1197
Inserting Item: Array
(
    [material_id] => 8894
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18898
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1197: 280, Remaining: 0
Total Summary:
Grand Total: 280
Wish to Pay: 280
Total Paid: 280
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1197
            [amount] => 280
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 16:47:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 290, Wish To Pay: 290, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1198
Inserting Item: Array
(
    [material_id] => 14297
    [quantity] => 3
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 75
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30666
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31663
    [quantity] => 1
    [unit_price] => 120
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17544
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1198: 290, Remaining: 0
Total Summary:
Grand Total: 290
Wish to Pay: 290
Total Paid: 290
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1198
            [amount] => 290
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 17:01:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 16, Wish To Pay: 16, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1199
Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 2
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 4
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1199: 16, Remaining: 0
Total Summary:
Grand Total: 16
Wish to Pay: 16
Total Paid: 16
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1199
            [amount] => 16
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 17:21:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1200
Inserting Item: Array
(
    [material_id] => 31113
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1200: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1200
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 17:35:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 55, Wish To Pay: 55, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1201
Inserting Item: Array
(
    [material_id] => 30639
    [quantity] => 5
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1201: 55, Remaining: 0
Total Summary:
Grand Total: 55
Wish to Pay: 55
Total Paid: 55
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1201
            [amount] => 55
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 17:40:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 30
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 44.16, Wish To Pay: 44.16, Received: 0, Change: 0
Customer found: Al-Hera Healthcare & pharma
Sale Order Inserted. ID: 1202
Inserting Item: Array
(
    [material_id] => 31807
    [quantity] => 1
    [unit_price] => 48
    [discount_percent] => 8
    [discount_amount] => 3.84
    [total_price] => 44.16
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1202: 44.16, Remaining: 0
Total Summary:
Grand Total: 44.16
Wish to Pay: 44.16
Total Paid: 44.16
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1202
            [amount] => 44.16
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 17:41:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 35
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 3, To Pay: 0, Wish To Pay: 0, Received: 0, Change: 0
Customer found: kabir humaun
Sale Order Inserted. ID: 1203
Inserting Item: Array
(
    [material_id] => 22346
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21693
    [quantity] => 10
    [unit_price] => 4.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 451
    [quantity] => 10
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Total Summary:
Grand Total: 164.7
Wish to Pay: 0
Total Paid: 0
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
)

Script execution completed at: 2026-07-06 17:49:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1204
Inserting Item: Array
(
    [material_id] => 24838
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5085
    [quantity] => 2
    [unit_price] => 85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1204: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1204
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 18:02:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 170, Wish To Pay: 170, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1205
Inserting Item: Array
(
    [material_id] => 30206
    [quantity] => 2
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28729
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31362
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29787
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1205: 170, Remaining: 0
Total Summary:
Grand Total: 170
Wish to Pay: 170
Total Paid: 170
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1205
            [amount] => 170
            [type] => Previous Sale Due Payment
            [date] => 2026-07-06
        )

)

Script execution completed at: 2026-07-06 18:09:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 9
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 636.67, Wish To Pay: 636.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1206
Inserting Item: Array
(
    [material_id] => 28312
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28727
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28727, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 03:42:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 9
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 636.67, Wish To Pay: 636.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1207
Inserting Item: Array
(
    [material_id] => 28312
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28727
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28727, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 03:42:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 9
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 996.67, Wish To Pay: 996.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1208
Inserting Item: Array
(
    [material_id] => 28312
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28727
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28727, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 03:44:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 9
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 996.67, Wish To Pay: 996.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1209
Inserting Item: Array
(
    [material_id] => 28312
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28727
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28727, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 03:44:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 9
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 996.67, Wish To Pay: 996.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1210
Inserting Item: Array
(
    [material_id] => 28312
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28727
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28727, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 03:44:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1046.67, Wish To Pay: 1046.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1211
Inserting Item: Array
(
    [material_id] => 28312
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28727
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28727, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 03:45:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1046.67, Wish To Pay: 1046.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1212
Inserting Item: Array
(
    [material_id] => 28312
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28727
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28727, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 03:45:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1046.67, Wish To Pay: 1046.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1213
Inserting Item: Array
(
    [material_id] => 28312
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28727
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28727, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 03:46:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1046.67, Wish To Pay: 1046.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1214
Inserting Item: Array
(
    [material_id] => 28312
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28727
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28727, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 03:46:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 956.67, Wish To Pay: 956.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1215
Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28727
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28727, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 03:52:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 956.67, Wish To Pay: 956.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1216
Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28727
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28727, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 03:52:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1046.67, Wish To Pay: 1046.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1217
Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28727
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28727, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 04:00:50

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 10
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1046.67, Wish To Pay: 1046.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1218
Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28727
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 28727, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 04:00:50

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 9
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 946.67, Wish To Pay: 946.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1219
Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18772
    [quantity] => 16
    [unit_price] => 0.65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 20
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24569
    [quantity] => 20
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29280
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 29280, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 04:02:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 9
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 946.67, Wish To Pay: 946.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1220
Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18772
    [quantity] => 16
    [unit_price] => 0.65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 20
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24569
    [quantity] => 20
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29280
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 29280, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 04:02:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 886.67, Wish To Pay: 886.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1221
Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18772
    [quantity] => 16
    [unit_price] => 0.65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 20
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29280
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 29280, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 04:04:36

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 886.67, Wish To Pay: 886.67, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1222
Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18772
    [quantity] => 16
    [unit_price] => 0.65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 20
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29280
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 29280, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 04:04:36

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 907.1, Wish To Pay: 907.1, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1223
Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18772
    [quantity] => 16
    [unit_price] => 0.65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 20
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29280
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 29280, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 04:06:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 907.1, Wish To Pay: 907.1, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1224
Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18772
    [quantity] => 16
    [unit_price] => 0.65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 20
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29280
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 29280, Available: 0, Requested: 1
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 04:06:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 907.1, Wish To Pay: 907.1, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1225
Inserting Item: Array
(
    [material_id] => 30231
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18772
    [quantity] => 16
    [unit_price] => 0.65
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 20
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31720
    [quantity] => 1
    [unit_price] => 250
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24772
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24569
    [quantity] => 20
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 23169
    [quantity] => 10
    [unit_price] => 2.27
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22.7
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28402
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1225: 907.1, Remaining: 0
Total Summary:
Grand Total: 907.1
Wish to Pay: 907.1
Total Paid: 907.1
Items Inserted: 8
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1225
            [amount] => 907.1
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 04:07:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 907.1, Wish To Pay: 907.1, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-727' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 04:07:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 840, Wish To Pay: 840, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1227
Inserting Item: Array
(
    [material_id] => 5083
    [quantity] => 14
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 840
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1227: 840, Remaining: 0
Total Summary:
Grand Total: 840
Wish to Pay: 840
Total Paid: 840
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1227
            [amount] => 840
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 04:25:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 840, Wish To Pay: 840, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-728' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 04:25:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 543.68, Wish To Pay: 543.68, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-727' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 04:38:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 543.68, Wish To Pay: 543.68, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-727' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 04:38:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 713.03, Wish To Pay: 713.03, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-727' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 04:47:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 713.03, Wish To Pay: 713.03, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-727' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 04:47:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 170, Wish To Pay: 170, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1233
Inserting Item: Array
(
    [material_id] => 8895
    [quantity] => 1
    [unit_price] => 125
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 125
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28528
    [quantity] => 1
    [unit_price] => 45
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1233: 170, Remaining: 0
Total Summary:
Grand Total: 170
Wish to Pay: 170
Total Paid: 170
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1233
            [amount] => 170
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 04:59:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 170, Wish To Pay: 170, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-729' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 04:59:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 7.5, Wish To Pay: 7.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1235
Inserting Item: Array
(
    [material_id] => 19003
    [quantity] => 5
    [unit_price] => 1.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1235: 7.5, Remaining: 0
Total Summary:
Grand Total: 7.5
Wish to Pay: 7.5
Total Paid: 7.5
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1235
            [amount] => 7.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 05:04:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 7.5, Wish To Pay: 7.5, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-730' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 05:04:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 424, Wish To Pay: 424, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1237
Inserting Item: Array
(
    [material_id] => 18554
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28734
    [quantity] => 14
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 238
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29356
    [quantity] => 12
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 96
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1237: 424, Remaining: 0
Total Summary:
Grand Total: 424
Wish to Pay: 424
Total Paid: 424
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1237
            [amount] => 424
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 05:15:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 424, Wish To Pay: 424, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-731' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 05:15:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 116, Wish To Pay: 116, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1239
Inserting Item: Array
(
    [material_id] => 18554
    [quantity] => 4
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 36
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29356
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1239: 116, Remaining: 0
Total Summary:
Grand Total: 116
Wish to Pay: 116
Total Paid: 116
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1239
            [amount] => 116
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 05:20:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 116, Wish To Pay: 116, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-732' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 05:20:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2, Wish To Pay: 2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1241
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 6
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 42
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 12127, Available: 1, Requested: 6
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 05:27:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 2, Wish To Pay: 2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1242
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 6
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 42
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 12127, Available: 1, Requested: 6
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 05:27:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 165.5, Wish To Pay: 165.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1243
Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 7
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 38.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5178
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19625
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1243: 165.5, Remaining: 0
Total Summary:
Grand Total: 165.5
Wish to Pay: 165.5
Total Paid: 165.5
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1243
            [amount] => 165.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 05:59:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1244
Inserting Item: Array
(
    [material_id] => 9251
    [quantity] => 7
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 42
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1244: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1244
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 06:01:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1245
Inserting Item: Array
(
    [material_id] => 28236
    [quantity] => 2
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1245: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1245
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 06:04:50

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1246
Inserting Item: Array
(
    [material_id] => 7346
    [quantity] => 30
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 210
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1246: 200, Remaining: 0
Total Summary:
Grand Total: 200
Wish to Pay: 200
Total Paid: 200
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1246
            [amount] => 200
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 06:05:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1247
Inserting Item: Array
(
    [material_id] => 22192
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28860
    [quantity] => 5
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1247: 90, Remaining: 0
Total Summary:
Grand Total: 90
Wish to Pay: 90
Total Paid: 90
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1247
            [amount] => 90
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 06:31:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-737' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 06:31:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1249
Inserting Item: Array
(
    [material_id] => 31367
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1249: 90, Remaining: 0
Total Summary:
Grand Total: 90
Wish to Pay: 90
Total Paid: 90
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1249
            [amount] => 90
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 06:54:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 11
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1880.05, Wish To Pay: 1880.05, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1250
Inserting Item: Array
(
    [material_id] => 3889
    [quantity] => 1
    [unit_price] => 230
    [discount_percent] => 3
    [discount_amount] => 6.9
    [total_price] => 223.1
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3964
    [quantity] => 1
    [unit_price] => 325
    [discount_percent] => 3
    [discount_amount] => 9.75
    [total_price] => 315.25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29628
    [quantity] => 1
    [unit_price] => 190
    [discount_percent] => 3
    [discount_amount] => 5.7
    [total_price] => 184.3
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3875
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 3
    [discount_amount] => 2.1
    [total_price] => 67.9
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18476
    [quantity] => 10
    [unit_price] => 35
    [discount_percent] => 3
    [discount_amount] => 10.5
    [total_price] => 339.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3720
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 1
    [discount_amount] => 2
    [total_price] => 198
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8302
    [quantity] => 7
    [unit_price] => 16
    [discount_percent] => 26.79
    [discount_amount] => 30
    [total_price] => 82
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3614
    [quantity] => 20
    [unit_price] => 8
    [discount_percent] => 3.13
    [discount_amount] => 5
    [total_price] => 155
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3722
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 2.5
    [discount_amount] => 5
    [total_price] => 195
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28709
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30026
    [quantity] => 1
    [unit_price] => 110
    [discount_percent] => 9.09
    [discount_amount] => 10
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1250: 1880.05, Remaining: 0
Total Summary:
Grand Total: 1880.05
Wish to Pay: 1880.05
Total Paid: 1880.05
Items Inserted: 11
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1250
            [amount] => 1880.05
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 07:37:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 250, Wish To Pay: 250, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1251
Inserting Item: Array
(
    [material_id] => 1151
    [quantity] => 6
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22347
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22355
    [quantity] => 6
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 72
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1251: 250, Remaining: 0
Total Summary:
Grand Total: 250
Wish to Pay: 250
Total Paid: 250
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1251
            [amount] => 250
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 07:49:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1252
Inserting Item: Array
(
    [material_id] => 24345
    [quantity] => 6
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1252: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1252
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 07:50:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 5, Wish To Pay: 5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1253
Inserting Item: Array
(
    [material_id] => 25032
    [quantity] => 2
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5169
    [quantity] => 2
    [unit_price] => 1.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 3
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1253: 5, Remaining: 0
Total Summary:
Grand Total: 5
Wish to Pay: 5
Total Paid: 5
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1253
            [amount] => 5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 07:52:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 570, Wish To Pay: 570, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1254
Inserting Item: Array
(
    [material_id] => 29140
    [quantity] => 30
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 450
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12949
    [quantity] => 30
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1254: 570, Remaining: 0
Total Summary:
Grand Total: 570
Wish to Pay: 570
Total Paid: 570
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1254
            [amount] => 570
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 08:29:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 350, Wish To Pay: 350, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1255
Inserting Item: Array
(
    [material_id] => 23919
    [quantity] => 6
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 36
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 12
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17615
    [quantity] => 3
    [unit_price] => 55
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 165
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22192
    [quantity] => 14
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1255: 350, Remaining: 0
Total Summary:
Grand Total: 350
Wish to Pay: 350
Total Paid: 350
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1255
            [amount] => 350
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 08:42:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1256
Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1256: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1256
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 08:44:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1257
Inserting Item: Array
(
    [material_id] => 19256
    [quantity] => 10
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 220
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9518
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1257: 300, Remaining: 0
Total Summary:
Grand Total: 300
Wish to Pay: 300
Total Paid: 300
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1257
            [amount] => 300
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 08:46:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1258
Inserting Item: Array
(
    [material_id] => 24277
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31712
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1258: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1258
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 08:59:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-747' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 08:59:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1260
Inserting Item: Array
(
    [material_id] => 31667
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1260: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1260
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 10:34:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1261
Inserting Item: Array
(
    [material_id] => 23335
    [quantity] => 20
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1261: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1261
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 10:35:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-749' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 10:35:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1270, Wish To Pay: 1270, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1263
Inserting Item: Array
(
    [material_id] => 14157
    [quantity] => 20
    [unit_price] => 45
    [discount_percent] => 3.33
    [discount_amount] => 30
    [total_price] => 870
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13313
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 8.16
    [discount_amount] => 8
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13976
    [quantity] => 20
    [unit_price] => 16
    [discount_percent] => 3.13
    [discount_amount] => 10
    [total_price] => 310
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1263: 1270, Remaining: 0
Total Summary:
Grand Total: 1270
Wish to Pay: 1270
Total Paid: 1270
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1263
            [amount] => 1270
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 11:03:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-748' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 11:30:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-748' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 11:30:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 500, Wish To Pay: 500, Received: 500, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1266
Inserting Item: Array
(
    [material_id] => 12098
    [quantity] => 10
    [unit_price] => 4.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 300
    [quantity] => 20
    [unit_price] => 14
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 280
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28261
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1266: 500, Remaining: 0
Total Summary:
Grand Total: 500
Wish to Pay: 500
Total Paid: 500
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1266
            [amount] => 500
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 11:35:09

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 215, Wish To Pay: 215, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1267
Inserting Item: Array
(
    [material_id] => 24685
    [quantity] => 40
    [unit_price] => 5.6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 224
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1267: 215, Remaining: 0
Total Summary:
Grand Total: 215
Wish to Pay: 215
Total Paid: 215
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1267
            [amount] => 215
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 11:38:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1268
Inserting Item: Array
(
    [material_id] => 5766
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1268: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1268
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 11:40:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-751' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 11:46:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-751' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 11:46:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 7.2, Wish To Pay: 7.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1271
Inserting Item: Array
(
    [material_id] => 14044
    [quantity] => 6
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1271: 7.2, Remaining: 0
Total Summary:
Grand Total: 7.2
Wish to Pay: 7.2
Total Paid: 7.2
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1271
            [amount] => 7.2
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 12:08:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 7.2, Wish To Pay: 7.2, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-754' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 12:08:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 325, Wish To Pay: 325, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1273
Inserting Item: Array
(
    [material_id] => 21341
    [quantity] => 1
    [unit_price] => 325
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 325
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1273: 325, Remaining: 0
Total Summary:
Grand Total: 325
Wish to Pay: 325
Total Paid: 325
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1273
            [amount] => 325
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 12:09:15

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 220, Wish To Pay: 220, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1274
Inserting Item: Array
(
    [material_id] => 31819
    [quantity] => 10
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5792
    [quantity] => 10
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1274: 220, Remaining: 0
Total Summary:
Grand Total: 220
Wish to Pay: 220
Total Paid: 220
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1274
            [amount] => 220
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 12:33:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 15, Wish To Pay: 15, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1275
Inserting Item: Array
(
    [material_id] => 30329
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1275: 15, Remaining: 0
Total Summary:
Grand Total: 15
Wish to Pay: 15
Total Paid: 15
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1275
            [amount] => 15
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 12:33:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 480, Wish To Pay: 480, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1276
Inserting Item: Array
(
    [material_id] => 22386
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18799
    [quantity] => 20
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13287
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21663
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1276: 480, Remaining: 0
Total Summary:
Grand Total: 480
Wish to Pay: 480
Total Paid: 480
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1276
            [amount] => 480
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 12:43:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 170, Wish To Pay: 170, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1277
Inserting Item: Array
(
    [material_id] => 28640
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5866
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1277: 170, Remaining: 0
Total Summary:
Grand Total: 170
Wish to Pay: 170
Total Paid: 170
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1277
            [amount] => 170
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 13:22:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 75, Wish To Pay: 75, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1278
Inserting Item: Array
(
    [material_id] => 28359
    [quantity] => 1
    [unit_price] => 75
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 75
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1278: 75, Remaining: 0
Total Summary:
Grand Total: 75
Wish to Pay: 75
Total Paid: 75
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1278
            [amount] => 75
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 13:25:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1279
Inserting Item: Array
(
    [material_id] => 28640
    [quantity] => 1
    [unit_price] => 70
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1279: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1279
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 13:29:09

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-761' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 13:29:09

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1281
Inserting Item: Array
(
    [material_id] => 25196
    [quantity] => 4
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 36
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9585
    [quantity] => 1
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1281: 140, Remaining: 0
Total Summary:
Grand Total: 140
Wish to Pay: 140
Total Paid: 140
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1281
            [amount] => 140
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 14:00:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1282
Inserting Item: Array
(
    [material_id] => 21239
    [quantity] => 5
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24592
    [quantity] => 2
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1282: 90, Remaining: 0
Total Summary:
Grand Total: 90
Wish to Pay: 90
Total Paid: 90
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1282
            [amount] => 90
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 14:04:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 245, Wish To Pay: 245, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1283
Inserting Item: Array
(
    [material_id] => 24260
    [quantity] => 10
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 220
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28409
    [quantity] => 1
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1283: 245, Remaining: 0
Total Summary:
Grand Total: 245
Wish to Pay: 245
Total Paid: 245
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1283
            [amount] => 245
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 14:09:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 18, Wish To Pay: 18, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1284
Inserting Item: Array
(
    [material_id] => 26775
    [quantity] => 1
    [unit_price] => 18
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 18
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1284: 18, Remaining: 0
Total Summary:
Grand Total: 18
Wish to Pay: 18
Total Paid: 18
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1284
            [amount] => 18
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 14:16:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 550, Wish To Pay: 550, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1285
Inserting Item: Array
(
    [material_id] => 3877
    [quantity] => 1
    [unit_price] => 550
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 550
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1285: 550, Remaining: 0
Total Summary:
Grand Total: 550
Wish to Pay: 550
Total Paid: 550
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1285
            [amount] => 550
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 14:17:50

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1286
Inserting Item: Array
(
    [material_id] => 24277
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22146
    [quantity] => 4
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1286: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1286
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 14:35:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 740, Wish To Pay: 740, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1287
Inserting Item: Array
(
    [material_id] => 1498
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31427
    [quantity] => 1
    [unit_price] => 885
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 885
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1287: 740, Remaining: 0
Total Summary:
Grand Total: 740
Wish to Pay: 740
Total Paid: 740
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1287
            [amount] => 740
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 14:39:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 362, Wish To Pay: 362, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1288
Inserting Item: Array
(
    [material_id] => 24505
    [quantity] => 4
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28220
    [quantity] => 4
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 44
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12221
    [quantity] => 4
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 48
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30548
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1288: 362, Remaining: 0
Total Summary:
Grand Total: 362
Wish to Pay: 362
Total Paid: 362
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1288
            [amount] => 362
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 14:49:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 170, Wish To Pay: 170, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1289
Inserting Item: Array
(
    [material_id] => 14147
    [quantity] => 20
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1289: 170, Remaining: 0
Total Summary:
Grand Total: 170
Wish to Pay: 170
Total Paid: 170
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1289
            [amount] => 170
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 14:49:47

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 22, Wish To Pay: 22, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1290
Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 2
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1290: 22, Remaining: 0
Total Summary:
Grand Total: 22
Wish to Pay: 22
Total Paid: 22
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1290
            [amount] => 22
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 14:58:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 550, Wish To Pay: 550, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1291
Inserting Item: Array
(
    [material_id] => 31067
    [quantity] => 1
    [unit_price] => 415
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 415
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30318
    [quantity] => 2
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1291: 550, Remaining: 0
Total Summary:
Grand Total: 550
Wish to Pay: 550
Total Paid: 550
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1291
            [amount] => 550
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 15:05:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1292
Inserting Item: Array
(
    [material_id] => 9004
    [quantity] => 10
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1292: 35, Remaining: 0
Total Summary:
Grand Total: 35
Wish to Pay: 35
Total Paid: 35
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1292
            [amount] => 35
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 15:15:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 290, Wish To Pay: 290, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1293
Inserting Item: Array
(
    [material_id] => 5732
    [quantity] => 15
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1293: 290, Remaining: 0
Total Summary:
Grand Total: 290
Wish to Pay: 290
Total Paid: 290
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1293
            [amount] => 290
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 15:15:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200.28, Wish To Pay: 200.28, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1294
Inserting Item: Array
(
    [material_id] => 25167
    [quantity] => 4
    [unit_price] => 10.07
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40.28
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24345
    [quantity] => 4
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17731
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22193
    [quantity] => 4
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 28
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12102
    [quantity] => 2
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1294: 200.28, Remaining: 0
Total Summary:
Grand Total: 200.28
Wish to Pay: 200.28
Total Paid: 200.28
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1294
            [amount] => 200.28
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 15:20:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 560, Wish To Pay: 560, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1295
Inserting Item: Array
(
    [material_id] => 21641
    [quantity] => 9
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 117
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24671
    [quantity] => 20
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5088
    [quantity] => 15
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9004
    [quantity] => 20
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1295: 560, Remaining: 0
Total Summary:
Grand Total: 560
Wish to Pay: 560
Total Paid: 560
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1295
            [amount] => 560
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 15:31:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 400, Wish To Pay: 400, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1296
Inserting Item: Array
(
    [material_id] => 26881
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30207
    [quantity] => 20
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1296: 400, Remaining: 0
Total Summary:
Grand Total: 400
Wish to Pay: 400
Total Paid: 400
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1296
            [amount] => 400
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 15:54:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 400, Wish To Pay: 400, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-777' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 15:54:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 175, Wish To Pay: 175, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1298
Inserting Item: Array
(
    [material_id] => 19625
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13313
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1298: 175, Remaining: 0
Total Summary:
Grand Total: 175
Wish to Pay: 175
Total Paid: 175
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1298
            [amount] => 175
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 15:58:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 175, Wish To Pay: 175, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-778' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 15:58:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1225.53, Wish To Pay: 1225.53, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1300
Inserting Item: Array
(
    [material_id] => 322
    [quantity] => 200
    [unit_price] => 0.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 20984
    [quantity] => 43
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 344
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7866
    [quantity] => 60
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25131
    [quantity] => 2
    [unit_price] => 95.55
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 191.1
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8924
    [quantity] => 48
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 192
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7883
    [quantity] => 53
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 265
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 7883, Available: 23, Requested: 53
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 16:04:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1225.1, Wish To Pay: 1225.1, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1301
Inserting Item: Array
(
    [material_id] => 322
    [quantity] => 200
    [unit_price] => 0.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 20984
    [quantity] => 43
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 344
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7866
    [quantity] => 60
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7883
    [quantity] => 51
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 255
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25131
    [quantity] => 2
    [unit_price] => 95.55
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 191.1
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8924
    [quantity] => 48
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 192
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1301: 1225.1, Remaining: 0
Total Summary:
Grand Total: 1225.1
Wish to Pay: 1225.1
Total Paid: 1225.1
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1301
            [amount] => 1225.1
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 16:11:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 220.6, Wish To Pay: 220.6, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1302
Inserting Item: Array
(
    [material_id] => 31712
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21374
    [quantity] => 10
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14611
    [quantity] => 20
    [unit_price] => 0.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21239
    [quantity] => 3
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5868
    [quantity] => 10
    [unit_price] => 2.25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18535
    [quantity] => 10
    [unit_price] => 2.21
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22.1
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1302: 220.6, Remaining: 0
Total Summary:
Grand Total: 220.6
Wish to Pay: 220.6
Total Paid: 220.6
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1302
            [amount] => 220.6
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 16:14:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 220.6, Wish To Pay: 220.6, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-780' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 16:14:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 240, Wish To Pay: 240, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1304
Inserting Item: Array
(
    [material_id] => 862
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28802
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 1
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 2
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25196
    [quantity] => 2
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 18
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1304: 240, Remaining: 0
Total Summary:
Grand Total: 240
Wish to Pay: 240
Total Paid: 240
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1304
            [amount] => 240
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 16:16:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 600, Wish To Pay: 600, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1305
Inserting Item: Array
(
    [material_id] => 18898
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29442
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24247
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24247, Available: 19, Requested: 20
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 16:35:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 600, Wish To Pay: 600, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1306
Inserting Item: Array
(
    [material_id] => 18898
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29442
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24247
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24247, Available: 19, Requested: 20
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 16:35:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 800, Wish To Pay: 800, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1307
Inserting Item: Array
(
    [material_id] => 18898
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 10985
    [quantity] => 1
    [unit_price] => 150
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18898
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29442
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24247
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24247, Available: 19, Requested: 20
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 16:36:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 800, Wish To Pay: 800, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1308
Inserting Item: Array
(
    [material_id] => 18898
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 10985
    [quantity] => 1
    [unit_price] => 150
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18898
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29442
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24247
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24247, Available: 19, Requested: 20
Stack trace: #0 {main}
Script execution completed at: 2026-07-07 16:36:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 780, Wish To Pay: 780, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1309
Inserting Item: Array
(
    [material_id] => 18898
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 10985
    [quantity] => 1
    [unit_price] => 150
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18898
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24247
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1309: 780, Remaining: 0
Total Summary:
Grand Total: 780
Wish to Pay: 780
Total Paid: 780
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1309
            [amount] => 780
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 16:38:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 780, Wish To Pay: 780, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-782' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 16:38:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 950, Wish To Pay: 950, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1311
Inserting Item: Array
(
    [material_id] => 22424
    [quantity] => 10
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 350
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30241
    [quantity] => 10
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22573
    [quantity] => 10
    [unit_price] => 32
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 320
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1311: 950, Remaining: 0
Total Summary:
Grand Total: 950
Wish to Pay: 950
Total Paid: 950
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1311
            [amount] => 950
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 16:49:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 950, Wish To Pay: 950, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-783' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 16:49:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1313
Inserting Item: Array
(
    [material_id] => 30777
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1313: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1313
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 17:09:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-784' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 17:09:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 12, Wish To Pay: 12, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1315
Inserting Item: Array
(
    [material_id] => 22355
    [quantity] => 1
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1315: 12, Remaining: 0
Total Summary:
Grand Total: 12
Wish to Pay: 12
Total Paid: 12
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1315
            [amount] => 12
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 17:16:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 12, Wish To Pay: 12, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-785' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 17:16:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 370, Wish To Pay: 370, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1317
Inserting Item: Array
(
    [material_id] => 31651
    [quantity] => 4
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 320
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28615
    [quantity] => 12
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1317: 370, Remaining: 0
Total Summary:
Grand Total: 370
Wish to Pay: 370
Total Paid: 370
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1317
            [amount] => 370
            [type] => Previous Sale Due Payment
            [date] => 2026-07-07
        )

)

Script execution completed at: 2026-07-07 17:21:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 370, Wish To Pay: 370, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-786' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-07 17:21:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1319
Inserting Item: Array
(
    [material_id] => 6145
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1319: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1319
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 02:29:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1320
Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 12
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1320: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1320
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 02:29:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 74.9, Wish To Pay: 74.9, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1321
Inserting Item: Array
(
    [material_id] => 323
    [quantity] => 20
    [unit_price] => 1.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18437
    [quantity] => 14
    [unit_price] => 0.85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 11.9
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30329
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25196
    [quantity] => 2
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 18
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1321: 74.9, Remaining: 0
Total Summary:
Grand Total: 74.9
Wish to Pay: 74.9
Total Paid: 74.9
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1321
            [amount] => 74.9
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 02:45:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120.16, Wish To Pay: 120.16, Received: 500, Change: 379.84
Customer found: Walk In
Sale Order Inserted. ID: 1322
Inserting Item: Array
(
    [material_id] => 28734
    [quantity] => 4
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 68
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 15322
    [quantity] => 8
    [unit_price] => 7.02
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 56.16
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1322: 120.16, Remaining: 0
Total Summary:
Grand Total: 120.16
Wish to Pay: 120.16
Total Paid: 120.16
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1322
            [amount] => 120.16
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 02:53:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1323
Inserting Item: Array
(
    [material_id] => 28521
    [quantity] => 5
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1323: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1323
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 03:03:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1324
Inserting Item: Array
(
    [material_id] => 8891
    [quantity] => 2
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1324: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1324
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 03:11:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1325
Inserting Item: Array
(
    [material_id] => 30413
    [quantity] => 5
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5169
    [quantity] => 10
    [unit_price] => 1.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28510
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29787
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1325: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1325
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 04:12:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 34, Wish To Pay: 34, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1326
Inserting Item: Array
(
    [material_id] => 18799
    [quantity] => 2
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 14
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 2
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1326: 34, Remaining: 0
Total Summary:
Grand Total: 34
Wish to Pay: 34
Total Paid: 34
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1326
            [amount] => 34
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 04:15:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 65, Wish To Pay: 65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1327
Inserting Item: Array
(
    [material_id] => 22418
    [quantity] => 10
    [unit_price] => 6.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 65
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1327: 65, Remaining: 0
Total Summary:
Grand Total: 65
Wish to Pay: 65
Total Paid: 65
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1327
            [amount] => 65
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 04:23:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 180, Wish To Pay: 180, Received: 500, Change: 320
Customer found: Walk In
Sale Order Inserted. ID: 1328
Inserting Item: Array
(
    [material_id] => 13363
    [quantity] => 1
    [unit_price] => 185
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 185
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1328: 180, Remaining: 0
Total Summary:
Grand Total: 180
Wish to Pay: 180
Total Paid: 180
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1328
            [amount] => 180
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 04:36:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 95, Wish To Pay: 95, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1329
Inserting Item: Array
(
    [material_id] => 28693
    [quantity] => 5
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1329: 95, Remaining: 0
Total Summary:
Grand Total: 95
Wish to Pay: 95
Total Paid: 95
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1329
            [amount] => 95
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 04:54:23

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 381.3, Wish To Pay: 381.3, Received: 500, Change: 118.7
Customer found: Walk In
Sale Order Inserted. ID: 1330
Inserting Item: Array
(
    [material_id] => 8879
    [quantity] => 20
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14606
    [quantity] => 20
    [unit_price] => 0.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1330: 381.3, Remaining: 0
Total Summary:
Grand Total: 381.3
Wish to Pay: 381.3
Total Paid: 381.3
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1330
            [amount] => 381.3
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 04:57:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1331
Inserting Item: Array
(
    [material_id] => 540
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1331: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1331
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 05:22:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1400, Wish To Pay: 1400, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1332
Inserting Item: Array
(
    [material_id] => 12238
    [quantity] => 24
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1440
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1332: 1400, Remaining: 0
Total Summary:
Grand Total: 1400
Wish to Pay: 1400
Total Paid: 1400
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1332
            [amount] => 1400
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 06:09:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1333
Inserting Item: Array
(
    [material_id] => 13538
    [quantity] => 18
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 234
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22385
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1333: 300, Remaining: 0
Total Summary:
Grand Total: 300
Wish to Pay: 300
Total Paid: 300
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1333
            [amount] => 300
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 06:34:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 325, Wish To Pay: 325, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1334
Inserting Item: Array
(
    [material_id] => 30682
    [quantity] => 1
    [unit_price] => 325
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 325
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1334: 325, Remaining: 0
Total Summary:
Grand Total: 325
Wish to Pay: 325
Total Paid: 325
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1334
            [amount] => 325
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 06:36:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1335
Inserting Item: Array
(
    [material_id] => 29765
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1335: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1335
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 06:37:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 979.95, Wish To Pay: 979.95, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1336
Inserting Item: Array
(
    [material_id] => 5635
    [quantity] => 30
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 210
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24438
    [quantity] => 30
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 525
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17582
    [quantity] => 30
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12098
    [quantity] => 15
    [unit_price] => 4.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 67.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1336: 979.95, Remaining: 0
Total Summary:
Grand Total: 979.95
Wish to Pay: 979.95
Total Paid: 979.95
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1336
            [amount] => 979.95
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 06:45:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1337
Inserting Item: Array
(
    [material_id] => 24463
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1337: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1337
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 06:47:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1338
Inserting Item: Array
(
    [material_id] => 31465
    [quantity] => 1
    [unit_price] => 140
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1338: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1338
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 06:59:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 25, Wish To Pay: 25, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1339
Inserting Item: Array
(
    [material_id] => 27687
    [quantity] => 10
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1339: 25, Remaining: 0
Total Summary:
Grand Total: 25
Wish to Pay: 25
Total Paid: 25
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1339
            [amount] => 25
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 07:24:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1340
Inserting Item: Array
(
    [material_id] => 5860
    [quantity] => 10
    [unit_price] => 1.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 21594
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1340: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1340
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 07:37:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1738.8, Wish To Pay: 1738.8, Received: 2000, Change: 261.2
Customer found: Walk In
Sale Order Inserted. ID: 1341
Inserting Item: Array
(
    [material_id] => 5903
    [quantity] => 3
    [unit_price] => 150
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 450
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12315
    [quantity] => 4
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30181
    [quantity] => 4
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17731
    [quantity] => 2
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30730
    [quantity] => 8
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 303
    [quantity] => 4
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28728
    [quantity] => 12
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1341: 1738.8, Remaining: 0
Total Summary:
Grand Total: 1738.8
Wish to Pay: 1738.8
Total Paid: 1738.8
Items Inserted: 7
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1341
            [amount] => 1738.8
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 07:51:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 251.71, Wish To Pay: 251.71, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1342
Inserting Item: Array
(
    [material_id] => 850
    [quantity] => 4
    [unit_price] => 30.09
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120.36
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25653
    [quantity] => 10
    [unit_price] => 10.03
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100.3
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 26784
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1342: 251.71, Remaining: 0
Total Summary:
Grand Total: 251.71
Wish to Pay: 251.71
Total Paid: 251.71
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1342
            [amount] => 251.71
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 08:20:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 30
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 165.6, Wish To Pay: 165.6, Received: 0, Change: 0
Customer found: Al-Hera Healthcare & pharma
Sale Order Inserted. ID: 1343
Inserting Item: Array
(
    [material_id] => 5578
    [quantity] => 15
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1343: 165.6, Remaining: 0
Total Summary:
Grand Total: 165.6
Wish to Pay: 165.6
Total Paid: 165.6
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1343
            [amount] => 165.6
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 08:25:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 230, Wish To Pay: 230, Received: 500, Change: 270
Customer found: Walk In
Sale Order Inserted. ID: 1344
Inserting Item: Array
(
    [material_id] => 12149
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1344: 230, Remaining: 0
Total Summary:
Grand Total: 230
Wish to Pay: 230
Total Paid: 230
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1344
            [amount] => 230
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 08:48:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 228, Wish To Pay: 228, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1345
Inserting Item: Array
(
    [material_id] => 26848
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1345: 228, Remaining: 0
Total Summary:
Grand Total: 228
Wish to Pay: 228
Total Paid: 228
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1345
            [amount] => 228
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 08:53:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 420, Wish To Pay: 420, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1346
Inserting Item: Array
(
    [material_id] => 31234
    [quantity] => 1
    [unit_price] => 430
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 430
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1346: 420, Remaining: 0
Total Summary:
Grand Total: 420
Wish to Pay: 420
Total Paid: 420
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1346
            [amount] => 420
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 08:56:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 160, Wish To Pay: 160, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1347
Inserting Item: Array
(
    [material_id] => 7822
    [quantity] => 14
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 168
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1347: 160, Remaining: 0
Total Summary:
Grand Total: 160
Wish to Pay: 160
Total Paid: 160
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1347
            [amount] => 160
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 09:15:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 230, Wish To Pay: 230, Received: 1000, Change: 770
Customer found: Walk In
Sale Order Inserted. ID: 1348
Inserting Item: Array
(
    [material_id] => 24575
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27759
    [quantity] => 1
    [unit_price] => 195
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 195
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1348: 230, Remaining: 0
Total Summary:
Grand Total: 230
Wish to Pay: 230
Total Paid: 230
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1348
            [amount] => 230
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 09:30:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 25.2, Wish To Pay: 25.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1349
Inserting Item: Array
(
    [material_id] => 19085
    [quantity] => 10
    [unit_price] => 2.52
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1349: 25.2, Remaining: 0
Total Summary:
Grand Total: 25.2
Wish to Pay: 25.2
Total Paid: 25.2
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1349
            [amount] => 25.2
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 09:33:10

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 288, Wish To Pay: 288, Received: 1000, Change: 712
Customer found: Walk In
Sale Order Inserted. ID: 1350
Inserting Item: Array
(
    [material_id] => 30190
    [quantity] => 1
    [unit_price] => 280
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 280
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1350: 288, Remaining: 0
Total Summary:
Grand Total: 288
Wish to Pay: 288
Total Paid: 288
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1350
            [amount] => 288
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 09:43:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 130, Wish To Pay: 130, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1351
Inserting Item: Array
(
    [material_id] => 31739
    [quantity] => 1
    [unit_price] => 105
    [discount_percent] => 4.76
    [discount_amount] => 5
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13488
    [quantity] => 10
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1351: 130, Remaining: 0
Total Summary:
Grand Total: 130
Wish to Pay: 130
Total Paid: 130
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1351
            [amount] => 130
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 09:45:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1352
Inserting Item: Array
(
    [material_id] => 29402
    [quantity] => 2
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1352: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1352
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 09:45:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 560, Wish To Pay: 560, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1353
Inserting Item: Array
(
    [material_id] => 87
    [quantity] => 1
    [unit_price] => 475
    [discount_percent] => 5.26
    [discount_amount] => 25
    [total_price] => 450
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31095
    [quantity] => 1
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1353: 560, Remaining: 0
Total Summary:
Grand Total: 560
Wish to Pay: 560
Total Paid: 560
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1353
            [amount] => 560
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 10:11:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 340, Wish To Pay: 340, Received: 1000, Change: 660
Customer found: Walk In
Sale Order Inserted. ID: 1354
Inserting Item: Array
(
    [material_id] => 31738
    [quantity] => 30
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1354: 340, Remaining: 0
Total Summary:
Grand Total: 340
Wish to Pay: 340
Total Paid: 340
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1354
            [amount] => 340
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 10:15:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 230, Wish To Pay: 230, Received: 1000, Change: 770
Customer found: Walk In
Sale Order Inserted. ID: 1355
Inserting Item: Array
(
    [material_id] => 13771
    [quantity] => 1
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31012
    [quantity] => 1
    [unit_price] => 120
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1355: 230, Remaining: 0
Total Summary:
Grand Total: 230
Wish to Pay: 230
Total Paid: 230
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1355
            [amount] => 230
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 10:18:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 33
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 5, To Pay: 235, Wish To Pay: 235, Received: 0, Change: 0
Customer found: wahab vai bariwala
Sale Order Inserted. ID: 1356
Inserting Item: Array
(
    [material_id] => 28535
    [quantity] => 1
    [unit_price] => 250
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 250
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1356: 230, Remaining: 5
Previous Sale Due Paid for sel-681: 5, Remaining: 0
Total Summary:
Grand Total: 230
Wish to Pay: 235
Total Paid: 235
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1356
            [amount] => 230
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

    [1] => Array
        (
            [ref] => sel-681
            [amount] => 5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 10:25:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 390, Wish To Pay: 390, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1357
Inserting Item: Array
(
    [material_id] => 29402
    [quantity] => 20
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1357: 390, Remaining: 0
Total Summary:
Grand Total: 390
Wish to Pay: 390
Total Paid: 390
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1357
            [amount] => 390
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 10:44:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 0, Wish To Pay: 0, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1358
Inserting Item: Array
(
    [material_id] => 2020
    [quantity] => 5
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30413
    [quantity] => 5
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1935
    [quantity] => 5
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 27.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Total Summary:
Grand Total: 95
Wish to Pay: 0
Total Paid: 0
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
)

Script execution completed at: 2026-07-08 11:13:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 95, To Pay: 187, Wish To Pay: 187, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1359
Inserting Item: Array
(
    [material_id] => 13263
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1358: 95, Remaining: 92
Previous Sale Due Paid for sel-1359: 92, Remaining: 0
Total Summary:
Grand Total: 92
Wish to Pay: 187
Total Paid: 187
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1358
            [amount] => 95
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

    [1] => Array
        (
            [ref] => sel-1359
            [amount] => 92
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 11:32:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1360
Inserting Item: Array
(
    [material_id] => 25401
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1360: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1360
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 11:44:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 230, Wish To Pay: 230, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1361
Inserting Item: Array
(
    [material_id] => 25390
    [quantity] => 12
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1361: 230, Remaining: 0
Total Summary:
Grand Total: 230
Wish to Pay: 230
Total Paid: 230
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1361
            [amount] => 230
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 12:48:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-829' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 12:57:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-829' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 12:57:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1364
Inserting Item: Array
(
    [material_id] => 28211
    [quantity] => 10
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31733
    [quantity] => 5
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1364: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1364
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 13:02:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-830' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 13:02:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1450.2, Wish To Pay: 1450.2, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1366
Inserting Item: Array
(
    [material_id] => 29474
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31837
    [quantity] => 6
    [unit_price] => 145
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 870
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30126
    [quantity] => 20
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8184
    [quantity] => 5
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 65
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24265
    [quantity] => 1
    [unit_price] => 90
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28161
    [quantity] => 5
    [unit_price] => 0.64
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 3.2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1366: 1450.2, Remaining: 0
Total Summary:
Grand Total: 1450.2
Wish to Pay: 1450.2
Total Paid: 1450.2
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1366
            [amount] => 1450.2
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 13:18:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100.5, Wish To Pay: 100.5, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-831' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 13:25:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100.5, Wish To Pay: 100.5, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-831' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 13:25:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 53, Wish To Pay: 53, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1369
Inserting Item: Array
(
    [material_id] => 4571
    [quantity] => 6
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 33
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9131
    [quantity] => 4
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1369: 53, Remaining: 0
Total Summary:
Grand Total: 53
Wish to Pay: 53
Total Paid: 53
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1369
            [amount] => 53
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 13:27:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 90, Wish To Pay: 90, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1370
Inserting Item: Array
(
    [material_id] => 25248
    [quantity] => 30
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1370: 90, Remaining: 0
Total Summary:
Grand Total: 90
Wish to Pay: 90
Total Paid: 90
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1370
            [amount] => 90
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 13:29:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1371
Inserting Item: Array
(
    [material_id] => 12208
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1371: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1371
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 13:30:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1372
Inserting Item: Array
(
    [material_id] => 28934
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1372: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1372
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 13:35:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1373
Inserting Item: Array
(
    [material_id] => 28971
    [quantity] => 14
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1373: 140, Remaining: 0
Total Summary:
Grand Total: 140
Wish to Pay: 140
Total Paid: 140
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1373
            [amount] => 140
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 13:45:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 316.5, Wish To Pay: 316.5, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-831' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 13:48:50

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1375
Inserting Item: Array
(
    [material_id] => 9585
    [quantity] => 1
    [unit_price] => 110
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1375: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1375
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 13:49:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1376
Inserting Item: Array
(
    [material_id] => 30014
    [quantity] => 1
    [unit_price] => 260
    [discount_percent] => 7.69
    [discount_amount] => 20
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17731
    [quantity] => 2
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1376: 360, Remaining: 0
Total Summary:
Grand Total: 360
Wish to Pay: 360
Total Paid: 360
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1376
            [amount] => 360
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 13:59:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 360, Wish To Pay: 360, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-838' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 13:59:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 510, Wish To Pay: 510, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-830' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 14:01:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 510, Wish To Pay: 510, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-830' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 14:01:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 510, Wish To Pay: 510, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-830' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 14:02:09

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 531, Wish To Pay: 531, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-830' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 14:02:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 510, Wish To Pay: 510, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-830' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 14:03:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 510, Wish To Pay: 510, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1383
Inserting Item: Array
(
    [material_id] => 31838
    [quantity] => 1
    [unit_price] => 531
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 531
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1383: 510, Remaining: 0
Total Summary:
Grand Total: 510
Wish to Pay: 510
Total Paid: 510
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1383
            [amount] => 510
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 14:06:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120.94, Wish To Pay: 120.94, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1384
Inserting Item: Array
(
    [material_id] => 30792
    [quantity] => 1
    [unit_price] => 57.44
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 57.44
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 4
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 28
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 15
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 52.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1384: 120.94, Remaining: 0
Total Summary:
Grand Total: 120.94
Wish to Pay: 120.94
Total Paid: 120.94
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1384
            [amount] => 120.94
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 14:06:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 948.4, Wish To Pay: 948.4, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1385
Inserting Item: Array
(
    [material_id] => 22734
    [quantity] => 7
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 420
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1608
    [quantity] => 1
    [unit_price] => 140.42
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140.42
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5868
    [quantity] => 10
    [unit_price] => 2.25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30548
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31662
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24736
    [quantity] => 1
    [unit_price] => 360
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1385: 948.4, Remaining: 0
Total Summary:
Grand Total: 948.4
Wish to Pay: 948.4
Total Paid: 948.4
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1385
            [amount] => 948.4
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 14:21:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 948.4, Wish To Pay: 948.4, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-841' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 14:21:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 160, Wish To Pay: 160, Received: 500, Change: 340
Customer found: Walk In
Sale Order Inserted. ID: 1387
Inserting Item: Array
(
    [material_id] => 29618
    [quantity] => 1
    [unit_price] => 160
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1387: 160, Remaining: 0
Total Summary:
Grand Total: 160
Wish to Pay: 160
Total Paid: 160
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1387
            [amount] => 160
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 14:22:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 160, Wish To Pay: 160, Received: 500, Change: 340
Customer found: Walk In
Error: Duplicate entry 'SO-2026-842' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 14:22:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200.1, Wish To Pay: 200.1, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1389
Inserting Item: Array
(
    [material_id] => 23354
    [quantity] => 21
    [unit_price] => 7.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 157.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31839
    [quantity] => 30
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1389: 200.1, Remaining: 0
Total Summary:
Grand Total: 200.1
Wish to Pay: 200.1
Total Paid: 200.1
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1389
            [amount] => 200.1
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 14:33:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200.1, Wish To Pay: 200.1, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-843' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 14:33:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 728, Wish To Pay: 728, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1391
Inserting Item: Array
(
    [material_id] => 29032
    [quantity] => 20
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 320
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13440
    [quantity] => 20
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31262
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 8918
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1391: 728, Remaining: 0
Total Summary:
Grand Total: 728
Wish to Pay: 728
Total Paid: 728
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1391
            [amount] => 728
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 14:36:12

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 15, Wish To Pay: 15, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1392
Inserting Item: Array
(
    [material_id] => 5265
    [quantity] => 2
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 16
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1392: 15, Remaining: 0
Total Summary:
Grand Total: 15
Wish to Pay: 15
Total Paid: 15
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1392
            [amount] => 15
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 14:38:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 250.5, Wish To Pay: 250.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1393
Inserting Item: Array
(
    [material_id] => 1860
    [quantity] => 15
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 262.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1393: 250.5, Remaining: 0
Total Summary:
Grand Total: 250.5
Wish to Pay: 250.5
Total Paid: 250.5
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1393
            [amount] => 250.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 14:39:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 160, Wish To Pay: 160, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1394
Inserting Item: Array
(
    [material_id] => 5635
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24335
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1394: 160, Remaining: 0
Total Summary:
Grand Total: 160
Wish to Pay: 160
Total Paid: 160
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1394
            [amount] => 160
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 14:41:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140.5, Wish To Pay: 140.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1395
Inserting Item: Array
(
    [material_id] => 30134
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 26514
    [quantity] => 5
    [unit_price] => 16.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 82.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1395: 140.5, Remaining: 0
Total Summary:
Grand Total: 140.5
Wish to Pay: 140.5
Total Paid: 140.5
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1395
            [amount] => 140.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 14:44:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1396
Inserting Item: Array
(
    [material_id] => 13212
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1402
    [quantity] => 7
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 49
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18981
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12172
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1396: 300, Remaining: 0
Total Summary:
Grand Total: 300
Wish to Pay: 300
Total Paid: 300
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1396
            [amount] => 300
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 14:59:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-849' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 14:59:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1398
Inserting Item: Array
(
    [material_id] => 18684
    [quantity] => 30
    [unit_price] => 6.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 195
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1398: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1398
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 14:59:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 250.95, Wish To Pay: 250.95, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1399
Inserting Item: Array
(
    [material_id] => 18923
    [quantity] => 6
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18437
    [quantity] => 7
    [unit_price] => 0.85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5.95
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22193
    [quantity] => 6
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 42
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5678
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1399: 250.95, Remaining: 0
Total Summary:
Grand Total: 250.95
Wish to Pay: 250.95
Total Paid: 250.95
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1399
            [amount] => 250.95
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 15:05:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 600, Wish To Pay: 600, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1400
Inserting Item: Array
(
    [material_id] => 29921
    [quantity] => 1
    [unit_price] => 450
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 450
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7293
    [quantity] => 30
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1400: 600, Remaining: 0
Total Summary:
Grand Total: 600
Wish to Pay: 600
Total Paid: 600
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1400
            [amount] => 600
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 15:07:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 75, Wish To Pay: 75, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1401
Inserting Item: Array
(
    [material_id] => 29119
    [quantity] => 5
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 75
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1401: 75, Remaining: 0
Total Summary:
Grand Total: 75
Wish to Pay: 75
Total Paid: 75
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1401
            [amount] => 75
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 15:08:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 75, Wish To Pay: 75, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:08:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:10:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:11:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:12:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:12:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:13:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:14:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:18:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:18:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:18:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:18:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:21:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:21:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:21:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:21:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:21:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:21:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 840, Wish To Pay: 840, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:22:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 840, Wish To Pay: 840, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-853' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:22:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 840, Wish To Pay: 840, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1421
Inserting Item: Array
(
    [material_id] => 27760
    [quantity] => 90
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 900
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1421: 840, Remaining: 0
Total Summary:
Grand Total: 840
Wish to Pay: 840
Total Paid: 840
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1421
            [amount] => 840
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 15:22:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 840, Wish To Pay: 840, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-854' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:22:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 940, Wish To Pay: 940, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1423
Inserting Item: Array
(
    [material_id] => 21119
    [quantity] => 14
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 840
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14007
    [quantity] => 20
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1423: 940, Remaining: 0
Total Summary:
Grand Total: 940
Wish to Pay: 940
Total Paid: 940
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1423
            [amount] => 940
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 15:23:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 940, Wish To Pay: 940, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-855' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:23:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1310.8, Wish To Pay: 1310.8, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1425
Inserting Item: Array
(
    [material_id] => 29703
    [quantity] => 14
    [unit_price] => 85
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1190
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14606
    [quantity] => 90
    [unit_price] => 0.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29486
    [quantity] => 20
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 24
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 48
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18149
    [quantity] => 30
    [unit_price] => 2.3
    [discount_percent] => 13.04
    [discount_amount] => 9
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1425: 1310.8, Remaining: 0
Total Summary:
Grand Total: 1310.8
Wish to Pay: 1310.8
Total Paid: 1310.8
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1425
            [amount] => 1310.8
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 15:35:36

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1310.8, Wish To Pay: 1310.8, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-856' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:35:36

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1427
Inserting Item: Array
(
    [material_id] => 13313
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 20
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1427: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1427
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 15:36:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-857' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:36:35

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-856' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:39:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-856' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:39:17

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1431
Inserting Item: Array
(
    [material_id] => 30467
    [quantity] => 1
    [unit_price] => 300
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1431: 300, Remaining: 0
Total Summary:
Grand Total: 300
Wish to Pay: 300
Total Paid: 300
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1431
            [amount] => 300
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 15:39:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-858' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:39:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-858' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:40:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1434
Inserting Item: Array
(
    [material_id] => 24896
    [quantity] => 5
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1434: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1434
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 15:41:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 99, Wish To Pay: 99, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-859' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:46:45

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 99, Wish To Pay: 99, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-859' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:46:45

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-859' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:47:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-859' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:47:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 101, Wish To Pay: 101, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1439
Inserting Item: Array
(
    [material_id] => 5861
    [quantity] => 7
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 14
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13159
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1956
    [quantity] => 5
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 1
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 2
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1439: 101, Remaining: 0
Total Summary:
Grand Total: 101
Wish to Pay: 101
Total Paid: 101
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1439
            [amount] => 101
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 15:54:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 101, Wish To Pay: 101, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-860' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:54:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1441
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1441: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1441
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 15:55:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-861' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:55:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 24, Wish To Pay: 24, Received: 40, Change: 16
Customer found: Walk In
Sale Order Inserted. ID: 1443
Inserting Item: Array
(
    [material_id] => 29027
    [quantity] => 2
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1443: 24, Remaining: 0
Total Summary:
Grand Total: 24
Wish to Pay: 24
Total Paid: 24
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1443
            [amount] => 24
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 15:57:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 24, Wish To Pay: 24, Received: 40, Change: 16
Customer found: Walk In
Error: Duplicate entry 'SO-2026-862' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:57:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 449.39, Wish To Pay: 449.39, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-860' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:57:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 449.39, Wish To Pay: 449.39, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-860' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 15:57:45

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140.14, Wish To Pay: 140.14, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1447
Inserting Item: Array
(
    [material_id] => 8103
    [quantity] => 14
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 154
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1447: 140.14, Remaining: 0
Total Summary:
Grand Total: 140.14
Wish to Pay: 140.14
Total Paid: 140.14
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1447
            [amount] => 140.14
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 16:01:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140.14, Wish To Pay: 140.14, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-863' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 16:01:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 128.8, Wish To Pay: 128.8, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1449
Inserting Item: Array
(
    [material_id] => 30647
    [quantity] => 10
    [unit_price] => 14
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1449: 128.8, Remaining: 0
Total Summary:
Grand Total: 128.8
Wish to Pay: 128.8
Total Paid: 128.8
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1449
            [amount] => 128.8
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 16:03:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 128.8, Wish To Pay: 128.8, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-864' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 16:03:32

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-863' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 16:04:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 25, Wish To Pay: 25, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1452
Inserting Item: Array
(
    [material_id] => 24338
    [quantity] => 10
    [unit_price] => 2.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1452: 25, Remaining: 0
Total Summary:
Grand Total: 25
Wish to Pay: 25
Total Paid: 25
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1452
            [amount] => 25
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 16:04:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 25, Wish To Pay: 25, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-865' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 16:04:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-865' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 16:04:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-865' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 16:05:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-865' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 16:05:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 450.1, Wish To Pay: 450.1, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1457
Inserting Item: Array
(
    [material_id] => 1561
    [quantity] => 10
    [unit_price] => 4.01
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40.1
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28971
    [quantity] => 14
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25645
    [quantity] => 10
    [unit_price] => 5.6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 56
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13489
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25100
    [quantity] => 10
    [unit_price] => 1.8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 18
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28246
    [quantity] => 10
    [unit_price] => 5.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 3606
    [quantity] => 10
    [unit_price] => 4
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31057
    [quantity] => 8
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1457: 450.1, Remaining: 0
Total Summary:
Grand Total: 450.1
Wish to Pay: 450.1
Total Paid: 450.1
Items Inserted: 8
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1457
            [amount] => 450.1
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 16:12:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1239.57, Wish To Pay: 1239.57, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-866' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 16:20:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1239.57, Wish To Pay: 1239.57, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-866' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 16:20:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 400, Wish To Pay: 400, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1460
Inserting Item: Array
(
    [material_id] => 29069
    [quantity] => 1
    [unit_price] => 400
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1460: 400, Remaining: 0
Total Summary:
Grand Total: 400
Wish to Pay: 400
Total Paid: 400
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1460
            [amount] => 400
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 16:28:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 400, Wish To Pay: 400, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-867' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 16:28:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 130, Wish To Pay: 130, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1462
Inserting Item: Array
(
    [material_id] => 13848
    [quantity] => 10
    [unit_price] => 13
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1462: 130, Remaining: 0
Total Summary:
Grand Total: 130
Wish to Pay: 130
Total Paid: 130
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1462
            [amount] => 130
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 16:30:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 130, Wish To Pay: 130, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-868' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 16:30:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1464
Inserting Item: Array
(
    [material_id] => 19085
    [quantity] => 30
    [unit_price] => 2.52
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 75.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1464: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1464
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 16:41:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-869' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 16:41:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1004.4, Wish To Pay: 1004.4, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-867' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 16:56:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 900, Wish To Pay: 900, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1467
Inserting Item: Array
(
    [material_id] => 5769
    [quantity] => 10
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 220
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25264
    [quantity] => 15
    [unit_price] => 1.6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24290
    [quantity] => 28
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 56
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13287
    [quantity] => 30
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 270
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5678
    [quantity] => 20
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14007
    [quantity] => 20
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1467: 900, Remaining: 0
Total Summary:
Grand Total: 900
Wish to Pay: 900
Total Paid: 900
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1467
            [amount] => 900
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:02:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-870' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:08:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-870' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:08:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1470
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19672
    [quantity] => 2
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1470: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1470
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:09:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 350, Wish To Pay: 350, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1471
Inserting Item: Array
(
    [material_id] => 30940
    [quantity] => 1
    [unit_price] => 450
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 450
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1471: 350, Remaining: 0
Total Summary:
Grand Total: 350
Wish to Pay: 350
Total Paid: 350
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1471
            [amount] => 350
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:10:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1472
Inserting Item: Array
(
    [material_id] => 24356
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1472: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1472
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:13:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1304.81, Wish To Pay: 1304.81, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-872' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:14:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1304.81, Wish To Pay: 1304.81, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-872' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:14:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1304.81, Wish To Pay: 1304.81, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-872' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:15:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1304.81, Wish To Pay: 1304.81, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-872' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:15:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1304.81, Wish To Pay: 1304.81, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1477
Inserting Item: Array
(
    [material_id] => 13930
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22378
    [quantity] => 18
    [unit_price] => 8.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 153
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30428
    [quantity] => 1
    [unit_price] => 350
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 350
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25367
    [quantity] => 1
    [unit_price] => 601.81
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 601.81
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1477: 1304.81, Remaining: 0
Total Summary:
Grand Total: 1304.81
Wish to Pay: 1304.81
Total Paid: 1304.81
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1477
            [amount] => 1304.81
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:16:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1304.81, Wish To Pay: 1304.81, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-874' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:16:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-874' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:20:53

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1480
Inserting Item: Array
(
    [material_id] => 31650
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1480: 200, Remaining: 0
Total Summary:
Grand Total: 200
Wish to Pay: 200
Total Paid: 200
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1480
            [amount] => 200
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:21:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-875' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:21:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 15, Wish To Pay: 15, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1482
Inserting Item: Array
(
    [material_id] => 8891
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1482: 15, Remaining: 0
Total Summary:
Grand Total: 15
Wish to Pay: 15
Total Paid: 15
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1482
            [amount] => 15
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:23:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1483
Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1483: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1483
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:26:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 45, Wish To Pay: 45, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1484
Inserting Item: Array
(
    [material_id] => 12098
    [quantity] => 10
    [unit_price] => 4.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1484: 45, Remaining: 0
Total Summary:
Grand Total: 45
Wish to Pay: 45
Total Paid: 45
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1484
            [amount] => 45
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:28:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 116, Wish To Pay: 116, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-870' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:33:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 116, Wish To Pay: 116, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-870' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:33:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 116, Wish To Pay: 116, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-870' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:34:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 116, Wish To Pay: 116, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-870' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:34:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-870' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:34:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-870' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:34:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1470.98, Wish To Pay: 1470.98, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1491
Inserting Item: Array
(
    [material_id] => 17607
    [quantity] => 10
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 500
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 14109
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31561
    [quantity] => 10
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30440
    [quantity] => 1
    [unit_price] => 720
    [discount_percent] => 3
    [discount_amount] => 21.6
    [total_price] => 698.4
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1491: 1470.98, Remaining: 0
Total Summary:
Grand Total: 1470.98
Wish to Pay: 1470.98
Total Paid: 1470.98
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1491
            [amount] => 1470.98
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:41:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 730, Wish To Pay: 730, Received: 750, Change: 20
Customer found: Walk In
Error: Duplicate entry 'SO-2026-879' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:41:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 730, Wish To Pay: 730, Received: 750, Change: 20
Customer found: Walk In
Error: Duplicate entry 'SO-2026-879' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:41:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 400, Wish To Pay: 400, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1494
Inserting Item: Array
(
    [material_id] => 31734
    [quantity] => 1
    [unit_price] => 425
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 425
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1494: 400, Remaining: 0
Total Summary:
Grand Total: 400
Wish to Pay: 400
Total Paid: 400
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1494
            [amount] => 400
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:45:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 400, Wish To Pay: 400, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-880' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:45:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 24, Wish To Pay: 24, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1496
Inserting Item: Array
(
    [material_id] => 23919
    [quantity] => 2
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12102
    [quantity] => 1
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1496: 24, Remaining: 0
Total Summary:
Grand Total: 24
Wish to Pay: 24
Total Paid: 24
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1496
            [amount] => 24
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:46:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 24, Wish To Pay: 24, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-881' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:46:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1498
Inserting Item: Array
(
    [material_id] => 29845
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12940
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25445
    [quantity] => 10
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 23919
    [quantity] => 5
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1498: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1498
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:50:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-882' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:50:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 8
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 856.6, Wish To Pay: 856.6, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-882' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:52:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 736.6, Wish To Pay: 736.6, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-882' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:52:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1502
Inserting Item: Array
(
    [material_id] => 30454
    [quantity] => 6
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 72
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1502: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1502
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 17:58:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-883' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 17:58:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 280.8, Wish To Pay: 280.8, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1504
Inserting Item: Array
(
    [material_id] => 12969
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7796
    [quantity] => 14
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 112
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28235
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1504: 280.8, Remaining: 0
Total Summary:
Grand Total: 280.8
Wish to Pay: 280.8
Total Paid: 280.8
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1504
            [amount] => 280.8
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 18:13:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 736.6, Wish To Pay: 736.6, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-884' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 18:16:18

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1506
Inserting Item: Array
(
    [material_id] => 17070
    [quantity] => 2
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 34
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30475
    [quantity] => 2
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 24
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25196
    [quantity] => 2
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 18
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28364
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 2
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 4
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1506: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1506
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 18:16:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-885' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 18:16:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 730, Wish To Pay: 730, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1508
Inserting Item: Array
(
    [material_id] => 30524
    [quantity] => 2
    [unit_price] => 25.8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 51.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 10
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29938
    [quantity] => 1
    [unit_price] => 665
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 665
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1508: 730, Remaining: 0
Total Summary:
Grand Total: 730
Wish to Pay: 730
Total Paid: 730
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1508
            [amount] => 730
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 18:17:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 730, Wish To Pay: 730, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-886' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-08 18:17:37

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1510
Inserting Item: Array
(
    [material_id] => 28364
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 85.71
    [discount_amount] => 30
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 29989
    [quantity] => 1
    [unit_price] => 95
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 95
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1510: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1510
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 19:11:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 300, Wish To Pay: 300, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1511
Inserting Item: Array
(
    [material_id] => 25252
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24590
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30105
    [quantity] => 10
    [unit_price] => 12.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 125
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1511: 300, Remaining: 0
Total Summary:
Grand Total: 300
Wish to Pay: 300
Total Paid: 300
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1511
            [amount] => 300
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 19:17:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 302.16, Wish To Pay: 302.16, Received: 500, Change: 197.84
Customer found: Walk In
Sale Order Inserted. ID: 1512
Inserting Item: Array
(
    [material_id] => 28071
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 26542
    [quantity] => 5
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 18743
    [quantity] => 6
    [unit_price] => 1.15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6.9
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30202
    [quantity] => 6
    [unit_price] => 23
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 138
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1512: 302.16, Remaining: 0
Total Summary:
Grand Total: 302.16
Wish to Pay: 302.16
Total Paid: 302.16
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1512
            [amount] => 302.16
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 19:32:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20.7, Wish To Pay: 20.7, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1513
Inserting Item: Array
(
    [material_id] => 18743
    [quantity] => 18
    [unit_price] => 1.15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20.7
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1513: 20.7, Remaining: 0
Total Summary:
Grand Total: 20.7
Wish to Pay: 20.7
Total Paid: 20.7
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1513
            [amount] => 20.7
            [type] => Previous Sale Due Payment
            [date] => 2026-07-08
        )

)

Script execution completed at: 2026-07-08 19:35:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1514
Inserting Item: Array
(
    [material_id] => 24896
    [quantity] => 10
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1514: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1514
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 02:34:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 15, Wish To Pay: 15, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1515
Inserting Item: Array
(
    [material_id] => 9042
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28618
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1515: 15, Remaining: 0
Total Summary:
Grand Total: 15
Wish to Pay: 15
Total Paid: 15
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1515
            [amount] => 15
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 02:37:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1516
Inserting Item: Array
(
    [material_id] => 28409
    [quantity] => 2
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1516: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1516
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 02:41:05

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 98, Wish To Pay: 98, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1517
Inserting Item: Array
(
    [material_id] => 19682
    [quantity] => 14
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 98
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1517: 98, Remaining: 0
Total Summary:
Grand Total: 98
Wish to Pay: 98
Total Paid: 98
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1517
            [amount] => 98
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 02:43:42

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 105, Wish To Pay: 105, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1518
Inserting Item: Array
(
    [material_id] => 24343
    [quantity] => 2
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28409
    [quantity] => 1
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1518: 105, Remaining: 0
Total Summary:
Grand Total: 105
Wish to Pay: 105
Total Paid: 105
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1518
            [amount] => 105
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 02:50:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 48, Wish To Pay: 48, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1519
Inserting Item: Array
(
    [material_id] => 24983
    [quantity] => 8
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 48
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1519: 48, Remaining: 0
Total Summary:
Grand Total: 48
Wish to Pay: 48
Total Paid: 48
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1519
            [amount] => 48
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 02:52:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 130, Wish To Pay: 130, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1520
Inserting Item: Array
(
    [material_id] => 31380
    [quantity] => 1
    [unit_price] => 140
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1520: 130, Remaining: 0
Total Summary:
Grand Total: 130
Wish to Pay: 130
Total Paid: 130
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1520
            [amount] => 130
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 02:53:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1521
Inserting Item: Array
(
    [material_id] => 24899
    [quantity] => 2
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1521: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1521
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 02:54:54

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 60, Wish To Pay: 60, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1522
Inserting Item: Array
(
    [material_id] => 27579
    [quantity] => 4
    [unit_price] => 1.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24896
    [quantity] => 5
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 5
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 17.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28709
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1522: 60, Remaining: 0
Total Summary:
Grand Total: 60
Wish to Pay: 60
Total Paid: 60
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1522
            [amount] => 60
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 03:02:09

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 279, Wish To Pay: 279, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1523
Inserting Item: Array
(
    [material_id] => 25091
    [quantity] => 1
    [unit_price] => 300
    [discount_percent] => 7
    [discount_amount] => 21
    [total_price] => 279
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1523: 279, Remaining: 0
Total Summary:
Grand Total: 279
Wish to Pay: 279
Total Paid: 279
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1523
            [amount] => 279
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 03:08:36

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 15, Wish To Pay: 15, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1524
Inserting Item: Array
(
    [material_id] => 8891
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1524: 15, Remaining: 0
Total Summary:
Grand Total: 15
Wish to Pay: 15
Total Paid: 15
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1524
            [amount] => 15
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 03:19:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1525
Inserting Item: Array
(
    [material_id] => 24896
    [quantity] => 5
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1525: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1525
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 03:28:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 170, Wish To Pay: 170, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1526
Inserting Item: Array
(
    [material_id] => 28358
    [quantity] => 1
    [unit_price] => 185
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 185
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1526: 170, Remaining: 0
Total Summary:
Grand Total: 170
Wish to Pay: 170
Total Paid: 170
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1526
            [amount] => 170
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 03:42:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 45, Wish To Pay: 45, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1527
Inserting Item: Array
(
    [material_id] => 29035
    [quantity] => 5
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 45
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1527: 45, Remaining: 0
Total Summary:
Grand Total: 45
Wish to Pay: 45
Total Paid: 45
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1527
            [amount] => 45
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 03:50:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 49, Wish To Pay: 49, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1528
Inserting Item: Array
(
    [material_id] => 22193
    [quantity] => 7
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 49
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1528: 49, Remaining: 0
Total Summary:
Grand Total: 49
Wish to Pay: 49
Total Paid: 49
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1528
            [amount] => 49
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 04:03:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1529
Inserting Item: Array
(
    [material_id] => 30981
    [quantity] => 5
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1529: 50, Remaining: 0
Total Summary:
Grand Total: 50
Wish to Pay: 50
Total Paid: 50
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1529
            [amount] => 50
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 04:05:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 110, Wish To Pay: 110, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1530
Inserting Item: Array
(
    [material_id] => 31286
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31728
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 8.33
    [discount_amount] => 5
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25407
    [quantity] => 3
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1530: 110, Remaining: 0
Total Summary:
Grand Total: 110
Wish to Pay: 110
Total Paid: 110
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1530
            [amount] => 110
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 04:17:59

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 228, Wish To Pay: 228, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1531
Inserting Item: Array
(
    [material_id] => 24438
    [quantity] => 10
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 175
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13192
    [quantity] => 10
    [unit_price] => 6.3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 63
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1531: 228, Remaining: 0
Total Summary:
Grand Total: 228
Wish to Pay: 228
Total Paid: 228
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1531
            [amount] => 228
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 04:37:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 500, Change: 310
Customer found: Walk In
Sale Order Inserted. ID: 1532
Inserting Item: Array
(
    [material_id] => 18980
    [quantity] => 14
    [unit_price] => 11.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 161
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19672
    [quantity] => 6
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1532: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1532
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 04:49:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 100, Wish To Pay: 100, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1533
Inserting Item: Array
(
    [material_id] => 31367
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1533: 100, Remaining: 0
Total Summary:
Grand Total: 100
Wish to Pay: 100
Total Paid: 100
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1533
            [amount] => 100
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 05:10:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 550, Wish To Pay: 550, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1534
Inserting Item: Array
(
    [material_id] => 31582
    [quantity] => 1
    [unit_price] => 575
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 575
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1534: 550, Remaining: 0
Total Summary:
Grand Total: 550
Wish to Pay: 550
Total Paid: 550
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1534
            [amount] => 550
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 05:29:43

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 228, Wish To Pay: 228, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-908' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 05:31:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 21, Wish To Pay: 21, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1536
Inserting Item: Array
(
    [material_id] => 30207
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24896
    [quantity] => 1
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1536: 21, Remaining: 0
Total Summary:
Grand Total: 21
Wish to Pay: 21
Total Paid: 21
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1536
            [amount] => 21
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 05:59:14

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 320, Wish To Pay: 320, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1537
Inserting Item: Array
(
    [material_id] => 5769
    [quantity] => 15
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 330
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1537: 320, Remaining: 0
Total Summary:
Grand Total: 320
Wish to Pay: 320
Total Paid: 320
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1537
            [amount] => 320
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 06:01:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 105, Wish To Pay: 105, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1538
Inserting Item: Array
(
    [material_id] => 25403
    [quantity] => 3
    [unit_price] => 36
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 108
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1538: 105, Remaining: 0
Total Summary:
Grand Total: 105
Wish to Pay: 105
Total Paid: 105
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1538
            [amount] => 105
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 06:25:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 105, Wish To Pay: 105, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-914' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 06:25:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 5, Wish To Pay: 5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1540
Inserting Item: Array
(
    [material_id] => 28615
    [quantity] => 1
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1540: 5, Remaining: 0
Total Summary:
Grand Total: 5
Wish to Pay: 5
Total Paid: 5
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1540
            [amount] => 5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 06:26:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 5, Wish To Pay: 5, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-915' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 06:26:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 230, Wish To Pay: 230, Received: 500, Change: 270
Customer found: Walk In
Error: Duplicate entry 'SO-2026-914' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 06:38:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 230, Wish To Pay: 230, Received: 500, Change: 270
Customer found: Walk In
Error: Duplicate entry 'SO-2026-914' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 06:38:46

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 230, Wish To Pay: 230, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1544
Inserting Item: Array
(
    [material_id] => 31122
    [quantity] => 1
    [unit_price] => 240
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 240
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1544: 230, Remaining: 0
Total Summary:
Grand Total: 230
Wish to Pay: 230
Total Paid: 230
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1544
            [amount] => 230
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 06:39:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 95, Wish To Pay: 95, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1545
Inserting Item: Array
(
    [material_id] => 13136
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1545: 95, Remaining: 0
Total Summary:
Grand Total: 95
Wish to Pay: 95
Total Paid: 95
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1545
            [amount] => 95
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 07:11:50

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 160, Wish To Pay: 160, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1546
Inserting Item: Array
(
    [material_id] => 25526
    [quantity] => 10
    [unit_price] => 17
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1546: 160, Remaining: 0
Total Summary:
Grand Total: 160
Wish to Pay: 160
Total Paid: 160
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1546
            [amount] => 160
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 07:12:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 420.5, Wish To Pay: 420.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1547
Inserting Item: Array
(
    [material_id] => 25196
    [quantity] => 10
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 90
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 1860
    [quantity] => 15
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 262.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25215
    [quantity] => 1
    [unit_price] => 55
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 55
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28116
    [quantity] => 1
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1547: 420.5, Remaining: 0
Total Summary:
Grand Total: 420.5
Wish to Pay: 420.5
Total Paid: 420.5
Items Inserted: 4
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1547
            [amount] => 420.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 07:26:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 4
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 420.5, Wish To Pay: 420.5, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-919' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 07:26:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 95, Wish To Pay: 95, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-916' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 07:31:33

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 95, Wish To Pay: 95, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1550
Inserting Item: Array
(
    [material_id] => 23368
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 23368, Available: 0, Requested: 10
Stack trace: #0 {main}
Script execution completed at: 2026-07-09 07:31:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 95, Wish To Pay: 95, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1551
Inserting Item: Array
(
    [material_id] => 23368
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 100
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 23368, Available: 0, Requested: 10
Stack trace: #0 {main}
Script execution completed at: 2026-07-09 07:31:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 185, Wish To Pay: 185, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1552
Inserting Item: Array
(
    [material_id] => 28150
    [quantity] => 20
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1552: 185, Remaining: 0
Total Summary:
Grand Total: 185
Wish to Pay: 185
Total Paid: 185
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1552
            [amount] => 185
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 07:32:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 65, Wish To Pay: 65, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1553
Inserting Item: Array
(
    [material_id] => 24504
    [quantity] => 2
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1553: 65, Remaining: 0
Total Summary:
Grand Total: 65
Wish to Pay: 65
Total Paid: 65
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1553
            [amount] => 65
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 07:35:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 660, Wish To Pay: 660, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1554
Inserting Item: Array
(
    [material_id] => 24934
    [quantity] => 3
    [unit_price] => 240
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 720
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1554: 660, Remaining: 0
Total Summary:
Grand Total: 660
Wish to Pay: 660
Total Paid: 660
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1554
            [amount] => 660
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 07:38:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1555
Inserting Item: Array
(
    [material_id] => 5797
    [quantity] => 10
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 120
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1555: 120, Remaining: 0
Total Summary:
Grand Total: 120
Wish to Pay: 120
Total Paid: 120
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1555
            [amount] => 120
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 07:39:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 795.02, Wish To Pay: 795.02, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1556
Inserting Item: Array
(
    [material_id] => 28376
    [quantity] => 1
    [unit_price] => 100
    [discount_percent] => 5
    [discount_amount] => 5
    [total_price] => 95
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28377
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31641
    [quantity] => 1
    [unit_price] => 640.02
    [discount_percent] => 3.12
    [discount_amount] => 20
    [total_price] => 620.02
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1556: 795.02, Remaining: 0
Total Summary:
Grand Total: 795.02
Wish to Pay: 795.02
Total Paid: 795.02
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1556
            [amount] => 795.02
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 07:59:29

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1557
Inserting Item: Array
(
    [material_id] => 17537
    [quantity] => 10
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1557: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1557
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 08:04:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 530, Wish To Pay: 530, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1558
Inserting Item: Array
(
    [material_id] => 31840
    [quantity] => 10
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 400
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31554
    [quantity] => 7
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1558: 530, Remaining: 0
Total Summary:
Grand Total: 530
Wish to Pay: 530
Total Paid: 530
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1558
            [amount] => 530
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 08:06:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1559
Inserting Item: Array
(
    [material_id] => 7808
    [quantity] => 30
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1559: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1559
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 08:09:25

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 40, Wish To Pay: 40, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1560
Inserting Item: Array
(
    [material_id] => 13285
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1560: 40, Remaining: 0
Total Summary:
Grand Total: 40
Wish to Pay: 40
Total Paid: 40
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1560
            [amount] => 40
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 08:12:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 140, Wish To Pay: 140, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1561
Inserting Item: Array
(
    [material_id] => 18799
    [quantity] => 20
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1561: 140, Remaining: 0
Total Summary:
Grand Total: 140
Wish to Pay: 140
Total Paid: 140
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1561
            [amount] => 140
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 08:13:56

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 130, Wish To Pay: 130, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1562
Inserting Item: Array
(
    [material_id] => 3725
    [quantity] => 14
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1562: 130, Remaining: 0
Total Summary:
Grand Total: 130
Wish to Pay: 130
Total Paid: 130
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1562
            [amount] => 130
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 08:17:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 590, Wish To Pay: 590, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1563
Inserting Item: Array
(
    [material_id] => 19368
    [quantity] => 14
    [unit_price] => 8
    [discount_percent] => 6.25
    [discount_amount] => 7
    [total_price] => 105
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13778
    [quantity] => 10
    [unit_price] => 10
    [discount_percent] => 5
    [discount_amount] => 5
    [total_price] => 95
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28986
    [quantity] => 1
    [unit_price] => 415
    [discount_percent] => 6.02
    [discount_amount] => 25
    [total_price] => 390
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1563: 590, Remaining: 0
Total Summary:
Grand Total: 590
Wish to Pay: 590
Total Paid: 590
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1563
            [amount] => 590
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 08:29:21

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 230, Wish To Pay: 230, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1564
Inserting Item: Array
(
    [material_id] => 25532
    [quantity] => 10
    [unit_price] => 7.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 75
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24438
    [quantity] => 10
    [unit_price] => 17.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 175
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1564: 230, Remaining: 0
Total Summary:
Grand Total: 230
Wish to Pay: 230
Total Paid: 230
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1564
            [amount] => 230
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 08:31:34

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1565
Inserting Item: Array
(
    [material_id] => 28728
    [quantity] => 1
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1565: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1565
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 08:36:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-933' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 08:36:01

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 70, Wish To Pay: 70, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1567
Inserting Item: Array
(
    [material_id] => 28168
    [quantity] => 2
    [unit_price] => 35
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1567: 70, Remaining: 0
Total Summary:
Grand Total: 70
Wish to Pay: 70
Total Paid: 70
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1567
            [amount] => 70
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 08:45:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 170, Wish To Pay: 170, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1568
Inserting Item: Array
(
    [material_id] => 5578
    [quantity] => 15
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 180
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1568: 170, Remaining: 0
Total Summary:
Grand Total: 170
Wish to Pay: 170
Total Paid: 170
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1568
            [amount] => 170
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 08:52:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 80, Wish To Pay: 80, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1569
Inserting Item: Array
(
    [material_id] => 30973
    [quantity] => 1
    [unit_price] => 80
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 80
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1569: 80, Remaining: 0
Total Summary:
Grand Total: 80
Wish to Pay: 80
Total Paid: 80
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1569
            [amount] => 80
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 09:05:41

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 350, Wish To Pay: 350, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1570
Inserting Item: Array
(
    [material_id] => 31825
    [quantity] => 1
    [unit_price] => 350
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 350
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1570: 350, Remaining: 0
Total Summary:
Grand Total: 350
Wish to Pay: 350
Total Paid: 350
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1570
            [amount] => 350
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 09:28:58

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10, Wish To Pay: 10, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1571
Inserting Item: Array
(
    [material_id] => 28321
    [quantity] => 1
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1571: 10, Remaining: 0
Total Summary:
Grand Total: 10
Wish to Pay: 10
Total Paid: 10
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1571
            [amount] => 10
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 09:30:47

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1800, Wish To Pay: 1800, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-937' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 09:37:49

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 1800, Wish To Pay: 1800, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1573
Inserting Item: Array
(
    [material_id] => 25401
    [quantity] => 30
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 1500
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 31262
    [quantity] => 30
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 360
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1573: 1800, Remaining: 0
Total Summary:
Grand Total: 1800
Wish to Pay: 1800
Total Paid: 1800
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1573
            [amount] => 1800
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 09:38:13

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 10.3, Wish To Pay: 10.3, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1574
Inserting Item: Array
(
    [material_id] => 30547
    [quantity] => 10
    [unit_price] => 1.03
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10.3
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1574: 10.3, Remaining: 0
Total Summary:
Grand Total: 10.3
Wish to Pay: 10.3
Total Paid: 10.3
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1574
            [amount] => 10.3
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 09:43:03

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 11.5, Wish To Pay: 11.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1575
Inserting Item: Array
(
    [material_id] => 18685
    [quantity] => 1
    [unit_price] => 11.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 11.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1575: 11.5, Remaining: 0
Total Summary:
Grand Total: 11.5
Wish to Pay: 11.5
Total Paid: 11.5
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1575
            [amount] => 11.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 09:59:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 35, Wish To Pay: 35, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1576
Inserting Item: Array
(
    [material_id] => 13383
    [quantity] => 10
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 35
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1576: 35, Remaining: 0
Total Summary:
Grand Total: 35
Wish to Pay: 35
Total Paid: 35
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1576
            [amount] => 35
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 10:00:08

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 23, Wish To Pay: 23, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1577
Inserting Item: Array
(
    [material_id] => 238
    [quantity] => 1
    [unit_price] => 23
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 23
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1577: 23, Remaining: 0
Total Summary:
Grand Total: 23
Wish to Pay: 23
Total Paid: 23
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1577
            [amount] => 23
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 10:01:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 20, Wish To Pay: 20, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1578
Inserting Item: Array
(
    [material_id] => 5235
    [quantity] => 1
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1578: 20, Remaining: 0
Total Summary:
Grand Total: 20
Wish to Pay: 20
Total Paid: 20
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1578
            [amount] => 20
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 10:13:27

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 76, Wish To Pay: 76, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-944' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 10:21:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 76, Wish To Pay: 76, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-944' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 10:21:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 222, Wish To Pay: 222, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-944' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 10:27:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 258, Wish To Pay: 258, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1582
Inserting Item: Array
(
    [material_id] => 25403
    [quantity] => 1
    [unit_price] => 36
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 36
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28408
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9251
    [quantity] => 1
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9271
    [quantity] => 1
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13972
    [quantity] => 14
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 112
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22355
    [quantity] => 5
    [unit_price] => 12
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1582: 258, Remaining: 0
Total Summary:
Grand Total: 258
Wish to Pay: 258
Total Paid: 258
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1582
            [amount] => 258
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 10:38:02

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 145, Wish To Pay: 145, Received: 1000, Change: 855
Customer found: Walk In
Sale Order Inserted. ID: 1583
Inserting Item: Array
(
    [material_id] => 25520
    [quantity] => 10
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1583: 145, Remaining: 0
Total Summary:
Grand Total: 145
Wish to Pay: 145
Total Paid: 145
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1583
            [amount] => 145
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 10:44:44

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 6
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 155, Wish To Pay: 155, Received: 200, Change: 45
Customer found: Walk In
Sale Order Inserted. ID: 1584
Inserting Item: Array
(
    [material_id] => 9430
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 19851
    [quantity] => 1
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 9
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24896
    [quantity] => 1
    [unit_price] => 6
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 7809
    [quantity] => 1
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28409
    [quantity] => 1
    [unit_price] => 25
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 25
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9493
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1584: 155, Remaining: 0
Total Summary:
Grand Total: 155
Wish to Pay: 155
Total Paid: 155
Items Inserted: 6
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1584
            [amount] => 155
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 10:55:07

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 451, Wish To Pay: 451, Received: 1000, Change: 549
Customer found: Walk In
Sale Order Inserted. ID: 1585
Inserting Item: Array
(
    [material_id] => 29543
    [quantity] => 1
    [unit_price] => 451
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 451
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1585: 451, Remaining: 0
Total Summary:
Grand Total: 451
Wish to Pay: 451
Total Paid: 451
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1585
            [amount] => 451
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 11:05:38

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 97, Wish To Pay: 97, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1586
Inserting Item: Array
(
    [material_id] => 7809
    [quantity] => 1
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 4726
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 9514
    [quantity] => 1
    [unit_price] => 60
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1586: 97, Remaining: 0
Total Summary:
Grand Total: 97
Wish to Pay: 97
Total Paid: 97
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1586
            [amount] => 97
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 11:08:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1587
Inserting Item: Array
(
    [material_id] => 29640
    [quantity] => 1
    [unit_price] => 150
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 150
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1587: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1587
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 11:30:28

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 170, Wish To Pay: 170, Received: 200, Change: 30
Customer found: Walk In
Sale Order Inserted. ID: 1588
Inserting Item: Array
(
    [material_id] => 31494
    [quantity] => 1
    [unit_price] => 170
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 170
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1588: 170, Remaining: 0
Total Summary:
Grand Total: 170
Wish to Pay: 170
Total Paid: 170
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1588
            [amount] => 170
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 11:50:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 72, Wish To Pay: 72, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1589
Inserting Item: Array
(
    [material_id] => 18771
    [quantity] => 20
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 20
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1589: 72, Remaining: 0
Total Summary:
Grand Total: 72
Wish to Pay: 72
Total Paid: 72
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1589
            [amount] => 72
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 11:54:50

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-950' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 12:12:31

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 190, Wish To Pay: 190, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1591
Inserting Item: Array
(
    [material_id] => 27734
    [quantity] => 1
    [unit_price] => 200
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 200
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1591: 190, Remaining: 0
Total Summary:
Grand Total: 190
Wish to Pay: 190
Total Paid: 190
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1591
            [amount] => 190
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 12:13:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 44, Wish To Pay: 44, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1592
Inserting Item: Array
(
    [material_id] => 21658
    [quantity] => 2
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 44
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1592: 44, Remaining: 0
Total Summary:
Grand Total: 44
Wish to Pay: 44
Total Paid: 44
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1592
            [amount] => 44
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 12:31:00

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 450.5, Wish To Pay: 450.5, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-954' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 12:42:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 450.5, Wish To Pay: 450.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1594
Inserting Item: Array
(
    [material_id] => 29688
    [quantity] => 6
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 132
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28292
    [quantity] => 10
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22426
    [quantity] => 30
    [unit_price] => 2.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 66
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 15
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 52.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 30
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 24652, Available: 13, Requested: 30
Stack trace: #0 {main}
Script execution completed at: 2026-07-09 12:44:39

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 5
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 450.5, Wish To Pay: 450.5, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1595
Inserting Item: Array
(
    [material_id] => 29688
    [quantity] => 6
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 132
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28292
    [quantity] => 10
    [unit_price] => 16
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 160
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 22426
    [quantity] => 30
    [unit_price] => 2.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 66
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13307
    [quantity] => 15
    [unit_price] => 3.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 52.5
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24652
    [quantity] => 30
    [unit_price] => 2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1595: 450.5, Remaining: 0
Total Summary:
Grand Total: 450.5
Wish to Pay: 450.5
Total Paid: 450.5
Items Inserted: 5
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1595
            [amount] => 450.5
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 12:48:11

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 6.6, Wish To Pay: 6.6, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1596
Inserting Item: Array
(
    [material_id] => 1981
    [quantity] => 20
    [unit_price] => 0.33
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 6.6
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1596: 6.6, Remaining: 0
Total Summary:
Grand Total: 6.6
Wish to Pay: 6.6
Total Paid: 6.6
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1596
            [amount] => 6.6
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 12:52:51

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1597
Inserting Item: Array
(
    [material_id] => 22418
    [quantity] => 20
    [unit_price] => 6.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Error: Insufficient stock! Raw Material ID: 12127, Available: 5, Requested: 10
Stack trace: #0 {main}
Script execution completed at: 2026-07-09 13:13:20

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-941' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 13:16:52

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1599
Inserting Item: Array
(
    [material_id] => 22418
    [quantity] => 20
    [unit_price] => 6.5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 130
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 12127
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1599: 200, Remaining: 0
Total Summary:
Grand Total: 200
Wish to Pay: 200
Total Paid: 200
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1599
            [amount] => 200
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 13:18:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-957' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 13:18:16

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 46.8, Wish To Pay: 46.8, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1601
Inserting Item: Array
(
    [material_id] => 19851
    [quantity] => 1
    [unit_price] => 9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 9
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 25400
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 30543
    [quantity] => 2
    [unit_price] => 3.9
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 7.8
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1601: 46.8, Remaining: 0
Total Summary:
Grand Total: 46.8
Wish to Pay: 46.8
Total Paid: 46.8
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1601
            [amount] => 46.8
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 13:20:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 46.8, Wish To Pay: 46.8, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-958' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 13:20:19

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-957' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 13:32:48

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 200, Wish To Pay: 200, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-957' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 13:32:55

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 500, Change: 350
Customer found: Walk In
Sale Order Inserted. ID: 1605
Inserting Item: Array
(
    [material_id] => 25032
    [quantity] => 10
    [unit_price] => 1
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 10
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 13314
    [quantity] => 14
    [unit_price] => 10
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 140
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1605: 150, Remaining: 0
Total Summary:
Grand Total: 150
Wish to Pay: 150
Total Paid: 150
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1605
            [amount] => 150
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 13:41:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 150, Wish To Pay: 150, Received: 500, Change: 350
Customer found: Walk In
Error: Duplicate entry 'SO-2026-959' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 13:41:24

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 870, Wish To Pay: 870, Received: 1000, Change: 130
Customer found: Walk In
Sale Order Inserted. ID: 1607
Inserting Item: Array
(
    [material_id] => 30346
    [quantity] => 1
    [unit_price] => 870
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 870
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1607: 870, Remaining: 0
Total Summary:
Grand Total: 870
Wish to Pay: 870
Total Paid: 870
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1607
            [amount] => 870
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 13:50:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 870, Wish To Pay: 870, Received: 1000, Change: 130
Customer found: Walk In
Error: Duplicate entry 'SO-2026-960' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 13:50:04

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 290, Wish To Pay: 290, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1609
Inserting Item: Array
(
    [material_id] => 14104
    [quantity] => 10
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 300
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5237
    [quantity] => 10
    [unit_price] => 1.2
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 12
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1609: 290, Remaining: 0
Total Summary:
Grand Total: 290
Wish to Pay: 290
Total Paid: 290
Items Inserted: 2
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1609
            [amount] => 290
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 13:52:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 290, Wish To Pay: 290, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-961' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 13:52:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 50, Wish To Pay: 50, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-960' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 13:52:57

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 310, Wish To Pay: 310, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1612
Inserting Item: Array
(
    [material_id] => 5235
    [quantity] => 1
    [unit_price] => 20
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 20
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5233
    [quantity] => 6
    [unit_price] => 5
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 24575
    [quantity] => 1
    [unit_price] => 40
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 40
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28080
    [quantity] => 1
    [unit_price] => 22
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 22
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 27878
    [quantity] => 10
    [unit_price] => 11
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 110
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 17582
    [quantity] => 4
    [unit_price] => 8
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 32
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28030
    [quantity] => 4
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 60
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1612: 310, Remaining: 0
Total Summary:
Grand Total: 310
Wish to Pay: 310
Total Paid: 310
Items Inserted: 7
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1612
            [amount] => 310
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 13:59:09

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 7
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 310, Wish To Pay: 310, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-962' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 13:59:09

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 550, Wish To Pay: 550, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1614
Inserting Item: Array
(
    [material_id] => 30001
    [quantity] => 1
    [unit_price] => 690
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 690
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1614: 550, Remaining: 0
Total Summary:
Grand Total: 550
Wish to Pay: 550
Total Paid: 550
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1614
            [amount] => 550
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 14:03:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 550, Wish To Pay: 550, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-963' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 14:03:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-962' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 14:12:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-962' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 14:12:26

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 2
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 120, Wish To Pay: 120, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-962' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 14:12:30

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1619
Inserting Item: Array
(
    [material_id] => 14609
    [quantity] => 1
    [unit_price] => 30
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1619: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1619
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 14:16:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-964' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 14:16:06

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 135, Wish To Pay: 135, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1621
Inserting Item: Array
(
    [material_id] => 13159
    [quantity] => 1
    [unit_price] => 50
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 50
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 5635
    [quantity] => 10
    [unit_price] => 7
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 70
    [item_type] => raw
    [serials] => Array
        (
        )

)

Inserting Item: Array
(
    [material_id] => 28416
    [quantity] => 1
    [unit_price] => 15
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 15
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1621: 135, Remaining: 0
Total Summary:
Grand Total: 135
Wish to Pay: 135
Total Paid: 135
Items Inserted: 3
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1621
            [amount] => 135
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 14:19:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 3
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 135, Wish To Pay: 135, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-965' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 14:19:22

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Sale Order Inserted. ID: 1623
Inserting Item: Array
(
    [material_id] => 25248
    [quantity] => 10
    [unit_price] => 3
    [discount_percent] => 0
    [discount_amount] => 0
    [total_price] => 30
    [item_type] => raw
    [serials] => Array
        (
        )

)

=== PROCESSING BATCH DATA ===
Batch data type: array
Batch data: Array
(
)

No batch data to process
Lot Raw Inserted: 0, Expiry Updated: 0
Previous Sale Due Paid for sel-1623: 30, Remaining: 0
Total Summary:
Grand Total: 30
Wish to Pay: 30
Total Paid: 30
Items Inserted: 1
Lot Raw Entries: 0
Expiry Updated: 0
Payment Distribution: Array
(
    [0] => Array
        (
            [ref] => sel-1623
            [amount] => 30
            [type] => Previous Sale Due Payment
            [date] => 2026-07-09
        )

)

Script execution completed at: 2026-07-09 14:22:40

=== FORM DATA REQUEST ===
No files uploaded
=== BATCH DATA STRUCTURE ===
Array
(
)


Customer ID: 29
Items count: 1
Files uploaded: 0
Batch data count: 0
Payment Info - Prev Due: 0, To Pay: 30, Wish To Pay: 30, Received: 0, Change: 0
Customer found: Walk In
Error: Duplicate entry 'SO-2026-966' for key 'so_number'
Stack trace: #0 /home/p2spharma/public_html/propharmacy/sale_orders_insert.php(297): mysqli_stmt->execute()
#1 {main}
Script execution completed at: 2026-07-09 14:22:40

