@powerhousedao/contributor-billing 0.0.93 → 0.0.95

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.
@@ -1 +1 @@
1
- {"version":3,"file":"InvoicePDF.d.ts","sourceRoot":"","sources":["../../../editors/invoice/InvoicePDF.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EAIb,MAAM,wCAAwC,CAAC;AAgThD,UAAU,eAAe;IACvB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA6bhD,CAAC"}
1
+ {"version":3,"file":"InvoicePDF.d.ts","sourceRoot":"","sources":["../../../editors/invoice/InvoicePDF.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EAIb,MAAM,wCAAwC,CAAC;AAiThD,UAAU,eAAe;IACvB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmahD,CAAC"}
@@ -36,7 +36,7 @@ const styles = StyleSheet.create({
36
36
  fontFamily: "Helvetica",
37
37
  },
38
38
  invoiceNumber: {
39
- fontSize: 12,
39
+ fontSize: 11,
40
40
  marginLeft: 0,
41
41
  },
42
42
  section: {
@@ -90,7 +90,7 @@ const styles = StyleSheet.create({
90
90
  tableRow: {
91
91
  flexDirection: "row",
92
92
  borderBottomWidth: 0,
93
- padding: 8,
93
+ paddingVertical: 8,
94
94
  fontSize: 10,
95
95
  alignItems: "flex-start",
96
96
  },
@@ -106,13 +106,21 @@ const styles = StyleSheet.create({
106
106
  fontWeight: "normal",
107
107
  },
108
108
  tableCol40: {
109
- width: "40%",
109
+ width: "30%",
110
110
  paddingRight: 8,
111
111
  },
112
112
  tableCol15: {
113
113
  width: "15%",
114
114
  textAlign: "right",
115
115
  },
116
+ tableCol12: {
117
+ width: "15%",
118
+ textAlign: "right",
119
+ },
120
+ tableCol18: {
121
+ width: "20%",
122
+ textAlign: "right",
123
+ },
116
124
  totals: {
117
125
  marginTop: 20,
118
126
  marginRight: 0,
@@ -128,15 +136,15 @@ const styles = StyleSheet.create({
128
136
  totalLabel: {
129
137
  marginRight: 8,
130
138
  color: "#6B7280",
131
- fontSize: 14,
139
+ fontSize: 10,
132
140
  fontWeight: "normal",
133
141
  width: 120,
134
142
  textAlign: "right",
135
143
  },
136
144
  totalValue: {
137
- minWidth: 100,
145
+ width: 160,
138
146
  textAlign: "right",
139
- fontSize: 14,
147
+ fontSize: 10,
140
148
  fontWeight: "normal",
141
149
  color: "#374151",
142
150
  },
@@ -152,15 +160,15 @@ const styles = StyleSheet.create({
152
160
  totalLabelBold: {
153
161
  marginRight: 8,
154
162
  color: "#000",
155
- fontSize: 16,
163
+ fontSize: 10,
156
164
  fontWeight: "bold",
157
165
  width: 120,
158
166
  textAlign: "right",
159
167
  },
160
168
  totalValueBold: {
161
- minWidth: 100,
169
+ width: 160,
162
170
  textAlign: "right",
163
- fontSize: 16,
171
+ fontSize: 10,
164
172
  fontWeight: "bold",
165
173
  color: "#000",
166
174
  },
@@ -195,17 +203,9 @@ const styles = StyleSheet.create({
195
203
  marginTop: -15,
196
204
  marginLeft: -15,
197
205
  },
198
- statusLabel: {
199
- fontSize: 14,
200
- marginTop: -13,
201
- fontFamily: "Helvetica",
202
- fontWeight: "normal",
203
- color: "#9ea0a2",
204
- marginRight: 4,
205
- },
206
206
  invoiceLabel: {
207
- fontSize: 14,
208
- marginRight: 4,
207
+ fontSize: 11,
208
+ marginRight: 2,
209
209
  marginBottom: 4,
210
210
  fontFamily: "Helvetica",
211
211
  color: "#9ea0a2",
@@ -263,7 +263,8 @@ const formatDate = (dateString) => {
263
263
  const formatCurrency = (amount, currency) => {
264
264
  // Format number with appropriate decimal places
265
265
  const formattedAmount = formatNumber(amount);
266
- return `${formattedAmount} ${currency}`;
266
+ // Use non-breaking space to keep currency inline with value
267
+ return `${formattedAmount}\u00A0${currency}`;
267
268
  };
268
269
  // Helper function to format numbers with appropriate decimal places
269
270
  function formatNumber(value) {
@@ -303,84 +304,51 @@ export const InvoicePDF = ({ invoice, fiatMode, }) => {
303
304
  }
304
305
  const lineItemChunks = chunkLineItems(invoice.lineItems, MAX_ITEMS_FIRST_PAGE, MAX_ITEMS_OTHER_PAGES);
305
306
  const totalPages = lineItemChunks.length;
306
- return (_jsx(Document, { children: lineItemChunks.map((items, pageIndex) => (_jsxs(Page, { size: "A4", style: styles.pageBackground, children: [_jsxs(View, { style: styles.page, children: [pageIndex === 0 && (_jsxs(_Fragment, { children: [_jsxs(View, { style: {
307
+ return (_jsx(Document, { children: lineItemChunks.map((items, pageIndex) => (_jsxs(Page, { size: "A4", style: styles.pageBackground, children: [_jsxs(View, { style: styles.page, children: [pageIndex === 0 && (_jsxs(_Fragment, { children: [_jsx(View, { style: {
307
308
  flexDirection: "row",
308
309
  justifyContent: "space-between",
309
310
  alignItems: "flex-start",
310
- }, children: [_jsxs(View, { style: {
311
- flexDirection: "column",
312
- alignItems: "flex-start",
313
- }, children: [_jsx(Text, { style: {
314
- fontSize: 20,
315
- fontWeight: "bold",
316
- marginBottom: 10,
317
- paddingRight: 65,
318
- marginRight: 20,
319
- }, children: invoice.issuer.name }), _jsxs(View, { children: [_jsx(Text, { style: styles.invoiceLabel, children: "Invoice number" }), _jsx(Text, { style: styles.invoiceNumber, children: invoice.invoiceNo })] })] }), _jsxs(View, { style: { alignItems: "flex-end" }, children: [_jsxs(Text, { style: styles.invoiceLabel, children: ["Invoice of (", invoice.currency, ")"] }), _jsx(Text, { style: [
320
- styles.invoiceNumber,
321
- { fontSize: 18, fontWeight: "bold" },
322
- ], children: formatNumber(invoice.totalPriceTaxIncl) })] })] }), _jsxs(View, { style: {
311
+ }, children: _jsxs(View, { style: {
312
+ flexDirection: "column",
313
+ alignItems: "flex-start",
314
+ marginRight: 0,
315
+ }, children: [_jsx(Text, { style: {
316
+ fontSize: 18,
317
+ fontWeight: "bold",
318
+ marginBottom: 20,
319
+ paddingRight: 100,
320
+ marginRight: 0,
321
+ }, hyphenationCallback: (word) => [word], children: invoice.issuer.name }), _jsxs(View, { style: {
322
+ flexDirection: "row",
323
+ gap: 10,
324
+ alignItems: "flex-start",
325
+ width: "100%",
326
+ flexWrap: "nowrap",
327
+ }, children: [_jsxs(View, { style: { width: "30%" }, children: [_jsx(Text, { style: styles.invoiceLabel, children: "Invoice number" }), _jsx(Text, { style: [styles.invoiceNumber], wrap: true, children: invoice.invoiceNo })] }), _jsxs(View, { style: { width: "15%" }, children: [_jsx(Text, { style: styles.invoiceLabel, children: "Invoice date" }), _jsx(Text, { style: styles.invoiceNumber, children: formatDate(invoice.dateIssued) })] }), invoice.dateDelivered && (_jsxs(View, { style: { width: "15%" }, children: [_jsx(Text, { style: styles.invoiceLabel, children: "Delivery date" }), _jsx(Text, { style: styles.invoiceNumber, children: formatDate(invoice.dateDelivered) })] })), _jsxs(View, { style: { width: "20%" }, children: [_jsx(Text, { style: styles.invoiceLabel, children: "Due date" }), _jsx(Text, { style: styles.invoiceNumber, children: formatDate(invoice.dateDue) })] }), _jsxs(View, { style: { width: "20%" }, children: [_jsxs(Text, { style: styles.invoiceLabel, children: ["Invoice of ", invoice.currency] }), _jsx(Text, { style: [styles.invoiceNumber, { fontWeight: "bold" }], children: formatNumber(invoice.totalPriceTaxIncl) })] })] })] }) }), _jsxs(View, { style: {
323
328
  flexDirection: "row",
324
329
  justifyContent: "space-between",
325
330
  marginTop: 20,
326
331
  }, children: [_jsxs(View, { style: {
327
- width: "50%",
332
+ width: "48%",
328
333
  minWidth: 0,
329
334
  flexDirection: "column",
330
- paddingRight: 65,
335
+ paddingRight: 30,
336
+ marginRight: 20,
331
337
  }, children: [_jsx(Text, { style: styles.sectionTitle, children: "Issuer" }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Name:" }), _jsx(Text, { style: styles.companyInfo, wrap: true, children: invoice.issuer.name })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Tax/Corp ID:" }), _jsx(Text, { style: styles.companyInfo, children: invoice.issuer.id
332
338
  ?.taxId ||
333
339
  invoice.issuer
334
340
  .id?.corpRegId ||
335
341
  "" })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Address:" }), _jsx(Text, { style: styles.companyInfo, wrap: true, children: invoice.issuer.address?.streetAddress || "" })] }), invoice.issuer.address?.extendedAddress && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel }), _jsx(Text, { style: styles.companyInfo, wrap: true, children: invoice.issuer.address?.extendedAddress || "" })] })), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel }), _jsxs(Text, { style: styles.companyInfo, wrap: true, children: [invoice.issuer.address?.city || "", ",", " ", invoice.issuer.address?.stateProvince || "", ",", " ", getCountryName(invoice.issuer.address?.country || "") || ""] })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Postcode:" }), _jsx(Text, { style: styles.companyInfo, children: invoice.issuer.address?.postalCode || "00000" })] }), invoice.issuer.contactInfo?.email && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Email:" }), _jsx(Text, { style: styles.companyInfo, wrap: true, children: invoice.issuer.contactInfo.email })] }))] }), _jsxs(View, { style: {
336
- width: "47%",
342
+ width: "48%",
337
343
  minWidth: 0,
338
344
  flexDirection: "column",
339
- }, children: [_jsx(Text, { style: styles.sectionTitle, children: "Payer" }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Name:" }), _jsx(Text, { style: styles.companyInfo, wrap: true, children: invoice.payer.name })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Tax/Corp ID:" }), _jsx(Text, { style: styles.companyInfo, children: invoice.payer.id?.taxId ||
345
+ paddingRight: 0,
346
+ marginRight: 10,
347
+ }, children: [_jsx(Text, { style: styles.sectionTitle, children: "Payer" }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Name:" }), _jsx(Text, { style: styles.companyInfo, wrap: true, hyphenationCallback: (word) => [word], children: invoice.payer.name })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Tax/Corp ID:" }), _jsx(Text, { style: styles.companyInfo, children: invoice.payer.id?.taxId ||
340
348
  invoice.payer
341
349
  .id?.corpRegId ||
342
- "" })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Address:" }), _jsx(Text, { style: styles.companyInfo, wrap: true, children: invoice.payer.address?.streetAddress || "" })] }), invoice.payer.address?.extendedAddress && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel }), _jsx(Text, { style: styles.companyInfo, wrap: true, children: invoice.payer.address?.extendedAddress || "" })] })), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel }), _jsxs(Text, { style: styles.companyInfo, wrap: true, children: [invoice.payer.address?.city || "", ",", " ", invoice.payer.address?.stateProvince || "", ",", " ", getCountryName(invoice.payer.address?.country || "") ||
343
- ""] })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Postcode:" }), _jsx(Text, { style: styles.companyInfo, children: invoice.payer.address?.postalCode || "00000" })] }), invoice.payer.contactInfo?.email && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Email:" }), _jsx(Text, { style: styles.companyInfo, wrap: true, children: invoice.payer.contactInfo.email })] }))] }), _jsxs(View, { style: {
344
- width: "30%",
345
- alignItems: "flex-end",
346
- textAlign: "right",
347
- }, children: [_jsxs(View, { style: { marginBottom: 5, width: "100%" }, children: [_jsx(Text, { style: {
348
- color: "#9ea0a2",
349
- fontSize: 12,
350
- textAlign: "right",
351
- fontFamily: "Helvetica",
352
- fontWeight: "normal",
353
- }, children: "Invoice date" }), _jsx(Text, { style: {
354
- fontWeight: 4,
355
- fontSize: 12,
356
- textAlign: "right",
357
- color: "#000",
358
- fontFamily: "Helvetica",
359
- }, children: formatDate(invoice.dateIssued) })] }), invoice.dateDelivered && (_jsxs(View, { style: { marginBottom: 5, width: "100%" }, children: [_jsx(Text, { style: {
360
- color: "#9ea0a2",
361
- fontSize: 12,
362
- textAlign: "right",
363
- fontFamily: "Helvetica",
364
- fontWeight: "normal",
365
- }, children: "Delivery date" }), _jsx(Text, { style: {
366
- fontWeight: 4,
367
- fontSize: 12,
368
- textAlign: "right",
369
- color: "#000",
370
- fontFamily: "Helvetica",
371
- }, children: formatDate(invoice.dateDelivered) })] })), _jsxs(View, { style: { marginBottom: 5, width: "100%" }, children: [_jsx(Text, { style: {
372
- color: "#9ea0a2",
373
- fontSize: 12,
374
- textAlign: "right",
375
- fontFamily: "Helvetica",
376
- fontWeight: "normal",
377
- }, children: "Due date" }), _jsx(Text, { style: {
378
- fontWeight: 4,
379
- fontSize: 12,
380
- textAlign: "right",
381
- color: "#000",
382
- fontFamily: "Helvetica",
383
- }, children: formatDate(invoice.dateDue) })] })] })] }), _jsxs(View, { style: [styles.paymentSection, { marginLeft: 0 }], children: [_jsx(Text, { style: styles.sectionTitle, children: "Payment Information" }), fiatMode ? (_jsx("div", { children: _jsx(PaymentSectionFiat, { paymentRouting: invoice.issuer.paymentRouting }) })) : (_jsx(PaymentSectionCrypto, { paymentRouting: invoice.issuer.paymentRouting }))] })] })), _jsxs(View, { style: styles.table, children: [_jsxs(View, { style: styles.tableHeader, children: [_jsx(Text, { style: styles.tableCol40, children: "Description" }), _jsx(Text, { style: styles.tableCol15, children: "Quantity" }), _jsx(Text, { style: styles.tableCol15, children: "Unit Price" }), _jsx(Text, { style: styles.tableCol15, children: "Tax" }), _jsx(Text, { style: styles.tableCol15, children: "Total" })] }), items.map((item, index) => (_jsx(InvoiceLineItem, { item: item, currency: invoice.currency }, index + pageIndex * 1000)))] }), pageIndex === totalPages - 1 && (_jsx(_Fragment, { children: _jsxs(View, { style: { flexDirection: "row", gap: 20 }, children: [_jsxs(View, { style: {
350
+ "" })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Address:" }), _jsx(Text, { style: styles.companyInfo, wrap: true, hyphenationCallback: (word) => [word], children: invoice.payer.address?.streetAddress || "" })] }), invoice.payer.address?.extendedAddress && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, hyphenationCallback: (word) => [word] }), _jsx(Text, { style: styles.companyInfo, wrap: true, hyphenationCallback: (word) => [word], children: invoice.payer.address?.extendedAddress || "" })] })), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, hyphenationCallback: (word) => [word] }), _jsxs(Text, { style: styles.companyInfo, wrap: true, hyphenationCallback: (word) => [word], children: [invoice.payer.address?.city || "", ",", " ", invoice.payer.address?.stateProvince || "", ",", " ", getCountryName(invoice.payer.address?.country || "") ||
351
+ ""] })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Postcode:" }), _jsx(Text, { style: styles.companyInfo, hyphenationCallback: (word) => [word], children: invoice.payer.address?.postalCode || "" })] }), invoice.payer.contactInfo?.email && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Email:" }), _jsx(Text, { style: styles.companyInfo, wrap: true, children: invoice.payer.contactInfo.email })] }))] })] }), _jsxs(View, { style: [styles.paymentSection, { marginLeft: 0 }], children: [_jsx(Text, { style: styles.sectionTitle, children: "Payment Information" }), fiatMode ? (_jsx("div", { children: _jsx(PaymentSectionFiat, { paymentRouting: invoice.issuer.paymentRouting }) })) : (_jsx(PaymentSectionCrypto, { paymentRouting: invoice.issuer.paymentRouting }))] })] })), _jsxs(View, { style: styles.table, children: [_jsxs(View, { style: styles.tableHeader, children: [_jsx(Text, { style: styles.tableCol40, children: "Description" }), _jsx(Text, { style: styles.tableCol15, children: "Quantity" }), _jsx(Text, { style: styles.tableCol18, children: "Unit Price" }), _jsx(Text, { style: styles.tableCol12, children: "Tax" }), _jsx(Text, { style: styles.tableCol18, children: "Total" })] }), items.map((item, index) => (_jsx(InvoiceLineItem, { item: item, currency: invoice.currency }, index + pageIndex * 1000)))] }), pageIndex === totalPages - 1 && (_jsx(_Fragment, { children: _jsxs(View, { style: { flexDirection: "row", gap: 20 }, children: [_jsxs(View, { style: {
384
352
  flex: 1,
385
353
  marginTop: 20,
386
354
  }, children: [_jsx(Text, { style: [styles.sectionTitle, { marginBottom: 10 }], children: invoice.notes ? "Notes" : "" }), _jsx(Text, { style: styles.companyInfo, children: invoice.notes || "" })] }), _jsxs(View, { style: [styles.totals, { flex: 1 }], children: [_jsxs(View, { style: styles.totalRow, children: [_jsx(Text, { style: styles.totalLabel, children: "Subtotal" }), _jsx(Text, { style: styles.totalValue, children: formatCurrency(invoice.lineItems.reduce((sum, item) => sum + item.quantity * item.unitPriceTaxExcl, 0), invoice.currency) })] }), _jsxs(View, { style: styles.totalRow, children: [_jsx(Text, { style: styles.totalLabel, children: "Tax" }), _jsx(Text, { style: styles.totalValue, children: formatCurrency(invoice.lineItems.reduce((sum, item) => sum +
@@ -403,12 +371,21 @@ export const InvoicePDF = ({ invoice, fiatMode, }) => {
403
371
  }
404
372
  const PaymentSectionFiat = ({ paymentRouting, }) => {
405
373
  console.log("paymentRouting", paymentRouting.bank);
406
- return (_jsxs(View, { style: [styles.gridContainer, { marginTop: 0, marginLeft: 0 }], children: [_jsxs(View, { style: styles.gridColumn, children: [_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Bank Name:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.name || "" })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Address:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.address?.streetAddress || "" })] }), paymentRouting.bank?.address?.extendedAddress && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.address?.extendedAddress })] })), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel }), _jsxs(Text, { style: styles.companyInfo, children: [paymentRouting.bank?.address?.city || "", ",", " ", paymentRouting.bank?.address?.stateProvince || "", ",", " ", getCountryName(paymentRouting.bank?.address?.country || "") || ""] })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Postcode:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.address?.postalCode || "00000" })] })] }), _jsxs(View, { style: [styles.gridColumn], children: [_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Beneficiary:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.beneficiary || "" })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Acct No:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.accountNum || "" })] }), paymentRouting.bank?.ABA && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "ABA/ACH:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.ABA })] })), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "BIC/SWIFT:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.BIC || paymentRouting.bank?.SWIFT || "" })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Acct Type:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.accountType || "" })] }), paymentRouting.bank?.intermediaryBank?.accountNum && (_jsxs(_Fragment, { children: [_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Bank:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.name })] }), paymentRouting.bank?.intermediaryBank?.accountNum && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Acct:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.accountNum })] })), paymentRouting.bank?.intermediaryBank?.accountType && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Type:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.accountType })] })), paymentRouting.bank?.intermediaryBank?.beneficiary && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Beneficiary:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.beneficiary })] })), paymentRouting.bank?.intermediaryBank?.ABA && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary ABA:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.ABA })] })), (paymentRouting.bank?.intermediaryBank?.BIC || paymentRouting.bank?.intermediaryBank?.SWIFT) && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary BIC/SWIFT:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.BIC || paymentRouting.bank?.intermediaryBank?.SWIFT })] })), paymentRouting.bank?.intermediaryBank?.address?.streetAddress && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Address:" }), _jsxs(Text, { style: styles.companyInfo, children: [paymentRouting.bank?.intermediaryBank?.address?.streetAddress, paymentRouting.bank?.intermediaryBank?.address?.extendedAddress &&
407
- `, ${paymentRouting.bank?.intermediaryBank?.address?.extendedAddress}`] })] })), (paymentRouting.bank?.intermediaryBank?.address?.city || paymentRouting.bank?.intermediaryBank?.address?.stateProvince || paymentRouting.bank?.intermediaryBank?.address?.postalCode) && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Location:" }), _jsx(Text, { style: styles.companyInfo, children: [
374
+ return (_jsxs(View, { style: [styles.gridContainer, { marginTop: 0, marginLeft: 0 }], children: [_jsxs(View, { style: styles.gridColumn, children: [_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Bank Name:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.name || "" })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Address:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.address?.streetAddress || "" })] }), paymentRouting.bank?.address?.extendedAddress && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.address?.extendedAddress })] })), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel }), _jsxs(Text, { style: styles.companyInfo, children: [paymentRouting.bank?.address?.city || "", ",", " ", paymentRouting.bank?.address?.stateProvince || "", ",", " ", getCountryName(paymentRouting.bank?.address?.country || "") || ""] })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Postcode:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.address?.postalCode || "00000" })] })] }), _jsxs(View, { style: [styles.gridColumn, { paddingLeft: 12 }], children: [_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Beneficiary:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.beneficiary || "" })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Acct No:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.accountNum || "" })] }), paymentRouting.bank?.ABA && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "ABA/ACH:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.ABA })] })), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "BIC/SWIFT:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.BIC || paymentRouting.bank?.SWIFT || "" })] }), _jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Acct Type:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.accountType || "" })] }), paymentRouting.bank?.intermediaryBank?.accountNum && (_jsxs(_Fragment, { children: [_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Bank:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.name })] }), paymentRouting.bank?.intermediaryBank?.accountNum && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Acct:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.accountNum })] })), paymentRouting.bank?.intermediaryBank?.accountType && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Type:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.accountType })] })), paymentRouting.bank?.intermediaryBank?.beneficiary && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Beneficiary:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.beneficiary })] })), paymentRouting.bank?.intermediaryBank?.ABA && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary ABA:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.ABA })] })), (paymentRouting.bank?.intermediaryBank?.BIC ||
375
+ paymentRouting.bank?.intermediaryBank?.SWIFT) && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary BIC/SWIFT:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.BIC ||
376
+ paymentRouting.bank?.intermediaryBank?.SWIFT })] })), paymentRouting.bank?.intermediaryBank?.address?.streetAddress && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Address:" }), _jsxs(Text, { style: styles.companyInfo, children: [paymentRouting.bank?.intermediaryBank?.address
377
+ ?.streetAddress, paymentRouting.bank?.intermediaryBank?.address
378
+ ?.extendedAddress &&
379
+ `, ${paymentRouting.bank?.intermediaryBank?.address?.extendedAddress}`] })] })), (paymentRouting.bank?.intermediaryBank?.address?.city ||
380
+ paymentRouting.bank?.intermediaryBank?.address?.stateProvince ||
381
+ paymentRouting.bank?.intermediaryBank?.address?.postalCode) && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Location:" }), _jsx(Text, { style: styles.companyInfo, children: [
408
382
  paymentRouting.bank?.intermediaryBank?.address?.city,
