@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.js
CHANGED
|
@@ -1652,71 +1652,8 @@ var FormatCurrencyDetails = function FormatCurrencyDetails(value, currency, lang
|
|
|
1652
1652
|
formattedValue = format.format.replace("###", formattedValue);
|
|
1653
1653
|
formattedValue = formattedValue.replace("$$", symbol);
|
|
1654
1654
|
var currencySplit = formattedValue.split(format.decimal);
|
|
1655
|
-
var format2 = numberFormat[numberFormatObj];
|
|
1656
|
-
var startFromSymbol = format2.format.startsWith("$$");
|
|
1657
|
-
var currencySplitFormatedArr = format2.format.replace("###", "|###|").replace("$$", "|$$$$|").split("|").filter(function (v) {
|
|
1658
|
-
return v !== "";
|
|
1659
|
-
}).map(function (section) {
|
|
1660
|
-
if (section === "###") {
|
|
1661
|
-
var decimalArr = formatMoney(parseFloat(value), decimal, format2.decimal, format2.group, true).split(format.decimal);
|
|
1662
|
-
|
|
1663
|
-
if (decimalArr.length > 0) {
|
|
1664
|
-
decimalArr[0] = {
|
|
1665
|
-
type: "int",
|
|
1666
|
-
val: decimalArr[0]
|
|
1667
|
-
};
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
if (decimalArr.length > 1) {
|
|
1671
|
-
decimalArr.push({
|
|
1672
|
-
type: "decimal",
|
|
1673
|
-
val: decimalArr[1]
|
|
1674
|
-
});
|
|
1675
|
-
decimalArr[1] = {
|
|
1676
|
-
type: "decimalSeperator",
|
|
1677
|
-
val: format.decimal
|
|
1678
|
-
};
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
if (!startFromSymbol) {
|
|
1682
|
-
decimalArr = [{
|
|
1683
|
-
type: "negative",
|
|
1684
|
-
val: value < 0 ? "-" : ""
|
|
1685
|
-
}].concat(decimalArr);
|
|
1686
|
-
}
|
|
1687
|
-
|
|
1688
|
-
if (rtl && currencies[currencyName].rtl) {
|
|
1689
|
-
decimalArr = decimalArr.reverse();
|
|
1690
|
-
}
|
|
1691
|
-
|
|
1692
|
-
return decimalArr;
|
|
1693
|
-
} else if (section === "$$") {
|
|
1694
|
-
if (startFromSymbol) {
|
|
1695
|
-
return [{
|
|
1696
|
-
type: "negative",
|
|
1697
|
-
val: value < 0 ? "-" : ""
|
|
1698
|
-
}, {
|
|
1699
|
-
type: "symbol",
|
|
1700
|
-
val: symbol
|
|
1701
|
-
}];
|
|
1702
|
-
} else {
|
|
1703
|
-
return [{
|
|
1704
|
-
type: "symbol",
|
|
1705
|
-
val: symbol
|
|
1706
|
-
}];
|
|
1707
|
-
}
|
|
1708
|
-
} else {
|
|
1709
|
-
return [{
|
|
1710
|
-
type: "text",
|
|
1711
|
-
val: section
|
|
1712
|
-
}];
|
|
1713
|
-
}
|
|
1714
|
-
}).reduce(function (a, b) {
|
|
1715
|
-
return a.concat(b);
|
|
1716
|
-
});
|
|
1717
1655
|
return {
|
|
1718
1656
|
currencySplit: currencySplit,
|
|
1719
|
-
currencySplitFormatedArr: currencySplitFormatedArr,
|
|
1720
1657
|
format: format,
|
|
1721
1658
|
str: (value < 0 ? "-" : "") + formattedValue,
|
|
1722
1659
|
symbol: symbol
|
|
@@ -9748,7 +9685,7 @@ var CustomerCompat = function CustomerCompat(customer) {
|
|
|
9748
9685
|
|
|
9749
9686
|
var InvoiceCompat = function InvoiceCompat(doc) {
|
|
9750
9687
|
if (doc == null) return null;
|
|
9751
|
-
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"]]);
|
|
9688
|
+
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"]]);
|
|
9752
9689
|
return Object.fromEntries(Object.entries(doc).map(function (_ref4) {
|
|
9753
9690
|
var k = _ref4[0],
|
|
9754
9691
|
v = _ref4[1];
|
|
@@ -9815,7 +9752,7 @@ var DocumentDefinitionCompat = function DocumentDefinitionCompat(dd) {
|
|
|
9815
9752
|
|
|
9816
9753
|
var CompanyCompat = function CompanyCompat(doc) {
|
|
9817
9754
|
if (doc == null) return null;
|
|
9818
|
-
var mapping = new Map([["dateFormat", "df"], ["timeZone", "tz"], ["language", "la"], ["
|
|
9755
|
+
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"]]);
|
|
9819
9756
|
var rootMapping = new Map([["template", TemplateCompat], ["documentDefinitions", DocumentDefinitionCompat]]);
|
|
9820
9757
|
var newCompany = Object.fromEntries(Object.entries(doc).map(function (_ref6) {
|
|
9821
9758
|
var k = _ref6[0],
|