feat(issued-orders)!: sections replace flat terms/notes fields; Obsah title
Per user decision the rich-text sections now carry all free-form PDF content on issued orders: dropped columns delivery_terms, payment_terms, issued_by, notes (migration applied to dev+test) and their PDF blocks + form fields. Kept: order_text (moved from the bottom card into the Zakladni udaje grid, replacing the Vystavil field) and internal_notes (now the only field in the bottom card, never printed). Sections card is titled 'Obsah' on issued orders; offers keep 'Rozsah projektu' and are untouched. Legacy clients sending the dropped keys are silently stripped (tested). PDF footer 'Vystavil:' stays - it prints the logged-in user, not the dropped column. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,11 +35,7 @@ export interface IssuedOrderInput {
|
||||
order_date?: string | null;
|
||||
delivery_date?: string | null;
|
||||
language?: string;
|
||||
delivery_terms?: string | null;
|
||||
payment_terms?: string | null;
|
||||
issued_by?: string | null;
|
||||
order_text?: string | null;
|
||||
notes?: string | null;
|
||||
internal_notes?: string | null;
|
||||
items?: IssuedOrderItemInput[];
|
||||
sections?: IssuedOrderSectionInput[];
|
||||
@@ -127,11 +123,7 @@ const NON_STATUS_UPDATE_FIELDS = [
|
||||
"order_date",
|
||||
"delivery_date",
|
||||
"language",
|
||||
"delivery_terms",
|
||||
"payment_terms",
|
||||
"issued_by",
|
||||
"order_text",
|
||||
"notes",
|
||||
"internal_notes",
|
||||
"items",
|
||||
"sections",
|
||||
@@ -322,13 +314,7 @@ export async function createIssuedOrder(body: IssuedOrderInput) {
|
||||
? new Date(String(body.delivery_date))
|
||||
: null,
|
||||
language: body.language ? String(body.language) : "cs",
|
||||
delivery_terms: body.delivery_terms
|
||||
? String(body.delivery_terms)
|
||||
: null,
|
||||
payment_terms: body.payment_terms ? String(body.payment_terms) : null,
|
||||
issued_by: body.issued_by ? String(body.issued_by) : null,
|
||||
order_text: body.order_text ? String(body.order_text) : null,
|
||||
notes: body.notes ? String(body.notes) : null,
|
||||
internal_notes: body.internal_notes
|
||||
? String(body.internal_notes)
|
||||
: null,
|
||||
@@ -406,14 +392,7 @@ export async function updateIssuedOrder(id: number, body: IssuedOrderInput) {
|
||||
const data: Record<string, unknown> = { modified_at: new Date() };
|
||||
|
||||
if (editable) {
|
||||
const strFields = [
|
||||
"currency",
|
||||
"language",
|
||||
"delivery_terms",
|
||||
"payment_terms",
|
||||
"issued_by",
|
||||
"order_text",
|
||||
];
|
||||
const strFields = ["currency", "language", "order_text"];
|
||||
for (const f of strFields) {
|
||||
if (body[f] !== undefined) data[f] = body[f] ? String(body[f]) : null;
|
||||
}
|
||||
@@ -440,8 +419,6 @@ export async function updateIssuedOrder(id: number, body: IssuedOrderInput) {
|
||||
data.delivery_date = body.delivery_date
|
||||
? new Date(String(body.delivery_date))
|
||||
: null;
|
||||
if (body.notes !== undefined)
|
||||
data.notes = body.notes ? String(body.notes) : null;
|
||||
if (body.internal_notes !== undefined)
|
||||
data.internal_notes = body.internal_notes
|
||||
? String(body.internal_notes)
|
||||
|
||||
Reference in New Issue
Block a user