update reciept
This commit is contained in:
parent
57a6e7ed99
commit
5f8d3b1aed
@ -129,6 +129,7 @@ $translations = [
|
|||||||
'error_update' => 'Error updating!',
|
'error_update' => 'Error updating!',
|
||||||
'print' => 'Print',
|
'print' => 'Print',
|
||||||
'print_invoice' => 'Print Invoice',
|
'print_invoice' => 'Print Invoice',
|
||||||
|
'print_receipt' => 'Print Receipt',
|
||||||
'thermal_receipt' => 'Thermal Receipt',
|
'thermal_receipt' => 'Thermal Receipt',
|
||||||
'order' => 'Order',
|
'order' => 'Order',
|
||||||
'customer' => 'Customer',
|
'customer' => 'Customer',
|
||||||
@ -362,6 +363,7 @@ $translations = [
|
|||||||
'error_update' => 'خطأ في التحديث!',
|
'error_update' => 'خطأ في التحديث!',
|
||||||
'print' => 'طباعة',
|
'print' => 'طباعة',
|
||||||
'print_invoice' => 'طباعة الفاتورة',
|
'print_invoice' => 'طباعة الفاتورة',
|
||||||
|
'print_receipt' => 'طباعة الإيصال',
|
||||||
'thermal_receipt' => 'إيصال حراري',
|
'thermal_receipt' => 'إيصال حراري',
|
||||||
'order' => 'الطلب',
|
'order' => 'الطلب',
|
||||||
'customer' => 'العميل',
|
'customer' => 'العميل',
|
||||||
|
|||||||
30
receipt.php
30
receipt.php
@ -49,7 +49,7 @@ function format_currency($amount) {
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Receipt #<?= $order['id'] ?></title>
|
<title><?= __('thermal_receipt') ?> #<?= $order['order_number'] ?? $order['id'] ?></title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;600&family=IBM+Plex+Sans+Arabic:wght@400;600&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;600&family=IBM+Plex+Sans+Arabic:wght@400;600&display=swap" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
@ -86,8 +86,8 @@ function format_currency($amount) {
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="no-print text-center my-3">
|
<div class="no-print text-center my-3">
|
||||||
<button onclick="window.print()" class="btn btn-primary btn-sm px-4">Print Receipt</button>
|
<button onclick="window.print()" class="btn btn-primary btn-sm px-4"><?= __('print_receipt') ?></button>
|
||||||
<a href="pos.php" class="btn btn-outline-secondary btn-sm ms-2">Back to POS</a>
|
<a href="pos.php" class="btn btn-outline-secondary btn-sm ms-2"><?= __('back_to_pos') ?></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="receipt-container">
|
<div class="receipt-container">
|
||||||
@ -102,27 +102,27 @@ function format_currency($amount) {
|
|||||||
<div class="small mt-1"><?= htmlspecialchars($order['branch_name_en']) ?> / <span class="arabic-text"><?= htmlspecialchars($order['branch_name_ar']) ?></span></div>
|
<div class="small mt-1"><?= htmlspecialchars($order['branch_name_en']) ?> / <span class="arabic-text"><?= htmlspecialchars($order['branch_name_ar']) ?></span></div>
|
||||||
<div class="small"><?= htmlspecialchars($order['branch_phone']) ?></div>
|
<div class="small"><?= htmlspecialchars($order['branch_phone']) ?></div>
|
||||||
<?php if (!empty($company['ctr_no'])): ?>
|
<?php if (!empty($company['ctr_no'])): ?>
|
||||||
<div class="small">CR No: <?= htmlspecialchars($company['ctr_no']) ?></div>
|
<div class="small"><?= __('ctr_no') ?>: <?= htmlspecialchars($company['ctr_no']) ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if (!empty($company['vat_no'])): ?>
|
<?php if (!empty($company['vat_no'])): ?>
|
||||||
<div class="small">VAT No: <?= htmlspecialchars($company['vat_no']) ?></div>
|
<div class="small"><?= __('vat_no') ?>: <?= htmlspecialchars($company['vat_no']) ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span>Date:</span>
|
<span><?= __('date') ?>:</span>
|
||||||
<span><?= date('Y-m-d H:i', strtotime($order['created_at'])) ?></span>
|
<span><?= date('Y-m-d H:i', strtotime($order['created_at'])) ?></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span>Order #:</span>
|
<span><?= __('order_no') ?>:</span>
|
||||||
<span class="fw-bold"><?= $order['id'] ?></span>
|
<span class="fw-bold"><?= $order['order_number'] ?? $order['id'] ?></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span>Customer:</span>
|
<span><?= __('customer') ?>:</span>
|
||||||
<span><?= $order['customer_name_en'] ?></span>
|
<span><?= $order['customer_name_en'] ?></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span>Phone:</span>
|
<span><?= __('phone') ?>:</span>
|
||||||
<span><?= $order['customer_phone'] ?></span>
|
<span><?= $order['customer_phone'] ?></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -146,21 +146,21 @@ function format_currency($amount) {
|
|||||||
?>
|
?>
|
||||||
<div class="totals">
|
<div class="totals">
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span>Subtotal:</span>
|
<span><?= __('subtotal') ?>:</span>
|
||||||
<span><?= format_currency($calculated_subtotal) ?></span>
|
<span><?= format_currency($calculated_subtotal) ?></span>
|
||||||
</div>
|
</div>
|
||||||
<?php if ($order['loyalty_discount'] > 0): ?>
|
<?php if ($order['loyalty_discount'] > 0): ?>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span>Discount (Loyalty):</span>
|
<span><?= __('loyalty_discount') ?>:</span>
|
||||||
<span>-<?= format_currency($order['loyalty_discount']) ?></span>
|
<span>-<?= format_currency($order['loyalty_discount']) ?></span>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span>VAT:</span>
|
<span><?= __('vat') ?>:</span>
|
||||||
<span><?= format_currency($order['vat_total'] ?? 0) ?></span>
|
<span><?= format_currency($order['vat_total'] ?? 0) ?></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="total-row mt-2">
|
<div class="total-row mt-2">
|
||||||
<span>Total:</span>
|
<span><?= __('total') ?>:</span>
|
||||||
<span><?= format_currency($order['total_price']) ?></span>
|
<span><?= format_currency($order['total_price']) ?></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -177,7 +177,7 @@ function format_currency($amount) {
|
|||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/jsbarcode@3.11.0/dist/JsBarcode.all.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/jsbarcode@3.11.0/dist/JsBarcode.all.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
JsBarcode("#barcode", "<?= $order['id'] ?>", {
|
JsBarcode("#barcode", "<?= $order['order_number'] ?? $order['id'] ?>", {
|
||||||
format: "CODE128",
|
format: "CODE128",
|
||||||
lineColor: "#000",
|
lineColor: "#000",
|
||||||
width: 1.5,
|
width: 1.5,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user