409
- paymentRouting.bank?.intermediaryBank?.address?.stateProvince,
410
- paymentRouting.bank?.intermediaryBank?.address?.postalCode
411
- ].filter(Boolean).join(', ') })] })), paymentRouting.bank?.intermediaryBank?.address?.country && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Country:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.address?.country })] })), paymentRouting.bank?.intermediaryBank?.memo && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Memo:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.memo })] }))] }))] })] }));
383
+ paymentRouting.bank?.intermediaryBank?.address
384
+ ?.stateProvince,
385
+ paymentRouting.bank?.intermediaryBank?.address?.postalCode,
386
+ ]
387
+ .filter(Boolean)
388
+ .join(", ") })] })), paymentRouting.bank?.intermediaryBank?.address?.country && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Country:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.address?.country })] })), paymentRouting.bank?.intermediaryBank?.memo && (_jsxs(View, { style: styles.row, children: [_jsx(Text, { style: styles.companyInfoLabel, children: "Intermediary Memo:" }), _jsx(Text, { style: styles.companyInfo, children: paymentRouting.bank?.intermediaryBank?.memo })] }))] }))] })] }));
412
389
  };
413
390
  {
414
391
  /* New component for crypto payment section */
@@ -417,6 +394,4 @@ const PaymentSectionCrypto = ({ paymentRouting, }) => (_jsx(View, { style: style
417
394
  {
418
395
  /* New component for line items */
419
396
  }
420
- const InvoiceLineItem = ({ item, currency, }) => (_jsxs(View, { style: styles.tableRow, children: [_jsxs(View, { style: styles.tableCol40, children: [_jsx(Text, { style: styles.itemName, children: item.description }), item.longDescription && (_jsx(Text, { style: styles.itemDescription, children: item.longDescription }))] }), _jsx(Text, { style: styles.tableCol15, children: item.quantity % 1 === 0
421
- ? item.quantity.toString()
422
- : item.quantity.toFixed(2) }), _jsx(Text, { style: styles.tableCol15, children: formatCurrency(item.unitPriceTaxExcl, currency) }), _jsx(Text, { style: styles.tableCol15, children: formatCurrency(item.unitPriceTaxIncl - item.unitPriceTaxExcl, currency) }), _jsx(Text, { style: styles.tableCol15, children: formatCurrency(item.quantity * item.unitPriceTaxIncl, currency) })] }));
397
+ const InvoiceLineItem = ({ item, currency, }) => (_jsxs(View, { style: styles.tableRow, children: [_jsxs(View, { style: styles.tableCol40, children: [_jsx(Text, { style: styles.itemName, hyphenationCallback: (word) => [word], children: item.description }), item.longDescription && (_jsx(Text, { style: styles.itemDescription, hyphenationCallback: (word) => [word], children: item.longDescription }))] }), _jsx(Text, { style: styles.tableCol15, children: item.quantity.toFixed(2) }), _jsx(Text, { style: styles.tableCol18, children: formatCurrency(item.unitPriceTaxExcl, currency) }), _jsx(Text, { style: styles.tableCol12, children: formatNumber(item.unitPriceTaxIncl - item.unitPriceTaxExcl) }), _jsx(Text, { style: styles.tableCol18, children: formatCurrency(item.quantity * item.unitPriceTaxIncl, currency) })] }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@powerhousedao/contributor-billing",
3
3
  "description": "Document models that help contributors of open organisations get paid anonymously for their work on a monthly basis.",
4
- "version": "0.0.93",
4
+ "version": "0.0.95",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
7
7
  "files": [