+
Expected Cash: OMR = number_format($expected_balance, 3) ?>
+
Actual Cash: OMR = number_format((float)($s['cash_in_hand'] ?? 0), 3) ?>
-
@@ -7238,34 +7261,94 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
$curBreakdown = db()->prepare("SELECT p.payment_method, SUM(p.amount) as total FROM pos_payments p JOIN pos_transactions t ON p.transaction_id = t.id WHERE t.register_session_id = ? AND t.status = 'completed' GROUP BY p.payment_method");
$curBreakdown->execute([$session['id']]);
$curMethods = $curBreakdown->fetchAll();
- $curCashSales = 0;
- foreach($curMethods as $cm) if(strtolower($cm['payment_method']) === 'cash') $curCashSales = (float)$cm['total'];
+
+ $cash_sales = 0;
+ $card_sales = 0;
+ $credit_sales = 0;
+ $bank_transfer_sales = 0;
+
+ foreach ($curMethods as $m) {
+ $method = strtolower($m['payment_method']);
+ if ($method === 'cash') $cash_sales = $m['total'];
+ elseif ($method === 'card' || strpos($method, 'card') !== false) $card_sales = $m['total'];
+ elseif ($method === 'credit') $credit_sales = $m['total'];
+ elseif (strpos($method, 'transfer') !== false || strpos($method, 'bank') !== false) $bank_transfer_sales = $m['total'];
+ else $cash_sales += $m['total'];
+ }
+ $total_sales = $cash_sales + $card_sales + $credit_sales + $bank_transfer_sales;
+ $expected_cash = (float)$session['opening_balance'] + $cash_sales;
+ $total_all = (float)$session['opening_balance'] + $total_sales;
?>
Session Summary
- Opening Cash:
+ Opening Balance:
OMR = number_format((float)$session['opening_balance'], 3) ?>
Cash Sales:
- OMR = number_format($curCashSales, 3) ?>
+ OMR = number_format($cash_sales, 3) ?>
+
+
+ Credit Card Sales:
+ OMR = number_format($card_sales, 3) ?>
+
+
+ Credit:
+ OMR = number_format($credit_sales, 3) ?>
+
+
+ Bank Transfer:
+ OMR = number_format($bank_transfer_sales, 3) ?>
-
-
Expected Cash in Hand:
-
OMR = number_format((float)$session['opening_balance'] + $curCashSales, 3) ?>
+
+ Balance (Total):
+ OMR = number_format($total_all, 3) ?>
-
-
-
-
= htmlspecialchars($cm['payment_method']) ?> Total:
-
OMR = number_format((float)$cm['total'], 3) ?>
+
+ Expected Cash:
+ OMR = number_format($expected_cash, 3) ?>
-
+
+
+
Transaction Details
+
+
+
+
+ Time
+ Order #
+ Customer
+ Method
+ Amount
+
+
+
+ prepare("SELECT t.*, c.name as customer_name, GROUP_CONCAT(p.payment_method SEPARATOR ', ') as methods FROM pos_transactions t LEFT JOIN pos_payments p ON t.id = p.transaction_id LEFT JOIN customers c ON t.customer_id = c.id WHERE t.register_session_id = ? AND t.status = 'completed' GROUP BY t.id ORDER BY t.created_at DESC");
+ $txs_stmt->execute([$session['id']]);
+ $txs = $txs_stmt->fetchAll();
+ foreach ($txs as $tx):
+ ?>
+
+ = date('H:i', strtotime($tx['created_at'])) ?>
+ = htmlspecialchars($tx['transaction_no']) ?>
+ = htmlspecialchars($tx['customer_name'] ?: 'Walk-in') ?>
+ = htmlspecialchars($tx['methods'] ?: '---') ?>
+ = number_format($tx['net_amount'], 3) ?>
+
+
+ No transactions
+
+
+
+
+
+
Total Cash in Hand (Actual Counted)
@@ -9887,11 +9970,15 @@ document.addEventListener('DOMContentLoaded', function() {
Card
-
-
- Credit
-
-
+
+
+ Credit
+
+
+
+ Transfer
+
+
diff --git a/post_debug.log b/post_debug.log
index 257cce7..2e823a8 100644
--- a/post_debug.log
+++ b/post_debug.log
@@ -57,3 +57,6 @@
2026-02-19 06:50:40 - POST: {"name_en":"Tissue","name_ar":"\u0645\u062d\u0627\u0631\u0645 \u0648\u0631\u0642\u064a\u0629","category_id":"2","unit_id":"2","supplier_id":"6","sku":"5673086966938977","sale_price":"0.25","purchase_price":"0.2","stock_quantity":"0.000","min_stock_level":"0.000","vat_rate":"5","expiry_date":"","promotion_start":"","promotion_end":"","promotion_percent":"0.00","add_item":""}
2026-02-19 06:53:36 - POST: {"action":"save_pos_transaction","customer_id":"","payments":"[{\"method\":\"cash\",\"amount\":0.978}]","total_amount":"0.9775","discount_code_id":"","discount_amount":"0","loyalty_redeemed":"0","items":"[{\"id\":1,\"qty\":2,\"price\":0.3825},{\"id\":2,\"qty\":1,\"price\":0.2125}]"}
2026-02-19 07:01:43 - POST: {"name_en":"Tissue","name_ar":"\u0645\u062d\u0627\u0631\u0645 \u0648\u0631\u0642\u064a\u0629","category_id":"2","unit_id":"2","supplier_id":"6","sku":"760115926272","sale_price":"0.25","purchase_price":"0.2","stock_quantity":"5","min_stock_level":"0.000","vat_rate":"5","expiry_date":"","promotion_start":"","promotion_end":"","promotion_percent":"0.00","add_item":""}
+2026-02-19 07:02:59 - POST: {"name_en":"Tissue","name_ar":"\u0645\u062d\u0627\u0631\u0645 \u0648\u0631\u0642\u064a\u0629","category_id":"2","unit_id":"2","supplier_id":"6","sku":"760115926272","sale_price":"0.25","purchase_price":"0.2","stock_quantity":"5","min_stock_level":"0.000","vat_rate":"5","expiry_date":"","promotion_start":"","promotion_end":"","promotion_percent":"0.00","add_item":""}
+2026-02-19 07:12:25 - POST: {"action":"save_pos_transaction","customer_id":"","payments":"[{\"method\":\"cash\",\"amount\":0.883}]","total_amount":"0.8825000000000001","discount_code_id":"","discount_amount":"0","loyalty_redeemed":"0","items":"[{\"id\":1,\"qty\":1,\"price\":0.3825},{\"id\":3,\"qty\":2,\"price\":0.25}]"}
+2026-02-19 07:12:39 - POST: {"close_register":"1","session_id":"3","cash_in_hand":"5","notes":""}