feat(issued-orders): editable PDF heading 'Text objednavky (na PDF)' (order_text)

New nullable issued_orders.order_text column (migration applied to dev+test). The heading above the PDF items table is now editable per order, mirroring invoices' billing_text: empty falls back to the default, which is now 'Objednavame si u Vas:' per user wording. Field sits above Dodaci podminky in the detail form; persisted via create + update strFields (both schemas - the invoices Update-schema gap is not repeated). Tests: persistence round-trip incl. null-clears, PDF custom heading + default fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-10 12:16:40 +02:00
parent 638264fc7c
commit ca1f07671f
8 changed files with 69 additions and 2 deletions

View File

@@ -45,6 +45,7 @@ export interface IssuedOrderDetail extends IssuedOrder {
delivery_terms: string | null;
payment_terms: string | null;
issued_by: string | null;
order_text: string | null;
notes: string | null;
internal_notes: string | null;
items: IssuedOrderItem[];

View File

@@ -171,6 +171,7 @@ interface OrderForm {
delivery_terms: string;
payment_terms: string;
issued_by: string;
order_text: string;
notes: string;
internal_notes: string;
status: string;
@@ -520,6 +521,7 @@ export default function IssuedOrderDetail() {
delivery_terms: "",
payment_terms: "",
issued_by: user?.fullName || "",
order_text: "",
notes: "",
internal_notes: "",
status: "draft",
@@ -621,6 +623,7 @@ export default function IssuedOrderDetail() {
delivery_terms: d.delivery_terms || "",
payment_terms: d.payment_terms || "",
issued_by: d.issued_by || "",
order_text: d.order_text || "",
notes: d.notes || "",
internal_notes: d.internal_notes || "",
status: d.status,
@@ -779,6 +782,7 @@ export default function IssuedOrderDetail() {
delivery_terms: form.delivery_terms,
payment_terms: form.payment_terms,
issued_by: form.issued_by,
order_text: form.order_text || null,
notes: form.notes,
internal_notes: form.internal_notes,
items: items
@@ -1419,6 +1423,16 @@ export default function IssuedOrderDetail() {
{/* Notes & terms */}
<Card sx={{ mb: 3 }}>
<Field label="Text objednávky (na PDF)">
<TextField
value={form.order_text}
disabled={!editable}
onChange={(e) =>
setForm((prev) => ({ ...prev, order_text: e.target.value }))
}
placeholder="Objednáváme si u Vás: (ponechte prázdné pro výchozí)"
/>
</Field>
<Field label="Dodací podmínky">
<TextField
value={form.delivery_terms}