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:
@@ -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
|
||||
|
||||
@@ -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]) => (
|
||||
|
||||
Reference in New Issue
Block a user