@powerhousedao/contributor-billing 0.0.93 → 0.0.94

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;AAyThD,UAAU,eAAe;IACvB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA8ahD,CAAC"}
@@ -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: "38%",
110
110
  paddingRight: 8,
111
111
  },
112
112
  tableCol15: {
113
113
  width: "15%",
114
114
  textAlign: "right",
115
115
  },
116
+ tableCol12: {
117
+ width: "12%",
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
  },
@@ -205,7 +213,7 @@ const styles = StyleSheet.create({
205
213
  },
206
214
  invoiceLabel: {
207
215
  fontSize: 14,
208
- marginRight: 4,
216
+ marginRight: 8,
209
217
  marginBottom: 4,
210
218
  fontFamily: "Helvetica",
211
219
  color: "#9ea0a2",
@@ -263,7 +271,8 @@ const formatDate = (dateString) => {
263
271
  const formatCurrency = (amount, currency) => {
264
272
  // Format number with appropriate decimal places
265
273
  const formattedAmount = formatNumber(amount);
266
- return `${formattedAmount} ${currency}`;
274
+ // Use non-breaking space to keep currency inline with value
275
+ return `${formattedAmount}\u00A0${currency}`;
267
276
  };
268
277
  // Helper function to format numbers with appropriate decimal places
269
278
  function formatNumber(value) {
@@ -310,77 +319,50 @@ export const InvoicePDF = ({ invoice, fiatMode, }) => {
310
319
  }, children: [_jsxs(View, { style: {
311
320
  flexDirection: "column",
312
321
  alignItems: "flex-start",
322
+ marginRight: 0,
313
323
  }, children: [_jsx(Text, { style: {
314
- fontSize: 20,
324
+ fontSize: 18,
315
325
  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: {
326
+ marginBottom: 20,
327
+ paddingRight: 100,
328
+ marginRight: 0,
329
+ }, hyphenationCallback: (word) => [word], children: invoice.issuer.name }), _jsxs(View, { style: {
330
+ flexDirection: "row",
331
+ alignItems: "flex-start",
332
+ gap: 24,
333
+ flexWrap: "nowrap",
334
+ }, children: [_jsxs(View, { children: [_jsx(Text, { style: styles.invoiceLabel, children: "Invoice number" }), _jsx(Text, { style: styles.invoiceNumber, children: invoice.invoiceNo })] }), _jsxs(View, { style: {
335
+ flexDirection: "row",
336
+ gap: 20,
337
+ alignItems: "flex-start",
338
+ }, children: [_jsxs(View, { children: [_jsx(Text, { style: styles.invoiceLabel, children: "Invoice date" }), _jsx(Text, { style: styles.invoiceNumber, children: formatDate(invoice.dateIssued) })] }), invoice.dateDelivered && (_jsxs(View, { children: [_jsx(Text, { style: styles.invoiceLabel, children: "Delivery date" }), _jsx(Text, { style: styles.invoiceNumber, children: formatDate(invoice.dateDelivered) })] })), _jsxs(View, { children: [_jsx(Text, { style: styles.invoiceLabel, children: "Due date" }), _jsx(Text, { style: styles.invoiceNumber, children: formatDate(invoice.dateDue) })] }), _jsxs(View, { children: [_jsxs(Text, { style: styles.invoiceLabel, children: ["Invoice of ", invoice.currency] }), _jsx(Text, { style: [
339
+ styles.invoiceNumber,
340
+ { fontWeight: "bold" },
341
+ ], children: formatNumber(invoice.totalPriceTaxIncl) })] })] })] })] }), _jsx(View, {})] }), _jsxs(View, { style: {
323
342
  flexDirection: "row",
324
343
  justifyContent: "space-between",
325
344
  marginTop: 20,
326
345
  }, children: [_jsxs(View, { style: {
327
- width: "50%",
346
+ width: "48%",
328
347
  minWidth: 0,
329
348
  flexDirection: "column",
330
- paddingRight: 65,
349
+ paddingRight: 30,
350
+ marginRight: 20,
331
351
  }, 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
352
  ?.taxId ||
333
353
  invoice.issuer
334
354
  .id?.corpRegId ||
335
355
  "" })] }), _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%",
356
+ width: "48%",
337
357
  minWidth: 0,
338
358
  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 ||
359
+ paddingRight: 0,
360
+ marginRight: 10,
361
+ }, 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
362
  invoice.payer
341
363
  .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: {
364
+ "" })] }), _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 || "") ||
365
+ ""] })] }), _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
366
  flex: 1,
385
367
  marginTop: 20,
386
368
  }, 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 +385,21 @@ export const InvoicePDF = ({ invoice, fiatMode, }) => {
403
385
  }
404
386
  const PaymentSectionFiat = ({ paymentRouting, }) => {
405
387
  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: [
388
+ 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 ||
389
+ 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 ||
390
+ 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
391
+ ?.streetAddress, paymentRouting.bank?.intermediaryBank?.address
392
+ ?.extendedAddress &&
393
+ `, ${paymentRouting.bank?.intermediaryBank?.address?.extendedAddress}`] })] })), (paymentRouting.bank?.intermediaryBank?.address?.city ||
394
+ paymentRouting.bank?.intermediaryBank?.address?.stateProvince ||
395
+ 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
396
  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 })] }))] }))] })] }));
397
+ paymentRouting.bank?.intermediaryBank?.address
398
+ ?.stateProvince,
399
+ paymentRouting.bank?.intermediaryBank?.address?.postalCode,
400
+ ]
401
+ .filter(Boolean)
402
+ .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
403
  };
413
404
  {
414
405
  /* New component for crypto payment section */
@@ -417,6 +408,4 @@ const PaymentSectionCrypto = ({ paymentRouting, }) => (_jsx(View, { style: style
417
408
  {
418
409
  /* New component for line items */
419
410
  }
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) })] }));
411
+ 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.94",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
7
7
  "files": [