@bookipi/htmlgenerator 1.1.23-alpha14 → 1.1.23-alpha15
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 +1 -64
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1 -64
- 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
|
|
@@ -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],
|