feat: editable billing text on invoices
- Added billing_text column to invoices table (VARCHAR 500) - Prisma migration: 20260323_add_billing_text - Form field on invoice create page with placeholder - PDF uses billing_text, falls back to default translation - Stored on create and editable on draft invoices Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -251,6 +251,7 @@ export async function createInvoice(body: Record<string, any>) {
|
||||
due_date: body.due_date ? new Date(String(body.due_date)) : null,
|
||||
tax_date: body.tax_date ? new Date(String(body.tax_date)) : null,
|
||||
issued_by: body.issued_by ? String(body.issued_by) : null,
|
||||
billing_text: body.billing_text ? String(body.billing_text) : null,
|
||||
notes: body.notes ? String(body.notes) : null,
|
||||
internal_notes: body.internal_notes ? String(body.internal_notes) : null,
|
||||
},
|
||||
@@ -293,7 +294,7 @@ export async function updateInvoice(id: number, body: Record<string, any>) {
|
||||
// Only allow full editing in 'issued' state
|
||||
const isDraft = currentStatus === 'issued';
|
||||
if (isDraft) {
|
||||
const strFields = ['currency', 'payment_method', 'constant_symbol', 'bank_name', 'bank_swift', 'bank_iban', 'bank_account', 'issued_by'];
|
||||
const strFields = ['currency', 'payment_method', 'constant_symbol', 'bank_name', 'bank_swift', 'bank_iban', 'bank_account', 'issued_by', 'billing_text'];
|
||||
for (const f of strFields) {
|
||||
if (body[f] !== undefined) data[f] = body[f] ? String(body[f]) : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user