@aibrains/pdf-renderer 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoicePdf = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const renderer_1 = require("@react-pdf/renderer");
6
+ const Document_1 = require("../primitives/Document");
7
+ const Page_1 = require("../primitives/Page");
8
+ const BrandedHeader_1 = require("../primitives/BrandedHeader");
9
+ const BrandedFooter_1 = require("../primitives/BrandedFooter");
10
+ const Watermark_1 = require("../primitives/Watermark");
11
+ const KeyValueTable_1 = require("../components/KeyValueTable");
12
+ const LineItemTable_1 = require("../components/LineItemTable");
13
+ const TotalsBlock_1 = require("../components/TotalsBlock");
14
+ const SignatureLine_1 = require("../components/SignatureLine");
15
+ const i18n_1 = require("../core/i18n");
16
+ const format_1 = require("../core/format");
17
+ const fonts_1 = require("../core/fonts");
18
+ const theme_1 = require("../core/theme");
19
+ const styles = renderer_1.StyleSheet.create({
20
+ metaBlock: {
21
+ marginTop: theme_1.DEFAULT_SPACING.md,
22
+ marginBottom: theme_1.DEFAULT_SPACING.md,
23
+ },
24
+ sectionTitle: {
25
+ fontSize: theme_1.DEFAULT_FONT_SIZE.md,
26
+ fontWeight: 700,
27
+ color: theme_1.DEFAULT_COLORS.text,
28
+ marginBottom: theme_1.DEFAULT_SPACING.xs,
29
+ },
30
+ sectionTitleSecondary: {
31
+ fontSize: theme_1.DEFAULT_FONT_SIZE.sm,
32
+ color: theme_1.DEFAULT_COLORS.textMuted,
33
+ marginBottom: theme_1.DEFAULT_SPACING.sm,
34
+ },
35
+ notesBlock: {
36
+ marginTop: theme_1.DEFAULT_SPACING.md,
37
+ padding: theme_1.DEFAULT_SPACING.sm,
38
+ backgroundColor: '#F8F9FA',
39
+ borderLeftWidth: 3,
40
+ borderLeftColor: theme_1.DEFAULT_COLORS.border,
41
+ },
42
+ notesLabel: {
43
+ fontSize: theme_1.DEFAULT_FONT_SIZE.sm,
44
+ fontWeight: 700,
45
+ color: theme_1.DEFAULT_COLORS.text,
46
+ marginBottom: theme_1.DEFAULT_SPACING.xs,
47
+ },
48
+ notesText: {
49
+ fontSize: theme_1.DEFAULT_FONT_SIZE.sm,
50
+ color: theme_1.DEFAULT_COLORS.text,
51
+ },
52
+ });
53
+ /**
54
+ * Build a one-line label per the template's labelLanguages. Returns the
55
+ * primary translation; the caller renders the secondary (if present)
56
+ * separately via `buildSecondary`.
57
+ */
58
+ function buildPrimary(key, langs) {
59
+ return (0, i18n_1.t)('invoice', key, langs[0]);
60
+ }
61
+ /**
62
+ * Returns the secondary-language label when the template is dual-language,
63
+ * else undefined. The caller renders it stacked below the primary at 80%
64
+ * size with the same family.
65
+ */
66
+ function buildSecondary(key, langs) {
67
+ return langs.length >= 2 ? (0, i18n_1.t)('invoice', key, langs[1]) : undefined;
68
+ }
69
+ /**
70
+ * Dual-language label for free-form labels (not for the table headers which
71
+ * use a single string and are themselves bilingual via Devanagari font run).
72
+ */
73
+ const dualLabelStyles = renderer_1.StyleSheet.create({
74
+ primary: {
75
+ fontSize: theme_1.DEFAULT_FONT_SIZE.sm,
76
+ color: theme_1.DEFAULT_COLORS.text,
77
+ },
78
+ secondary: {
79
+ fontSize: theme_1.DEFAULT_FONT_SIZE.sm * 0.8,
80
+ color: theme_1.DEFAULT_COLORS.textMuted,
81
+ },
82
+ });
83
+ /** Stacked dual-language label primitive (small enough to inline here). */
84
+ const DualLabel = ({ primary, secondary }) => ((0, jsx_runtime_1.jsxs)(renderer_1.View, { children: [(0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [dualLabelStyles.primary, { fontFamily: (0, fonts_1.pickFontFamily)(primary) }], children: primary }), secondary && ((0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [dualLabelStyles.secondary, { fontFamily: (0, fonts_1.pickFontFamily)(secondary) }], children: secondary }))] }));
85
+ const InvoicePdf = ({ data, template, branding, settings, }) => {
86
+ var _a, _b, _c, _d, _e, _f, _g, _h;
87
+ const langs = template.labelLanguages;
88
+ const isDualLang = langs.length >= 2;
89
+ // Number + currency formatters bound once per render
90
+ const numberGrouping = template.numberFormat === 'auto-from-workspace'
91
+ ? 'western'
92
+ : template.numberFormat;
93
+ const renderNumber = (v) => (0, format_1.formatNumber)(v !== null && v !== void 0 ? v : 0, numberGrouping);
94
+ // Currency display: shared-types `formatCurrency` exposes `showSymbol` only;
95
+ // map V1 `'symbol'` → showSymbol:true and `'iso-code'`/`'name'` → false (the
96
+ // ISO code prefix is added by the shared-types implementation as the
97
+ // fallback shape). When showSymbol is true the symbol/native symbol is used.
98
+ const renderCurrency = (v) => (0, format_1.formatCurrency)(v, data.currency, {
99
+ locale: settings.defaultLocale,
100
+ showSymbol: template.currencyDisplay === 'symbol',
101
+ });
102
+ // Header label resolution — uses BrandedHeader's own config shape
103
+ const headerConfig = {
104
+ showLogo: template.header.showLogo,
105
+ showSchoolName: template.header.showSchoolName,
106
+ showSchoolAddress: template.header.showSchoolAddress,
107
+ showContact: template.header.showContact,
108
+ tagline: template.header.tagline,
109
+ primaryColor: (_a = template.brandingOverrides) === null || _a === void 0 ? void 0 : _a.primaryColor,
110
+ };
111
+ const headerBranding = {
112
+ logoSrc: (_c = (_b = template.brandingOverrides) === null || _b === void 0 ? void 0 : _b.logoSrc) !== null && _c !== void 0 ? _c : branding.logoSrc,
113
+ schoolName: branding.schoolName,
114
+ addressLines: (_e = (_d = template.brandingOverrides) === null || _d === void 0 ? void 0 : _d.addressLines) !== null && _e !== void 0 ? _e : branding.addressLines,
115
+ phone: branding.phone,
116
+ email: branding.email,
117
+ };
118
+ // Watermark on draft / cancelled invoices
119
+ const watermarkLabel = data.status === 'draft'
120
+ ? (0, i18n_1.t)('invoice', 'watermarkDraft', langs[0])
121
+ : data.status === 'cancelled'
122
+ ? (0, i18n_1.t)('invoice', 'watermarkCancelled', langs[0])
123
+ : undefined;
124
+ // KeyValueTable expects pre-formatted strings; build them with dual-lang
125
+ // labels rendered ABOVE each value would require a custom row primitive,
126
+ // so V1 uses primary-language labels in the metadata table and emits
127
+ // a small bilingual title above it. Acceptable trade-off; the table
128
+ // itself stays in C.0's existing API.
129
+ const metadataEntries = [
130
+ { label: buildPrimary('invoiceNumber', langs), value: data.invoiceNumber },
131
+ { label: buildPrimary('issuedDate', langs), value: (0, format_1.formatDate)(data.issuedDate, template.dateFormat) },
132
+ { label: buildPrimary('dueDate', langs), value: (0, format_1.formatDate)(data.dueDate, template.dateFormat) },
133
+ { label: buildPrimary('studentName', langs), value: data.studentName },
134
+ { label: buildPrimary('gradeLevel', langs), value: data.gradeLevel },
135
+ { label: buildPrimary('academicYear', langs), value: data.academicYear },
136
+ { label: buildPrimary('billingPeriod', langs), value: data.billingPeriod },
137
+ ];
138
+ return ((0, jsx_runtime_1.jsx)(Document_1.Document, { title: `Invoice ${data.invoiceNumber}`, subject: "Invoice", children: (0, jsx_runtime_1.jsxs)(Page_1.Page, { size: template.pageSize, orientation: template.orientation, margins: template.margins, children: [watermarkLabel && (0, jsx_runtime_1.jsx)(Watermark_1.Watermark, { text: watermarkLabel }), (0, jsx_runtime_1.jsx)(BrandedHeader_1.BrandedHeader, { branding: headerBranding, config: headerConfig }), (0, jsx_runtime_1.jsxs)(renderer_1.View, { style: styles.metaBlock, children: [(0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [styles.sectionTitle, { fontFamily: (0, fonts_1.pickFontFamily)(buildPrimary('title', langs)) }], children: buildPrimary('title', langs) }), isDualLang && ((0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [
139
+ styles.sectionTitleSecondary,
140
+ { fontFamily: (0, fonts_1.pickFontFamily)((_f = buildSecondary('title', langs)) !== null && _f !== void 0 ? _f : '') },
141
+ ], children: buildSecondary('title', langs) })), (0, jsx_runtime_1.jsx)(KeyValueTable_1.KeyValueTable, { entries: metadataEntries })] }), (0, jsx_runtime_1.jsx)(LineItemTable_1.LineItemTable, { items: data.lineItems, columns: template.lineItemColumns, headers: {
142
+ description: buildPrimary('description', langs),
143
+ quantity: buildPrimary('quantity', langs),
144
+ amount: buildPrimary('amount', langs),
145
+ discount: buildPrimary('discount', langs),
146
+ taxRate: buildPrimary('taxRate', langs),
147
+ taxAmount: buildPrimary('taxAmount', langs),
148
+ total: buildPrimary('total', langs),
149
+ }, renderNumber: renderNumber }), (0, jsx_runtime_1.jsx)(TotalsBlock_1.TotalsBlock, { entries: {
150
+ subtotal: data.subtotal,
151
+ taxTotal: data.taxTotal,
152
+ discountTotal: data.discountTotal,
153
+ grandTotal: data.grandTotal,
154
+ amountPaid: data.amountPaid,
155
+ amountDue: data.amountDue,
156
+ }, visibility: {
157
+ showSubtotal: template.totalsSection.showSubtotal,
158
+ showTaxTotal: template.totalsSection.showTaxTotal,
159
+ showDiscountTotal: template.totalsSection.showDiscountTotal,
160
+ showAmountPaid: template.totalsSection.showAmountPaid,
161
+ showAmountDue: template.totalsSection.showAmountDue,
162
+ }, labels: {
163
+ subtotal: buildPrimary('subtotal', langs),
164
+ taxTotal: buildPrimary('totalTax', langs),
165
+ discountTotal: buildPrimary('totalDiscount', langs),
166
+ grandTotal: buildPrimary('grandTotal', langs),
167
+ amountPaid: buildPrimary('amountPaid', langs),
168
+ amountDue: buildPrimary('amountDue', langs),
169
+ }, renderCurrency: renderCurrency }), data.notes && ((0, jsx_runtime_1.jsxs)(renderer_1.View, { style: styles.notesBlock, children: [(0, jsx_runtime_1.jsx)(DualLabel, { primary: buildPrimary('notes', langs), secondary: buildSecondary('notes', langs) }), (0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [styles.notesText, { fontFamily: (0, fonts_1.pickFontFamily)(data.notes) }], children: data.notes.length > 500 ? `${data.notes.slice(0, 500)}…` : data.notes })] })), template.footer.showSignatureLine && ((0, jsx_runtime_1.jsx)(SignatureLine_1.SignatureLine, { caption: (_h = (_g = branding.formalName) !== null && _g !== void 0 ? _g : branding.schoolName) !== null && _h !== void 0 ? _h : '', signatureSrc: branding.principalSignatureSrc, align: "right" })), (0, jsx_runtime_1.jsx)(BrandedFooter_1.BrandedFooter, { text: template.footer.text, showPageNumbers: template.footer.showPageNumbers, lang: langs[0] })] }) }));
170
+ };
171
+ exports.InvoicePdf = InvoicePdf;
172
+ //# sourceMappingURL=InvoicePdf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvoicePdf.js","sourceRoot":"","sources":["../../src/documents/InvoicePdf.tsx"],"names":[],"mappings":";;;;AAkBA,kDAA6D;AAC7D,qDAAkD;AAClD,6CAA0C;AAC1C,+DAA4D;AAC5D,+DAA4D;AAC5D,uDAAoD;AACpD,+DAAgF;AAChF,+DAA2E;AAC3E,2DAAwD;AACxD,+DAA4D;AAC5D,uCAA4C;AAC5C,2CAA0E;AAC1E,yCAA+C;AAC/C,yCAAmF;AA6DnF,MAAM,MAAM,GAAG,qBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,SAAS,EAAE,uBAAe,CAAC,EAAE;QAC7B,YAAY,EAAE,uBAAe,CAAC,EAAE;KACjC;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,yBAAiB,CAAC,EAAE;QAC9B,UAAU,EAAE,GAAG;QACf,KAAK,EAAE,sBAAc,CAAC,IAAI;QAC1B,YAAY,EAAE,uBAAe,CAAC,EAAE;KACjC;IACD,qBAAqB,EAAE;QACrB,QAAQ,EAAE,yBAAiB,CAAC,EAAE;QAC9B,KAAK,EAAE,sBAAc,CAAC,SAAS;QAC/B,YAAY,EAAE,uBAAe,CAAC,EAAE;KACjC;IACD,UAAU,EAAE;QACV,SAAS,EAAE,uBAAe,CAAC,EAAE;QAC7B,OAAO,EAAE,uBAAe,CAAC,EAAE;QAC3B,eAAe,EAAE,SAAS;QAC1B,eAAe,EAAE,CAAC;QAClB,eAAe,EAAE,sBAAc,CAAC,MAAM;KACvC;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,yBAAiB,C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,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAChD,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,GACd,IACG,GACE,CACZ,CAAC;AACJ,CAAC,CAAC;AAtKW,QAAA,UAAU,cAsKrB"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * `<ReceiptPdf>` — Sprint C.1.2 second document component.
3
+ *
4
+ * Composition exercise mirroring `<InvoicePdf>`: zero new primitives, all
5
+ * structure assembled from C.0.3 primitives (Document + Page + BrandedHeader
6
+ * + BrandedFooter + Watermark) and C.0.3 components (KeyValueTable +
7
+ * LineItemTable + TotalsBlock + SignatureLine).
8
+ *
9
+ * Receipts differ from invoices in three ways that shape this document:
10
+ * 1. Always issued AFTER a completed payment — no due-date concept; line
11
+ * items list what was charged, totals show what was paid.
12
+ * 2. Carry payment-channel metadata (gateway / transaction ID / paid-by)
13
+ * that invoices don't have. Rendered in a second `KeyValueTable` block.
14
+ * 3. PABSON tenants require PAN/VAT/taxable-amount/tax-amount disclosure
15
+ * for VAT compliance — surfaced as a third metadata block when both
16
+ * `taxBreakdownSection.show*` toggles are on and the values are present
17
+ * on `branding.panNumber` / `branding.vatNumber`.
18
+ *
19
+ * Watermark is applied for `status: 'voided' | 'refunded'`. The "happy path"
20
+ * status `'paid'` renders without a watermark (a paid receipt is the normal
21
+ * artifact).
22
+ */
23
+ import * as React from 'react';
24
+ import { type LineItem } from '../components/LineItemTable';
25
+ import type { DocumentComponentProps, PdfTemplateConfig } from '../descriptors/types';
26
+ /**
27
+ * Per-doc-type config for receipts. Extends the shared `PdfTemplateConfig`
28
+ * with receipt-specific toggles: a slimmer set of line-item columns (no
29
+ * quantity/discount/taxRate — receipts don't itemize those the way invoices
30
+ * do), payment-channel detail visibility, and a tax-breakdown section.
31
+ */
32
+ export interface ReceiptTemplateConfig extends PdfTemplateConfig {
33
+ /**
34
+ * Receipt line-item table only exposes the four columns relevant to a
35
+ * payment record. `description`, `amount`, and `total` are always shown
36
+ * (enforced at runtime by LineItemTable's REQUIRED_COLUMNS set); only
37
+ * `taxAmount` is operator-configurable.
38
+ */
39
+ lineItemColumns: {
40
+ description: boolean;
41
+ amount: boolean;
42
+ taxAmount: boolean;
43
+ total: boolean;
44
+ };
45
+ totalsSection: {
46
+ showSubtotal: boolean;
47
+ showTaxTotal: boolean;
48
+ showDiscountTotal: boolean;
49
+ };
50
+ paymentDetails: {
51
+ showPaymentMethod: boolean;
52
+ showTransactionId: boolean;
53
+ showPaidBy: boolean;
54
+ };
55
+ taxBreakdownSection: {
56
+ showPanNumber: boolean;
57
+ showVatNumber: boolean;
58
+ };
59
+ footer: PdfTemplateConfig['footer'] & {
60
+ showSignatureLine: boolean;
61
+ showThankYou: boolean;
62
+ };
63
+ }
64
+ /**
65
+ * Receipt data shape the document component renders.
66
+ *
67
+ * Mirrors the `Receipt` zod schema in `@aibrains/shared-types/finance` but
68
+ * declared locally because (a) the renderer is published as its own npm
69
+ * package and shouldn't take a peer-dep on the consumer's shared-types
70
+ * version, and (b) structural typing lets endpoints pass the full shared
71
+ * shape — extra fields fall through harmlessly.
72
+ */
73
+ export interface ReceiptDocumentData {
74
+ receiptNumber: string;
75
+ paidDate: string;
76
+ invoiceNumber: string;
77
+ /** Optional — typically the gateway-side ID for digital payments (eSewa, Khalti, gateway txn refs). */
78
+ transactionId?: string;
79
+ /** Display name for the gateway/method, e.g. 'eSewa', 'Cash', 'Bank transfer'. */
80
+ paymentMethod: string;
81
+ paidBy: string;
82
+ studentName: string;
83
+ studentId?: string;
84
+ gradeLevel?: string;
85
+ academicYear?: string;
86
+ billingPeriod?: string;
87
+ lineItems: LineItem[];
88
+ subtotal: number;
89
+ taxTotal: number;
90
+ discountTotal: number;
91
+ grandTotal: number;
92
+ /**
93
+ * Amount captured by this payment. For typical full-pay receipts this
94
+ * equals `grandTotal`; partial-payment flows can show a smaller value
95
+ * here while keeping `grandTotal` as the invoice's full amount.
96
+ */
97
+ paidAmount: number;
98
+ currency: string;
99
+ /**
100
+ * Tax-compliance block. PAN/VAT come from `branding` (school-level); the
101
+ * `taxableAmount` + `taxAmount` are receipt-level. All four are required
102
+ * for the rendered block to appear when the operator has both
103
+ * `taxBreakdownSection.showPanNumber` and `showVatNumber` toggled on.
104
+ */
105
+ taxableAmount?: number;
106
+ taxAmount?: number;
107
+ notes?: string;
108
+ /**
109
+ * V1 supports three lifecycle states. `'paid'` is the normal artifact (no
110
+ * watermark). `'voided'` + `'refunded'` get watermarks to clearly mark the
111
+ * document as no-longer-the-source-of-truth.
112
+ */
113
+ status: 'paid' | 'voided' | 'refunded';
114
+ }
115
+ export declare const ReceiptPdf: React.FC<DocumentComponentProps<ReceiptDocumentData, ReceiptTemplateConfig>>;
116
+ //# sourceMappingURL=ReceiptPdf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReceiptPdf.d.ts","sourceRoot":"","sources":["../../src/documents/ReceiptPdf.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAAiB,KAAK,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAO3E,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAE9B;;;;;GAKG;AACH,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D;;;;;OAKG;IACH,eAAe,EAAE;QACf,WAAW,EAAE,OAAO,CAAC;QACrB,MAAM,EAAE,OAAO,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;QACnB,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,aAAa,EAAE;QACb,YAAY,EAAE,OAAO,CAAC;QACtB,YAAY,EAAE,OAAO,CAAC;QACtB,iBAAiB,EAAE,OAAO,CAAC;KAC5B,CAAC;IACF,cAAc,EAAE;QACd,iBAAiB,EAAE,OAAO,CAAC;QAC3B,iBAAiB,EAAE,OAAO,CAAC;QAC3B,UAAU,EAA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
@@ -0,0 +1,221 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReceiptPdf = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const renderer_1 = require("@react-pdf/renderer");
6
+ const Document_1 = require("../primitives/Document");
7
+ const Page_1 = require("../primitives/Page");
8
+ const BrandedHeader_1 = require("../primitives/BrandedHeader");
9
+ const BrandedFooter_1 = require("../primitives/BrandedFooter");
10
+ const Watermark_1 = require("../primitives/Watermark");
11
+ const KeyValueTable_1 = require("../components/KeyValueTable");
12
+ const LineItemTable_1 = require("../components/LineItemTable");
13
+ const TotalsBlock_1 = require("../components/TotalsBlock");
14
+ const SignatureLine_1 = require("../components/SignatureLine");
15
+ const i18n_1 = require("../core/i18n");
16
+ const format_1 = require("../core/format");
17
+ const fonts_1 = require("../core/fonts");
18
+ const theme_1 = require("../core/theme");
19
+ const styles = renderer_1.StyleSheet.create({
20
+ metaBlock: {
21
+ marginTop: theme_1.DEFAULT_SPACING.md,
22
+ marginBottom: theme_1.DEFAULT_SPACING.sm,
23
+ },
24
+ sectionTitle: {
25
+ fontSize: theme_1.DEFAULT_FONT_SIZE.md,
26
+ fontWeight: 700,
27
+ color: theme_1.DEFAULT_COLORS.text,
28
+ marginBottom: theme_1.DEFAULT_SPACING.xs,
29
+ },
30
+ sectionTitleSecondary: {
31
+ fontSize: theme_1.DEFAULT_FONT_SIZE.sm,
32
+ color: theme_1.DEFAULT_COLORS.textMuted,
33
+ marginBottom: theme_1.DEFAULT_SPACING.sm,
34
+ },
35
+ subsectionTitle: {
36
+ fontSize: theme_1.DEFAULT_FONT_SIZE.sm,
37
+ fontWeight: 700,
38
+ color: theme_1.DEFAULT_COLORS.text,
39
+ marginTop: theme_1.DEFAULT_SPACING.sm,
40
+ marginBottom: theme_1.DEFAULT_SPACING.xs,
41
+ },
42
+ notesBlock: {
43
+ marginTop: theme_1.DEFAULT_SPACING.md,
44
+ padding: theme_1.DEFAULT_SPACING.sm,
45
+ backgroundColor: '#F8F9FA',
46
+ borderLeftWidth: 3,
47
+ borderLeftColor: theme_1.DEFAULT_COLORS.border,
48
+ },
49
+ notesText: {
50
+ fontSize: theme_1.DEFAULT_FONT_SIZE.sm,
51
+ color: theme_1.DEFAULT_COLORS.text,
52
+ },
53
+ thankYouBlock: {
54
+ marginTop: theme_1.DEFAULT_SPACING.lg,
55
+ textAlign: 'center',
56
+ },
57
+ thankYouText: {
58
+ fontSize: theme_1.DEFAULT_FONT_SIZE.sm,
59
+ fontWeight: 700,
60
+ color: theme_1.DEFAULT_COLORS.text,
61
+ },
62
+ });
63
+ function buildPrimary(key, langs) {
64
+ return (0, i18n_1.t)('receipt', key, langs[0]);
65
+ }
66
+ function buildSecondary(key, langs) {
67
+ return langs.length >= 2 ? (0, i18n_1.t)('receipt', key, langs[1]) : undefined;
68
+ }
69
+ const dualLabelStyles = renderer_1.StyleSheet.create({
70
+ primary: {
71
+ fontSize: theme_1.DEFAULT_FONT_SIZE.sm,
72
+ color: theme_1.DEFAULT_COLORS.text,
73
+ },
74
+ secondary: {
75
+ fontSize: theme_1.DEFAULT_FONT_SIZE.sm * 0.8,
76
+ color: theme_1.DEFAULT_COLORS.textMuted,
77
+ },
78
+ });
79
+ /**
80
+ * Stacked dual-language label primitive — same pattern InvoicePdf uses.
81
+ * Small enough to inline; not worth extracting to its own primitive yet.
82
+ */
83
+ const DualLabel = ({ primary, secondary }) => ((0, jsx_runtime_1.jsxs)(renderer_1.View, { children: [(0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [dualLabelStyles.primary, { fontFamily: (0, fonts_1.pickFontFamily)(primary) }], children: primary }), secondary && ((0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [dualLabelStyles.secondary, { fontFamily: (0, fonts_1.pickFontFamily)(secondary) }], children: secondary }))] }));
84
+ const ReceiptPdf = ({ data, template, branding, settings, }) => {
85
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
86
+ const langs = template.labelLanguages;
87
+ const isDualLang = langs.length >= 2;
88
+ const numberGrouping = template.numberFormat === 'auto-from-workspace'
89
+ ? 'western'
90
+ : template.numberFormat;
91
+ const renderNumber = (v) => (0, format_1.formatNumber)(v !== null && v !== void 0 ? v : 0, numberGrouping);
92
+ const renderCurrency = (v) => (0, format_1.formatCurrency)(v, data.currency, {
93
+ locale: settings.defaultLocale,
94
+ showSymbol: template.currencyDisplay === 'symbol',
95
+ });
96
+ const headerConfig = {
97
+ showLogo: template.header.showLogo,
98
+ showSchoolName: template.header.showSchoolName,
99
+ showSchoolAddress: template.header.showSchoolAddress,
100
+ showContact: template.header.showContact,
101
+ tagline: template.header.tagline,
102
+ primaryColor: (_a = template.brandingOverrides) === null || _a === void 0 ? void 0 : _a.primaryColor,
103
+ };
104
+ const headerBranding = {
105
+ logoSrc: (_c = (_b = template.brandingOverrides) === null || _b === void 0 ? void 0 : _b.logoSrc) !== null && _c !== void 0 ? _c : branding.logoSrc,
106
+ schoolName: branding.schoolName,
107
+ addressLines: (_e = (_d = template.brandingOverrides) === null || _d === void 0 ? void 0 : _d.addressLines) !== null && _e !== void 0 ? _e : branding.addressLines,
108
+ phone: branding.phone,
109
+ email: branding.email,
110
+ };
111
+ // Watermark on voided / refunded receipts (paid is the happy path, no mark).
112
+ const watermarkLabel = data.status === 'voided'
113
+ ? (0, i18n_1.t)('receipt', 'watermarkVoided', langs[0])
114
+ : data.status === 'refunded'
115
+ ? (0, i18n_1.t)('receipt', 'watermarkRefunded', langs[0])
116
+ : undefined;
117
+ // Primary metadata block — receipt-specific keys (no due-date concept).
118
+ const metadataEntries = [
119
+ { label: buildPrimary('receiptNumber', langs), value: data.receiptNumber },
120
+ { label: buildPrimary('paymentDate', langs), value: (0, format_1.formatDate)(data.paidDate, template.dateFormat) },
121
+ { label: buildPrimary('invoiceRef', langs), value: data.invoiceNumber },
122
+ { label: buildPrimary('studentName', langs), value: data.studentName },
123
+ { label: buildPrimary('studentId', langs), value: data.studentId },
124
+ { label: buildPrimary('gradeLevel', langs), value: data.gradeLevel },
125
+ { label: buildPrimary('academicYear', langs), value: data.academicYear },
126
+ { label: buildPrimary('billingPeriod', langs), value: data.billingPeriod },
127
+ ];
128
+ // Payment-channel block — entries collapse to [] when all toggles are off,
129
+ // so an operator who wants a minimal receipt drops the whole sub-section.
130
+ const paymentEntries = [];
131
+ if (template.paymentDetails.showPaymentMethod) {
132
+ paymentEntries.push({ label: buildPrimary('paymentMethod', langs), value: data.paymentMethod });
133
+ }
134
+ if (template.paymentDetails.showTransactionId && data.transactionId) {
135
+ paymentEntries.push({ label: buildPrimary('transactionId', langs), value: data.transactionId });
136
+ }
137
+ if (template.paymentDetails.showPaidBy) {
138
+ paymentEntries.push({ label: buildPrimary('paidBy', langs), value: data.paidBy });
139
+ }
140
+ // Tax-breakdown block — PABSON VAT-compliance requirement. PAN/VAT come from
141
+ // branding (school-level); taxableAmount/taxAmount are receipt-level. The
142
+ // entire sub-section is gated by operator toggles: when both showPanNumber
143
+ // AND showVatNumber are off, the operator has opted out of tax disclosure
144
+ // and NO row in this block renders — including the receipt-level amounts.
145
+ // This guards against the case where data carries tax figures but the
146
+ // operator wanted them suppressed (e.g., non-PABSON tenant + GENERIC
147
+ // profile + nonzero data.taxAmount).
148
+ const taxEntries = [];
149
+ const taxBreakdownEnabled = template.taxBreakdownSection.showPanNumber || template.taxBreakdownSection.showVatNumber;
150
+ if (taxBreakdownEnabled) {
151
+ if (template.taxBreakdownSection.showPanNumber && branding.panNumber) {
152
+ taxEntries.push({ label: buildPrimary('panNumber', langs), value: branding.panNumber });
153
+ }
154
+ if (template.taxBreakdownSection.showVatNumber && branding.vatNumber) {
155
+ taxEntries.push({ label: buildPrimary('vatNumber', langs), value: branding.vatNumber });
156
+ }
157
+ if (data.taxableAmount !== undefined && data.taxableAmount > 0) {
158
+ taxEntries.push({
159
+ label: buildPrimary('taxableAmount', langs),
160
+ value: renderCurrency(data.taxableAmount),
161
+ });
162
+ }
163
+ if (data.taxAmount !== undefined && data.taxAmount > 0) {
164
+ taxEntries.push({
165
+ label: buildPrimary('taxAmountLabel', langs),
166
+ value: renderCurrency(data.taxAmount),
167
+ });
168
+ }
169
+ }
170
+ // LineItemTable requires the full 7-column shape — receipts hardcode the
171
+ // four irrelevant columns to false so they never render, then forward the
172
+ // single configurable column (`taxAmount`) from template config.
173
+ const lineItemColumns = {
174
+ description: true,
175
+ quantity: false,
176
+ amount: true,
177
+ discount: false,
178
+ taxRate: false,
179
+ taxAmount: template.lineItemColumns.taxAmount,
180
+ total: true,
181
+ };
182
+ return ((0, jsx_runtime_1.jsx)(Document_1.Document, { title: `Receipt ${data.receiptNumber}`, subject: "Payment Receipt", children: (0, jsx_runtime_1.jsxs)(Page_1.Page, { size: template.pageSize, orientation: template.orientation, margins: template.margins, children: [watermarkLabel && (0, jsx_runtime_1.jsx)(Watermark_1.Watermark, { text: watermarkLabel }), (0, jsx_runtime_1.jsx)(BrandedHeader_1.BrandedHeader, { branding: headerBranding, config: headerConfig }), (0, jsx_runtime_1.jsxs)(renderer_1.View, { style: styles.metaBlock, children: [(0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [styles.sectionTitle, { fontFamily: (0, fonts_1.pickFontFamily)(buildPrimary('title', langs)) }], children: buildPrimary('title', langs) }), isDualLang && ((0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [
183
+ styles.sectionTitleSecondary,
184
+ { fontFamily: (0, fonts_1.pickFontFamily)((_f = buildSecondary('title', langs)) !== null && _f !== void 0 ? _f : '') },
185
+ ], children: buildSecondary('title', langs) })), (0, jsx_runtime_1.jsx)(KeyValueTable_1.KeyValueTable, { entries: metadataEntries })] }), paymentEntries.length > 0 && ((0, jsx_runtime_1.jsxs)(renderer_1.View, { style: styles.metaBlock, children: [(0, jsx_runtime_1.jsx)(DualLabel, { primary: buildPrimary('paymentDetailsTitle', langs), secondary: buildSecondary('paymentDetailsTitle', langs) }), (0, jsx_runtime_1.jsx)(KeyValueTable_1.KeyValueTable, { entries: paymentEntries })] })), (0, jsx_runtime_1.jsx)(LineItemTable_1.LineItemTable, { items: data.lineItems, columns: lineItemColumns, headers: {
186
+ description: buildPrimary('description', langs),
187
+ quantity: '',
188
+ amount: buildPrimary('amount', langs),
189
+ discount: '',
190
+ taxRate: '',
191
+ taxAmount: buildPrimary('taxAmount', langs),
192
+ total: buildPrimary('total', langs),
193
+ }, renderNumber: renderNumber }), (0, jsx_runtime_1.jsx)(TotalsBlock_1.TotalsBlock, { entries: {
194
+ subtotal: data.subtotal,
195
+ taxTotal: data.taxTotal,
196
+ discountTotal: data.discountTotal,
197
+ grandTotal: data.grandTotal,
198
+ amountPaid: data.paidAmount,
199
+ // amountDue intentionally omitted — by definition a receipt
200
+ // documents an applied payment; there is no "amount due" line.
201
+ amountDue: undefined,
202
+ }, visibility: {
203
+ showSubtotal: template.totalsSection.showSubtotal,
204
+ showTaxTotal: template.totalsSection.showTaxTotal,
205
+ showDiscountTotal: template.totalsSection.showDiscountTotal,
206
+ showAmountPaid: true,
207
+ showAmountDue: false,
208
+ }, labels: {
209
+ subtotal: buildPrimary('subtotal', langs),
210
+ taxTotal: buildPrimary('totalTax', langs),
211
+ discountTotal: buildPrimary('totalDiscount', langs),
212
+ grandTotal: buildPrimary('grandTotal', langs),
213
+ amountPaid: buildPrimary('paidAmount', langs),
214
+ amountDue: '',
215
+ }, renderCurrency: renderCurrency }), taxEntries.length > 0 && ((0, jsx_runtime_1.jsxs)(renderer_1.View, { style: styles.metaBlock, children: [(0, jsx_runtime_1.jsx)(DualLabel, { primary: buildPrimary('taxBreakdownTitle', langs), secondary: buildSecondary('taxBreakdownTitle', langs) }), (0, jsx_runtime_1.jsx)(KeyValueTable_1.KeyValueTable, { entries: taxEntries })] })), data.notes && ((0, jsx_runtime_1.jsxs)(renderer_1.View, { style: styles.notesBlock, children: [(0, jsx_runtime_1.jsx)(DualLabel, { primary: buildPrimary('notes', langs), secondary: buildSecondary('notes', langs) }), (0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [styles.notesText, { fontFamily: (0, fonts_1.pickFontFamily)(data.notes) }], children: data.notes.length > 500 ? `${data.notes.slice(0, 500)}…` : data.notes })] })), template.footer.showThankYou && ((0, jsx_runtime_1.jsxs)(renderer_1.View, { style: styles.thankYouBlock, children: [(0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [styles.thankYouText, { fontFamily: (0, fonts_1.pickFontFamily)(buildPrimary('thankYou', langs)) }], children: buildPrimary('thankYou', langs) }), isDualLang && ((0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [
216
+ dualLabelStyles.secondary,
217
+ { fontFamily: (0, fonts_1.pickFontFamily)((_g = buildSecondary('thankYou', langs)) !== null && _g !== void 0 ? _g : '') },
218
+ ], children: buildSecondary('thankYou', langs) }))] })), template.footer.showSignatureLine && ((0, jsx_runtime_1.jsx)(SignatureLine_1.SignatureLine, { caption: (_j = (_h = branding.formalName) !== null && _h !== void 0 ? _h : branding.schoolName) !== null && _j !== void 0 ? _j : '', signatureSrc: branding.principalSignatureSrc, align: "right" })), (0, jsx_runtime_1.jsx)(BrandedFooter_1.BrandedFooter, { text: template.footer.text, showPageNumbers: template.footer.showPageNumbers, lang: langs[0] })] }) }));
219
+ };
220
+ exports.ReceiptPdf = ReceiptPdf;
221
+ //# sourceMappingURL=ReceiptPdf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReceiptPdf.js","sourceRoot":"","sources":["../../src/documents/ReceiptPdf.tsx"],"names":[],"mappings":";;;;AAwBA,kDAA6D;AAC7D,qDAAkD;AAClD,6CAA0C;AAC1C,+DAA4D;AAC5D,+DAA4D;AAC5D,uDAAoD;AACpD,+DAAgF;AAChF,+DAA2E;AAC3E,2DAAwD;AACxD,+DAA4D;AAC5D,uCAA4C;AAC5C,2CAA0E;AAC1E,yCAA+C;AAC/C,yCAAmF;AAiGnF,MAAM,MAAM,GAAG,qBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,SAAS,EAAE,uBAAe,CAAC,EAAE;QA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AiB,IAAI,CACpC,uBAAC,6BAAa,IACZ,OAAO,EAAE,MAAA,MAAA,QAAQ,CAAC,UAAU,mCAAI,QAAQ,CAAC,UAAU,mCAAI,EAAE,EACzD,YAAY,EAAE,QAAQ,CAAC,qBAAqB,EAC5C,KAAK,EAAC,OAAO,GACb,CACH,EAED,uBAAC,6BAAa,IACZ,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAC1B,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAChD,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,GACd,IACG,GACE,CACZ,CAAC;AACJ,CAAC,CAAC;AArQW,QAAA,UAAU,cAqQrB"}
@@ -0,0 +1,31 @@
1
+ {
2
+ "title": "Invoice",
3
+ "invoiceNumber": "Invoice No.",
4
+ "issuedDate": "Issued",
5
+ "dueDate": "Due",
6
+ "academicYear": "Academic Year",
7
+ "billingPeriod": "Billing Period",
8
+ "billedTo": "Billed to",
9
+ "studentName": "Student",
10
+ "studentId": "Student ID",
11
+ "gradeLevel": "Grade",
12
+ "lineItems": "Line items",
13
+ "description": "Description",
14
+ "quantity": "Qty",
15
+ "amount": "Amount",
16
+ "discount": "Discount",
17
+ "taxRate": "Tax %",
18
+ "taxAmount": "Tax",
19
+ "total": "Total",
20
+ "subtotal": "Subtotal",
21
+ "totalTax": "Total tax",
22
+ "totalDiscount": "Total discount",
23
+ "grandTotal": "Grand total",
24
+ "amountPaid": "Paid",
25
+ "amountDue": "Due",
26
+ "status": "Status",
27
+ "notes": "Notes",
28
+ "footerThankYou": "Thank you for your payment.",
29
+ "watermarkDraft": "DRAFT",
30
+ "watermarkCancelled": "CANCELLED"
31
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "title": "Payment Receipt",
3
+ "subtitle": "Official Receipt",
4
+ "receiptNumber": "Receipt No.",
5
+ "paymentDate": "Payment Date",
6
+ "paymentMethod": "Payment Method",
7
+ "transactionId": "Transaction ID",
8
+ "paidBy": "Paid By",
9
+ "invoiceNumber": "Invoice No.",
10
+ "invoiceRef": "Against Invoice",
11
+ "academicYear": "Academic Year",
12
+ "billingPeriod": "Billing Period",
13
+ "studentName": "Student",
14
+ "studentId": "Student ID",
15
+ "gradeLevel": "Grade",
16
+ "lineItems": "Line items",
17
+ "description": "Description",
18
+ "amount": "Amount",
19
+ "taxAmount": "Tax",
20
+ "total": "Total",
21
+ "subtotal": "Subtotal",
22
+ "totalTax": "Total tax",
23
+ "totalDiscount": "Total discount",
24
+ "grandTotal": "Grand total",
25
+ "paidAmount": "Amount paid",
26
+ "taxBreakdownTitle": "Tax Compliance",
27
+ "panNumber": "PAN",
28
+ "vatNumber": "VAT",
29
+ "taxableAmount": "Taxable amount",
30
+ "taxAmountLabel": "Tax amount",
31
+ "paymentDetailsTitle": "Payment details",
32
+ "notes": "Notes",
33
+ "thankYou": "Thank you for your payment.",
34
+ "watermarkVoided": "VOIDED",
35
+ "watermarkRefunded": "REFUNDED"
36
+ }