Fix item counts, PR/QT conversions, validation and department loss
This commit is contained in:
@@ -326,7 +326,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" class="form-control form-control-sm item_tax_rate"
|
||||
value="${parseFloat(item.tax_rate || 0).toFixed(2)}" min="0" max="100" step="0.01" oninput="recalc_totals()">
|
||||
value="${line_tax_rate(item).toFixed(2)}" min="0" max="100" step="0.01" oninput="recalc_totals()">
|
||||
<input type="hidden" class="item_tax_amount" value="${item.tax_amount || 0}">
|
||||
</td>
|
||||
<td class="item_total text-end">${format_number((item.quantity || 1) * (item.unit_price || 0), 2)}</td>
|
||||
@@ -974,7 +974,7 @@
|
||||
// ── Boot ─────────────────────────────────────────────────────────────────
|
||||
$(async function() {
|
||||
try {
|
||||
load_departments('department_id');
|
||||
await Promise.resolve(load_departments('department_id')).catch(function() {});
|
||||
await load_location_config();
|
||||
await retrieve_warehouses();
|
||||
|
||||
|
||||
+1
-2
@@ -226,8 +226,7 @@
|
||||
var body = '';
|
||||
|
||||
$.each(page_data, function(i, o) {
|
||||
var items = JSON.parse(o.items || '[]');
|
||||
var item_count = items.length;
|
||||
var item_count = parseInt(o.item_count) || 0;
|
||||
var can_cancel = parseInt(o.status) >= -2 && parseInt(o.status) <= 1;
|
||||
|
||||
body += `<tr>
|
||||
|
||||
@@ -218,9 +218,7 @@
|
||||
}
|
||||
|
||||
$.each(rows, function(i, r) {
|
||||
var items = [];
|
||||
try { items = JSON.parse(r.items || '[]'); } catch(e) {}
|
||||
var item_count = items.length;
|
||||
var item_count = parseInt(r.item_count) || 0;
|
||||
body += `<tr>
|
||||
<td class="py-3 fw-semibold">${escape_html(r.return_number || '')}</td>
|
||||
<td class="py-3">
|
||||
|
||||
Reference in New Issue
Block a user