@bookipi/htmlgenerator 1.1.23-alpha14 → 1.1.23-alpha17
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 +2 -65
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +2 -65
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1650,71 +1650,8 @@ var FormatCurrencyDetails = function FormatCurrencyDetails(value, currency, lang
|
|
|
1650
1650
|
formattedValue = format.format.replace("###", formattedValue);
|
|
1651
1651
|
formattedValue = formattedValue.replace("$$", symbol);
|
|
1652
1652
|
var currencySplit = formattedValue.split(format.decimal);
|
|
1653
|
-
var format2 = numberFormat[numberFormatObj];
|
|
1654
|
-
var startFromSymbol = format2.format.startsWith("$$");
|
|
1655
|
-
var currencySplitFormatedArr = format2.format.replace("###", "|###|").replace("$$", "|$$$$|").split("|").filter(function (v) {
|
|
1656
|
-
return v !== "";
|
|
1657
|
-
}).map(function (section) {
|
|
1658
|
-
if (section === "###") {
|
|
1659
|
-
var decimalArr = formatMoney(parseFloat(value), decimal, format2.decimal, format2.group, true).split(format.decimal);
|
|
1660
|
-
|
|
1661
|
-
if (decimalArr.length > 0) {
|
|
1662
|
-
decimalArr[0] = {
|
|
1663
|
-
type: "int",
|
|
1664
|
-
val: decimalArr[0]
|
|
1665
|
-
};
|
|
1666
|
-
}
|
|
1667
|
-
|
|
1668
|
-
if (decimalArr.length > 1) {
|
|
1669
|
-
decimalArr.push({
|
|
1670
|
-
type: "decimal",
|
|
1671
|
-
val: decimalArr[1]
|
|
1672
|
-
});
|
|
1673
|
-
decimalArr[1] = {
|
|
1674
|
-
type: "decimalSeperator",
|
|
1675
|
-
val: format.decimal
|
|
1676
|
-
};
|
|
1677
|
-
}
|
|
1678
|
-
|
|
1679
|
-
if (!startFromSymbol) {
|
|
1680
|
-
decimalArr = [{
|
|
1681
|
-
type: "negative",
|
|
1682
|
-
val: value < 0 ? "-" : ""
|
|
1683
|
-
}].concat(decimalArr);
|
|
1684
|
-
}
|
|
1685
|
-
|
|
1686
|
-
if (rtl && currencies[currencyName].rtl) {
|
|
1687
|
-
decimalArr = decimalArr.reverse();
|
|
1688
|
-
}
|
|
1689
|
-
|
|
1690
|
-
return decimalArr;
|
|
1691
|
-
} else if (section === "$$") {
|
|
1692
|
-
if (startFromSymbol) {
|
|
1693
|
-
return [{
|
|
1694
|
-
type: "negative",
|
|
1695
|
-
val: value < 0 ? "-" : ""
|
|
1696
|
-
}, {
|
|
1697
|
-
type: "symbol",
|
|
1698
|
-
val: symbol
|
|
1699
|
-
}];
|
|
1700
|
-
} else {
|
|
1701
|
-
return [{
|
|
1702
|
-
type: "symbol",
|
|
1703
|
-
val: symbol
|
|
1704
|
-
}];
|
|
1705
|
-
}
|
|
1706
|
-
} else {
|
|
1707
|
-
return [{
|
|
1708
|
-
type: "text",
|
|
1709
|
-
val: section
|
|
1710
|
-
}];
|
|
1711
|
-
}
|
|
1712
|
-
}).reduce(function (a, b) {
|
|
1713
|
-
return a.concat(b);
|
|
1714
|
-
});
|
|
1715
1653
|
return {
|
|
1716
1654
|
currencySplit: currencySplit,
|
|
1717
|
-
currencySplitFormatedArr: currencySplitFormatedArr,
|
|
1718
1655
|
format: format,
|
|
1719
1656
|
str: (value < 0 ? "-" : "") + formattedValue,
|
|
1720
1657
|
symbol: symbol
|
|
@@ -9747,7 +9684,7 @@ var CustomerCompat = function CustomerCompat(customer) {
|
|
|
9747
9684
|
|
|
9748
9685
|
var InvoiceCompat = function InvoiceCompat(doc) {
|
|
9749
9686
|
if (doc == null) return null;
|
|
9750
|
-
var mapping = new Map([["address1", "a1"], ["address2", "a2"], ["address3", "a3"], ["customer", ["cu", CustomerCompat]], ["items", ["it", ItemCompat]], ["taxInclusive", "ti"], ["taxPercentage", "tp"], ["taxDeductible", "t1d"], ["taxInclusive", "ti"], ["taxName", "tn"], ["enableTax2", "ttx"], ["taxName2", "tn2"], ["taxPercentage2", "tp2"], ["taxDeductible2", "t2d"], ["tax1_total", "tx"], ["tax2_total", "tx2"], ["taxDeductibleInc2", "t2di"], ["shippingCost", "sp"], ["shippingNonTax", "sntx"], ["total", "tt"], ["subtotal", "st"], ["amountDue", "ad"], ["discount", "dc"], ["discountOption", "dco"], ["discountPercentage", "dcp"], ["discountPercentageOption", "dcpo"], ["payments", ["pm", PaymentCompat]], ["timeZone", "tz"], ["type", "ty"], ["date", "d"], ["dueDate", "dd"], ["dueIn", "di"], ["removeDueDate", "rd"], ["purchaseOrderNumber", "pon"], ["note", "nt"], ["signDate", "sd"], ["customerSignature", "cs"], ["customerSigned", "cs"]]);
|
|
9687
|
+
var mapping = new Map([["address1", "a1"], ["address2", "a2"], ["address3", "a3"], ["customer", ["cu", CustomerCompat]], ["items", ["it", ItemCompat]], ["taxInclusive", "ti"], ["taxPercentage", "tp"], ["taxDeductible", "t1d"], ["taxInclusive", "ti"], ["taxName", "tn"], ["enableTax2", "ttx"], ["taxName2", "tn2"], ["taxPercentage2", "tp2"], ["taxDeductible2", "t2d"], ["tax1_total", "tx"], ["tax2_total", "tx2"], ["taxDeductibleInc2", "t2di"], ["shippingCost", "sp"], ["shippingNonTax", "sntx"], ["total", "tt"], ["subtotal", "st"], ["amountDue", "ad"], ["discount", "dc"], ["discountOption", "dco"], ["discountPercentage", "dcp"], ["discountPercentageOption", "dcpo"], ["payments", ["pm", PaymentCompat]], ["timeZone", "tz"], ["type", "ty"], ["date", "d"], ["dueDate", "dd"], ["dueIn", "di"], ["removeDueDate", "rd"], ["purchaseOrderNumber", "pon"], ["note", "nt"], ["signDate", "sd"], ["customerSignature", "cs"], ["customerSigned", "cs"], ["surchargeAmount", "sca"]]);
|
|
9751
9688
|
return Object.fromEntries(Object.entries(doc).map(function (_ref4) {
|
|
9752
9689
|
var k = _ref4[0],
|
|
9753
9690
|
v = _ref4[1];
|
|
@@ -9814,7 +9751,7 @@ var DocumentDefinitionCompat = function DocumentDefinitionCompat(dd) {
|
|
|
9814
9751
|
|
|
9815
9752
|
var CompanyCompat = function CompanyCompat(doc) {
|
|
9816
9753
|
if (doc == null) return null;
|
|
9817
|
-
var mapping = new Map([["dateFormat", "df"], ["timeZone", "tz"], ["language", "la"], ["
|
|
9754
|
+
var mapping = new Map([["dateFormat", "df"], ["timeZone", "tz"], ["language", "la"], ["businessNumber", "tfn"], ["abbrBusinessNumber", "bn"], ["paymentInstruction1", "p1"], ["paymentInstruction2", "p2"], ["paymentInstruction3", "p3"], ["invoiceColor", "ct"], ["taxPercentage", "tp"], ["taxDeductible", "t1d"], ["taxInclusive", "ti"], ["taxName", "tn"], ["twoTaxes", "ttx"], ["taxName2", "tn2"], ["taxPercentage2", "tp2"], ["taxDeductible2", "t2d"], ["name", "c"], ["hasPaymentInstruction", "pi"], ["additionalInfo", "ai"], ["phoneNumber", "ph"], ["displayEmail", "de"], ["email", "e"], ["logoExists", "lg"], ["currency", "cr"], ["hasSignature", "sg"], ["currencyFormat", "cf"]]);
|
|
9818
9755
|
var rootMapping = new Map([["template", TemplateCompat], ["documentDefinitions", DocumentDefinitionCompat]]);
|
|
9819
9756
|
var newCompany = Object.fromEntries(Object.entries(doc).map(function (_ref6) {
|
|
9820
9757
|
var k = _ref6[0],
|