@@ -279,7 +275,7 @@ include 'includes/header.php';
Cashier
Customer
Type
-
Source
+
VAT
Total
Commission
@@ -326,11 +322,7 @@ include 'includes/header.php';
= ucfirst($order['order_type']) ?>
-
- Table = htmlspecialchars((string)($order['table_number'] ?? '')) ?>
-
- = ucfirst($order['order_type']) ?>
-
+ = format_currency($order['vat']) ?>
= format_currency($order['total_amount']) ?>
diff --git a/admin/products.php b/admin/products.php
index 6a04893..e6fe17d 100644
--- a/admin/products.php
+++ b/admin/products.php
@@ -15,6 +15,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) {
$name_ar = $_POST['name_ar'] ?? '';
$category_id = (int)$_POST['category_id'];
$price = (float)$_POST['price'];
+ $vat_percent = (float)($_POST['vat_percent'] ?? 0);
$cost_price = (float)($_POST['cost_price'] ?? 0);
$stock_quantity = (int)($_POST['stock_quantity'] ?? 0);
$description = $_POST['description'] ?? '';
@@ -48,16 +49,16 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) {
if (!has_permission('products_edit')) {
$message = '
Access Denied: You do not have permission to edit products.
';
} else {
- $stmt = $pdo->prepare("UPDATE products SET name = ?, name_ar = ?, category_id = ?, price = ?, cost_price = ?, stock_quantity = ?, description = ?, image_url = ?, promo_discount_percent = ?, promo_date_from = ?, promo_date_to = ?, is_loyalty = ? WHERE id = ?");
- $stmt->execute([$name, $name_ar, $category_id, $price, $cost_price, $stock_quantity, $description, $image_url, $promo_discount_percent, $promo_date_from, $promo_date_to, $is_loyalty, $id]);
+ $stmt = $pdo->prepare("UPDATE products SET name = ?, name_ar = ?, category_id = ?, price = ?, vat_percent = ?, cost_price = ?, stock_quantity = ?, description = ?, image_url = ?, promo_discount_percent = ?, promo_date_from = ?, promo_date_to = ?, is_loyalty = ? WHERE id = ?");
+ $stmt->execute([$name, $name_ar, $category_id, $price, $vat_percent, $cost_price, $stock_quantity, $description, $image_url, $promo_discount_percent, $promo_date_from, $promo_date_to, $is_loyalty, $id]);
$message = '
Product updated successfully!
';
}
} elseif ($action === 'add_product') {
if (!has_permission('products_add')) {
$message = '
Access Denied: You do not have permission to add products.
';
} else {
- $stmt = $pdo->prepare("INSERT INTO products (name, name_ar, category_id, price, cost_price, stock_quantity, description, image_url, promo_discount_percent, promo_date_from, promo_date_to, is_loyalty) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
- $stmt->execute([$name, $name_ar, $category_id, $price, $cost_price, $stock_quantity, $description, $image_url, $promo_discount_percent, $promo_date_from, $promo_date_to, $is_loyalty]);
+ $stmt = $pdo->prepare("INSERT INTO products (name, name_ar, category_id, price, vat_percent, cost_price, stock_quantity, description, image_url, promo_discount_percent, promo_date_from, promo_date_to, is_loyalty) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
+ $stmt->execute([$name, $name_ar, $category_id, $price, $vat_percent, $cost_price, $stock_quantity, $description, $image_url, $promo_discount_percent, $promo_date_from, $promo_date_to, $is_loyalty]);
$message = '
Product created successfully!
';
}
}
@@ -184,6 +185,7 @@ include 'includes/header.php';
= t('product') ?>
= t('category') ?>
= t('price') ?>
+
= t('VAT') ?>
= t('stock') ?>
= t('promotion') ?>
= t('actions') ?>
@@ -223,6 +225,9 @@ include 'includes/header.php';
= t('cost') ?>: = format_currency($product['cost_price']) ?>
+
+ = (float)$product['vat_percent'] ?>%
+
= $product['stock_quantity'] ?>
@@ -256,7 +261,7 @@ include 'includes/header.php';
-
+
= t('none') ?>
@@ -306,7 +311,7 @@ include 'includes/header.php';
-
+
= t('category') ?> *
= t('select') ?> = t('category') ?>
@@ -316,22 +321,32 @@ include 'includes/header.php';
-
+
= t('price') ?> *
+
+
+ = t('VAT') ?> (%)
+
+ 0%
+ 5%
+ 10%
+ 15%
+
+
-
+
= t('cost') ?> = t('price') ?>
-
+
= t('stock') ?> = t('quantity') ?>
-
+
= t('description') ?>
@@ -400,6 +415,7 @@ function prepareEditForm(p) {
document.getElementById('productNameAr').value = p.name_ar || '';
document.getElementById('productCategoryId').value = p.category_id;
document.getElementById('productPrice').value = p.price;
+ document.getElementById('productVatPercent').value = parseFloat(p.vat_percent || 0);
document.getElementById('productCostPrice').value = p.cost_price || '';
document.getElementById('productStockQuantity').value = p.stock_quantity || '0';
document.getElementById('productDescription').value = p.description || '';
diff --git a/admin/tables.php b/admin/tables.php
index 63455eb..46489e7 100644
--- a/admin/tables.php
+++ b/admin/tables.php
@@ -74,6 +74,15 @@ $tables_pagination = paginate_query($pdo, $query);
$tables = $tables_pagination['data'];
include 'includes/header.php';
+
+// Base URL for QR codes
+$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || ($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https') ? "https://" : "http://";
+$host = $_SERVER['HTTP_HOST'];
+// Calculate project root
+$current_dir = dirname($_SERVER['PHP_SELF']); // /admin
+$project_root = dirname($current_dir); // /
+if ($project_root === DIRECTORY_SEPARATOR) $project_root = '';
+$baseUrl = $protocol . $host . $project_root;
?>
@@ -102,6 +111,7 @@ include 'includes/header.php';
Area
Capacity
Status
+ QR Code
Actions
@@ -121,6 +131,12 @@ include 'includes/header.php';
= ucfirst($table['status']) ?>
+
+
+ View QR
+
+
- No tables found.
+ No tables found.
@@ -197,6 +213,33 @@ include 'includes/header.php';
+
+
+
+
+
+
+
+
+
Table
+
+
+
+
Scan to Order
+
+
+
+
+
+
-
-
\ No newline at end of file
+function showTableQR(id, number) {
+ const baseUrl = '= $baseUrl ?>';
+ const qorderUrl = baseUrl + '/qorder.php?table_id=' + id;
+ const qrCodeUrl = "https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=" + encodeURIComponent(qorderUrl);
+
+ document.getElementById('qrTableNumber').innerText = 'Table ' + number;
+ document.getElementById('qrContainer').innerHTML = ' ';
+ document.getElementById('qrLink').innerText = qorderUrl;
+
+ const modal = new bootstrap.Modal(document.getElementById('qrModal'));
+ modal.show();
+}
+
+function printQR() {
+ const content = document.getElementById('printableQR').innerHTML;
+ const printWindow = window.open('', '_blank');
+ printWindow.document.write('Print Table QR ');
+ printWindow.document.write(' ');
+ printWindow.document.write('');
+ printWindow.document.write('');
+ printWindow.document.write(content);
+ printWindow.document.write('');
+ printWindow.document.close();
+ setTimeout(() => {
+ printWindow.print();
+ printWindow.close();
+ }, 500);
+}
+
+
+
diff --git a/api/order.php b/api/order.php
index 21bfb8d..513e74e 100644
--- a/api/order.php
+++ b/api/order.php
@@ -29,11 +29,11 @@ try {
$table_number = null;
if ($order_type === 'dine-in') {
- $tid = $data['table_number'] ?? null; // Front-end sends ID as table_number
+ $tid = $data['table_id'] ?? ($data['table_number'] ?? null); // Support both table_id and table_number as numeric ID
if ($tid) {
// Validate table exists AND belongs to the correct outlet
$stmt = $pdo->prepare(
- "SELECT t.id, t.name
+ "SELECT t.id, t.table_number
FROM tables t
JOIN areas a ON t.area_id = a.id
WHERE t.id = ? AND a.outlet_id = ?"
@@ -42,7 +42,7 @@ try {
$table = $stmt->fetch(PDO::FETCH_ASSOC);
if ($table) {
$table_id = $table['id'];
- $table_number = $table['name'];
+ $table_number = $table['table_number'];
}
}
@@ -50,7 +50,7 @@ try {
if (!$table_id) {
// Optional: try to find the first available table for this outlet
$stmt = $pdo->prepare(
- "SELECT t.id, t.name
+ "SELECT t.id, t.table_number
FROM tables t
JOIN areas a ON t.area_id = a.id
WHERE a.outlet_id = ?
@@ -60,7 +60,7 @@ try {
$table = $stmt->fetch(PDO::FETCH_ASSOC);
if ($table) {
$table_id = $table['id'];
- $table_number = $table['name'];
+ $table_number = $table['table_number'];
}
}
}
@@ -105,7 +105,8 @@ try {
}
// Total amount will be recalculated on server to be safe
- $calculated_total = 0;
+ $calculated_subtotal = 0;
+ $calculated_vat = 0;
// First, process items to calculate real total and handle loyalty
$processed_items = [];
@@ -126,6 +127,7 @@ try {
if (!$product) continue;
$unit_price = get_product_price($product);
+ $vat_percent = floatval($product['vat_percent'] ?? 0);
$variant_name = null;
// Add variant adjustment
@@ -150,6 +152,7 @@ try {
'variant_name' => $variant_name,
'quantity' => $qty,
'unit_price' => $unit_price,
+ 'vat_percent' => $vat_percent,
'is_loyalty' => (bool)$product['is_loyalty']
];
}
@@ -230,14 +233,22 @@ try {
}
}
- // Recalculate Subtotal and Earned Points
- foreach ($processed_items as $pi) {
- $calculated_total += $pi['unit_price'] * $pi['quantity'];
+ // Recalculate Subtotal, VAT and Earned Points
+ foreach ($processed_items as &$pi) {
+ $item_subtotal = $pi['unit_price'] * $pi['quantity'];
+ $item_vat = $item_subtotal * ($pi['vat_percent'] / 100);
+
+ $pi['vat_amount'] = $item_vat;
+
+ $calculated_subtotal += $item_subtotal;
+ $calculated_vat += $item_vat;
+
// Award points for PAID loyalty items
if ($pi['is_loyalty'] && $pi['unit_price'] > 0 && $pi['quantity'] > 0) {
$points_awarded += $pi['quantity'] * $points_per_product;
}
}
+ unset($pi);
// Award Points
if ($customer_id && $loyalty_enabled && $points_awarded > 0) {
@@ -250,8 +261,7 @@ try {
$award_history_id = $pdo->lastInsertId();
}
- $vat = isset($data['vat']) ? floatval($data['vat']) : 0.00;
- $final_total = max(0, $calculated_total + $vat);
+ $final_total = max(0, $calculated_subtotal + $calculated_vat);
// User/Payment info
$user = get_logged_user();
@@ -266,7 +276,7 @@ try {
$userStmt->execute([$user_id]);
$commission_rate = (float)$userStmt->fetchColumn();
if ($commission_rate > 0) {
- $commission_amount = $calculated_total * ($commission_rate / 100);
+ $commission_amount = $calculated_subtotal * ($commission_rate / 100);
}
}
@@ -288,21 +298,21 @@ try {
$stmt = $pdo->prepare("UPDATE orders SET
outlet_id = ?, table_id = ?, table_number = ?, order_type = ?,
customer_id = ?, customer_name = ?, customer_phone = ?,
- payment_type_id = ?, total_amount = ?, discount = ?, user_id = ?,
+ payment_type_id = ?, total_amount = ?, discount = ?, vat = ?, user_id = ?,
commission_amount = ?, status = 'pending'
WHERE id = ?");
$stmt->execute([
$outlet_id, $table_id, $table_number, $order_type,
$customer_id, $customer_name, $customer_phone,
- $payment_type_id, $final_total, $vat, $user_id,
+ $payment_type_id, $final_total, 0, $calculated_vat, $user_id,
$commission_amount, $order_id
]);
$delStmt = $pdo->prepare("DELETE FROM order_items WHERE order_id = ?");
$delStmt->execute([$order_id]);
} else {
- $stmt = $pdo->prepare("INSERT INTO orders (outlet_id, table_id, table_number, order_type, customer_id, customer_name, customer_phone, payment_type_id, total_amount, discount, user_id, commission_amount, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'pending')");
- $stmt->execute([$outlet_id, $table_id, $table_number, $order_type, $customer_id, $customer_name, $customer_phone, $payment_type_id, $final_total, $vat, $user_id, $commission_amount]);
+ $stmt = $pdo->prepare("INSERT INTO orders (outlet_id, table_id, table_number, order_type, customer_id, customer_name, customer_phone, payment_type_id, total_amount, discount, vat, user_id, commission_amount, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'pending')");
+ $stmt->execute([$outlet_id, $table_id, $table_number, $order_type, $customer_id, $customer_name, $customer_phone, $payment_type_id, $final_total, 0, $calculated_vat, $user_id, $commission_amount]);
$order_id = $pdo->lastInsertId();
}
@@ -317,13 +327,13 @@ try {
}
// Insert Items and Update Stock
- $item_stmt = $pdo->prepare("INSERT INTO order_items (order_id, product_id, product_name, variant_id, variant_name, quantity, unit_price) VALUES (?, ?, ?, ?, ?, ?, ?)");
+ $item_stmt = $pdo->prepare("INSERT INTO order_items (order_id, product_id, product_name, variant_id, variant_name, quantity, unit_price, vat_percent, vat_amount) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stock_stmt = $pdo->prepare("UPDATE products SET stock_quantity = stock_quantity - ? WHERE id = ?");
$order_items_list = [];
foreach ($processed_items as $pi) {
- $item_stmt->execute([$order_id, $pi['product_id'], $pi['product_name'], $pi['variant_id'], $pi['variant_name'], $pi['quantity'], $pi['unit_price']]);
+ $item_stmt->execute([$order_id, $pi['product_id'], $pi['product_name'], $pi['variant_id'], $pi['variant_name'], $pi['quantity'], $pi['unit_price'], $pi['vat_percent'], $pi['vat_amount']]);
// Decrement Stock
$stock_stmt->execute([$pi['quantity'], $pi['product_id']]);
diff --git a/assets/js/main.js b/assets/js/main.js
index b9d949f..3d71c7b 100644
--- a/assets/js/main.js
+++ b/assets/js/main.js
@@ -40,6 +40,8 @@ document.addEventListener('DOMContentLoaded', () => {
const cartItemsContainer = document.getElementById('cart-items');
const cartTotalPrice = document.getElementById('cart-total-price');
const cartSubtotal = document.getElementById('cart-subtotal');
+ const cartVatAmount = document.getElementById('cart-vat-amount');
+ const cartVatRow = document.getElementById('cart-vat-row');
const cartVatInput = document.getElementById('cart-vat-input');
const quickOrderBtn = document.getElementById('quick-order-btn');
@@ -504,7 +506,9 @@ document.addEventListener('DOMContentLoaded', () => {
addToCart({
id: product.id, name: product.name, name_ar: product.name_ar || "",
price: parseFloat(product.price), base_price: parseFloat(product.price),
- hasVariants: false, quantity: 1, variant_id: null, variant_name: null, is_loyalty: parseInt(product.is_loyalty) === 1
+ hasVariants: false, quantity: 1, variant_id: null, variant_name: null,
+ is_loyalty: parseInt(product.is_loyalty) === 1,
+ vat_percent: parseFloat(product.vat_percent || 0)
});
}
};
@@ -526,7 +530,9 @@ document.addEventListener('DOMContentLoaded', () => {
addToCart({
id: product.id, name: product.name, name_ar: product.name_ar || "",
price: finalPrice, base_price: parseFloat(product.price),
- hasVariants: true, quantity: 1, variant_id: v.id, variant_name: v.name, is_loyalty: parseInt(product.is_loyalty) === 1
+ hasVariants: true, quantity: 1, variant_id: v.id, variant_name: v.name,
+ is_loyalty: parseInt(product.is_loyalty) === 1,
+ vat_percent: parseFloat(product.vat_percent || 0)
});
variantSelectionModal.hide();
};
@@ -572,6 +578,8 @@ document.addEventListener('DOMContentLoaded', () => {
if (cart.length === 0) {
cartItemsContainer.innerHTML = ``;
if (cartSubtotal) cartSubtotal.innerText = formatCurrency(0);
+ if (cartVatAmount) cartVatAmount.innerText = formatCurrency(0);
+ if (cartVatRow) cartVatRow.classList.add('d-none');
if (cartTotalPrice) cartTotalPrice.innerText = formatCurrency(0);
if (quickOrderBtn) { quickOrderBtn.disabled = true; quickOrderBtn.innerText = _t('quick_pay'); }
if (placeOrderBtn) { placeOrderBtn.disabled = true; placeOrderBtn.innerText = _t('save_bill'); }
@@ -580,9 +588,13 @@ document.addEventListener('DOMContentLoaded', () => {
cartItemsContainer.innerHTML = '';
let subtotal = 0;
+ let totalVat = 0;
cart.forEach((item, index) => {
const itemTotal = item.price * item.quantity;
+ const itemVat = itemTotal * (item.vat_percent / 100);
subtotal += itemTotal;
+ totalVat += itemVat;
+
const row = document.createElement('div');
row.className = 'd-flex justify-content-between align-items-center mb-3 border-bottom pb-2';
const itemName = (LANG === 'ar' && item.name_ar) ? item.name_ar : item.name;
@@ -592,7 +604,7 @@ document.addEventListener('DOMContentLoaded', () => {
${itemName}
${otherName ? `
${otherName}
` : ''}
-
${formatCurrency(item.price)}
+
${formatCurrency(item.price)} ${item.vat_percent > 0 ? `${item.vat_percent}% VAT ` : ''}
@@ -608,11 +620,16 @@ document.addEventListener('DOMContentLoaded', () => {
});
if (cartSubtotal) cartSubtotal.innerText = formatCurrency(subtotal);
- const vatRate = parseFloat(settings.vat_rate) || 0;
- const vat = subtotal * (vatRate / 100);
- if (cartVatInput) cartVatInput.value = vat.toFixed(2);
- const total = subtotal + vat;
+ if (cartVatAmount) cartVatAmount.innerText = formatCurrency(totalVat);
+ if (cartVatRow) {
+ if (totalVat > 0) cartVatRow.classList.remove('d-none');
+ else cartVatRow.classList.add('d-none');
+ }
+ if (cartVatInput) cartVatInput.value = totalVat.toFixed(3);
+
+ const total = subtotal + totalVat;
if (cartTotalPrice) cartTotalPrice.innerText = formatCurrency(total);
+
if (quickOrderBtn) { quickOrderBtn.disabled = false; quickOrderBtn.innerText = _t('quick_pay'); }
if (placeOrderBtn) { placeOrderBtn.disabled = false; placeOrderBtn.innerText = _t('save_bill'); }
}
@@ -648,9 +665,23 @@ document.addEventListener('DOMContentLoaded', () => {
window.processOrder = function(paymentTypeId, paymentTypeName) {
const orderTypeInput = document.querySelector('input[name="order_type"]:checked');
const orderType = orderTypeInput ? orderTypeInput.value : 'takeaway';
- const subtotal = cart.reduce((acc, item) => acc + (item.price * item.quantity), 0);
- const vatRate = parseFloat(settings.vat_rate) || 0;
- const vat = subtotal * (vatRate / 100);
+
+ let subtotal = 0;
+ let totalVat = 0;
+ const itemsData = cart.map(item => {
+ const itemTotal = item.price * item.quantity;
+ const itemVat = itemTotal * (item.vat_percent / 100);
+ subtotal += itemTotal;
+ totalVat += itemVat;
+ return {
+ product_id: item.id,
+ quantity: item.quantity,
+ unit_price: item.price,
+ variant_id: item.variant_id,
+ vat_percent: item.vat_percent,
+ vat_amount: itemVat
+ };
+ });
const orderData = {
order_id: currentOrderId,
@@ -659,9 +690,9 @@ document.addEventListener('DOMContentLoaded', () => {
customer_id: selectedCustomerId ? selectedCustomerId.value : null,
outlet_id: CURRENT_OUTLET ? CURRENT_OUTLET.id : 1,
payment_type_id: paymentTypeId,
- total_amount: subtotal + vat,
- vat: vat,
- items: cart.map(item => ({ product_id: item.id, quantity: item.quantity, unit_price: item.price, variant_id: item.variant_id })),
+ total_amount: subtotal + totalVat,
+ vat: totalVat,
+ items: itemsData,
redeem_loyalty: isLoyaltyRedemption
};
@@ -673,10 +704,13 @@ document.addEventListener('DOMContentLoaded', () => {
name: item.name,
variant_name: item.variant_name,
quantity: item.quantity,
- price: item.price
+ price: item.price,
+ vat_percent: item.vat_percent,
+ vat_amount: (item.price * item.quantity) * (item.vat_percent / 100)
})),
- total: subtotal + vat,
- vat: vat,
+ subtotal: subtotal,
+ total: subtotal + totalVat,
+ vat: totalVat,
orderType: orderType,
tableNumber: (orderType === 'dine-in') ? currentTableName : null,
date: new Date().toLocaleString('en-US', { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' }),
@@ -702,7 +736,7 @@ document.addEventListener('DOMContentLoaded', () => {
};
window.printThermalReceipt = function(data) {
- const width = 400;
+ const width = 450;
const height = 800;
const left = (screen.width - width) / 2;
const top = (screen.height - height) / 2;
@@ -717,7 +751,7 @@ document.addEventListener('DOMContentLoaded', () => {
const tr = {
'Order': 'الطلب', 'Type': 'النوع', 'Date': 'التاريخ', 'Staff': 'الموظف',
'Table': 'طاولة', 'Payment': 'الدفع', 'ITEM': 'الصنف', 'TOTAL': 'المجموع',
- 'Subtotal': 'المجموع الفرعي', 'VAT': 'ضريبة القيمة المضافة', 'Tax Included': 'شامل الضريبة',
+ 'Subtotal': 'المجموع الفرعي', 'VAT': 'الضريبة', 'Tax Included': 'شامل الضريبة',
'THANK YOU FOR YOUR VISIT!': 'شكراً لزيارتكم!', 'Please come again.': 'يرجى زيارتنا مرة أخرى.',
'Customer Details': 'تفاصيل العميل', 'Tel': 'هاتف', 'takeaway': 'سفري',
'dine-in': 'محلي', 'delivery': 'توصيل', 'VAT No': 'الرقم الضريبي', 'CTR No': 'رقم السجل التجاري'
@@ -730,6 +764,7 @@ document.addEventListener('DOMContentLoaded', () => {
${item.variant_name ? `
(${item.variant_name})
` : ''}
${item.quantity} x ${formatCurrency(item.price)}
+
${item.vat_percent > 0 ? item.vat_percent + '%' : '-'}
${formatCurrency(item.quantity * item.price)}
`).join('');
@@ -761,7 +796,6 @@ document.addEventListener('DOMContentLoaded', () => {
const loyaltyHtml = data.loyaltyRedeemed ? `
* Loyalty Reward Applied *
` : '';
- const subtotal = data.total - data.vat;
const logoHtml = settings.logo_url ? `
` : '';
const html = `
@@ -805,14 +839,20 @@ document.addEventListener('DOMContentLoaded', () => {
${customerHtml}
- ITEM / الصنف TOTAL / المجموع
+
+
+ ITEM / الصنف
+ VAT / الضريبة
+ TOTAL / المجموع
+
+
${itemsHtml}
- Subtotal / ${tr['Subtotal']} ${formatCurrency(subtotal)}
- ${Math.abs(data.vat) > 0 ? `${data.vat < 0 ? 'Discount' : 'VAT'} / ${tr['VAT']} ${data.vat < 0 ? '-' : '+'}${formatCurrency(Math.abs(data.vat))} ` : ''}
+ Subtotal / ${tr['Subtotal']} ${formatCurrency(data.subtotal)}
+ ${Math.abs(data.vat) > 0 ? `VAT / ${tr['VAT']} ${formatCurrency(Math.abs(data.vat))} ` : ''}
TOTAL / ${tr['TOTAL']} ${formatCurrency(data.total)}
@@ -841,4 +881,4 @@ document.addEventListener('DOMContentLoaded', () => {
const modal = new bootstrap.Modal(document.getElementById('qrRatingModal'));
modal.show();
};
-});
\ No newline at end of file
+});
diff --git a/pos.php b/pos.php
index 11ef67f..63aaad3 100644
--- a/pos.php
+++ b/pos.php
@@ -326,6 +326,11 @@ if (!$loyalty_settings) {
Subtotal
= format_currency(0) ?>