feat: dodaj ishodište i PDF račune za putni nalog
Some checks failed
ERP CI/CD Pipeline / test (push) Has been cancelled
ERP CI/CD Pipeline / Deploy (server git pull + compose) (push) Has been cancelled

Dodano je origin_location polje kroz backend model, serializer, admin i UI
modal za kreiranje/uređivanje putnog naloga (default: Zagreb).

Računi putnog naloga sada prihvaćaju slike i PDF datoteke, uz backend
validaciju formata, podršku za serving PDF-a i prilagodbu preview prikaza.

Za greške uploada računa dodan je error toast kako bi poruke validacije bile
vidljive korisniku odmah u sučelju.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
mariomitte
2026-07-19 19:54:15 +02:00
parent cbcbf0b3af
commit d35eaeccf4
12 changed files with 175 additions and 14 deletions

View File

@@ -747,9 +747,14 @@ export async function createWorkOrderInvoice(workOrderId, data = {}, signal = nu
formData.append('image', data.imageFile);
}
const options = signal ? { signal } : {};
const response = await api.post('fleet/work-order-invoices/', formData, options);
showToast('Račun je uspješno spremljen.', 'success');
return response;
try {
const response = await api.post('fleet/work-order-invoices/', formData, options);
showToast('Račun je uspješno spremljen.', 'success');
return response;
} catch (error) {
showToast(error?.message || 'Neuspješno spremanje računa.', 'error');
throw error;
}
}
async function _refreshNotificationsAsync() {