Autosave: 20260220-181541
This commit is contained in:
parent
3447cdbc2a
commit
7863ad8c93
33
index.php
33
index.php
@ -3436,9 +3436,10 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
|
||||
<td><?= htmlspecialchars($c['phone']) ?></td>
|
||||
<td class="text-end">OMR <?= number_format((float)$c['balance'], 3) ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -3501,7 +3502,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
|
||||
<button type="submit" class="btn btn-primary flex-grow-1">
|
||||
<i class="bi bi-filter"></i> <span data-en="Filter" data-ar="تصفية">Filter</span>
|
||||
</button>
|
||||
<a href="index.php?page=export&type=<?= $page ?>&<?= http_build_query($_GET) ?>" class="btn btn-outline-success">
|
||||
<a href="index.php?<?= http_build_query(array_merge($_GET, ['page' => 'export', 'type' => $page])) ?>" class="btn btn-outline-success">
|
||||
<i class="bi bi-download"></i> <span data-en="Export" data-ar="تصدير">Export</span>
|
||||
</a>
|
||||
<?php if (!empty($_GET['search']) || !empty($_GET['start_date']) || !empty($_GET['end_date'])): ?>
|
||||
@ -3821,7 +3822,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
|
||||
<button type="submit" class="btn btn-primary flex-grow-1">
|
||||
<i class="bi bi-search"></i> <span data-en="Search" data-ar="بحث">Search</span>
|
||||
</button>
|
||||
<a href="index.php?page=export&type=items&<?= http_build_query($_GET) ?>" class="btn btn-outline-success">
|
||||
<a href="index.php?<?= http_build_query(array_merge($_GET, ['page' => 'export', 'type' => 'items'])) ?>" class="btn btn-outline-success">
|
||||
<i class="bi bi-download"></i> <span data-en="Export" data-ar="تصدير">Export</span>
|
||||
</a>
|
||||
<?php if (!empty($_GET['search'])): ?>
|
||||
@ -5600,9 +5601,12 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
|
||||
<button type="submit" class="btn btn-primary btn-sm flex-grow-1">
|
||||
<i class="bi bi-filter"></i> <span data-en="Filter" data-ar="تصفية">Filter</span>
|
||||
</button>
|
||||
<a href="index.php?page=export&type=<?= $page ?>&<?= http_build_query($_GET) ?>" class="btn btn-success btn-sm">
|
||||
<a href="index.php?<?= http_build_query(array_merge($_GET, ['page' => 'export', 'type' => $page])) ?>" class="btn btn-success btn-sm">
|
||||
<i class="bi bi-download"></i> <span data-en="Export" data-ar="تصدير">Export</span>
|
||||
</a>
|
||||
<button type="button" class="btn btn-outline-primary btn-sm" onclick="window.print()">
|
||||
<i class="bi bi-printer"></i> <span data-en="Print" data-ar="طباعة">Print</span>
|
||||
</button>
|
||||
<a href="index.php?page=<?= $page ?>" class="btn btn-outline-secondary btn-sm flex-grow-1">
|
||||
<i class="bi bi-x-circle"></i> <span data-en="Clear" data-ar="مسح">Clear</span>
|
||||
</a>
|
||||
@ -5621,14 +5625,18 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
|
||||
<th data-en="Total" data-ar="الإجمالي" class="text-end">Total</th>
|
||||
<th data-en="Paid" data-ar="المدفوع" class="text-end">Paid</th>
|
||||
<th data-en="Balance" data-ar="المتبقي" class="text-end">Balance</th>
|
||||
<th data-en="Actions" data-ar="الإجراءات" class="text-end">Actions</th>
|
||||
<th data-en="Actions" data-ar="الإجراءات" class="text-end d-print-none">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$itemTable = ($page === 'purchases') ? 'purchase_items' : 'invoice_items';
|
||||
$fkCol = ($page === 'purchases') ? 'purchase_id' : 'invoice_id';
|
||||
$total_all = 0; $total_paid = 0; $total_balance = 0;
|
||||
foreach ($data['invoices'] as $inv):
|
||||
$total_all += (float)$inv['total_with_vat'];
|
||||
$total_paid += (float)$inv['paid_amount'];
|
||||
$total_balance += ((float)$inv['total_with_vat'] - (float)$inv['paid_amount']);
|
||||
$items = db()->prepare("SELECT ii.*, i.name_en, i.name_ar, i.vat_rate
|
||||
FROM $itemTable ii
|
||||
JOIN stock_items i ON ii.item_id = i.id
|
||||
@ -5668,7 +5676,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
|
||||
<td class="text-end fw-bold">OMR <?= number_format((float)$inv['total_with_vat'], 3) ?></td>
|
||||
<td class="text-end text-success">OMR <?= number_format((float)$inv['paid_amount'], 3) ?></td>
|
||||
<td class="text-end text-danger fw-bold">OMR <?= number_format((float)($inv['total_with_vat'] - $inv['paid_amount']), 3) ?></td>
|
||||
<td class="text-end">
|
||||
<td class="text-end d-print-none">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-outline-info view-invoice-btn" data-json="<?= htmlspecialchars(json_encode($inv)) ?>" title="View"><i class="bi bi-eye"></i></button>
|
||||
<button class="btn btn-outline-warning return-invoice-btn" data-id="<?= $inv['id'] ?>" data-bs-toggle="modal" data-bs-target="<?= $page === 'sales' ? '#addSalesReturnModal' : '#addPurchaseReturnModal' ?>" title="Return"><i class="bi bi-arrow-return-left"></i></button>
|
||||
@ -5686,6 +5694,15 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="fw-bold bg-light">
|
||||
<td colspan="5" class="text-end" data-en="Totals" data-ar="الإجمالي">Totals</td>
|
||||
<td class="text-end">OMR <?= number_format($total_all, 3) ?></td>
|
||||
<td class="text-end text-success">OMR <?= number_format($total_paid, 3) ?></td>
|
||||
<td class="text-end text-danger">OMR <?= number_format($total_balance, 3) ?></td>
|
||||
<td class="d-print-none"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user