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:
BOHA
2026-03-23 19:47:15 +01:00
parent 2540efbec2
commit c4c4433561
6 changed files with 19 additions and 2 deletions

View File

@@ -77,6 +77,7 @@ interface InvoiceForm {
payment_method: string
constant_symbol: string
issued_by: string
billing_text: string
notes: string
bank_account_id: number | string
bank_name: string
@@ -271,6 +272,7 @@ export default function InvoiceDetail() {
payment_method: 'Příkazem',
constant_symbol: '0308',
issued_by: user?.fullName || '',
billing_text: '',
notes: '',
bank_account_id: '',
bank_name: '',
@@ -855,6 +857,16 @@ export default function InvoiceDetail() {
</FormField>
</div>
<FormField label="Text fakturace (na PDF)">
<input
type="text"
value={form.billing_text}
onChange={(e) => setForm(prev => ({ ...prev, billing_text: e.target.value }))}
className="admin-form-input"
placeholder="Fakturujeme Vám za: (ponechte prázdné pro výchozí)"
/>
</FormField>
<div className="admin-form-row">
<FormField label="Datum vystavení" error={errors.issue_date} required>
<AdminDatePicker mode="date" value={form.issue_date} onChange={(val: string) => { setForm(prev => ({ ...prev, issue_date: val })); setErrors(prev => ({ ...prev, issue_date: '' })) }} />