@driveflux/pdf 1.5.9 → 1.5.11
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/__mocks__/subscription.d.ts.map +1 -1
- package/dist/__mocks__/subscription.js +1 -0
- package/dist/templates/QuotationPdf/Pricing.d.ts.map +1 -1
- package/dist/templates/QuotationPdf/Pricing.js +7 -5
- package/dist/templates/QuotationPdf/translations.d.ts +1 -3
- package/dist/templates/QuotationPdf/translations.d.ts.map +1 -1
- package/dist/templates/QuotationPdf/translations.js +1 -3
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../src/__mocks__/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAA;AAExF,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../src/__mocks__/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAA;AAExF,eAAO,MAAM,YAAY,EAAE,wBA+0B1B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pricing.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/Pricing.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE,KAAK,KAAK,GAAG;IACZ,SAAS,EAAE,mBAAmB,CAAA;IAC9B,CAAC,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAA;CACtC,CAAA;AAED,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"Pricing.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/Pricing.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE,KAAK,KAAK,GAAG;IACZ,SAAS,EAAE,mBAAmB,CAAA;IAC9B,CAAC,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAA;CACtC,CAAA;AAED,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,CA0tBtB,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -7,6 +7,8 @@ var Pricing = function(param) {
|
|
|
7
7
|
var quotation = param.quotation, t = param.t;
|
|
8
8
|
var _quotation_fees_discountAmount, _quotation_fees_discountAmount1;
|
|
9
9
|
var _quotation_fees = quotation.fees, startFee = _quotation_fees.startFee, reservationFee = _quotation_fees.reservationFee, deposit = _quotation_fees.deposit, subscriptionFee = _quotation_fees.subscriptionFee, extraCharges = _quotation_fees.extraCharges, couponType = _quotation_fees.couponType, discountAmount = _quotation_fees.discountAmount, quotedPrices = _quotation_fees.quotedPrices;
|
|
10
|
+
var taxRate = quotation.fees.taxAmount / quotation.fees.amountBeforeTax;
|
|
11
|
+
var taxPercentage = taxRate * 100;
|
|
10
12
|
var hasDiscounts = quotedPrices !== null && quotedPrices !== undefined;
|
|
11
13
|
var totalUpfrontFee = hasDiscounts ? ((quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.startFee) || 0) + (reservationFee || 0) + ((quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.deposit) || 0) : startFee + (reservationFee || 0) + deposit;
|
|
12
14
|
var totalMonthlyFee = hasDiscounts ? (quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.subscriptionFee) || 0 : subscriptionFee;
|
|
@@ -68,8 +70,8 @@ var Pricing = function(param) {
|
|
|
68
70
|
totalMonthlyFee -= discountAmount || 0;
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
|
-
var serviceMonthlyFee = totalMonthlyFee *
|
|
72
|
-
var serviceUpfrontFee = (totalUpfrontFee *
|
|
73
|
+
var serviceMonthlyFee = totalMonthlyFee * taxRate;
|
|
74
|
+
var serviceUpfrontFee = (totalUpfrontFee * taxRate).toFixed(2);
|
|
73
75
|
var getFeeValue = function(key) {
|
|
74
76
|
switch(key){
|
|
75
77
|
case 'startFee':
|
|
@@ -347,7 +349,7 @@ var Pricing = function(param) {
|
|
|
347
349
|
letterSpacing: 1,
|
|
348
350
|
paddingRight: 4
|
|
349
351
|
},
|
|
350
|
-
children: t === null || t === void 0 ? void 0 : t.
|
|
352
|
+
children: "".concat(t === null || t === void 0 ? void 0 : t.serviceFee, " (").concat(taxPercentage, "%)")
|
|
351
353
|
}),
|
|
352
354
|
quotedPrices !== undefined ? /*#__PURE__*/ _jsx(Text, {
|
|
353
355
|
style: {
|
|
@@ -577,7 +579,7 @@ var Pricing = function(param) {
|
|
|
577
579
|
letterSpacing: 1,
|
|
578
580
|
paddingRight: 4
|
|
579
581
|
},
|
|
580
|
-
children: t === null || t === void 0 ? void 0 : t.
|
|
582
|
+
children: "".concat(t === null || t === void 0 ? void 0 : t.serviceFee, " (").concat(taxPercentage, "%)")
|
|
581
583
|
}),
|
|
582
584
|
/*#__PURE__*/ _jsx(Text, {
|
|
583
585
|
style: {
|
|
@@ -670,7 +672,7 @@ var Pricing = function(param) {
|
|
|
670
672
|
letterSpacing: 1,
|
|
671
673
|
color: colors.primary3
|
|
672
674
|
},
|
|
673
|
-
children: t === null || t === void 0 ? void 0 : t.
|
|
675
|
+
children: "".concat(t === null || t === void 0 ? void 0 : t.serviceFee, " (").concat(taxPercentage, "%)")
|
|
674
676
|
}),
|
|
675
677
|
/*#__PURE__*/ _jsx(Text, {
|
|
676
678
|
style: {
|
|
@@ -23,10 +23,10 @@ declare const enTranslation: {
|
|
|
23
23
|
};
|
|
24
24
|
pricing: {
|
|
25
25
|
title: string;
|
|
26
|
+
serviceFee: string;
|
|
26
27
|
fees: {
|
|
27
28
|
upfront: {
|
|
28
29
|
title: string;
|
|
29
|
-
serviceFee: string;
|
|
30
30
|
content: {
|
|
31
31
|
title: string;
|
|
32
32
|
key: string;
|
|
@@ -34,7 +34,6 @@ declare const enTranslation: {
|
|
|
34
34
|
};
|
|
35
35
|
monthly: {
|
|
36
36
|
title: string;
|
|
37
|
-
serviceFee: string;
|
|
38
37
|
content: {
|
|
39
38
|
title: string;
|
|
40
39
|
key: string;
|
|
@@ -44,7 +43,6 @@ declare const enTranslation: {
|
|
|
44
43
|
title: string;
|
|
45
44
|
description: string;
|
|
46
45
|
subTotal: string;
|
|
47
|
-
serviceFee: string;
|
|
48
46
|
grandTotal: string;
|
|
49
47
|
};
|
|
50
48
|
extraCharge: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/translations.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;yCA+Ba,MAAM
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/translations.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;yCA+Ba,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDrC,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,OAAO,aAAa,CAAA;AAE1D,eAAO,MAAM,eAAe,WAAY,IAAI,KAAG,uBAK9C,CAAA"}
|
|
@@ -36,10 +36,10 @@ var enTranslation = {
|
|
|
36
36
|
},
|
|
37
37
|
pricing: {
|
|
38
38
|
title: 'Pricing',
|
|
39
|
+
serviceFee: 'Service Fee',
|
|
39
40
|
fees: {
|
|
40
41
|
upfront: {
|
|
41
42
|
title: 'Upfront Fees',
|
|
42
|
-
serviceFee: 'Service Fee (8%)',
|
|
43
43
|
content: [
|
|
44
44
|
{
|
|
45
45
|
title: 'Booking Fee',
|
|
@@ -57,7 +57,6 @@ var enTranslation = {
|
|
|
57
57
|
},
|
|
58
58
|
monthly: {
|
|
59
59
|
title: 'Monthly Fees',
|
|
60
|
-
serviceFee: 'Service Fee (8%)',
|
|
61
60
|
content: [
|
|
62
61
|
{
|
|
63
62
|
title: 'Subscription Fee',
|
|
@@ -69,7 +68,6 @@ var enTranslation = {
|
|
|
69
68
|
title: 'Due Today',
|
|
70
69
|
description: 'Grand Total is due before your subscription start. Monthly fee is due on the first day of every cycle period.',
|
|
71
70
|
subTotal: 'Upfront Fees + Monthly Fee',
|
|
72
|
-
serviceFee: 'Service Fee (8%)',
|
|
73
71
|
grandTotal: 'Grand Total'
|
|
74
72
|
},
|
|
75
73
|
extraCharge: 'Extra Charge',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@driveflux/pdf",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@driveflux/db": "1.12.
|
|
16
|
-
"@driveflux/env": "1.
|
|
15
|
+
"@driveflux/db": "1.12.8",
|
|
16
|
+
"@driveflux/env": "1.4.0",
|
|
17
17
|
"@driveflux/format-money": "5.3.2",
|
|
18
18
|
"@driveflux/time": "4.3.2",
|
|
19
19
|
"@react-pdf/renderer": "^4.0.0",
|