fix payments

This commit is contained in:
root
2026-07-08 23:30:16 -04:00
parent 6e8da3cc2c
commit ed11cccecc
15 changed files with 959 additions and 132 deletions
+5 -4
View File
@@ -350,19 +350,20 @@ if ($returnUrl === '') {
<table class="table table-sm table-striped table-hover align-middle fc-table-stack">
<thead class="table-light">
<tr>
<th>Invoice</th><th>Amount</th><th>Balance</th><th>Method</th><th>Date</th><th>Status</th>
<th>Invoice</th><th>Amount</th><th>Invoice Balance</th><th>Method</th><th>Date</th><th>Payment Status</th><th>Invoice Status</th>
</tr>
</thead>
<tbody>
<?php $imap = $f['invoice_map'] ?? []; ?>
<?php foreach ($f['payments'] as $p): ?>
<tr>
<td data-label="Invoice"><?php $iid = (int)($p['invoice_id'] ?? 0); echo esc($imap[$iid] ?? ('#'.$iid)); ?></td>
<td data-label="Invoice"><?php $iid = (int)($p['invoice_id'] ?? 0); echo esc($p['invoice_number'] ?? $imap[$iid] ?? ('#'.$iid)); ?></td>
<td data-label="Amount">$<?= number_format((float)($p['paid_amount'] ?? 0), 2) ?></td>
<td data-label="Balance">$<?= number_format((float)($p['balance'] ?? 0), 2) ?></td>
<td data-label="Invoice Balance">$<?= number_format((float)($p['invoice_current_balance'] ?? 0), 2) ?></td>
<td data-label="Method"><?= esc($p['payment_method'] ?? '') ?></td>
<td data-label="Date"><?= esc(!empty($p['payment_date']) ? local_date($p['payment_date'], 'm-d-Y') : '') ?></td>
<td data-label="Status"><?= esc($p['status'] ?? '') ?></td>
<td data-label="Payment Status"><?= esc($p['payment_status'] ?? '') ?></td>
<td data-label="Invoice Status"><?= esc($p['invoice_status'] ?? '') ?></td>
</tr>
<?php endforeach; ?>
</tbody>
+5 -4
View File
@@ -263,19 +263,20 @@
<table class="table table-sm table-striped table-hover align-middle">
<thead class="table-light">
<tr>
<th>Invoice</th><th>Amount</th><th>Balance</th><th>Method</th><th>Date</th><th>Status</th>
<th>Invoice</th><th>Amount</th><th>Invoice Balance</th><th>Method</th><th>Date</th><th>Payment Status</th><th>Invoice Status</th>
</tr>
</thead>
<tbody>
<?php $imap = $f['invoice_map'] ?? []; ?>
<?php foreach ($f['payments'] as $p): ?>
<tr>
<td><?php $iid = (int)($p['invoice_id'] ?? 0); echo esc($imap[$iid] ?? ('#'.$iid)); ?></td>
<td><?php $iid = (int)($p['invoice_id'] ?? 0); echo esc($p['invoice_number'] ?? $imap[$iid] ?? ('#'.$iid)); ?></td>
<td>$<?= number_format((float)($p['paid_amount'] ?? 0), 2) ?></td>
<td>$<?= number_format((float)($p['balance'] ?? 0), 2) ?></td>
<td>$<?= number_format((float)($p['invoice_current_balance'] ?? 0), 2) ?></td>
<td><?= esc($p['payment_method'] ?? '') ?></td>
<td><?= esc(!empty($p['payment_date']) ? local_date($p['payment_date'], 'm-d-Y') : '') ?></td>
<td><?= esc($p['status'] ?? '') ?></td>
<td><?= esc($p['payment_status'] ?? '') ?></td>
<td><?= esc($p['invoice_status'] ?? '') ?></td>
</tr>
<?php endforeach; ?>
</tbody>