@bookipi/htmlgenerator 1.12.0-alpha4 → 1.12.0-alpha6
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.
- package/dist/index.js +124 -5
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +124 -5
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -412,7 +412,7 @@ var en = (_deposit_due$terms$pr = {
|
|
|
412
412
|
return "This offer is valid from the date of issue and will expire at the close of business (" + x + "). Acceptance will be in the form of accepting and signing this proposal.";
|
|
413
413
|
}, _deposit_due$terms$pr.details_line_3 = function details_line_3(x, y, z) {
|
|
414
414
|
return x + " (" + y + "). " + z;
|
|
415
|
-
}, _deposit_due$terms$pr.details_line_3_1 = 'This offer is valid from the date of issue and will expire at the close of business', _deposit_due$terms$pr.details_line_3_2 = 'Acceptance will be in the form of accepting and signing this proposal.', _deposit_due$terms$pr.details_line_4 = "Please accept this proposal and terms of service. This creates a legally binding contract between us. At any time if you have any questions please contact us on the details above. These terms will be effective throughout the period of our engagement and may only be changed by the Parties' agreement in writing.", _deposit_due$terms$pr.supplier_details = 'Supplier Details', _deposit_due$terms$pr.customer_details = 'Customer Details', _deposit_due$terms$pr.effective_date = 'Dated', _deposit_due$terms$pr.supplier_empty = 'No supplier added yet.', _deposit_due$terms$pr.customer_empty = 'No customer added yet.', _deposit_due$terms$pr.kind_regards = 'Kind regards', _deposit_due$terms$pr.services_title = 'Billing Schedule', _deposit_due$terms$pr["total"] = 'Total:', _deposit_due$terms$pr.items_empty = 'No services added yet.', _deposit_due$terms$pr.agreement_title = 'Terms and Conditions', _deposit_due$terms$pr["signature"] = 'Signature', _deposit_due$terms$pr.proposal_id = 'Proposal ID:', _deposit_due$terms$pr.client = 'Client:', _deposit_due$terms$pr.email_addresses = 'Email address:', _deposit_due$terms$pr.ip = 'IP:', _deposit_due$terms$pr.time = 'Time:', _deposit_due$terms$pr.upgradeRequired = 'Upgrade required', _deposit_due$terms$pr.document = 'Document', _deposit_due$terms$pr["invoice"] = 'Invoice', _deposit_due$terms$pr.estimate = 'Estimate', _deposit_due$terms$pr.creditNote = 'Credit Note', _deposit_due$terms$pr.deliveryNote = 'Delivery Note', _deposit_due$terms$pr.purchaseOrder = 'Purchase Order', _deposit_due$terms$pr.Invoice = 'Invoice', _deposit_due$terms$pr["Estimate"] = 'Estimate', _deposit_due$terms$pr.creditnote = 'Credit Note', _deposit_due$terms$pr.service_delivery_date = 'Date of delivery or completion of service', _deposit_due$terms$pr["tax_label"] = 'VAT Rate', _deposit_due$terms$pr.label_siren = 'SIREN', _deposit_due$terms$pr.vat = 'VAT', _deposit_due$terms$pr);
|
|
415
|
+
}, _deposit_due$terms$pr.details_line_3_1 = 'This offer is valid from the date of issue and will expire at the close of business', _deposit_due$terms$pr.details_line_3_2 = 'Acceptance will be in the form of accepting and signing this proposal.', _deposit_due$terms$pr.details_line_4 = "Please accept this proposal and terms of service. This creates a legally binding contract between us. At any time if you have any questions please contact us on the details above. These terms will be effective throughout the period of our engagement and may only be changed by the Parties' agreement in writing.", _deposit_due$terms$pr.supplier_details = 'Supplier Details', _deposit_due$terms$pr.customer_details = 'Customer Details', _deposit_due$terms$pr.effective_date = 'Dated', _deposit_due$terms$pr.supplier_empty = 'No supplier added yet.', _deposit_due$terms$pr.customer_empty = 'No customer added yet.', _deposit_due$terms$pr.kind_regards = 'Kind regards', _deposit_due$terms$pr.services_title = 'Billing Schedule', _deposit_due$terms$pr["total"] = 'Total:', _deposit_due$terms$pr.items_empty = 'No services added yet.', _deposit_due$terms$pr.agreement_title = 'Terms and Conditions', _deposit_due$terms$pr["signature"] = 'Signature', _deposit_due$terms$pr.proposal_id = 'Proposal ID:', _deposit_due$terms$pr.client = 'Client:', _deposit_due$terms$pr.email_addresses = 'Email address:', _deposit_due$terms$pr.ip = 'IP:', _deposit_due$terms$pr.time = 'Time:', _deposit_due$terms$pr.upgradeRequired = 'Upgrade required', _deposit_due$terms$pr.document = 'Document', _deposit_due$terms$pr["invoice"] = 'Invoice', _deposit_due$terms$pr.estimate = 'Estimate', _deposit_due$terms$pr.creditNote = 'Credit Note', _deposit_due$terms$pr.deliveryNote = 'Delivery Note', _deposit_due$terms$pr.purchaseOrder = 'Purchase Order', _deposit_due$terms$pr.Invoice = 'Invoice', _deposit_due$terms$pr["Estimate"] = 'Estimate', _deposit_due$terms$pr.creditnote = 'Credit Note', _deposit_due$terms$pr.service_delivery_date = 'Date of delivery or completion of service', _deposit_due$terms$pr["tax_label"] = 'VAT Rate', _deposit_due$terms$pr.label_siren = 'SIREN', _deposit_due$terms$pr.vat = 'VAT', _deposit_due$terms$pr.total_tax = 'Total tax', _deposit_due$terms$pr);
|
|
416
416
|
|
|
417
417
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
418
418
|
|
|
@@ -11828,6 +11828,95 @@ var util = {
|
|
|
11828
11828
|
};
|
|
11829
11829
|
//# sourceMappingURL=index.modern.js.map
|
|
11830
11830
|
|
|
11831
|
+
var TWO_DECIMAL_TOLERANCE = 0.01;
|
|
11832
|
+
var resolveTaxAmount = function resolveTaxAmount(tax) {
|
|
11833
|
+
var rate = Number(tax === null || tax === void 0 ? void 0 : tax.rate) || 0;
|
|
11834
|
+
var taxableAmount = Number(tax === null || tax === void 0 ? void 0 : tax.taxableAmount) || 0;
|
|
11835
|
+
if ((tax === null || tax === void 0 ? void 0 : tax.taxAmount) != null && !Number.isNaN(Number(tax.taxAmount))) {
|
|
11836
|
+
return Number(tax.taxAmount);
|
|
11837
|
+
}
|
|
11838
|
+
return taxableAmount * rate / 100;
|
|
11839
|
+
};
|
|
11840
|
+
var getEInvoiceTaxLines = function getEInvoiceTaxLines(document) {
|
|
11841
|
+
var _document$eInvoicing;
|
|
11842
|
+
var taxesSummary = document === null || document === void 0 ? void 0 : (_document$eInvoicing = document.eInvoicing) === null || _document$eInvoicing === void 0 ? void 0 : _document$eInvoicing.taxesSummary;
|
|
11843
|
+
if (!Array.isArray(taxesSummary) || taxesSummary.length === 0) {
|
|
11844
|
+
return null;
|
|
11845
|
+
}
|
|
11846
|
+
return taxesSummary.map(function (tax) {
|
|
11847
|
+
var _tax$categoryCode;
|
|
11848
|
+
return {
|
|
11849
|
+
rate: Number(tax === null || tax === void 0 ? void 0 : tax.rate) || 0,
|
|
11850
|
+
categoryCode: (_tax$categoryCode = tax === null || tax === void 0 ? void 0 : tax.categoryCode) != null ? _tax$categoryCode : '',
|
|
11851
|
+
taxableAmount: Number(tax === null || tax === void 0 ? void 0 : tax.taxableAmount) || 0,
|
|
11852
|
+
taxAmount: resolveTaxAmount(tax)
|
|
11853
|
+
};
|
|
11854
|
+
}).sort(function (a, b) {
|
|
11855
|
+
return a.rate - b.rate || a.categoryCode.localeCompare(b.categoryCode);
|
|
11856
|
+
});
|
|
11857
|
+
};
|
|
11858
|
+
var isTaxSummaryMatching = function isTaxSummaryMatching(lines, document) {
|
|
11859
|
+
if (!Array.isArray(lines) || lines.length === 0) return false;
|
|
11860
|
+
var linesTotal = lines.reduce(function (acc, line) {
|
|
11861
|
+
return acc + line.taxAmount;
|
|
11862
|
+
}, 0);
|
|
11863
|
+
var expectedTax = (document === null || document === void 0 ? void 0 : document.tx) != null ? Number(document.tx) : (Number(document === null || document === void 0 ? void 0 : document.tt) || 0) - (Number(document === null || document === void 0 ? void 0 : document.st) || 0);
|
|
11864
|
+
if (Number.isNaN(expectedTax)) return false;
|
|
11865
|
+
var tolerance = TWO_DECIMAL_TOLERANCE * lines.length;
|
|
11866
|
+
return Math.abs(linesTotal - expectedTax) <= tolerance;
|
|
11867
|
+
};
|
|
11868
|
+
var formatTaxRate = function formatTaxRate(rate, locale) {
|
|
11869
|
+
try {
|
|
11870
|
+
return new Intl.NumberFormat(locale || 'en', {
|
|
11871
|
+
maximumFractionDigits: 2
|
|
11872
|
+
}).format(Number(rate) || 0);
|
|
11873
|
+
} catch (_unused) {
|
|
11874
|
+
return String(Number(rate) || 0);
|
|
11875
|
+
}
|
|
11876
|
+
};
|
|
11877
|
+
var getEInvoiceTaxLabel = function getEInvoiceTaxLabel(company, defaultLang) {
|
|
11878
|
+
var _ref, _ref2;
|
|
11879
|
+
var eInvoiceConfig = getEInvoiceConfig(company === null || company === void 0 ? void 0 : company.co);
|
|
11880
|
+
var configLabel = eInvoiceConfig !== null && eInvoiceConfig !== void 0 && eInvoiceConfig.taxLabel ? defaultLang === null || defaultLang === void 0 ? void 0 : defaultLang[eInvoiceConfig.taxLabel] : null;
|
|
11881
|
+
return (_ref = (_ref2 = configLabel != null ? configLabel : defaultLang === null || defaultLang === void 0 ? void 0 : defaultLang.vat) != null ? _ref2 : defaultLang === null || defaultLang === void 0 ? void 0 : defaultLang.tax) != null ? _ref : 'Tax';
|
|
11882
|
+
};
|
|
11883
|
+
|
|
11884
|
+
var checkHasShippingTaxRate = function checkHasShippingTaxRate(document) {
|
|
11885
|
+
return document.shippingTaxRate != null && document.shippingTaxRate !== '';
|
|
11886
|
+
};
|
|
11887
|
+
var computeShippingTax = function computeShippingTax(document) {
|
|
11888
|
+
var rate = checkHasShippingTaxRate(document) ? parseFloat(document.shippingTaxRate) : 0;
|
|
11889
|
+
var shipping = document.sp ? parseFloat(document.sp) : 0;
|
|
11890
|
+
if (!(rate > 0) || document.sntx || !shipping) {
|
|
11891
|
+
return 0;
|
|
11892
|
+
}
|
|
11893
|
+
return document.ti ? shipping * (1 - 1 / (1 + rate / 100)) : shipping * rate / 100;
|
|
11894
|
+
};
|
|
11895
|
+
var getShippingTaxBreakdown = function getShippingTaxBreakdown(document) {
|
|
11896
|
+
var hasShippingTaxRate = checkHasShippingTaxRate(document);
|
|
11897
|
+
var shippingTaxRate = hasShippingTaxRate ? parseFloat(document.shippingTaxRate) : 0;
|
|
11898
|
+
var shippingTax = computeShippingTax(document);
|
|
11899
|
+
var itemTax1 = document.tx ? parseFloat(document.tx) : 0;
|
|
11900
|
+
var itemTax2 = document.tx2 ? parseFloat(document.tx2) : 0;
|
|
11901
|
+
var shippingMatchesTax1 = hasShippingTaxRate && shippingTaxRate > 0 && !document.sntx && shippingTaxRate === parseFloat(document.tp || 0);
|
|
11902
|
+
var shippingMatchesTax2 = hasShippingTaxRate && shippingTaxRate > 0 && !document.sntx && !!document.ttx && shippingTaxRate === parseFloat(document.tp2 || 0) && !shippingMatchesTax1;
|
|
11903
|
+
var showTax1SubBreakdown = shippingMatchesTax1 && !!shippingTax;
|
|
11904
|
+
var showTax2SubBreakdown = shippingMatchesTax2 && !!shippingTax;
|
|
11905
|
+
var showSeparateShippingLine = hasShippingTaxRate && shippingTaxRate > 0 && !document.sntx && !shippingMatchesTax1 && !shippingMatchesTax2 && !!shippingTax;
|
|
11906
|
+
return {
|
|
11907
|
+
hasShippingTaxRate: hasShippingTaxRate,
|
|
11908
|
+
shippingTaxRate: shippingTaxRate,
|
|
11909
|
+
shippingTax: shippingTax,
|
|
11910
|
+
itemTax1: itemTax1,
|
|
11911
|
+
itemTax2: itemTax2,
|
|
11912
|
+
shippingMatchesTax1: shippingMatchesTax1,
|
|
11913
|
+
shippingMatchesTax2: shippingMatchesTax2,
|
|
11914
|
+
showTax1SubBreakdown: showTax1SubBreakdown,
|
|
11915
|
+
showTax2SubBreakdown: showTax2SubBreakdown,
|
|
11916
|
+
showSeparateShippingLine: showSeparateShippingLine
|
|
11917
|
+
};
|
|
11918
|
+
};
|
|
11919
|
+
|
|
11831
11920
|
var nl2br = function nl2br(str, is_xhtml) {
|
|
11832
11921
|
if (typeof str === "undefined" || str === null) {
|
|
11833
11922
|
return "";
|
|
@@ -11953,7 +12042,21 @@ var InvoiceContent = function InvoiceContent(_ref) {
|
|
|
11953
12042
|
t: t
|
|
11954
12043
|
});
|
|
11955
12044
|
var effectiveCurrency = document.currency || company.cr;
|
|
11956
|
-
|
|
12045
|
+
var eInvoiceTaxLines = getEInvoiceTaxLines(document);
|
|
12046
|
+
var eInvoiceTaxRowLabel = getEInvoiceTaxLabel(company, defaultLang);
|
|
12047
|
+
var shippingBreakdown = getShippingTaxBreakdown(document);
|
|
12048
|
+
var formatAmount = function formatAmount(amount) {
|
|
12049
|
+
return FormatCurrency$3(amount, effectiveCurrency, company.la, company.cf);
|
|
12050
|
+
};
|
|
12051
|
+
var shippingLabel = company.r_sp ? company.r_sp : defaultLang['shipping'];
|
|
12052
|
+
var subBreakdownRows = function subBreakdownRows(itemsAmount, shippingAmount) {
|
|
12053
|
+
return "<tr>\n <td class=\"text-md-right\" width=\"22%\" style=\"padding-left: 24px;\">" + defaultLang['item'] + "</td>\n <td class=\"text-right\" width=\"22%\">" + formatAmount(itemsAmount) + "</td>\n </tr>\n <tr>\n <td class=\"text-md-right\" width=\"22%\" style=\"padding-left: 24px;\">" + shippingLabel + "</td>\n <td class=\"text-right\" width=\"22%\">" + formatAmount(shippingAmount) + "</td>\n </tr>";
|
|
12054
|
+
};
|
|
12055
|
+
var defaultTaxRows = "" + (document.tx != 0 ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + ("" + displayTaxName1 + taxIncluded1 + "(" + document.tp + "%)") + "</td>\n <td class=\"text-right\" width=\"22%\">" + ("" + (document.t1d ? '(' : '') + formatAmount(shippingBreakdown.shippingMatchesTax1 ? shippingBreakdown.itemTax1 + shippingBreakdown.shippingTax : document.tx) + (document.t1d ? ')' : '')) + "</td>\n </tr>" + (shippingBreakdown.showTax1SubBreakdown ? subBreakdownRows(shippingBreakdown.itemTax1, shippingBreakdown.shippingTax) : '') : '') + (document.ttx && document.tx2 != 0 ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + ("" + displayTaxName2 + taxIncluded2 + "(" + document.tp2 + "%)") + "</td>\n <td class=\"text-right\" width=\"22%\">" + ("" + (document.t2d ? '(' : '') + formatAmount(shippingBreakdown.shippingMatchesTax2 ? shippingBreakdown.itemTax2 + shippingBreakdown.shippingTax : document.tx2) + (document.t2d ? ')' : '')) + "</td>\n </tr>" + (shippingBreakdown.showTax2SubBreakdown ? subBreakdownRows(shippingBreakdown.itemTax2, shippingBreakdown.shippingTax) : '') : '') + (shippingBreakdown.showSeparateShippingLine ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + (shippingLabel + " " + defaultLang['tax'] + (document.ti ? ' ' + defaultLang['included'] : '') + " (" + formatTaxRate(shippingBreakdown.shippingTaxRate, company.la) + "%)") + "</td>\n <td class=\"text-right\" width=\"22%\">" + formatAmount(shippingBreakdown.shippingTax) + "</td>\n </tr>" : '');
|
|
12056
|
+
var taxBreakdownRows = !eInvoiceTaxLines ? defaultTaxRows : isTaxSummaryMatching(eInvoiceTaxLines, document) ? eInvoiceTaxLines.map(function (line) {
|
|
12057
|
+
return "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + (eInvoiceTaxRowLabel + " (" + formatTaxRate(line.rate, company.la) + "%)") + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$3(line.taxAmount, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>";
|
|
12058
|
+
}).join('') : "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + (defaultLang['total_tax'] || 'Total tax') + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$3(document.tx || 0, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>";
|
|
12059
|
+
return html$8(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteralLoose(["<!-- begin invoice-content -->\n <div class=\"invoice-content\">\n <div class=\"table-responsive\">\n <table class=\"table table-invoice\">\n <thead>\n <tr class=\"table table-invoice\">\n <th\n class=\"text-left\"\n ", "\n >\n ", "\n </th>\n <th\n class=\"text-center d-none d-md-table-cell\"\n ", "\n >\n ", "\n </th>\n <th\n class=\"text-right d-none d-md-table-cell\"\n ", "\n >\n ", "\n </th>\n ", "\n <th\n class=\"text-right item-last\"\n ", "\n >\n ", "\n </th>\n </tr>\n </thead>\n <tbody>\n ", "\n </tbody>\n </table>\n </div>\n\n <hr />\n <div class=\"row\">\n <div class=\"col-12\">\n <table class=\"table table-borderless table-small\">\n <tbody>\n <tr>\n <td class=\"d-none d-md-table-cell\" width=\"50%\"></td>\n <td style=\"padding: 0;\">\n <table class=\"table table-borderless table-small\">\n <tr>\n <td class=\"text-md-right\" width=\"22%\">\n ", "\n </td>\n <td class=\"text-right\" width=\"22%\">\n ", "\n </td>\n </tr>\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <!-- end invoice-content -->"])), itemWidth[0] ? "width='" + itemWidth[0] + "'" : '', company.r_it ? company.r_it : defaultLang['item'], itemWidth[1] ? "width='" + itemWidth[1] + "'" : '', document.um ? document.um : company.r_q ? company.r_q : defaultLang['quantity'], itemWidth[2] ? "width='" + itemWidth[2] + "'" : '', company.r_p ? company.r_p : defaultLang['price'], discountOnItem ? "<th class=\"text-right d-none d-md-table-cell\" " + (itemWidth[3] ? "width='" + itemWidth[3] + "'" : '') + ">" + (company.r_dc ? company.r_dc : defaultLang['discount']) + "</th>" : '', itemWidth[4] ? "width='" + itemWidth[4] + "'" : '', company.r_a ? company.r_a : defaultLang['amount'], itemsContainer, company.r_sb ? company.r_sb : defaultLang['subtotal'], FormatCurrency$3(document.st, effectiveCurrency, company.la, company.cf), document.dc && !document.discountAfterTax ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + ((company.r_dc ? company.r_dc : defaultLang['discount']) + (document.dcpo && document.dcp ? ' (' + document.dcp + '%)' : '')) + "</td>\n <td class=\"text-right\" width=\"22%\">" + ('(' + FormatCurrency$3(document.dc, effectiveCurrency, company.la, company.cf) + ')') + "</td>\n </tr>" : '', document.sp && !document.sntx ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + (company.r_sp ? company.r_sp : defaultLang['shipping']) + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$3(document.sp, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '', taxBreakdownRows, document.dc && document.discountAfterTax ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + ((company.r_dc ? company.r_dc : defaultLang['discount']) + (document.dcpo && document.dcp ? ' (' + document.dcp + '%)' : '')) + "</td>\n <td class=\"text-right\" width=\"22%\">" + ('(' + FormatCurrency$3(document.dc, effectiveCurrency, company.la, company.cf) + ')') + "</td>\n </tr>" : '', document.sp && document.sntx ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + (company.r_sp ? company.r_sp : defaultLang['shipping']) + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$3(document.sp, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '', document.ti && !document.t1d && !document.t2d ? "<tr>\n <td class=\"text-md-right\" width=\"22%\" style=\"border-top: 1px solid #ddd\">" + (company.r_n ? company.r_n : defaultLang['net']) + "</td>\n <td class=\"text-right\" width=\"22%\" style=\"border-top: 1px solid #ddd\">" + FormatCurrency$3(document.tt - (document.tx || 0) - (document.tx2 || 0), effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '', document.ty == 1 || document.ty !== 1 && (document.t1d || document.ttx && document.tx2 > 0 && document.t2d) ? "<tr>\n <td class=\"text-md-right\" width=\"22%\" style=\"border-bottom: 1px solid #ddd\">" + (company.r_tt ? company.r_tt : defaultLang['total']) + "</td>\n <td class=\"text-right\" width=\"22%\" style=\"border-bottom: 1px solid #ddd\">" + FormatCurrency$3(document.tt ? document.tt : 0, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '', document.sca ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + defaultLang['credit_card_surcharge'] + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$3(document.sca, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '', document.hangingAmount && document.hangingAmount > 0 ? "<tr>\n <td class=\"text-md-right\" width=\"22%\" style=\"border-top: 1px solid #ddd\">" + (company.payment_in_progress ? company.payment_in_progress : defaultLang.payment_in_progress) + "</td>\n <td class=\"text-right\" width=\"22%\" style=\"border-top: 1px solid #ddd\">" + FormatCurrency$3(document.hangingAmount || 0, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '', document.ty == 1 && document.pma && document.pm ? paymentContainer : '', document.ty == 1 && isDeposit && document.depositAmount > 0 ? "\n <tr>\n <td class=\"text-md-right\" width=\"22%\" style=\"border-top: 1px solid #ddd\">" + (document.ty == 1 ? company.r_ad ? company.r_ad : defaultLang['amount_due'] : company.r_gt ? company.r_gt : defaultLang['grand_total']) + "</td>\n <td class=\"text-right\" width=\"22%\" style=\"border-top: 1px solid #ddd\">" + FormatCurrency$3(document.ad - (document.hangingAmount || 0), effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '');
|
|
11957
12060
|
};
|
|
11958
12061
|
|
|
11959
12062
|
var _templateObject$9, _templateObject2$2;
|
|
@@ -12143,7 +12246,7 @@ var PaymentInstructions = function PaymentInstructions(_ref) {
|
|
|
12143
12246
|
|
|
12144
12247
|
var COMPANY_KEYS = ['_id', 'fax', 'contactName', 'c', 'e', 'ph', 'tfn', 'la', 'cr', 'cf', 'tz', 'ls', 'doc', 'bn', 'tn', 'tn2', 'tp', 'tp2', 'ti', 'ttx', 't1d', 't2d', 'pi', 'p1', 'p2', 'p3', 'sg', 'a1', 'a2', 'a3', 'address', 'language', 'la', 'sc', 'sr', 'ai', 'ct', 'de', 'r_bs', 'r_tc', 'r_nt', 'r_deposit_due', 'r_ad', 'r_gt', 'r_po', 'r_bt', 'r_st', 'r_d', 'r_a', 'r_dc', 'r_ic', 'r_it', 'r_n', 'r_p', 'r_q', 'r_sb', 'r_sp', 'r_tt', 'r_pi', 'r_inv', 'r_est', 'r_crd', 'r_dd', 'df', 'lg', 'hasPaymentInstructionQRCode', 'updatedAt', 'payment_in_progress', 'eInvoicing', 'co'];
|
|
12145
12248
|
|
|
12146
|
-
var DOCUMENT_KEYS = ['_id', 'ad', 'ty', 'cu', 'currency', 'd', 'dd', 'rn', 'it', 'st', 'tx', 'tx2', 'tt', 'dc', 'dcp', 'dcpo', 'sp', 'sntx', 'tp', 'tp2', 'tn', 'tn2', 'tax1BaseAmount', 'tax2BaseAmount', 'ti', 'ttx', 't1d', 't2d', 'pm', 'sca', 'hangingAmount', 'depositAmount', 'um', 'shouldShowPaymentInstructions', 'customization', 'asi', 'no', 'proposal', 'd', 'rd', 'di', 'pon', 'pma', 'depositDue', 'noteHtml', 'nt', 'tc', 'sd', 'cs', 'a1', 'a2', 'a3', 't2di', 'dco', 'discountAfterTax', 'csd', 'tz', 'sent', 'isUserSignatureOverlayed', 'serviceDeliveryDate'];
|
|
12249
|
+
var DOCUMENT_KEYS = ['_id', 'ad', 'ty', 'cu', 'currency', 'd', 'dd', 'rn', 'it', 'st', 'tx', 'tx2', 'tt', 'dc', 'dcp', 'dcpo', 'sp', 'sntx', 'shippingTaxRate', 'tp', 'tp2', 'tn', 'tn2', 'tax1BaseAmount', 'tax2BaseAmount', 'ti', 'ttx', 't1d', 't2d', 'pm', 'sca', 'hangingAmount', 'depositAmount', 'um', 'shouldShowPaymentInstructions', 'customization', 'asi', 'no', 'proposal', 'd', 'rd', 'di', 'pon', 'pma', 'depositDue', 'noteHtml', 'nt', 'tc', 'sd', 'cs', 'a1', 'a2', 'a3', 't2di', 'dco', 'discountAfterTax', 'csd', 'tz', 'sent', 'isUserSignatureOverlayed', 'serviceDeliveryDate', 'eInvoicing'];
|
|
12147
12250
|
|
|
12148
12251
|
var decodeHtml = function decodeHtml(str) {
|
|
12149
12252
|
if (str === void 0) {
|
|
@@ -12339,7 +12442,9 @@ var getDefaultLang = function getDefaultLang(t, lang) {
|
|
|
12339
12442
|
siren: t ? t('label_siren') : lang['label_siren'],
|
|
12340
12443
|
vat: t ? t('vat') : lang['vat'],
|
|
12341
12444
|
serviceDeliveryDate: t ? t('service_delivery_date') : lang['service_delivery_date'],
|
|
12342
|
-
tax_label: t ? t('tax_label') : lang['tax_label']
|
|
12445
|
+
tax_label: t ? t('tax_label') : lang['tax_label'],
|
|
12446
|
+
total_tax: t ? t('total_tax') : lang['total_tax'],
|
|
12447
|
+
tax: t ? t('tax') : lang['tax']
|
|
12343
12448
|
};
|
|
12344
12449
|
};
|
|
12345
12450
|
|
|
@@ -12772,7 +12877,21 @@ var InvoiceContent$1 = function InvoiceContent(_ref) {
|
|
|
12772
12877
|
t: t
|
|
12773
12878
|
});
|
|
12774
12879
|
var effectiveCurrency = document.currency || company.cr;
|
|
12775
|
-
|
|
12880
|
+
var eInvoiceTaxLines = getEInvoiceTaxLines(document);
|
|
12881
|
+
var eInvoiceTaxRowLabel = getEInvoiceTaxLabel(company, defaultLang);
|
|
12882
|
+
var shippingBreakdown = getShippingTaxBreakdown(document);
|
|
12883
|
+
var formatAmount = function formatAmount(amount) {
|
|
12884
|
+
return FormatCurrency$7(amount, effectiveCurrency, company.la, company.cf);
|
|
12885
|
+
};
|
|
12886
|
+
var shippingLabel = company.r_sp ? company.r_sp : defaultLang['shipping'];
|
|
12887
|
+
var subBreakdownRows = function subBreakdownRows(itemsAmount, shippingAmount) {
|
|
12888
|
+
return "<tr>\n <td width=\"22%\" style=\"padding-left: 24px;\">" + defaultLang['item'] + "</td>\n <td class=\"text-right\" width=\"22%\">" + formatAmount(itemsAmount) + "</td>\n </tr>\n <tr>\n <td width=\"22%\" style=\"padding-left: 24px;\">" + shippingLabel + "</td>\n <td class=\"text-right\" width=\"22%\">" + formatAmount(shippingAmount) + "</td>\n </tr>";
|
|
12889
|
+
};
|
|
12890
|
+
var defaultTaxRows = "" + (document.tx != 0 ? "<tr>\n <td width=\"22%\">" + (displayTaxName1 + taxIncluded1 + '(' + document.tp + '%)') + "</td>\n <td class=\"text-right\" width=\"22%\">" + ((document.t1d ? '(' : '') + formatAmount(shippingBreakdown.shippingMatchesTax1 ? shippingBreakdown.itemTax1 + shippingBreakdown.shippingTax : document.tx) + (document.t1d ? ')' : '')) + "</td>\n </tr>" + (shippingBreakdown.showTax1SubBreakdown ? subBreakdownRows(shippingBreakdown.itemTax1, shippingBreakdown.shippingTax) : '') : '') + (document.ttx && document.tx2 != 0 ? "<tr>\n <td width=\"22%\">" + (displayTaxName2 + taxIncluded2 + '(' + document.tp2 + '%)') + "</td>\n <td class=\"text-right\" width=\"22%\">" + ((document.t2d ? '(' : '') + formatAmount(shippingBreakdown.shippingMatchesTax2 ? shippingBreakdown.itemTax2 + shippingBreakdown.shippingTax : document.tx2) + (document.t2d ? ')' : '')) + "</td>\n </tr>" + (shippingBreakdown.showTax2SubBreakdown ? subBreakdownRows(shippingBreakdown.itemTax2, shippingBreakdown.shippingTax) : '') : '') + (shippingBreakdown.showSeparateShippingLine ? "<tr>\n <td width=\"22%\">" + (shippingLabel + ' ' + defaultLang['tax'] + (document.ti ? ' ' + defaultLang['included'] : '') + ' (' + formatTaxRate(shippingBreakdown.shippingTaxRate, company.la) + '%)') + "</td>\n <td class=\"text-right\" width=\"22%\">" + formatAmount(shippingBreakdown.shippingTax) + "</td>\n </tr>" : '');
|
|
12891
|
+
var taxBreakdownRows = !eInvoiceTaxLines ? defaultTaxRows : isTaxSummaryMatching(eInvoiceTaxLines, document) ? eInvoiceTaxLines.map(function (line) {
|
|
12892
|
+
return "<tr>\n <td width=\"22%\">" + (eInvoiceTaxRowLabel + ' (' + formatTaxRate(line.rate, company.la) + '%)') + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$7(line.taxAmount, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>";
|
|
12893
|
+
}).join('') : "<tr>\n <td width=\"22%\">" + (defaultLang['total_tax'] || 'Total tax') + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$7(document.tx || 0, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>";
|
|
12894
|
+
return html$q(_templateObject$r || (_templateObject$r = _taggedTemplateLiteralLoose(["<!-- begin invoice-content -->\n <div class=\"invoice-content\">\n <div class=\"table-responsive\">\n <table\n class=\"table table-borderless table-invoice\"\n style=\"margin-bottom: 40px; table-layout: fixed;\"\n >\n <thead class=\"invoice-table-header invoice-items-head\">\n <tr class=\"table table-invoice\">\n <th\n class=\"text-left text-uppercase\"\n style=\"border-top-left-radius: 8px; border-bottom-left-radius: 8px;\"\n ", "\n >\n ", "\n </th>\n <th\n class=\"text-center text-uppercase d-none d-md-table-cell\"\n ", "\n >\n ", "\n </th>\n <th\n class=\"text-center text-uppercase d-none d-md-table-cell\"\n ", "\n >\n ", "\n </th>\n ", "\n <th\n class=\"text-right text-uppercase item-last\"\n style=\"border-top-right-radius: 8px; border-bottom-right-radius: 8px;\"\n ", "\n >\n ", "\n </th>\n </tr>\n </thead>\n <tbody>\n ", "\n </tbody>\n </table>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <table class=\"price-table table table-borderless table-small\">\n <tbody>\n <tr>\n <td class=\"d-none d-md-table-cell\" width=\"50%\"></td>\n <td style=\"padding: 0;\">\n <table class=\"price-table table table-borderless table-small\">\n <tr>\n <td width=\"22%\" style=\"border-top: 1px solid #E5E7EB\">\n ", "\n </td>\n <td\n class=\"text-right\"\n width=\"22%\"\n style=\"border-top: 1px solid #E5E7EB\"\n >\n ", "\n </td>\n </tr>\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n\n <!-- end invoice-content -->\n </div>"])), itemWidth[0] ? "width='" + itemWidth[0] + "'" : '', company.r_it ? company.r_it : defaultLang['item'], itemWidth[1] ? "width='" + itemWidth[1] + "'" : '', company.r_p ? company.r_p : defaultLang['price'], itemWidth[2] ? "width='" + itemWidth[2] + "'" : '', document.um ? document.um : company.r_q ? company.r_q : defaultLang['quantity'], discountOnItem ? "<th class=\"text-right text-uppercase d-none d-md-table-cell\" " + (itemWidth[3] ? "width='" + itemWidth[3] + "'" : '') + ">" + (company.r_dc ? company.r_dc : defaultLang['discount']) + "</th>" : '', itemWidth[4] ? "width='" + itemWidth[4] + "'" : '', company.r_a ? company.r_a : defaultLang['amount'], itemsContainer, company.r_sb ? company.r_sb : defaultLang['subtotal'], FormatCurrency$7(document.st, effectiveCurrency, company.la, company.cf), document.dc && !document.discountAfterTax ? "<tr>\n <td width=\"22%\">" + ((company.r_dc ? company.r_dc : defaultLang['discount']) + (document.dcpo && document.dcp ? ' (' + document.dcp + '%)' : '')) + "</td>\n <td class=\"text-right\" width=\"22%\">" + ('(' + FormatCurrency$7(document.dc, effectiveCurrency, company.la, company.cf) + ')') + "</td>\n </tr>" : '', document.sp && !document.sntx ? "<tr>\n <td width=\"22%\">" + (company.r_sp ? company.r_sp : defaultLang['shipping']) + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$7(document.sp, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '', taxBreakdownRows, document.dc && document.discountAfterTax ? "<tr>\n <td width=\"22%\">" + ((company.r_dc ? company.r_dc : defaultLang['discount']) + (document.dcpo && document.dcp ? ' (' + document.dcp + '%)' : '')) + "</td>\n <td class=\"text-right\" width=\"22%\">" + ('(' + FormatCurrency$7(document.dc, effectiveCurrency, company.la, company.cf) + ')') + "</td>\n </tr>" : '', document.sp && document.sntx ? "<tr>\n <td width=\"22%\">" + (company.r_sp ? company.r_sp : defaultLang['shipping']) + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$7(document.sp, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '', document.ti && !document.t1d && !document.t2d ? "<tr>\n <td width=\"22%\" style=\"border-top: 1px solid #E5E7EB\">" + (company.r_n ? company.r_n : defaultLang['net']) + "</td>\n <td class=\"text-right\" width=\"22%\" style=\"border-top: 1px solid #E5E7EB\">" + FormatCurrency$7(document.tt - (document.tx || 0) - (document.tx2 || 0), effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '', document.ty == 1 || document.ty !== 1 && (document.t1d || document.ttx && document.tx2 > 0 && document.t2d) ? "<tr>\n <td width=\"22%\">" + (company.r_tt ? company.r_tt : defaultLang['total']) + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$7(document.tt ? document.tt : 0, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '', document.sca ? "<tr>\n <td width=\"22%\">" + defaultLang['credit_card_surcharge'] + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$7(document.sca, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '', document.hangingAmount && document.hangingAmount > 0 ? "<tr>\n <td width=\"22%\" style=\"border-top: 1px solid #E5E7EB\">" + (company.payment_in_progress ? company.payment_in_progress : defaultLang.payment_in_progress) + "</td>\n <td class=\"text-right\" width=\"22%\" style=\"border-top: 1px solid #E5E7EB\">" + FormatCurrency$7(document.hangingAmount || 0, effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '', document.ty == 1 && document.pma && document.pm ? paymentContainer : '', document.ty == 1 && isDeposit && document.depositAmount > 0 ? "\n <tr>\n <td width=\"22%\" style=\"border-top: 1px solid #E5E7EB\">" + (document.ty == 1 ? company.r_ad ? company.r_ad : defaultLang['amount_due'] : company.r_gt ? company.r_gt : defaultLang['grand_total']) + "</td>\n <td class=\"text-right\" width=\"22%\" style=\"border-top: 1px solid #E5E7EB\">" + FormatCurrency$7(document.ad - (document.hangingAmount || 0), effectiveCurrency, company.la, company.cf) + "</td>\n </tr>" : '');
|
|
12776
12895
|
};
|
|
12777
12896
|
|
|
12778
12897
|
var _templateObject$s;
|