Ilości ujemne w zamówieniu (Ilość)

This commit is contained in:
2026-03-30 09:43:59 +02:00
parent 9023b9a5ed
commit 7da3865110
5 changed files with 49 additions and 32 deletions
+5 -2
View File
@@ -501,7 +501,9 @@ function getStatusClass($status) {
</select>`;
} else if (fieldName === 'delivery_date') {
inputHTML = `<input type="date" class="inline-input" value="${currentText}">`;
} else if (fieldName === 'quantity' || fieldName === 'price_per_unit') {
} else if (fieldName === 'quantity') {
inputHTML = `<input type="number" min="1" step="1" class="inline-input" style="width: 70px;" value="${currentText}">`;
} else if (fieldName === 'price_per_unit') {
inputHTML = `<input type="number" step="0.01" class="inline-input" style="width: 70px;" value="${currentText}">`;
} else {
inputHTML = `<input type="text" class="inline-input" value="${currentText}">`;
@@ -558,7 +560,7 @@ function getStatusClass($status) {
<td></td>
<td class="text-muted"><span class="badge bg-info text-dark">Nowe</span></td>
<td><input type="text" class="form-control form-control-sm border-primary" id="add-prod" placeholder="Nazwa produktu..."></td>
<td><input type="number" class="form-control form-control-sm border-primary" id="add-qty" value="1" style="width: 60px;"></td>
<td><input type="number" class="form-control form-control-sm border-primary" id="add-qty" value="1" min="1" step="1" style="width: 60px;"></td>
<td><input type="text" class="form-control form-control-sm border-primary" id="add-place" placeholder="Sklep..."></td>
<td><input type="text" class="form-control form-control-sm border-primary" id="add-price" placeholder="0.00" style="width: 80px;"></td>
<td class="text-muted small">Brak</td>
@@ -581,6 +583,7 @@ function getStatusClass($status) {
const price = document.getElementById('add-price').value;
if(!prod) { alert("Nazwa produktu jest obowiązkowa!"); document.getElementById('add-prod').focus(); return; }
if(!qty || Number(qty) < 1) { alert("Ilość musi być większa od zera!"); document.getElementById('add-qty').focus(); return; }
try {
let response = await fetch('ajax_add_row.php', {