|
|
|
@ -501,7 +501,9 @@ function getStatusClass($status) {
|
|
|
|
</select>`;
|
|
|
|
</select>`;
|
|
|
|
} else if (fieldName === 'delivery_date') {
|
|
|
|
} else if (fieldName === 'delivery_date') {
|
|
|
|
inputHTML = `<input type="date" class="inline-input" value="${currentText}">`;
|
|
|
|
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}">`;
|
|
|
|
inputHTML = `<input type="number" step="0.01" class="inline-input" style="width: 70px;" value="${currentText}">`;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
inputHTML = `<input type="text" class="inline-input" value="${currentText}">`;
|
|
|
|
inputHTML = `<input type="text" class="inline-input" value="${currentText}">`;
|
|
|
|
@ -558,7 +560,7 @@ function getStatusClass($status) {
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
|
|
<td class="text-muted"><span class="badge bg-info text-dark">Nowe</span></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="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-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><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>
|
|
|
|
<td class="text-muted small">Brak</td>
|
|
|
|
@ -581,6 +583,7 @@ function getStatusClass($status) {
|
|
|
|
const price = document.getElementById('add-price').value;
|
|
|
|
const price = document.getElementById('add-price').value;
|
|
|
|
|
|
|
|
|
|
|
|
if(!prod) { alert("Nazwa produktu jest obowiązkowa!"); document.getElementById('add-prod').focus(); return; }
|
|
|
|
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 {
|
|
|
|
try {
|
|
|
|
let response = await fetch('ajax_add_row.php', {
|
|
|
|
let response = await fetch('ajax_add_row.php', {
|
|
|
|
|