Fix item counts, PR/QT conversions, validation and department loss
This commit is contained in:
@@ -194,7 +194,7 @@
|
||||
<td><input type="number" class="form-control form-control-sm item_qty" value="${item.quantity || 1}" min="0.0001" step="any" oninput="recalc_totals()"></td>
|
||||
<td><input type="number" class="form-control form-control-sm item_price" value="${item.unit_price || item.price || 0}" min="0" step="any" oninput="recalc_totals()"></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()">
|
||||
<input type="number" class="form-control form-control-sm item_tax_rate" 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 || item.price || 0), 2)}</td>
|
||||
@@ -371,8 +371,8 @@
|
||||
recalc_totals();
|
||||
});
|
||||
|
||||
$(function() {
|
||||
load_departments('department_id');
|
||||
$(async function() {
|
||||
await Promise.resolve(load_departments('department_id')).catch(function() {});
|
||||
flatpickr('#po_date', { dateFormat: 'd/m/Y', allowInput: true });
|
||||
flatpickr('#expected_date', { dateFormat: 'd/m/Y', allowInput: true });
|
||||
if (po_id) {
|
||||
|
||||
Reference in New Issue
Block a user