b23-lib 3.10.0 → 4.0.0
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/Auth/index.js +1 -1
- package/dist/Auth/index.js.map +1 -1
- package/dist/Auth/index.mjs +1 -1
- package/dist/Auth/index.mjs.map +1 -1
- package/dist/Classes/Cart.js +1 -1
- package/dist/Classes/Cart.js.map +1 -1
- package/dist/Classes/Cart.mjs +1 -1
- package/dist/Classes/Charge.d.mts +23 -7
- package/dist/Classes/Charge.d.ts +23 -7
- package/dist/Classes/Charge.js +1 -1
- package/dist/Classes/Charge.js.map +1 -1
- package/dist/Classes/Charge.mjs +1 -1
- package/dist/Classes/Coupon.js +1 -1
- package/dist/Classes/Coupon.js.map +1 -1
- package/dist/Classes/Coupon.mjs +1 -1
- package/dist/Classes/Inventory.js +1 -1
- package/dist/Classes/Inventory.js.map +1 -1
- package/dist/Classes/Inventory.mjs +1 -1
- package/dist/Classes/Invoice.d.mts +44 -10
- package/dist/Classes/Invoice.d.ts +44 -10
- package/dist/Classes/Invoice.js +1 -1
- package/dist/Classes/Invoice.js.map +1 -1
- package/dist/Classes/Invoice.mjs +1 -1
- package/dist/Classes/Invoice.mjs.map +1 -1
- package/dist/Classes/LineItem.d.mts +28 -8
- package/dist/Classes/LineItem.d.ts +28 -8
- package/dist/Classes/LineItem.js +1 -1
- package/dist/Classes/LineItem.js.map +1 -1
- package/dist/Classes/LineItem.mjs +1 -1
- package/dist/Classes/Order.js +1 -1
- package/dist/Classes/Order.js.map +1 -1
- package/dist/Classes/Order.mjs +1 -1
- package/dist/Classes/Product.js +1 -1
- package/dist/Classes/Product.js.map +1 -1
- package/dist/Classes/Product.mjs +1 -1
- package/dist/Classes/ShoppingContainer.d.mts +55 -26
- package/dist/Classes/ShoppingContainer.d.ts +55 -26
- package/dist/Classes/ShoppingContainer.js +1 -1
- package/dist/Classes/ShoppingContainer.js.map +1 -1
- package/dist/Classes/ShoppingContainer.mjs +1 -1
- package/dist/Classes/TieredPrice.js +1 -1
- package/dist/Classes/TieredPrice.js.map +1 -1
- package/dist/Classes/TieredPrice.mjs +1 -1
- package/dist/{chunk-MBR2GRKU.mjs → chunk-3SUQYXIJ.mjs} +2 -2
- package/dist/{chunk-MBR2GRKU.mjs.map → chunk-3SUQYXIJ.mjs.map} +1 -1
- package/dist/chunk-A2PC4S2X.mjs +2 -0
- package/dist/chunk-A2PC4S2X.mjs.map +1 -0
- package/dist/chunk-LE4HS2A6.mjs +2 -0
- package/dist/chunk-LE4HS2A6.mjs.map +1 -0
- package/dist/chunk-MWDQACOC.mjs +2 -0
- package/dist/chunk-MWDQACOC.mjs.map +1 -0
- package/dist/{chunk-4PTWJI6J.mjs → chunk-XXKEHCV5.mjs} +2 -2
- package/dist/chunk-XXKEHCV5.mjs.map +1 -0
- package/dist/chunk-YDSXBMNW.mjs +2 -0
- package/dist/chunk-YDSXBMNW.mjs.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-4PTWJI6J.mjs.map +0 -1
- package/dist/chunk-5N2HRXWJ.mjs +0 -2
- package/dist/chunk-5N2HRXWJ.mjs.map +0 -1
- package/dist/chunk-MPKIC2MS.mjs +0 -2
- package/dist/chunk-MPKIC2MS.mjs.map +0 -1
- package/dist/chunk-NXDEYUDI.mjs +0 -2
- package/dist/chunk-NXDEYUDI.mjs.map +0 -1
- package/dist/chunk-SZLAIOMF.mjs +0 -2
- package/dist/chunk-SZLAIOMF.mjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a,f}from'../chunk-
|
|
1
|
+
import {a,f}from'../chunk-XXKEHCV5.mjs';import'../chunk-7RAIVZKB.mjs';import'../chunk-UIQH5QIR.mjs';import'../chunk-PL5HGCWN.mjs';import'../chunk-O6BLQQO7.mjs';import {b}from'../chunk-UXZBULDS.mjs';var u=class extends b{productKey;stocks;constructor(r,o=new Date){super(r,o),this.productKey=r.productKey,this.stocks=r.stocks.map(e=>({selectionAttributes:a.deepClone(e.selectionAttributes),size:e.size,available:e.available,country:e.country}));}getProductKey(){return this.productKey}getStockData(r,o,e){let n=r?f.generateSelectionAttributesKey(r):void 0;return this.stocks.filter(t=>!(n&&f.generateSelectionAttributesKey(t.selectionAttributes)!==n||o&&t.size!==o||e&&t.country!==e)).map(t=>({selectionAttributes:a.deepClone(t.selectionAttributes),size:t.size,available:t.available,country:t.country}))}getDetails(){return {...super.getDetails(),productKey:this.getProductKey(),stocks:this.getStockData()}}};export{u as InventoryModel};//# sourceMappingURL=Inventory.mjs.map
|
|
2
2
|
//# sourceMappingURL=Inventory.mjs.map
|
|
@@ -32,13 +32,23 @@ type InvoiceLineItemData = {
|
|
|
32
32
|
name: string;
|
|
33
33
|
variantLabel: string;
|
|
34
34
|
quantity: number;
|
|
35
|
-
netUnitPrice: PriceData;
|
|
36
|
-
netSubtotal: PriceData;
|
|
37
35
|
taxTotal: PriceData;
|
|
38
|
-
grandTotal: PriceData;
|
|
39
36
|
taxBreakdown: Record<string, InvoiceTaxBreakdown>;
|
|
40
37
|
taxCode: string;
|
|
41
38
|
taxCodeType: string;
|
|
39
|
+
taxExclusive: {
|
|
40
|
+
unitPrice: PriceData;
|
|
41
|
+
subtotal: PriceData;
|
|
42
|
+
netUnitPrice: PriceData;
|
|
43
|
+
netSubtotal: PriceData;
|
|
44
|
+
};
|
|
45
|
+
taxInclusive: {
|
|
46
|
+
unitPrice: PriceData;
|
|
47
|
+
subtotal: PriceData;
|
|
48
|
+
netUnitPrice: PriceData;
|
|
49
|
+
netSubtotal: PriceData;
|
|
50
|
+
};
|
|
51
|
+
grandTotal: PriceData;
|
|
42
52
|
};
|
|
43
53
|
type InvoiceLineItemModel = {
|
|
44
54
|
id: string;
|
|
@@ -47,13 +57,23 @@ type InvoiceLineItemModel = {
|
|
|
47
57
|
name: string;
|
|
48
58
|
variantLabel: string;
|
|
49
59
|
quantity: number;
|
|
50
|
-
netUnitPrice: PriceModel;
|
|
51
|
-
netSubtotal: PriceModel;
|
|
52
60
|
taxTotal: PriceModel;
|
|
53
|
-
grandTotal: PriceModel;
|
|
54
61
|
taxBreakdown: Record<string, InvoiceTaxBreakdownModel>;
|
|
55
62
|
taxCode: string;
|
|
56
63
|
taxCodeType: string;
|
|
64
|
+
taxExclusive: {
|
|
65
|
+
unitPrice: PriceModel;
|
|
66
|
+
subtotal: PriceModel;
|
|
67
|
+
netUnitPrice: PriceModel;
|
|
68
|
+
netSubtotal: PriceModel;
|
|
69
|
+
};
|
|
70
|
+
taxInclusive: {
|
|
71
|
+
unitPrice: PriceModel;
|
|
72
|
+
subtotal: PriceModel;
|
|
73
|
+
netUnitPrice: PriceModel;
|
|
74
|
+
netSubtotal: PriceModel;
|
|
75
|
+
};
|
|
76
|
+
grandTotal: PriceModel;
|
|
57
77
|
};
|
|
58
78
|
type InvoiceChargeData = {
|
|
59
79
|
id: string;
|
|
@@ -61,12 +81,19 @@ type InvoiceChargeData = {
|
|
|
61
81
|
category: string;
|
|
62
82
|
impact: ChargeImpact;
|
|
63
83
|
name: string;
|
|
64
|
-
taxableValue: PriceData;
|
|
65
84
|
taxTotal: PriceData;
|
|
66
|
-
grandTotal: PriceData;
|
|
67
85
|
taxBreakdown: Record<string, InvoiceTaxBreakdown>;
|
|
68
86
|
taxCode: string;
|
|
69
87
|
taxCodeType: string;
|
|
88
|
+
taxExclusive: {
|
|
89
|
+
chargeAmount: PriceData;
|
|
90
|
+
netChargeAmount: PriceData;
|
|
91
|
+
};
|
|
92
|
+
taxInclusive: {
|
|
93
|
+
chargeAmount: PriceData;
|
|
94
|
+
netChargeAmount: PriceData;
|
|
95
|
+
};
|
|
96
|
+
grandTotal: PriceData;
|
|
70
97
|
};
|
|
71
98
|
type InvoiceChargeModel = {
|
|
72
99
|
id: string;
|
|
@@ -74,12 +101,19 @@ type InvoiceChargeModel = {
|
|
|
74
101
|
category: string;
|
|
75
102
|
impact: ChargeImpact;
|
|
76
103
|
name: string;
|
|
77
|
-
taxableValue: PriceModel;
|
|
78
104
|
taxTotal: PriceModel;
|
|
79
|
-
grandTotal: PriceModel;
|
|
80
105
|
taxBreakdown: Record<string, InvoiceTaxBreakdownModel>;
|
|
81
106
|
taxCode: string;
|
|
82
107
|
taxCodeType: string;
|
|
108
|
+
taxExclusive: {
|
|
109
|
+
chargeAmount: PriceModel;
|
|
110
|
+
netChargeAmount: PriceModel;
|
|
111
|
+
};
|
|
112
|
+
taxInclusive: {
|
|
113
|
+
chargeAmount: PriceModel;
|
|
114
|
+
netChargeAmount: PriceModel;
|
|
115
|
+
};
|
|
116
|
+
grandTotal: PriceModel;
|
|
83
117
|
};
|
|
84
118
|
type InvoiceTaxContextData = {
|
|
85
119
|
recipientTaxIdentifier: string;
|
|
@@ -32,13 +32,23 @@ type InvoiceLineItemData = {
|
|
|
32
32
|
name: string;
|
|
33
33
|
variantLabel: string;
|
|
34
34
|
quantity: number;
|
|
35
|
-
netUnitPrice: PriceData;
|
|
36
|
-
netSubtotal: PriceData;
|
|
37
35
|
taxTotal: PriceData;
|
|
38
|
-
grandTotal: PriceData;
|
|
39
36
|
taxBreakdown: Record<string, InvoiceTaxBreakdown>;
|
|
40
37
|
taxCode: string;
|
|
41
38
|
taxCodeType: string;
|
|
39
|
+
taxExclusive: {
|
|
40
|
+
unitPrice: PriceData;
|
|
41
|
+
subtotal: PriceData;
|
|
42
|
+
netUnitPrice: PriceData;
|
|
43
|
+
netSubtotal: PriceData;
|
|
44
|
+
};
|
|
45
|
+
taxInclusive: {
|
|
46
|
+
unitPrice: PriceData;
|
|
47
|
+
subtotal: PriceData;
|
|
48
|
+
netUnitPrice: PriceData;
|
|
49
|
+
netSubtotal: PriceData;
|
|
50
|
+
};
|
|
51
|
+
grandTotal: PriceData;
|
|
42
52
|
};
|
|
43
53
|
type InvoiceLineItemModel = {
|
|
44
54
|
id: string;
|
|
@@ -47,13 +57,23 @@ type InvoiceLineItemModel = {
|
|
|
47
57
|
name: string;
|
|
48
58
|
variantLabel: string;
|
|
49
59
|
quantity: number;
|
|
50
|
-
netUnitPrice: PriceModel;
|
|
51
|
-
netSubtotal: PriceModel;
|
|
52
60
|
taxTotal: PriceModel;
|
|
53
|
-
grandTotal: PriceModel;
|
|
54
61
|
taxBreakdown: Record<string, InvoiceTaxBreakdownModel>;
|
|
55
62
|
taxCode: string;
|
|
56
63
|
taxCodeType: string;
|
|
64
|
+
taxExclusive: {
|
|
65
|
+
unitPrice: PriceModel;
|
|
66
|
+
subtotal: PriceModel;
|
|
67
|
+
netUnitPrice: PriceModel;
|
|
68
|
+
netSubtotal: PriceModel;
|
|
69
|
+
};
|
|
70
|
+
taxInclusive: {
|
|
71
|
+
unitPrice: PriceModel;
|
|
72
|
+
subtotal: PriceModel;
|
|
73
|
+
netUnitPrice: PriceModel;
|
|
74
|
+
netSubtotal: PriceModel;
|
|
75
|
+
};
|
|
76
|
+
grandTotal: PriceModel;
|
|
57
77
|
};
|
|
58
78
|
type InvoiceChargeData = {
|
|
59
79
|
id: string;
|
|
@@ -61,12 +81,19 @@ type InvoiceChargeData = {
|
|
|
61
81
|
category: string;
|
|
62
82
|
impact: ChargeImpact;
|
|
63
83
|
name: string;
|
|
64
|
-
taxableValue: PriceData;
|
|
65
84
|
taxTotal: PriceData;
|
|
66
|
-
grandTotal: PriceData;
|
|
67
85
|
taxBreakdown: Record<string, InvoiceTaxBreakdown>;
|
|
68
86
|
taxCode: string;
|
|
69
87
|
taxCodeType: string;
|
|
88
|
+
taxExclusive: {
|
|
89
|
+
chargeAmount: PriceData;
|
|
90
|
+
netChargeAmount: PriceData;
|
|
91
|
+
};
|
|
92
|
+
taxInclusive: {
|
|
93
|
+
chargeAmount: PriceData;
|
|
94
|
+
netChargeAmount: PriceData;
|
|
95
|
+
};
|
|
96
|
+
grandTotal: PriceData;
|
|
70
97
|
};
|
|
71
98
|
type InvoiceChargeModel = {
|
|
72
99
|
id: string;
|
|
@@ -74,12 +101,19 @@ type InvoiceChargeModel = {
|
|
|
74
101
|
category: string;
|
|
75
102
|
impact: ChargeImpact;
|
|
76
103
|
name: string;
|
|
77
|
-
taxableValue: PriceModel;
|
|
78
104
|
taxTotal: PriceModel;
|
|
79
|
-
grandTotal: PriceModel;
|
|
80
105
|
taxBreakdown: Record<string, InvoiceTaxBreakdownModel>;
|
|
81
106
|
taxCode: string;
|
|
82
107
|
taxCodeType: string;
|
|
108
|
+
taxExclusive: {
|
|
109
|
+
chargeAmount: PriceModel;
|
|
110
|
+
netChargeAmount: PriceModel;
|
|
111
|
+
};
|
|
112
|
+
taxInclusive: {
|
|
113
|
+
chargeAmount: PriceModel;
|
|
114
|
+
netChargeAmount: PriceModel;
|
|
115
|
+
};
|
|
116
|
+
grandTotal: PriceModel;
|
|
83
117
|
};
|
|
84
118
|
type InvoiceTaxContextData = {
|
|
85
119
|
recipientTaxIdentifier: string;
|
package/dist/Classes/Invoice.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var y={INR:"\u20B9"},I={INR:"en-IN"};var g=class extends Error{constructor(e="Amount cannot be negative."){super(`InvalidAmount: ${e}`),this.name="InvalidPriceAmountError";}},l=class extends Error{constructor(e="Currency code is required."){super(`InvalidCurrency: ${e}`),this.name="InvalidCurrencyCodeError";}},c=class extends Error{constructor(e="Cannot perform operation on prices with different currencies."){super(`CurrencyMismatch: ${e}`),this.name="CurrencyMismatchError";}},a=class extends Error{constructor(e){super(`InvalidArgument: ${e}`),this.name="InvalidArgumentError";}};var i=class n{#e;amount;currency;constructor(e){if(this.#e="PriceModel",e.amount<0)throw new g("Amount cannot be negative.");if(!e.currency)throw new l("Currency code is required.");this.currency=e.currency,this.amount=parseFloat(e.amount.toFixed(n.getPrecisionPlaces(this.currency)));}get kind(){return this.#e}static isPriceModel(e){return typeof e=="object"&&e!==null&&e.kind==="PriceModel"}getCurrency(){return this.currency}getAmount(){return this.amount}getDetails(){return {amount:this.amount,currency:this.currency}}getPreciseAmount(e){return parseFloat(e.toFixed(n.getPrecisionPlaces(this.currency)))}compareTo(e){if(n.isPriceModel(e)){if(this.currency!==e.getCurrency())throw new c("Cannot compare prices in different currencies.")}else throw new a("Must be a PriceModel instance.");return this.getPreciseAmount(this.amount-e.getAmount())}add(e){if(n.isPriceModel(e)){if(this.currency!==e.getCurrency())throw new c("Cannot add prices in different currencies.")}else throw new a("Must be a PriceModel instance.");return new n({amount:this.getPreciseAmount(this.amount+e.getAmount()),currency:this.currency})}subtract(e){if(n.isPriceModel(e)){if(this.currency!==e.getCurrency())throw new c("Cannot subtract prices in different currencies.")}else throw new a("Must be a PriceModel instance.");return new n({amount:this.getPreciseAmount(this.amount-e.getAmount()),currency:this.currency})}multiply(e){if(n.isPriceModel(e)){if(this.currency!==e.getCurrency())throw new c("Cannot multiply prices in different currencies.");return new n({amount:this.getPreciseAmount(this.amount*e.getAmount()),currency:this.currency})}else if(typeof e=="number"&&e>=0)return new n({amount:this.getPreciseAmount(this.amount*e),currency:this.currency});throw new a("Must be a non-negative number.")}divide(e){if(n.isPriceModel(e)){if(this.currency!==e.getCurrency())throw new c("Cannot divide prices in different currencies.");return new n({amount:this.getPreciseAmount(this.amount/e.getAmount()),currency:this.currency})}else if(typeof e=="number"&&e>0)return new n({amount:this.getPreciseAmount(this.amount/e),currency:this.currency});throw new a("Must be a positive number.")}min(...e){if(e.length===0)throw new a("Must provide at least one PriceModel.");return e.reduce((t,r)=>{if(n.isPriceModel(r)){if(t.getCurrency()!==r.getCurrency())throw new c("Cannot compare prices in different currencies.")}else throw new a("Must be a PriceModel instance.");return t.compareTo(r)<0?t:r},this)}max(...e){if(e.length===0)throw new a("Must provide at least one PriceModel.");return e.reduce((t,r)=>{if(n.isPriceModel(r)){if(t.getCurrency()!==r.getCurrency())throw new c("Cannot compare prices in different currencies.")}else throw new a("Must be a PriceModel instance.");return t.compareTo(r)>0?t:r},this)}zero(){return new n({currency:this.currency,amount:0})}isZero(){return this.amount===0}round(){return new n({currency:this.currency,amount:this.getRoundedAmount()})}getRoundedAmount(){return n.getRoundedAmount(this.amount,this.currency)}getFormattedString(){return n.getFormattedString(this.amount,this.currency)}toString(){return this.getFormattedString()}static getFormattedString(e,t,r={displayAsInteger:!1,style:"currency",currencyDisplay:"symbol"}){let s=I[t];if(!t||!s)throw new l("Invalid currency code for formatting.");let o=e,p=r.displayAsInteger?0:n.getDecimalPlaces(t),C={style:r.style??"currency",currency:t,signDisplay:"never",currencyDisplay:r.currencyDisplay,minimumFractionDigits:p,maximumFractionDigits:p};r.displayAsInteger&&(o=Math.ceil(o));try{return new Intl.NumberFormat(s,C).format(o)}catch(b){return console.error(`Error formatting price for currency "${t}" and locale "${s}":`,b),`${y[t]??t} ${n.addThousandSeparators(o.toFixed(p))}`}}static getDecimalPlaces(e){switch(e){case"INR":default:return 2}}static getPrecisionPlaces(e){switch(e){case"INR":default:return 6}}static addThousandSeparators(e){let t=e.split("."),r=t[0],s=t.length>1?"."+t[1]:"";return r.replace(/\B(?=(\d{3})+(?!\d))/g,",")+s}static getRoundedAmount(e,t){if(e<0)throw new g("Amount cannot be negative for rounding.");if(t===void 0)throw new l("Invalid currency code for rounding.");let r=n.getDecimalPlaces(t),s=Math.pow(10,r);return Math.round(e*s)/s}static getSmallestUnit(e){let t=n.getDecimalPlaces(e);return 1/Math.pow(10,t)}};var A=n=>structuredClone(n),h=class{customFields;constructor(e,t=new Date){this.customFields={...e.customFields};}getCustomField(e){let t=this.customFields[e];return t==null?t:A(t)}setCustomField(e,t){this.customFields[e]=t;}getAllCustomFields(){return A(this.customFields)}},d=class extends h{version;createdAt;modifiedAt;modifiedBy;constructor(e,t=new Date){super(e),this.version=e.version??1,this.createdAt=e.createdAt&&!isNaN(Date.parse(e.createdAt))?new Date(e.createdAt).toISOString():t.toISOString(),this.modifiedAt=e.modifiedAt&&!isNaN(Date.parse(e.modifiedAt))?new Date(e.modifiedAt).toISOString():t.toISOString(),this.modifiedBy={...e.modifiedBy};}getDetails(){return {customFields:this.getAllCustomFields(),version:this.getVersion(),createdAt:this.getCreatedAt(),modifiedAt:this.getModifiedAt(),modifiedBy:this.getModifiedBy()}}getVersion(){return this.version}getCreatedAt(){return this.createdAt}getCreatedAtTime(){return new Date(this.createdAt).getTime()}getModifiedAt(){return this.modifiedAt}getModifiedAtTime(){return new Date(this.modifiedAt).getTime()}getModifiedBy(){return {...this.modifiedBy}}setModifiedBy(e,t,r,s){this.modifiedBy={id:e,authType:t,requestId:r,lambdaName:s};}};var u=class extends d{id;firstName;lastName;company;phone;email;addressLine1;addressLine2;city;postalCode;state;country;isBillingAddress;isShippingAddress;constructor(e,t=new Date){super(e,t),this.id=e.id,this.firstName=e.firstName,this.lastName=e.lastName||"",this.company=e.company||"",this.phone=e.phone,this.email=e.email,this.addressLine1=e.addressLine1,this.addressLine2=e.addressLine2||"",this.city=e.city,this.postalCode=e.postalCode,this.state=e.state,this.country=e.country,this.isBillingAddress=e.isBillingAddress,this.isShippingAddress=e.isShippingAddress;}getDetails(){return {...super.getDetails(),id:this.getId(),firstName:this.getFirstName(),lastName:this.getLastName(),company:this.getCompany(),phone:this.getPhone(),email:this.getEmail(),addressLine1:this.getAddressLine1(),addressLine2:this.getAddressLine2(),city:this.getCity(),postalCode:this.getPostalCode(),state:this.getState(),country:this.getCountry(),isBillingAddress:this.getIsBillingAddress(),isShippingAddress:this.getIsShippingAddress()}}getId(){return this.id}getFirstName(){return this.firstName}getLastName(){return this.lastName}getCompany(){return this.company}getPhone(){return this.phone}getEmail(){return this.email}getAddressLine1(){return this.addressLine1}getAddressLine2(){return this.addressLine2}getCity(){return this.city}getPostalCode(){return this.postalCode}getState(){return this.state}getCountry(){return this.country}getIsBillingAddress(){return this.isBillingAddress}getIsShippingAddress(){return this.isShippingAddress}getAddressType(){return this.isBillingAddress&&this.isShippingAddress?"billing&shipping":this.isBillingAddress?"billing":this.isShippingAddress?"shipping":"none"}static checkIfShippingAddress(e){return e==="shipping"||e==="billing&shipping"}static checkIfBillingAddress(e){return e==="billing"||e==="billing&shipping"}};var x=class extends d{invoiceNumber;orderNumber;issueDate;country;currency;locale;customerId;customerEmail;billingAddress;shippingAddress;taxContext;merchant;lineItems;charges;total;state;constructor(e,t=new Date){super(e,t),this.invoiceNumber=e.invoiceNumber,this.state=e.state,this.orderNumber=e.orderNumber,this.issueDate=e.issueDate,this.country=e.country,this.currency=e.currency,this.locale=e.locale,this.customerId=e.customerId,this.customerEmail=e.customerEmail,this.billingAddress=new u(e.billingAddress),this.shippingAddress=new u(e.shippingAddress),this.taxContext=e.taxContext,this.merchant={merchantName:e.merchant.merchantName,taxIdentifier:e.merchant.taxIdentifier,email:e.merchant.email,phone:e.merchant.phone,address:new u(e.merchant.address)},this.lineItems=e.lineItems.map(r=>({...r,netUnitPrice:new i(r.netUnitPrice),netSubtotal:new i(r.netSubtotal),taxTotal:new i(r.taxTotal),grandTotal:new i(r.grandTotal),taxBreakdown:Object.fromEntries(Object.entries(r.taxBreakdown||{}).map(([s,o])=>[s,{...o,taxableAmount:new i(o.taxableAmount),taxAmount:new i(o.taxAmount)}]))})),this.charges=e.charges.map(r=>({...r,taxableValue:new i(r.taxableValue),taxTotal:new i(r.taxTotal),grandTotal:new i(r.grandTotal),taxBreakdown:Object.fromEntries(Object.entries(r.taxBreakdown||{}).map(([s,o])=>[s,{...o,taxableAmount:new i(o.taxableAmount),taxAmount:new i(o.taxAmount)}]))})),this.total={lineItemSubtotal:new i(e.total.lineItemSubtotal),netLineItemSubtotal:new i(e.total.netLineItemSubtotal),lineItemTaxTotal:new i(e.total.lineItemTaxTotal),lineItemTaxBreakdown:this.mapTaxBreakdown(e.total.lineItemTaxBreakdown),additiveCharges:new i(e.total.additiveCharges),netAdditiveCharges:new i(e.total.netAdditiveCharges),additiveChargesTaxTotal:new i(e.total.additiveChargesTaxTotal),additiveChargesTaxBreakdown:this.mapTaxBreakdown(e.total.additiveChargesTaxBreakdown),adjustmentCharges:new i(e.total.adjustmentCharges),shippingCharges:new i(e.total.shippingCharges),netShippingCharges:new i(e.total.netShippingCharges),discountTotal:new i(e.total.discountTotal),discountBreakdown:Object.fromEntries(Object.entries(e.total.discountBreakdown).map(([r,s])=>[r,new i(s)])),taxTotal:new i(e.total.taxTotal),taxBreakdown:this.mapTaxBreakdown(e.total.taxBreakdown),grandTotal:new i(e.total.grandTotal)};}mapTaxBreakdown(e){return Object.fromEntries(Object.entries(e||{}).map(([t,r])=>[t,{system:r.system,totalAmount:new i(r.totalAmount),subSystems:Object.fromEntries(Object.entries(r.subSystems).map(([s,o])=>[s,new i(o)]))}]))}serializeTaxBreakdown(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,{system:r.system,totalAmount:r.totalAmount.getDetails(),subSystems:Object.fromEntries(Object.entries(r.subSystems).map(([s,o])=>[s,o.getDetails()]))}]))}getInvoiceNumber(){return this.invoiceNumber}getOrderNumber(){return this.orderNumber}getIssueDate(){return this.issueDate}getCountry(){return this.country}getCurrency(){return this.currency}getLocale(){return this.locale}getCustomerId(){return this.customerId}getCustomerEmail(){return this.customerEmail}getTaxContext(){return {...this.taxContext}}getRecipientTaxIdentifier(){return this.taxContext.recipientTaxIdentifier}getRecipientTaxIdentifierType(){return this.taxContext.recipientTaxIdentifierType}getBillingAddress(){return this.billingAddress}getShippingAddress(){return this.shippingAddress}getSupplyRegion(){return this.taxContext.supplyRegion}getSupplyRegionCode(){return this.taxContext.supplyRegionCode}getMerchant(){return {merchantName:this.merchant.merchantName,taxIdentifier:this.merchant.taxIdentifier,email:this.merchant.email,phone:this.merchant.phone,address:this.merchant.address}}getLineItems(){return [...this.lineItems]}getCharges(){return [...this.charges]}getTotal(){return this.total}getState(){return this.state}getDetails(){let e=this.getTotal();return {...super.getDetails(),invoiceNumber:this.invoiceNumber,orderNumber:this.orderNumber,issueDate:this.issueDate,country:this.country,currency:this.currency,locale:this.locale,customerId:this.customerId,customerEmail:this.customerEmail,billingAddress:this.billingAddress.getDetails(),shippingAddress:this.shippingAddress.getDetails(),taxContext:this.taxContext,state:this.state,merchant:{merchantName:this.merchant.merchantName,taxIdentifier:this.merchant.taxIdentifier,email:this.merchant.email,phone:this.merchant.phone,address:this.merchant.address.getDetails()},lineItems:this.lineItems.map(t=>({...t,netUnitPrice:t.netUnitPrice.getDetails(),netSubtotal:t.netSubtotal.getDetails(),taxTotal:t.taxTotal.getDetails(),grandTotal:t.grandTotal.getDetails(),taxBreakdown:Object.fromEntries(Object.entries(t.taxBreakdown).map(([r,s])=>[r,{...s,taxableAmount:s.taxableAmount.getDetails(),taxAmount:s.taxAmount.getDetails()}]))})),charges:this.charges.map(t=>({...t,taxableValue:t.taxableValue.getDetails(),taxTotal:t.taxTotal.getDetails(),grandTotal:t.grandTotal.getDetails(),taxBreakdown:Object.fromEntries(Object.entries(t.taxBreakdown).map(([r,s])=>[r,{...s,taxableAmount:s.taxableAmount.getDetails(),taxAmount:s.taxAmount.getDetails()}]))})),total:{lineItemSubtotal:e.lineItemSubtotal.getDetails(),netLineItemSubtotal:e.netLineItemSubtotal.getDetails(),lineItemTaxTotal:e.lineItemTaxTotal.getDetails(),lineItemTaxBreakdown:this.serializeTaxBreakdown(e.lineItemTaxBreakdown),additiveCharges:e.additiveCharges.getDetails(),netAdditiveCharges:e.netAdditiveCharges.getDetails(),additiveChargesTaxTotal:e.additiveChargesTaxTotal.getDetails(),additiveChargesTaxBreakdown:this.serializeTaxBreakdown(e.additiveChargesTaxBreakdown),adjustmentCharges:e.adjustmentCharges.getDetails(),shippingCharges:e.shippingCharges.getDetails(),netShippingCharges:e.netShippingCharges.getDetails(),discountTotal:e.discountTotal.getDetails(),discountBreakdown:Object.fromEntries(Object.entries(e.discountBreakdown).map(([t,r])=>[t,r.getDetails()])),taxTotal:e.taxTotal.getDetails(),taxBreakdown:this.serializeTaxBreakdown(e.taxBreakdown),grandTotal:e.grandTotal.getDetails()}}}};module.exports=x;//# sourceMappingURL=Invoice.js.map
|
|
1
|
+
'use strict';var I={INR:"\u20B9"},C={INR:"en-IN"};var h=class extends Error{constructor(e="Amount cannot be negative."){super(`InvalidAmount: ${e}`),this.name="InvalidPriceAmountError";}},m=class extends Error{constructor(e="Currency code is required."){super(`InvalidCurrency: ${e}`),this.name="InvalidCurrencyCodeError";}},c=class extends Error{constructor(e="Cannot perform operation on prices with different currencies."){super(`CurrencyMismatch: ${e}`),this.name="CurrencyMismatchError";}},o=class extends Error{constructor(e){super(`InvalidArgument: ${e}`),this.name="InvalidArgumentError";}};var i=class n{#e;amount;currency;constructor(e){if(this.#e="PriceModel",e.amount<0)throw new h("Amount cannot be negative.");if(!e.currency)throw new m("Currency code is required.");this.currency=e.currency,this.amount=parseFloat(e.amount.toFixed(n.getPrecisionPlaces(this.currency)));}get kind(){return this.#e}static isPriceModel(e){return typeof e=="object"&&e!==null&&e.kind==="PriceModel"}getCurrency(){return this.currency}getAmount(){return this.amount}getDetails(){return {amount:this.amount,currency:this.currency}}getPreciseAmount(e){return parseFloat(e.toFixed(n.getPrecisionPlaces(this.currency)))}compareTo(e){if(n.isPriceModel(e)){if(this.currency!==e.getCurrency())throw new c("Cannot compare prices in different currencies.")}else throw new o("Must be a PriceModel instance.");return this.getPreciseAmount(this.amount-e.getAmount())}add(e){if(n.isPriceModel(e)){if(this.currency!==e.getCurrency())throw new c("Cannot add prices in different currencies.")}else throw new o("Must be a PriceModel instance.");return new n({amount:this.getPreciseAmount(this.amount+e.getAmount()),currency:this.currency})}subtract(e){if(n.isPriceModel(e)){if(this.currency!==e.getCurrency())throw new c("Cannot subtract prices in different currencies.")}else throw new o("Must be a PriceModel instance.");return new n({amount:this.getPreciseAmount(this.amount-e.getAmount()),currency:this.currency})}multiply(e){if(n.isPriceModel(e)){if(this.currency!==e.getCurrency())throw new c("Cannot multiply prices in different currencies.");return new n({amount:this.getPreciseAmount(this.amount*e.getAmount()),currency:this.currency})}else if(typeof e=="number"&&e>=0)return new n({amount:this.getPreciseAmount(this.amount*e),currency:this.currency});throw new o("Must be a non-negative number.")}divide(e){if(n.isPriceModel(e)){if(this.currency!==e.getCurrency())throw new c("Cannot divide prices in different currencies.");return new n({amount:this.getPreciseAmount(this.amount/e.getAmount()),currency:this.currency})}else if(typeof e=="number"&&e>0)return new n({amount:this.getPreciseAmount(this.amount/e),currency:this.currency});throw new o("Must be a positive number.")}min(...e){if(e.length===0)throw new o("Must provide at least one PriceModel.");return e.reduce((t,r)=>{if(n.isPriceModel(r)){if(t.getCurrency()!==r.getCurrency())throw new c("Cannot compare prices in different currencies.")}else throw new o("Must be a PriceModel instance.");return t.compareTo(r)<0?t:r},this)}max(...e){if(e.length===0)throw new o("Must provide at least one PriceModel.");return e.reduce((t,r)=>{if(n.isPriceModel(r)){if(t.getCurrency()!==r.getCurrency())throw new c("Cannot compare prices in different currencies.")}else throw new o("Must be a PriceModel instance.");return t.compareTo(r)>0?t:r},this)}zero(){return new n({currency:this.currency,amount:0})}isZero(){return this.amount===0}round(){return new n({currency:this.currency,amount:this.getRoundedAmount()})}getRoundedAmount(){return n.getRoundedAmount(this.amount,this.currency)}getFormattedString(){return n.getFormattedString(this.amount,this.currency)}toString(){return this.getFormattedString()}static getFormattedString(e,t,r={displayAsInteger:!1,style:"currency",currencyDisplay:"symbol"}){let s=C[t];if(!t||!s)throw new m("Invalid currency code for formatting.");let a=e,l=r.displayAsInteger?0:n.getDecimalPlaces(t),u={style:r.style??"currency",currency:t,signDisplay:"never",currencyDisplay:r.currencyDisplay,minimumFractionDigits:l,maximumFractionDigits:l};r.displayAsInteger&&(a=Math.ceil(a));try{return new Intl.NumberFormat(s,u).format(a)}catch(b){return console.error(`Error formatting price for currency "${t}" and locale "${s}":`,b),`${I[t]??t} ${n.addThousandSeparators(a.toFixed(l))}`}}static getDecimalPlaces(e){switch(e){case"INR":default:return 2}}static getPrecisionPlaces(e){switch(e){case"INR":default:return 6}}static addThousandSeparators(e){let t=e.split("."),r=t[0],s=t.length>1?"."+t[1]:"";return r.replace(/\B(?=(\d{3})+(?!\d))/g,",")+s}static getRoundedAmount(e,t){if(e<0)throw new h("Amount cannot be negative for rounding.");if(t===void 0)throw new m("Invalid currency code for rounding.");let r=n.getDecimalPlaces(t),s=Math.pow(10,r);return Math.round(e*s)/s}static getSmallestUnit(e){let t=n.getDecimalPlaces(e);return 1/Math.pow(10,t)}};var A=n=>structuredClone(n),x=class{customFields;constructor(e,t=new Date){this.customFields={...e.customFields};}getCustomField(e){let t=this.customFields[e];return t==null?t:A(t)}setCustomField(e,t){this.customFields[e]=t;}getAllCustomFields(){return A(this.customFields)}},d=class extends x{version;createdAt;modifiedAt;modifiedBy;constructor(e,t=new Date){super(e),this.version=e.version??1,this.createdAt=e.createdAt&&!isNaN(Date.parse(e.createdAt))?new Date(e.createdAt).toISOString():t.toISOString(),this.modifiedAt=e.modifiedAt&&!isNaN(Date.parse(e.modifiedAt))?new Date(e.modifiedAt).toISOString():t.toISOString(),this.modifiedBy={...e.modifiedBy};}getDetails(){return {customFields:this.getAllCustomFields(),version:this.getVersion(),createdAt:this.getCreatedAt(),modifiedAt:this.getModifiedAt(),modifiedBy:this.getModifiedBy()}}getVersion(){return this.version}getCreatedAt(){return this.createdAt}getCreatedAtTime(){return new Date(this.createdAt).getTime()}getModifiedAt(){return this.modifiedAt}getModifiedAtTime(){return new Date(this.modifiedAt).getTime()}getModifiedBy(){return {...this.modifiedBy}}setModifiedBy(e,t,r,s){this.modifiedBy={id:e,authType:t,requestId:r,lambdaName:s};}};var g=class extends d{id;firstName;lastName;company;phone;email;addressLine1;addressLine2;city;postalCode;state;country;isBillingAddress;isShippingAddress;constructor(e,t=new Date){super(e,t),this.id=e.id,this.firstName=e.firstName,this.lastName=e.lastName||"",this.company=e.company||"",this.phone=e.phone,this.email=e.email,this.addressLine1=e.addressLine1,this.addressLine2=e.addressLine2||"",this.city=e.city,this.postalCode=e.postalCode,this.state=e.state,this.country=e.country,this.isBillingAddress=e.isBillingAddress,this.isShippingAddress=e.isShippingAddress;}getDetails(){return {...super.getDetails(),id:this.getId(),firstName:this.getFirstName(),lastName:this.getLastName(),company:this.getCompany(),phone:this.getPhone(),email:this.getEmail(),addressLine1:this.getAddressLine1(),addressLine2:this.getAddressLine2(),city:this.getCity(),postalCode:this.getPostalCode(),state:this.getState(),country:this.getCountry(),isBillingAddress:this.getIsBillingAddress(),isShippingAddress:this.getIsShippingAddress()}}getId(){return this.id}getFirstName(){return this.firstName}getLastName(){return this.lastName}getCompany(){return this.company}getPhone(){return this.phone}getEmail(){return this.email}getAddressLine1(){return this.addressLine1}getAddressLine2(){return this.addressLine2}getCity(){return this.city}getPostalCode(){return this.postalCode}getState(){return this.state}getCountry(){return this.country}getIsBillingAddress(){return this.isBillingAddress}getIsShippingAddress(){return this.isShippingAddress}getAddressType(){return this.isBillingAddress&&this.isShippingAddress?"billing&shipping":this.isBillingAddress?"billing":this.isShippingAddress?"shipping":"none"}static checkIfShippingAddress(e){return e==="shipping"||e==="billing&shipping"}static checkIfBillingAddress(e){return e==="billing"||e==="billing&shipping"}};var y=class extends d{invoiceNumber;orderNumber;issueDate;country;currency;locale;customerId;customerEmail;billingAddress;shippingAddress;taxContext;merchant;lineItems;charges;total;state;constructor(e,t=new Date){super(e,t),this.invoiceNumber=e.invoiceNumber,this.state=e.state,this.orderNumber=e.orderNumber,this.issueDate=e.issueDate,this.country=e.country,this.currency=e.currency,this.locale=e.locale,this.customerId=e.customerId,this.customerEmail=e.customerEmail,this.billingAddress=new g(e.billingAddress),this.shippingAddress=new g(e.shippingAddress),this.taxContext=e.taxContext,this.merchant={merchantName:e.merchant.merchantName,taxIdentifier:e.merchant.taxIdentifier,email:e.merchant.email,phone:e.merchant.phone,address:new g(e.merchant.address)},this.lineItems=e.lineItems.map(r=>{let s=r.taxExclusive,a=r.taxInclusive;return {id:r.id,productKey:r.productKey,sku:r.sku,name:r.name,variantLabel:r.variantLabel,quantity:r.quantity,taxTotal:new i(r.taxTotal),taxBreakdown:Object.fromEntries(Object.entries(r.taxBreakdown||{}).map(([l,u])=>[l,{...u,taxableAmount:new i(u.taxableAmount),taxAmount:new i(u.taxAmount)}])),taxCode:r.taxCode,taxCodeType:r.taxCodeType,taxExclusive:{unitPrice:new i(s.unitPrice),subtotal:new i(s.subtotal),netUnitPrice:new i(s.netUnitPrice),netSubtotal:new i(s.netSubtotal)},taxInclusive:{unitPrice:new i(a.unitPrice),subtotal:new i(a.subtotal),netUnitPrice:new i(a.netUnitPrice),netSubtotal:new i(a.netSubtotal)},grandTotal:new i(r.grandTotal)}}),this.charges=e.charges.map(r=>{let s=r.taxExclusive,a=r.taxInclusive;return {id:r.id,type:r.type,category:r.category,impact:r.impact,name:r.name,taxTotal:new i(r.taxTotal),taxBreakdown:Object.fromEntries(Object.entries(r.taxBreakdown||{}).map(([l,u])=>[l,{...u,taxableAmount:new i(u.taxableAmount),taxAmount:new i(u.taxAmount)}])),taxCode:r.taxCode,taxCodeType:r.taxCodeType,taxExclusive:{chargeAmount:new i(s.chargeAmount),netChargeAmount:new i(s.netChargeAmount)},taxInclusive:{chargeAmount:new i(a.chargeAmount),netChargeAmount:new i(a.netChargeAmount)},grandTotal:new i(r.grandTotal)}}),this.total={lineItemTaxTotal:new i(e.total.lineItemTaxTotal),lineItemTaxBreakdown:this.mapTaxBreakdown(e.total.lineItemTaxBreakdown),additiveChargesTaxTotal:new i(e.total.additiveChargesTaxTotal),additiveChargesTaxBreakdown:this.mapTaxBreakdown(e.total.additiveChargesTaxBreakdown),adjustmentCharges:new i(e.total.adjustmentCharges),discountTotal:new i(e.total.discountTotal),discountBreakdown:Object.fromEntries(Object.entries(e.total.discountBreakdown).map(([r,s])=>[r,new i(s)])),taxTotal:new i(e.total.taxTotal),taxBreakdown:this.mapTaxBreakdown(e.total.taxBreakdown),taxExclusive:{lineItemSubtotal:new i(e.total.taxExclusive.lineItemSubtotal),netLineItemSubtotal:new i(e.total.taxExclusive.netLineItemSubtotal),additiveCharges:new i(e.total.taxExclusive.additiveCharges),netAdditiveCharges:new i(e.total.taxExclusive.netAdditiveCharges),shippingCharges:new i(e.total.taxExclusive.shippingCharges),netShippingCharges:new i(e.total.taxExclusive.netShippingCharges)},taxInclusive:{lineItemSubtotal:new i(e.total.taxInclusive.lineItemSubtotal),netLineItemSubtotal:new i(e.total.taxInclusive.netLineItemSubtotal),additiveCharges:new i(e.total.taxInclusive.additiveCharges),netAdditiveCharges:new i(e.total.taxInclusive.netAdditiveCharges),shippingCharges:new i(e.total.taxInclusive.shippingCharges),netShippingCharges:new i(e.total.taxInclusive.netShippingCharges)},grandTotal:new i(e.total.grandTotal)};}mapTaxBreakdown(e){return Object.fromEntries(Object.entries(e||{}).map(([t,r])=>[t,{system:r.system,totalAmount:new i(r.totalAmount),subSystems:Object.fromEntries(Object.entries(r.subSystems).map(([s,a])=>[s,new i(a)]))}]))}serializeTaxBreakdown(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,{system:r.system,totalAmount:r.totalAmount.getDetails(),subSystems:Object.fromEntries(Object.entries(r.subSystems).map(([s,a])=>[s,a.getDetails()]))}]))}getInvoiceNumber(){return this.invoiceNumber}getOrderNumber(){return this.orderNumber}getIssueDate(){return this.issueDate}getCountry(){return this.country}getCurrency(){return this.currency}getLocale(){return this.locale}getCustomerId(){return this.customerId}getCustomerEmail(){return this.customerEmail}getTaxContext(){return {...this.taxContext}}getRecipientTaxIdentifier(){return this.taxContext.recipientTaxIdentifier}getRecipientTaxIdentifierType(){return this.taxContext.recipientTaxIdentifierType}getBillingAddress(){return this.billingAddress}getShippingAddress(){return this.shippingAddress}getSupplyRegion(){return this.taxContext.supplyRegion}getSupplyRegionCode(){return this.taxContext.supplyRegionCode}getMerchant(){return {merchantName:this.merchant.merchantName,taxIdentifier:this.merchant.taxIdentifier,email:this.merchant.email,phone:this.merchant.phone,address:this.merchant.address}}getLineItems(){return [...this.lineItems]}getCharges(){return [...this.charges]}getTotal(){return this.total}getState(){return this.state}getDetails(){let e=this.getTotal();return {...super.getDetails(),invoiceNumber:this.invoiceNumber,orderNumber:this.orderNumber,issueDate:this.issueDate,country:this.country,currency:this.currency,locale:this.locale,customerId:this.customerId,customerEmail:this.customerEmail,billingAddress:this.billingAddress.getDetails(),shippingAddress:this.shippingAddress.getDetails(),taxContext:this.taxContext,state:this.state,merchant:{merchantName:this.merchant.merchantName,taxIdentifier:this.merchant.taxIdentifier,email:this.merchant.email,phone:this.merchant.phone,address:this.merchant.address.getDetails()},lineItems:this.lineItems.map(t=>({id:t.id,productKey:t.productKey,sku:t.sku,name:t.name,variantLabel:t.variantLabel,quantity:t.quantity,taxCode:t.taxCode,taxCodeType:t.taxCodeType,taxTotal:t.taxTotal.getDetails(),taxBreakdown:Object.fromEntries(Object.entries(t.taxBreakdown).map(([r,s])=>[r,{...s,taxableAmount:s.taxableAmount.getDetails(),taxAmount:s.taxAmount.getDetails()}])),taxExclusive:{unitPrice:t.taxExclusive.unitPrice.getDetails(),subtotal:t.taxExclusive.subtotal.getDetails(),netUnitPrice:t.taxExclusive.netUnitPrice.getDetails(),netSubtotal:t.taxExclusive.netSubtotal.getDetails()},taxInclusive:{unitPrice:t.taxInclusive.unitPrice.getDetails(),subtotal:t.taxInclusive.subtotal.getDetails(),netUnitPrice:t.taxInclusive.netUnitPrice.getDetails(),netSubtotal:t.taxInclusive.netSubtotal.getDetails()},grandTotal:t.grandTotal.getDetails()})),charges:this.charges.map(t=>({id:t.id,type:t.type,category:t.category,impact:t.impact,name:t.name,taxCode:t.taxCode,taxCodeType:t.taxCodeType,taxTotal:t.taxTotal.getDetails(),taxBreakdown:Object.fromEntries(Object.entries(t.taxBreakdown).map(([r,s])=>[r,{...s,taxableAmount:s.taxableAmount.getDetails(),taxAmount:s.taxAmount.getDetails()}])),taxExclusive:{chargeAmount:t.taxExclusive.chargeAmount.getDetails(),netChargeAmount:t.taxExclusive.netChargeAmount.getDetails()},taxInclusive:{chargeAmount:t.taxInclusive.chargeAmount.getDetails(),netChargeAmount:t.taxInclusive.netChargeAmount.getDetails()},grandTotal:t.grandTotal.getDetails()})),total:{lineItemTaxTotal:e.lineItemTaxTotal.getDetails(),lineItemTaxBreakdown:this.serializeTaxBreakdown(e.lineItemTaxBreakdown),additiveChargesTaxTotal:e.additiveChargesTaxTotal.getDetails(),additiveChargesTaxBreakdown:this.serializeTaxBreakdown(e.additiveChargesTaxBreakdown),adjustmentCharges:e.adjustmentCharges.getDetails(),discountTotal:e.discountTotal.getDetails(),discountBreakdown:Object.fromEntries(Object.entries(e.discountBreakdown).map(([t,r])=>[t,r.getDetails()])),taxTotal:e.taxTotal.getDetails(),taxBreakdown:this.serializeTaxBreakdown(e.taxBreakdown),taxExclusive:{lineItemSubtotal:e.taxExclusive.lineItemSubtotal.getDetails(),netLineItemSubtotal:e.taxExclusive.netLineItemSubtotal.getDetails(),additiveCharges:e.taxExclusive.additiveCharges.getDetails(),netAdditiveCharges:e.taxExclusive.netAdditiveCharges.getDetails(),shippingCharges:e.taxExclusive.shippingCharges.getDetails(),netShippingCharges:e.taxExclusive.netShippingCharges.getDetails()},taxInclusive:{lineItemSubtotal:e.taxInclusive.lineItemSubtotal.getDetails(),netLineItemSubtotal:e.taxInclusive.netLineItemSubtotal.getDetails(),additiveCharges:e.taxInclusive.additiveCharges.getDetails(),netAdditiveCharges:e.taxInclusive.netAdditiveCharges.getDetails(),shippingCharges:e.taxInclusive.shippingCharges.getDetails(),netShippingCharges:e.taxInclusive.netShippingCharges.getDetails()},grandTotal:e.grandTotal.getDetails()}}}};module.exports=y;//# sourceMappingURL=Invoice.js.map
|
|
2
2
|
//# sourceMappingURL=Invoice.js.map
|