= h(tr('يعيد الرقم القادم لطلبات العيد إلى 1 للطلبات الجديدة فقط، بدون تغيير أرقام الطلبات السابقة.', 'Resets the next Eid order serial to 1 for new orders only, without changing older saved orders.')) ?>
+
+
= h(tr('طلبات العيد', 'Eid orders')) ?>
+
= h(tr('إعادة ضبط التسلسل الموسمي', 'Reset seasonal serial')) ?>
+
= h(tr('يعيد الرقم القادم لطلبات العيد إلى 1 للطلبات الجديدة فقط، بدون تغيير أرقام الطلبات السابقة.', 'Resets the next Eid order serial to 1 for new orders only, without changing older saved orders.')) ?>
+
-
-
-
-
= h(tr('الرقم القادم', 'Next serial')) ?>
+
+
= h(tr('الرقم القادم', 'Next serial')) ?>
+
= h(eid_serial_label($eidSerialNext)) ?>
+
+ = h(tr('إعادة الضبط إلى 1', 'Reset to 1')) ?>
+
-
- = h(tr('إعادة الضبط إلى 1', 'Reset to 1')) ?>
-
@@ -355,9 +356,18 @@
margin-top: -0.125rem;
}
+ #settingsModal .settings-eid-header-row {
+ flex-wrap: nowrap;
+ }
+
#settingsModal .settings-eid-reset-box {
- padding-top: 0.875rem;
- padding-bottom: 0.875rem;
+ flex: 0 0 auto;
+ min-width: 290px;
+ align-self: flex-start;
+ }
+
+ #settingsModal .settings-eid-inline-controls {
+ justify-content: space-between;
}
#settingsModal .settings-inline-save {
@@ -380,6 +390,15 @@
width: 100%;
justify-content: flex-end;
}
+
+ #settingsModal .settings-eid-header-row {
+ flex-wrap: wrap;
+ }
+
+ #settingsModal .settings-eid-reset-box {
+ width: 100%;
+ min-width: 0;
+ }
}
#wablasSettingsModal {
diff --git a/includes/sale_form.php b/includes/sale_form.php
index 333df6b..d022d01 100644
--- a/includes/sale_form.php
+++ b/includes/sale_form.php
@@ -15,6 +15,7 @@ $savePrintLabel = $savePrintLabel ?? tr('حفظ مع الطباعة', 'Save with
$error = '';
$paymentAmountInput = (string) ($_POST['payment_amount'] ?? '');
$catalog = catalog();
+$globalVatPercent = max(0, (float) get_setting('vat_percentage', 5));
$allowedBranches = get_user_branches($user);
$deliveryOptions = eid_delivery_status_options();
$selectedDeliveryStatus = trim((string) ($_POST['delivery_status'] ?? ($isEidOrder ? 'pending' : '')));
@@ -110,8 +111,7 @@ $itemNote = trim((string) ($item['item_note'] ?? ''));
: (float) $product['price'];
$lineTotal = $price * $qty;
- $vatPercent = (float) ($product['vat'] ?? 0);
- // Assuming price is inclusive of VAT:
+ $vatPercent = $globalVatPercent;
$itemVat = $lineTotal * ($vatPercent / 100);
$totalVat += $itemVat;
@@ -547,7 +547,7 @@ require __DIR__ . '/header.php';
0.000
- = h(tr('الضريبة (مضافة)', 'VAT (Added)')) ?>
+ = h(tr('الضريبة (' . number_format($globalVatPercent, 2) . '%)', 'VAT (' . number_format($globalVatPercent, 2) . '%)')) ?>
0.000
@@ -879,7 +879,7 @@ function renderInvoice() {
const item = invoiceItems[sku];
const lineTotal = item.qty * item.price;
- const vatPercent = parseFloat(catalogData[sku].vat) || 0;
+ const vatPercent = = json_encode((float) $globalVatPercent) ?>;
const itemVat = lineTotal * (vatPercent / 100);
totalVat += itemVat;