update main.js

This commit is contained in:
Flatlogic Bot 2026-04-03 10:23:05 +00:00
parent 8f58dec2a3
commit 6a8f33fcc9
5 changed files with 9 additions and 9 deletions

View File

@ -502,11 +502,11 @@ function printThermalReceipt() {
<span><strong>Type:</strong> ${data.orderType.toUpperCase()}</span>
<span><strong>${tr['Type']}:</strong> ${tr[data.orderType] || data.orderType}</span>
</div>
${data.source ? \`
${data.source ? `
<div class="order-info-row">
<span><strong>Source:</strong> ${data.source.toUpperCase()}</span>
<span><strong>${tr['Source'] || "Source"}:</strong> ${data.source.toUpperCase()}</span>
</div>\` : ""}
</div>` : ""}
<div class="order-info-row">
<span><strong>Date:</strong> ${data.date}</span>
<span><strong>${tr['Date']}:</strong> ${data.date}</span>

View File

@ -92,7 +92,7 @@ try {
if ($existing) {
$customer_id = $existing['id'];
} else {
$stmt = $pdo->prepare("INSERT INTO customers (name, phone) VALUES (?, ?, ?)");
$stmt = $pdo->prepare("INSERT INTO customers (name, phone) VALUES (?, ?)");
$stmt->execute([$customer_name, $customer_phone]);
$customer_id = $pdo->lastInsertId();
}
@ -254,7 +254,7 @@ try {
->execute([$redemptions_done, $customer_id]);
// Record Loyalty History (Deduction)
$historyStmt = $pdo->prepare("INSERT INTO loyalty_points_history (customer_id, points_change, reason) VALUES (?, ?, ?, 'Redeemed Free Product(s)')");
$historyStmt = $pdo->prepare("INSERT INTO loyalty_points_history (customer_id, points_change, reason) VALUES (?, ?, 'Redeemed Free Product(s)')");
$historyStmt->execute([$customer_id, -$points_deducted]);
$redeem_history_id = $pdo->lastInsertId();
@ -293,7 +293,7 @@ try {
$awardStmt->execute([$points_awarded, $customer_id]);
// Record Loyalty History (Award)
$historyStmt = $pdo->prepare("INSERT INTO loyalty_points_history (customer_id, points_change, reason) VALUES (?, ?, ?, 'Earned from Products')");
$historyStmt = $pdo->prepare("INSERT INTO loyalty_points_history (customer_id, points_change, reason) VALUES (?, ?, 'Earned from Products')");
$historyStmt->execute([$customer_id, $points_awarded]);
$award_history_id = $pdo->lastInsertId();
}
@ -371,7 +371,7 @@ 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, vat_percent, vat_amount) 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 = [];

View File

@ -941,7 +941,7 @@ document.addEventListener('DOMContentLoaded', () => {
<div class="order-info">
<div class="order-info-row"><span><strong>Order:</strong> #${data.orderId}</span><span><strong>${tr['Order']}:</strong> #${data.orderId}</span></div>
<div class="order-info-row"><span><strong>Type:</strong> ${data.orderType.toUpperCase()}</span><span><strong>${tr['Type']}:</strong> ${tr[data.orderType] || data.orderType}</span></div>
${data.source ? \`<div class="order-info-row"><span><strong>Source:</strong> ${data.source.toUpperCase()}</span><span><strong>${tr['Source'] || "Source"}:</strong> ${data.source.toUpperCase()}</span></div>\` : ""}
${data.source ? `<div class="order-info-row"><span><strong>Source:</strong> ${data.source.toUpperCase()}</span><span><strong>${tr['Source'] || "Source"}:</strong> ${data.source.toUpperCase()}</span></div>` : ""}
<div class="order-info-row"><span><strong>Date:</strong> ${data.date}</span><span><strong>${tr['Date']}:</strong> ${data.date}</span></div>
<div class="order-info-row"><span><strong>Staff:</strong> ${CURRENT_USER.name}</span><span><strong>${tr['Staff']}:</strong> ${CURRENT_USER.name}</span></div>
</div>

View File

@ -282,7 +282,7 @@ function renderOrders(orders) {
</div>
<div class="card-body">
<h5 class="card-title mb-3">
${order.order_type === 'dine-in' ? \`Table ${order.table_number}\` : order.order_type.toUpperCase()}
${order.order_type === 'dine-in' ? `Table ${order.table_number}` : order.order_type.toUpperCase()}
<br><small class="text-white badge bg-dark opacity-75">${order.source ? order.source.toUpperCase() : "POS"}</small>
${order.customer_name ? `<br><small class="text-muted">${order.customer_name}</small>` : ''}
${order.car_plate ? `<br><small class="text-muted"><i class="bi bi-car-front"></i> ${order.car_plate}</small>` : ''}

View File

@ -1 +1 @@
<?php // Cleanup