feat(invoices): Persian line items + elegant client-side PDF download

- Translate persisted English invoice line labels/descriptions/reasons to
  Persian at display time (new lib/invoice-labels.ts), covering both new and
  historical invoices without a data migration.
- Generate a styled, RTL Persian invoice PDF on the client (lib/invoice-pdf.ts)
  with the Abrban logo, line-item table and totals, via html2canvas + jsPDF.
- Wire both the user and admin invoice pages to the translator and new download.
- Add invoices.pdf dictionary keys (fa/en).
- Remove the now-dead ASCII-only backend PDF endpoints and generateInvoicePdf.
- Add frontend/.npmrc (npmmirror registry + high timeouts) for Iran-network installs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
keyhan
2026-06-19 19:59:22 +03:30
parent 78ed95b29b
commit 4d64fda227
11 changed files with 677 additions and 133 deletions
+15
View File
@@ -705,6 +705,21 @@ const en: Dictionary = {
statusUpdated: 'Invoice status updated',
statusUpdateFailed: 'Failed to update invoice status',
reasonRequired: 'Reason is required for manual status changes',
pdf: {
documentTitle: 'Invoice',
tagline: 'Cloud infrastructure, in your control',
invoiceNumberLabel: 'Invoice number',
colIndex: '#',
colDesc: 'Description',
colAmount: 'Amount',
customer: 'Customer',
application: 'Application',
createdAt: 'Issued on',
paidAt: 'Paid on',
subtotal: 'Subtotal',
generatedAt: 'This document was generated automatically on {date}.',
footer: 'Abrban — abrban.com',
},
},
logs: {
title: 'Logs',