umwd-components 0.1.810 → 0.1.812

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.
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
- import { useState, useEffect, Fragment as Fragment$1 } from 'react';
9
+ import { useState, useEffect } from 'react';
10
10
  import IconButton from '@mui/material/IconButton';
11
11
  import Dialog from '@mui/material/Dialog';
12
12
  import DialogContent from '@mui/material/DialogContent';
@@ -106,45 +106,9 @@ const InvoicePDF = ({ props }) => {
106
106
  const { Document, Page, View, Text, StyleSheet } = pdfComponents;
107
107
  const styles = createStyles(StyleSheet);
108
108
  const { seller_business_credentials, seller_company_address, buyer_company_address, buyer_business_credentials, type, } = invoice;
109
- const renderCreditNote = () => (jsx(Document, { title: `credit_${safeGet(invoice, "invoice_number", "unknown")}`, children: jsxs(Page, { size: "A4", style: styles.page, children: [jsx(View, { style: styles.header, children: jsx(Text, { style: styles.h1, children: safeGet(seller_business_credentials, "company_name") }) }), jsx(View, { style: styles.section, children: jsx(Text, { style: styles.h2, children: "CREDIT NOTE" }) }), jsx(View, { style: styles.section, children: jsxs(View, { style: styles.row, children: [jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: styles.h3, children: "BILLING DETAILS" }), jsx(Text, { children: safeGet(buyer_business_credentials, "company_name") }), jsxs(Text, { children: [safeGet(invoice, "buyer_first_name"), " ", safeGet(invoice, "buyer_last_name")] }), jsxs(Text, { children: [safeGet(buyer_company_address, "street"), " ", safeGet(buyer_company_address, "street_number"), " ", safeGet(buyer_company_address, "street_number_addition")] }), jsxs(Text, { children: [safeGet(buyer_company_address, "postal_code"), " ", safeGet(buyer_company_address, "city")] })] }), jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: styles.h3, children: "FROM" }), jsx(Text, { children: safeGet(seller_business_credentials, "company_name") }), jsxs(Text, { children: [safeGet(seller_company_address, "street"), " ", safeGet(seller_company_address, "street_number"), " ", safeGet(seller_company_address, "street_number_addition")] }), jsxs(Text, { children: [safeGet(seller_company_address, "postal_code"), " ", safeGet(seller_company_address, "city")] }), jsx(Text, { style: { fontWeight: "bold", marginTop: 10 }, children: "CoC Number" }), jsx(Text, { children: safeGet(seller_business_credentials, "coc_number") }), jsx(Text, { style: { fontWeight: "bold", marginTop: 10 }, children: "VAT Number" }), jsx(Text, { children: safeGet(seller_business_credentials, "vat_number") })] })] }) }), jsx(View, { style: styles.section, children: jsxs(View, { style: styles.row, children: [jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: { fontWeight: "bold" }, children: "Invoice number: " }), jsx(Text, { children: safeGet(invoice, "invoice_number") })] }), safeGet(invoice, "customer_reference") && (jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: { fontWeight: "bold" }, children: "Your reference: " }), jsx(Text, { children: safeGet(invoice, "customer_reference") })] })), jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: { fontWeight: "bold" }, children: "Invoice date" }), jsx(Text, { children: safeGet(invoice, "invoice_date") })] })] }) }), jsxs(View, { style: styles.section, children: [jsx(Text, { style: styles.h3, children: "SUMMARY" }), jsxs(View, { style: styles.row, children: [invoice?.admin_items &&
110
- Array.isArray(invoice.admin_items) &&
111
- invoice.admin_items.length > 0 && (jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Line Item Number" }) })), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Title" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Amount" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "VAT rate" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "VAT" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Excl. VAT" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Incl. VAT" }) })] }), invoice?.items &&
112
- Array.isArray(invoice.items) &&
113
- invoice.items.map((item, index) => (jsx(Fragment$1, { children: jsxs(View, { style: styles.row, children: [jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: [item && "product_title" in item
114
- ? item.product_title
115
- : "", item && "item_description" in item
116
- ? item.item_description
117
- : ""] }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px" }, children: safeGet(item, "quantity") }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: [safeGet(item, "vat_rate"), " %"] }) }), jsx(View, { style: styles.productRowSection, children: item?.price_excl_vat && item?.price_incl_vat && (jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC", " ", (item.price_incl_vat - item.price_excl_vat)?.toFixed(2)] })) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price_excl_vat", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price_incl_vat", 0)?.toFixed(2)] }) })] }) }, `credit-item-${index}`))), invoice?.admin_items &&
118
- Array.isArray(invoice.admin_items) &&
119
- invoice.admin_items.map((item, index) => (jsx(Fragment$1, { children: jsxs(View, { style: styles.row, children: [jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px" }, children: safeGet(item, "line_item_number") }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px" }, children: safeGet(item, "description") }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px" }, children: safeGet(item, "quantity") }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: [safeGet(item, "price.vat_rate"), " %"] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price.vat", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price.price", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price.price_incl_vat", 0)?.toFixed(2)] }) })] }) }, `credit-admin-item-${index}`)))] }), jsxs(View, { style: styles.section, children: [jsx(Text, { style: styles.h3, children: "TOTALS" }), jsxs(View, { style: styles.row, children: [jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontWeight: "bold" }, children: "VAT" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontWeight: "bold" }, children: "Excl. VAT" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontWeight: "bold" }, children: "Incl. VAT" }) })] }), jsxs(View, { style: styles.row, children: [jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { children: ["\u20AC ", safeGet(invoice, "VAT_total", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { children: ["\u20AC ", safeGet(invoice, "total_excl_vat", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { children: ["\u20AC ", safeGet(invoice, "total_incl_vat", 0)?.toFixed(2)] }) })] })] }), jsx(View, { style: styles.section, children: jsxs(Text, { style: { ...styles.h3, border: "2px solid black", padding: 10 }, children: ["Total: \u20AC ", safeGet(invoice, "total_incl_vat", 0)?.toFixed(2)] }) })] }) }));
120
- if (type === "credit") {
121
- return renderCreditNote();
109
+ {
110
+ return (jsx(Document, { children: jsx(Page, { size: "A4", style: styles.page, children: jsx(View, { style: styles.header, children: jsx(Text, { style: styles.h1, children: "Test Invoice PDF" }) }) }) }));
122
111
  }
123
- if (type === "proforma") {
124
- return (jsx(Document, { title: `proforma_${safeGet(invoice, "invoice_number", "unknown")}`, children: jsxs(Page, { size: "A4", style: styles.page, children: [jsx(View, { style: styles.header, children: jsx(Text, { style: styles.h1, children: safeGet(seller_business_credentials, "company_name") }) }), jsxs(View, { style: styles.section, children: [jsx(Text, { style: styles.h2, children: "PROFORMA INVOICE" }), jsx(Text, { style: { fontSize: 10, marginTop: 5 }, children: "This is not a final invoice and cannot be used for tax purposes" })] }), jsx(View, { style: styles.section, children: jsxs(View, { style: styles.row, children: [jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: styles.h3, children: "BILLING DETAILS" }), jsx(Text, { children: safeGet(buyer_business_credentials, "company_name") }), jsxs(Text, { children: [safeGet(invoice, "buyer_first_name"), " ", safeGet(invoice, "buyer_last_name")] }), jsxs(Text, { children: [safeGet(buyer_company_address, "street"), " ", safeGet(buyer_company_address, "street_number"), " ", safeGet(buyer_company_address, "street_number_addition")] }), jsxs(Text, { children: [safeGet(buyer_company_address, "postal_code"), " ", safeGet(buyer_company_address, "city")] })] }), jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: styles.h3, children: "FROM" }), jsx(Text, { children: safeGet(seller_business_credentials, "company_name") }), jsxs(Text, { children: [safeGet(seller_company_address, "street"), " ", safeGet(seller_company_address, "street_number"), " ", safeGet(seller_company_address, "street_number_addition")] }), jsxs(Text, { children: [safeGet(seller_company_address, "postal_code"), " ", safeGet(seller_company_address, "city")] }), jsx(Text, { style: { fontWeight: "bold", marginTop: 10 }, children: "CoC Number" }), jsx(Text, { children: safeGet(seller_business_credentials, "coc_number") }), jsx(Text, { style: { fontWeight: "bold", marginTop: 10 }, children: "VAT Number" }), jsx(Text, { children: safeGet(seller_business_credentials, "vat_number") })] })] }) }), jsx(View, { style: styles.section, children: jsxs(View, { style: styles.row, children: [jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: { fontWeight: "bold" }, children: "Invoice number: " }), jsx(Text, { children: safeGet(invoice, "invoice_number") })] }), safeGet(invoice, "customer_reference") && (jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: { fontWeight: "bold" }, children: "Your reference: " }), jsx(Text, { children: safeGet(invoice, "customer_reference") })] })), jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: { fontWeight: "bold" }, children: "Invoice date" }), jsx(Text, { children: safeGet(invoice, "invoice_date") })] })] }) }), jsxs(View, { style: styles.section, children: [jsx(Text, { style: styles.h3, children: "SUMMARY" }), jsxs(View, { style: styles.row, children: [invoice?.admin_items &&
125
- Array.isArray(invoice.admin_items) &&
126
- invoice.admin_items.length > 0 && (jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Line Item Number" }) })), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Title" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Amount" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "VAT rate" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "VAT" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Excl. VAT" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Incl. VAT" }) })] }), invoice?.items &&
127
- Array.isArray(invoice.items) &&
128
- invoice.items.map((item, index) => (jsx(Fragment$1, { children: jsxs(View, { style: styles.row, children: [jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: [item && "product_title" in item
129
- ? item.product_title
130
- : "", item && "item_description" in item
131
- ? item.item_description
132
- : ""] }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px" }, children: safeGet(item, "quantity") }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: [safeGet(item, "vat_rate"), " %"] }) }), jsx(View, { style: styles.productRowSection, children: item?.price_excl_vat && item?.price_incl_vat && (jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC", " ", (item.price_incl_vat - item.price_excl_vat)?.toFixed(2)] })) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price_excl_vat", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price_incl_vat", 0)?.toFixed(2)] }) })] }) }, `proforma-item-${index}`))), invoice?.admin_items &&
133
- Array.isArray(invoice.admin_items) &&
134
- invoice.admin_items.map((item, index) => (jsx(Fragment$1, { children: jsxs(View, { style: styles.row, children: [jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px" }, children: safeGet(item, "line_item_number") }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px" }, children: safeGet(item, "description") }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px" }, children: safeGet(item, "quantity") }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: [safeGet(item, "price.vat_rate"), " %"] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price.vat", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price.price", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price.price_incl_vat", 0)?.toFixed(2)] }) })] }) }, `proforma-admin-item-${index}`)))] }), jsxs(View, { style: styles.section, children: [jsx(Text, { style: styles.h3, children: "TOTALS" }), jsxs(View, { style: styles.row, children: [jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontWeight: "bold" }, children: "VAT" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontWeight: "bold" }, children: "Excl. VAT" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontWeight: "bold" }, children: "Incl. VAT" }) })] }), jsxs(View, { style: styles.row, children: [jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { children: ["\u20AC ", safeGet(invoice, "VAT_total", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { children: ["\u20AC ", safeGet(invoice, "total_excl_vat", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { children: ["\u20AC ", safeGet(invoice, "total_incl_vat", 0)?.toFixed(2)] }) })] })] }), jsx(View, { style: styles.section, children: jsxs(Text, { style: { ...styles.h3, border: "2px solid black", padding: 10 }, children: ["Total Due: \u20AC ", safeGet(invoice, "total_incl_vat", 0)?.toFixed(2)] }) })] }) }));
135
- }
136
- // Default invoice
137
- return (jsx(Document, { title: `invoice_${safeGet(invoice, "invoice_number", "unknown")}`, children: jsxs(Page, { size: "A4", style: styles.page, children: [jsx(View, { style: styles.header, children: jsx(Text, { style: styles.h1, children: safeGet(seller_business_credentials, "company_name") }) }), jsx(View, { style: styles.section, children: jsx(Text, { style: styles.h2, children: "INVOICE" }) }), jsx(View, { style: styles.section, children: jsxs(View, { style: styles.row, children: [jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: styles.h3, children: "BILLING DETAILS" }), jsx(Text, { children: safeGet(buyer_business_credentials, "company_name") }), jsxs(Text, { children: [safeGet(invoice, "buyer_first_name"), " ", safeGet(invoice, "buyer_last_name")] }), jsxs(Text, { children: [safeGet(buyer_company_address, "street"), " ", safeGet(buyer_company_address, "street_number"), " ", safeGet(buyer_company_address, "street_number_addition")] }), jsxs(Text, { children: [safeGet(buyer_company_address, "postal_code"), " ", safeGet(buyer_company_address, "city")] })] }), jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: styles.h3, children: "FROM" }), jsx(Text, { children: safeGet(seller_business_credentials, "company_name") }), jsxs(Text, { children: [safeGet(seller_company_address, "street"), " ", safeGet(seller_company_address, "street_number"), " ", safeGet(seller_company_address, "street_number_addition")] }), jsxs(Text, { children: [safeGet(seller_company_address, "postal_code"), " ", safeGet(seller_company_address, "city")] }), jsx(Text, { style: { fontWeight: "bold", marginTop: 10 }, children: "CoC Number" }), jsx(Text, { children: safeGet(seller_business_credentials, "coc_number") }), jsx(Text, { style: { fontWeight: "bold", marginTop: 10 }, children: "VAT Number" }), jsx(Text, { children: safeGet(seller_business_credentials, "vat_number") })] })] }) }), jsx(View, { style: styles.section, children: jsxs(View, { style: styles.row, children: [jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: { fontWeight: "bold" }, children: "Invoice number: " }), jsx(Text, { children: safeGet(invoice, "invoice_number") })] }), safeGet(invoice, "customer_reference") && (jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: { fontWeight: "bold" }, children: "Your reference: " }), jsx(Text, { children: safeGet(invoice, "customer_reference") })] })), jsxs(View, { style: styles.rowSection, children: [jsx(Text, { style: { fontWeight: "bold" }, children: "Invoice date" }), jsx(Text, { children: safeGet(invoice, "invoice_date") })] })] }) }), jsxs(View, { style: styles.section, children: [jsx(Text, { style: styles.h3, children: "SUMMARY" }), jsxs(View, { style: styles.row, children: [invoice?.admin_items &&
138
- Array.isArray(invoice.admin_items) &&
139
- invoice.admin_items.length > 0 && (jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Line Item Number" }) })), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Title" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Amount" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "VAT rate" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "VAT" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Excl. VAT" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px", fontWeight: "bold" }, children: "Incl. VAT" }) })] }), invoice?.items &&
140
- Array.isArray(invoice.items) &&
141
- invoice.items.map((item, index) => (jsx(Fragment$1, { children: jsxs(View, { style: styles.row, children: [jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: [item && "product_title" in item
142
- ? item.product_title
143
- : "", item && "item_description" in item
144
- ? item.item_description
145
- : ""] }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px" }, children: safeGet(item, "quantity") }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: [safeGet(item, "vat_rate"), " %"] }) }), jsx(View, { style: styles.productRowSection, children: item?.price_excl_vat && item?.price_incl_vat && (jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC", " ", (item.price_incl_vat - item.price_excl_vat)?.toFixed(2)] })) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price_excl_vat", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price_incl_vat", 0)?.toFixed(2)] }) })] }) }, `invoice-item-${index}`))), invoice?.admin_items &&
146
- Array.isArray(invoice.admin_items) &&
147
- invoice.admin_items.map((item, index) => (jsx(Fragment$1, { children: jsxs(View, { style: styles.row, children: [jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px" }, children: safeGet(item, "line_item_number") }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px" }, children: safeGet(item, "description") }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontSize: "10px" }, children: safeGet(item, "quantity") }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: [safeGet(item, "price.vat_rate"), " %"] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price.vat", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price.price", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { style: { fontSize: "10px" }, children: ["\u20AC ", safeGet(item, "price.price_incl_vat", 0)?.toFixed(2)] }) })] }) }, `invoice-admin-item-${index}`)))] }), jsxs(View, { style: styles.section, children: [jsx(Text, { style: styles.h3, children: "TOTALS" }), jsxs(View, { style: styles.row, children: [jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontWeight: "bold" }, children: "VAT" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontWeight: "bold" }, children: "Excl. VAT" }) }), jsx(View, { style: styles.productRowSection, children: jsx(Text, { style: { fontWeight: "bold" }, children: "Incl. VAT" }) })] }), jsxs(View, { style: styles.row, children: [jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { children: ["\u20AC ", safeGet(invoice, "VAT_total", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { children: ["\u20AC ", safeGet(invoice, "total_excl_vat", 0)?.toFixed(2)] }) }), jsx(View, { style: styles.productRowSection, children: jsxs(Text, { children: ["\u20AC ", safeGet(invoice, "total_incl_vat", 0)?.toFixed(2)] }) })] })] }), jsx(View, { style: styles.section, children: jsxs(Text, { style: { ...styles.h3, border: "2px solid black", padding: 10 }, children: ["Total Due: \u20AC ", safeGet(invoice, "total_incl_vat", 0)?.toFixed(2)] }) })] }) }));
148
112
  };
149
113
  function InvoiceDownloadLink({ invoice }) {
150
114
  const { pdfComponents, loading, error } = usePDFRenderer();