feat(nas): archive issued-order PDFs to NAS_ORDERS; split NAS_FINANCIALS_PATH into NAS_INVOICES + NAS_ORDERS

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-09 20:52:06 +02:00
parent 313d9218c1
commit 841ab676ec
11 changed files with 158 additions and 62 deletions

View File

@@ -775,6 +775,18 @@ export default function IssuedOrderDetail() {
alert.success(
isEdit ? "Objednávka byla uložena" : "Objednávka byla vytvořena",
);
// Archive the PDF to NAS for any non-draft order (create-as-sent,
// finalize draft→sent, or editing an already-live order). A draft has no
// PO number, so it is skipped (the backend also guards on po_number).
// Fire-and-forget: never block the success toast or navigation.
const recordId = isEdit ? id : data.id;
const effectiveStatus = targetStatus ?? form.status;
if (recordId && effectiveStatus !== "draft") {
apiFetch(`${API_BASE}/issued-orders-pdf/${recordId}?save=1`).catch(
() => {},
);
}
// Reflect the just-saved status locally. On CREATE the component is reused
// for the redirect to the new order's detail and the one-shot edit-mode
// hydration won't re-run (dataReady stays true), so without this the page

View File

@@ -758,7 +758,8 @@ export default function Settings() {
{(
[
["Projekty", si.nas?.projects],
["Finance", si.nas?.financials],
["Faktury", si.nas?.invoices],
["Objednávky", si.nas?.orders],
["Nabídky", si.nas?.offers],
] as [string, Record<string, any>][]
).map(([label, info]) => (