@driveflux/pdf 4.0.79 → 4.0.81
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/components/FluxLogo.js +62 -3
- package/dist/components/StandardPage.js +108 -10
- package/dist/index.js +0 -1
- package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +145 -27
- package/dist/templates/QuotationPdf/GFV.js +49 -12
- package/dist/templates/QuotationPdf/Header.js +63 -5
- package/dist/templates/QuotationPdf/Pricing.js +573 -191
- package/dist/templates/QuotationPdf/QuotationPdfPage.js +23 -3
- package/dist/templates/QuotationPdf/SectionBoxNew.js +34 -4
- package/dist/templates/QuotationPdf/TermsSection.js +42 -5
- package/dist/templates/QuotationPdf/VehiclePhotos.js +54 -24
- package/dist/templates/QuotationPdf/index.js +197 -10
- package/dist/templates/QuotationPdf/translations.js +34 -22
- package/dist/templates/QuotationPdf/utils.js +92 -49
- package/dist/templates/SubscriptionAgreement/Confirmation.js +65 -10
- package/dist/templates/SubscriptionAgreement/CoverPage.js +93 -10
- package/dist/templates/SubscriptionAgreement/CoverPageSection.js +16 -5
- package/dist/templates/SubscriptionAgreement/Details.js +139 -59
- package/dist/templates/SubscriptionAgreement/Footer.js +48 -6
- package/dist/templates/SubscriptionAgreement/Header.js +35 -5
- package/dist/templates/SubscriptionAgreement/LabelValue.js +25 -3
- package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +26 -3
- package/dist/templates/SubscriptionAgreement/TermsOfUse.js +94 -8
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +97 -11
- package/dist/templates/SubscriptionAgreement/index.js +253 -15
- package/dist/templates/SubscriptionAgreement/translations.js +195 -194
- package/dist/templates/SubscriptionAgreement/types.js +1 -2
- package/dist/templates/SubscriptionAgreement/utils.js +16 -11
- package/dist/templates/index.js +0 -1
- package/dist/theme/colors.js +44 -63
- package/dist/theme/index.js +0 -1
- package/dist/types.js +1 -2
- package/dist/utils.js +167 -16
- package/dist/watch.js +3 -4
- package/package.json +8 -8
|
@@ -3,49 +3,77 @@ import { formatMoney } from '@driveflux/format-money';
|
|
|
3
3
|
import { Text, View } from '@react-pdf/renderer';
|
|
4
4
|
import { colors } from '../../theme/colors.js';
|
|
5
5
|
import SectionBoxNew from './SectionBoxNew.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
? quotedPrices?.subscriptionFee || 0
|
|
16
|
-
: subscriptionFee;
|
|
6
|
+
var Pricing = function Pricing(param) {
|
|
7
|
+
var quotation = param.quotation, t = param.t;
|
|
8
|
+
var _quotation_fees_discountAmount, _quotation_fees_discountAmount1;
|
|
9
|
+
var _quotation_fees = quotation.fees, 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).toFixed(0);
|
|
12
|
+
var hasDiscounts = quotedPrices !== null && quotedPrices !== undefined;
|
|
13
|
+
var totalUpfrontFee = hasDiscounts ? (reservationFee || 0) + ((quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.deposit) || 0) : (reservationFee || 0) + deposit;
|
|
14
|
+
var totalMonthlyFee = hasDiscounts ? (quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.subscriptionFee) || 0 : subscriptionFee;
|
|
17
15
|
if (hasDiscounts) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
17
|
+
try {
|
|
18
|
+
for(var _iterator = quotedPrices.extraCharges[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
19
|
+
var charge = _step.value;
|
|
20
|
+
if (charge.type === 'upfront') {
|
|
21
|
+
totalUpfrontFee += charge.amount;
|
|
22
|
+
} else if (charge.type === 'monthly') {
|
|
23
|
+
totalMonthlyFee += charge.amount;
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
} catch (err) {
|
|
27
|
+
_didIteratorError = true;
|
|
28
|
+
_iteratorError = err;
|
|
29
|
+
} finally{
|
|
30
|
+
try {
|
|
31
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
32
|
+
_iterator.return();
|
|
33
|
+
}
|
|
34
|
+
} finally{
|
|
35
|
+
if (_didIteratorError) {
|
|
36
|
+
throw _iteratorError;
|
|
37
|
+
}
|
|
24
38
|
}
|
|
25
39
|
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
} else {
|
|
41
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
42
|
+
try {
|
|
43
|
+
for(var _iterator1 = extraCharges[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
44
|
+
var charge1 = _step1.value;
|
|
45
|
+
if (charge1.type === 'upfront') {
|
|
46
|
+
totalUpfrontFee += charge1.amount;
|
|
47
|
+
} else if (charge1.type === 'monthly') {
|
|
48
|
+
totalMonthlyFee += charge1.amount;
|
|
49
|
+
}
|
|
31
50
|
}
|
|
32
|
-
|
|
33
|
-
|
|
51
|
+
} catch (err) {
|
|
52
|
+
_didIteratorError1 = true;
|
|
53
|
+
_iteratorError1 = err;
|
|
54
|
+
} finally{
|
|
55
|
+
try {
|
|
56
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
57
|
+
_iterator1.return();
|
|
58
|
+
}
|
|
59
|
+
} finally{
|
|
60
|
+
if (_didIteratorError1) {
|
|
61
|
+
throw _iteratorError1;
|
|
62
|
+
}
|
|
34
63
|
}
|
|
35
64
|
}
|
|
36
65
|
}
|
|
37
66
|
if (quotation.couponCode) {
|
|
38
67
|
if (couponType === 'upfront') {
|
|
39
68
|
totalUpfrontFee -= discountAmount || 0;
|
|
40
|
-
}
|
|
41
|
-
else if (couponType === 'monthly') {
|
|
69
|
+
} else if (couponType === 'monthly') {
|
|
42
70
|
totalMonthlyFee -= discountAmount || 0;
|
|
43
71
|
}
|
|
44
72
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
switch
|
|
73
|
+
var serviceMonthlyFee = totalMonthlyFee * taxRate;
|
|
74
|
+
var serviceUpfrontFee = (totalUpfrontFee * taxRate).toFixed(2);
|
|
75
|
+
var getFeeValue = function getFeeValue(key) {
|
|
76
|
+
switch(key){
|
|
49
77
|
case 'reservationFee':
|
|
50
78
|
return reservationFee;
|
|
51
79
|
case 'deposit':
|
|
@@ -56,286 +84,640 @@ const Pricing = ({ quotation, t }) => {
|
|
|
56
84
|
return null;
|
|
57
85
|
}
|
|
58
86
|
};
|
|
59
|
-
|
|
60
|
-
switch
|
|
87
|
+
var getQuotedFeeValue = function getQuotedFeeValue(key) {
|
|
88
|
+
switch(key){
|
|
61
89
|
case 'deposit':
|
|
62
|
-
return quotedPrices
|
|
90
|
+
return quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.deposit;
|
|
63
91
|
case 'subscriptionFee':
|
|
64
|
-
return quotedPrices
|
|
92
|
+
return quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.subscriptionFee;
|
|
65
93
|
case 'reservationFee':
|
|
66
94
|
return reservationFee;
|
|
67
95
|
default:
|
|
68
96
|
return null;
|
|
69
97
|
}
|
|
70
98
|
};
|
|
71
|
-
|
|
99
|
+
var upfrontTotalDiscount = function upfrontTotalDiscount() {
|
|
100
|
+
var _quotedPrices_extraCharges;
|
|
72
101
|
// Calculate base fees total (deposit)
|
|
73
|
-
|
|
74
|
-
|
|
102
|
+
var originalBaseTotal = deposit;
|
|
103
|
+
var quotedBaseTotal = (quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.deposit) || 0;
|
|
75
104
|
// Calculate original upfront extra charges
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
105
|
+
var originalExtraCharges = extraCharges.filter(function(charge) {
|
|
106
|
+
return charge.type === 'upfront';
|
|
107
|
+
}).reduce(function(sum, charge) {
|
|
108
|
+
return sum + charge.amount;
|
|
109
|
+
}, 0);
|
|
79
110
|
// Calculate quoted upfront extra charges
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
111
|
+
var quotedExtraCharges = (quotedPrices === null || quotedPrices === void 0 ? void 0 : (_quotedPrices_extraCharges = quotedPrices.extraCharges) === null || _quotedPrices_extraCharges === void 0 ? void 0 : _quotedPrices_extraCharges.filter(function(charge) {
|
|
112
|
+
return charge.type === 'upfront';
|
|
113
|
+
}).reduce(function(sum, charge) {
|
|
114
|
+
return sum + charge.amount;
|
|
115
|
+
}, 0)) || originalExtraCharges;
|
|
116
|
+
var originalTotal = originalBaseTotal + originalExtraCharges;
|
|
117
|
+
var quotedTotal = quotedBaseTotal + quotedExtraCharges;
|
|
85
118
|
// Calculate total discount (original - quoted)
|
|
86
|
-
|
|
119
|
+
var totalDiscount = originalTotal - quotedTotal;
|
|
87
120
|
return totalDiscount;
|
|
88
121
|
};
|
|
89
|
-
return
|
|
122
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
123
|
+
children: /*#__PURE__*/ _jsx(SectionBoxNew, {
|
|
124
|
+
topContent: /*#__PURE__*/ _jsxs(_Fragment, {
|
|
125
|
+
children: [
|
|
126
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
127
|
+
style: {
|
|
90
128
|
textTransform: 'uppercase',
|
|
91
129
|
fontSize: 12,
|
|
92
|
-
fontWeight: 'bold'
|
|
93
|
-
},
|
|
130
|
+
fontWeight: 'bold'
|
|
131
|
+
},
|
|
132
|
+
children: t === null || t === void 0 ? void 0 : t.title
|
|
133
|
+
}),
|
|
134
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
135
|
+
style: {
|
|
94
136
|
fontWeight: 'bold',
|
|
95
137
|
color: colors.black,
|
|
96
|
-
letterSpacing: 1
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
|
|
138
|
+
letterSpacing: 1
|
|
139
|
+
},
|
|
140
|
+
children: t === null || t === void 0 ? void 0 : t.fees.upfront.title
|
|
141
|
+
}),
|
|
142
|
+
t === null || t === void 0 ? void 0 : t.fees.upfront.content.map(function(fee) {
|
|
143
|
+
var _ref;
|
|
144
|
+
var _getFeeValue, _getQuotedFeeValue;
|
|
145
|
+
var feeValue = (_getFeeValue = getFeeValue(fee.key)) === null || _getFeeValue === void 0 ? void 0 : _getFeeValue.toFixed(2);
|
|
146
|
+
var quotedFeeValue = (_ref = (_getQuotedFeeValue = getQuotedFeeValue(fee.key)) === null || _getQuotedFeeValue === void 0 ? void 0 : _getQuotedFeeValue.toFixed(2)) !== null && _ref !== void 0 ? _ref : undefined;
|
|
100
147
|
if (feeValue === '0.00') {
|
|
101
148
|
return null;
|
|
102
149
|
}
|
|
103
|
-
return
|
|
150
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
151
|
+
style: {
|
|
104
152
|
justifyContent: 'space-between',
|
|
105
153
|
flexDirection: 'row',
|
|
106
|
-
rowGap: 8
|
|
107
|
-
},
|
|
154
|
+
rowGap: 8
|
|
155
|
+
},
|
|
156
|
+
children: [
|
|
157
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
158
|
+
style: {
|
|
108
159
|
paddingRight: 4,
|
|
109
160
|
letterSpacing: 1,
|
|
110
|
-
color: colors.primary3
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
|
|
161
|
+
color: colors.primary3
|
|
162
|
+
},
|
|
163
|
+
children: fee.title
|
|
164
|
+
}),
|
|
165
|
+
hasDiscounts && fee.key !== 'reservationFee' ? // Only show strikethrough if quoted value is different from original value
|
|
166
|
+
feeValue !== quotedFeeValue ? /*#__PURE__*/ _jsxs(View, {
|
|
167
|
+
style: {
|
|
114
168
|
justifyContent: 'flex-end',
|
|
115
|
-
flexDirection: 'row'
|
|
116
|
-
},
|
|
169
|
+
flexDirection: 'row'
|
|
170
|
+
},
|
|
171
|
+
children: [
|
|
172
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
173
|
+
style: {
|
|
117
174
|
color: colors.primary2,
|
|
118
175
|
letterSpacing: 1,
|
|
119
176
|
textDecoration: 'line-through',
|
|
120
|
-
marginRight: 4
|
|
121
|
-
},
|
|
177
|
+
marginRight: 4
|
|
178
|
+
},
|
|
179
|
+
children: feeValue !== null ? feeValue : ''
|
|
180
|
+
}),
|
|
181
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
182
|
+
style: {
|
|
122
183
|
color: colors.primary3,
|
|
123
|
-
letterSpacing: 1
|
|
124
|
-
},
|
|
184
|
+
letterSpacing: 1
|
|
185
|
+
},
|
|
186
|
+
children: quotedFeeValue
|
|
187
|
+
})
|
|
188
|
+
]
|
|
189
|
+
}) : // When values are the same, just show the single value
|
|
190
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
191
|
+
style: {
|
|
125
192
|
color: colors.primary3,
|
|
126
|
-
letterSpacing: 1
|
|
127
|
-
},
|
|
193
|
+
letterSpacing: 1
|
|
194
|
+
},
|
|
195
|
+
children: feeValue !== null ? feeValue : ''
|
|
196
|
+
}) : // When no discounts or it's a reservation fee
|
|
197
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
198
|
+
style: {
|
|
128
199
|
color: colors.primary3,
|
|
129
|
-
letterSpacing: 1
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
200
|
+
letterSpacing: 1
|
|
201
|
+
},
|
|
202
|
+
children: feeValue !== null ? feeValue : ''
|
|
203
|
+
})
|
|
204
|
+
]
|
|
205
|
+
}, fee.key);
|
|
206
|
+
}),
|
|
207
|
+
quotation.fees.extraCharges.length > 0 && quotation.fees.extraCharges.filter(function(charge) {
|
|
208
|
+
return charge.amount > 0;
|
|
209
|
+
}).filter(function(charge) {
|
|
210
|
+
return charge.type === 'upfront';
|
|
211
|
+
}).map(function(charge, i) {
|
|
212
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
213
|
+
style: {
|
|
138
214
|
justifyContent: 'space-between',
|
|
139
215
|
flexDirection: 'row',
|
|
140
|
-
rowGap: 8
|
|
141
|
-
},
|
|
216
|
+
rowGap: 8
|
|
217
|
+
},
|
|
218
|
+
children: [
|
|
219
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
220
|
+
style: {
|
|
142
221
|
paddingRight: 4,
|
|
143
222
|
letterSpacing: 1,
|
|
144
|
-
color: colors.primary3
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
223
|
+
color: colors.primary3
|
|
224
|
+
},
|
|
225
|
+
children: charge.description
|
|
226
|
+
}),
|
|
227
|
+
hasDiscounts ? function() {
|
|
228
|
+
var quotedCharge = quotedPrices.extraCharges.find(function(extraCharge) {
|
|
229
|
+
return extraCharge.description === charge.description;
|
|
230
|
+
});
|
|
231
|
+
var originalAmount = charge.amount.toFixed(2);
|
|
232
|
+
var quotedAmount = quotedCharge === null || quotedCharge === void 0 ? void 0 : quotedCharge.amount.toFixed(2);
|
|
149
233
|
// Only show strikethrough if amounts are different
|
|
150
|
-
return originalAmount !== quotedAmount ?
|
|
234
|
+
return originalAmount !== quotedAmount ? /*#__PURE__*/ _jsxs(View, {
|
|
235
|
+
style: {
|
|
151
236
|
justifyContent: 'flex-end',
|
|
152
|
-
flexDirection: 'row'
|
|
153
|
-
},
|
|
237
|
+
flexDirection: 'row'
|
|
238
|
+
},
|
|
239
|
+
children: [
|
|
240
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
241
|
+
style: {
|
|
154
242
|
color: colors.primary2,
|
|
155
243
|
letterSpacing: 1,
|
|
156
244
|
textDecoration: 'line-through',
|
|
157
|
-
marginRight: 4
|
|
158
|
-
},
|
|
245
|
+
marginRight: 4
|
|
246
|
+
},
|
|
247
|
+
children: originalAmount
|
|
248
|
+
}),
|
|
249
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
250
|
+
style: {
|
|
159
251
|
color: colors.primary3,
|
|
160
|
-
letterSpacing: 1
|
|
161
|
-
},
|
|
252
|
+
letterSpacing: 1
|
|
253
|
+
},
|
|
254
|
+
children: quotedAmount
|
|
255
|
+
})
|
|
256
|
+
]
|
|
257
|
+
}) : // When amounts are the same, show single value
|
|
258
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
259
|
+
style: {
|
|
162
260
|
color: colors.primary3,
|
|
163
|
-
letterSpacing: 1
|
|
164
|
-
},
|
|
165
|
-
|
|
261
|
+
letterSpacing: 1
|
|
262
|
+
},
|
|
263
|
+
children: originalAmount
|
|
264
|
+
});
|
|
265
|
+
}() : /*#__PURE__*/ _jsx(Text, {
|
|
266
|
+
style: {
|
|
166
267
|
color: colors.primary3,
|
|
167
|
-
letterSpacing: 1
|
|
168
|
-
},
|
|
268
|
+
letterSpacing: 1
|
|
269
|
+
},
|
|
270
|
+
children: charge.amount.toFixed(2)
|
|
271
|
+
})
|
|
272
|
+
]
|
|
273
|
+
}, i);
|
|
274
|
+
}),
|
|
275
|
+
quotation.couponCode !== null && couponType === 'upfront' && /*#__PURE__*/ _jsxs(View, {
|
|
276
|
+
style: {
|
|
169
277
|
justifyContent: 'space-between',
|
|
170
278
|
flexDirection: 'row',
|
|
171
|
-
rowGap: 8
|
|
172
|
-
},
|
|
279
|
+
rowGap: 8
|
|
280
|
+
},
|
|
281
|
+
children: [
|
|
282
|
+
/*#__PURE__*/ _jsxs(Text, {
|
|
283
|
+
style: {
|
|
173
284
|
paddingRight: 4,
|
|
174
285
|
letterSpacing: 1,
|
|
175
|
-
color: colors.primary3
|
|
176
|
-
},
|
|
286
|
+
color: colors.primary3
|
|
287
|
+
},
|
|
288
|
+
children: [
|
|
289
|
+
t === null || t === void 0 ? void 0 : t.fees.promo,
|
|
290
|
+
" - ",
|
|
291
|
+
quotation.couponCode
|
|
292
|
+
]
|
|
293
|
+
}),
|
|
294
|
+
/*#__PURE__*/ _jsxs(Text, {
|
|
295
|
+
style: {
|
|
177
296
|
color: colors.success4,
|
|
178
297
|
letterSpacing: 1,
|
|
179
|
-
fontWeight: 'bold'
|
|
180
|
-
},
|
|
298
|
+
fontWeight: 'bold'
|
|
299
|
+
},
|
|
300
|
+
children: [
|
|
301
|
+
"- ",
|
|
302
|
+
(_quotation_fees_discountAmount = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount === void 0 ? void 0 : _quotation_fees_discountAmount.toFixed(2)
|
|
303
|
+
]
|
|
304
|
+
})
|
|
305
|
+
]
|
|
306
|
+
}),
|
|
307
|
+
hasDiscounts && /*#__PURE__*/ _jsxs(View, {
|
|
308
|
+
style: {
|
|
181
309
|
justifyContent: 'space-between',
|
|
182
310
|
flexDirection: 'row',
|
|
183
|
-
rowGap: 8
|
|
184
|
-
},
|
|
311
|
+
rowGap: 8
|
|
312
|
+
},
|
|
313
|
+
children: [
|
|
314
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
315
|
+
style: {
|
|
185
316
|
color: colors.primary3,
|
|
186
317
|
letterSpacing: 1,
|
|
187
|
-
paddingRight: 4
|
|
188
|
-
},
|
|
318
|
+
paddingRight: 4
|
|
319
|
+
},
|
|
320
|
+
children: t === null || t === void 0 ? void 0 : t.fees.totalDiscount
|
|
321
|
+
}),
|
|
322
|
+
/*#__PURE__*/ _jsxs(Text, {
|
|
323
|
+
style: {
|
|
189
324
|
color: colors.success4,
|
|
190
325
|
fontWeight: 'bold',
|
|
191
|
-
letterSpacing: 1
|
|
192
|
-
},
|
|
326
|
+
letterSpacing: 1
|
|
327
|
+
},
|
|
328
|
+
children: [
|
|
329
|
+
"- ",
|
|
330
|
+
upfrontTotalDiscount()
|
|
331
|
+
]
|
|
332
|
+
})
|
|
333
|
+
]
|
|
334
|
+
}),
|
|
335
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
336
|
+
style: {
|
|
193
337
|
justifyContent: 'space-between',
|
|
194
338
|
flexDirection: 'row',
|
|
195
|
-
rowGap: 8
|
|
196
|
-
},
|
|
339
|
+
rowGap: 8
|
|
340
|
+
},
|
|
341
|
+
children: [
|
|
342
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
343
|
+
style: {
|
|
197
344
|
color: colors.primary3,
|
|
198
345
|
letterSpacing: 1,
|
|
199
|
-
paddingRight: 4
|
|
200
|
-
},
|
|
346
|
+
paddingRight: 4
|
|
347
|
+
},
|
|
348
|
+
children: "".concat(t === null || t === void 0 ? void 0 : t.serviceFee, " (").concat(taxPercentage, "%)")
|
|
349
|
+
}),
|
|
350
|
+
quotedPrices !== undefined ? /*#__PURE__*/ _jsx(Text, {
|
|
351
|
+
style: {
|
|
352
|
+
color: colors.primary3,
|
|
353
|
+
letterSpacing: 1
|
|
354
|
+
},
|
|
355
|
+
children: serviceUpfrontFee
|
|
356
|
+
}) : /*#__PURE__*/ _jsx(Text, {
|
|
357
|
+
style: {
|
|
358
|
+
color: colors.primary3,
|
|
359
|
+
letterSpacing: 1
|
|
360
|
+
},
|
|
361
|
+
children: serviceUpfrontFee
|
|
362
|
+
})
|
|
363
|
+
]
|
|
364
|
+
}),
|
|
365
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
366
|
+
style: {
|
|
201
367
|
backgroundColor: colors.primary1,
|
|
202
|
-
borderTop:
|
|
368
|
+
borderTop: "1px solid ".concat(colors.primary1),
|
|
203
369
|
justifyContent: 'space-between',
|
|
204
370
|
flexDirection: 'row',
|
|
205
|
-
padding: 4
|
|
206
|
-
},
|
|
371
|
+
padding: 4
|
|
372
|
+
},
|
|
373
|
+
children: [
|
|
374
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
375
|
+
style: {
|
|
207
376
|
letterSpacing: 1,
|
|
208
377
|
paddingRight: 4,
|
|
209
|
-
fontWeight: 'bold'
|
|
210
|
-
},
|
|
378
|
+
fontWeight: 'bold'
|
|
379
|
+
},
|
|
380
|
+
children: "Total"
|
|
381
|
+
}),
|
|
382
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
383
|
+
style: {
|
|
384
|
+
letterSpacing: 1,
|
|
385
|
+
fontWeight: 'bold'
|
|
386
|
+
},
|
|
387
|
+
children: formatMoney(totalUpfrontFee + Number.parseFloat(serviceUpfrontFee))
|
|
388
|
+
})
|
|
389
|
+
]
|
|
390
|
+
}),
|
|
391
|
+
/*#__PURE__*/ _jsx(View, {
|
|
392
|
+
children: /*#__PURE__*/ _jsx(Text, {
|
|
393
|
+
style: {
|
|
211
394
|
color: colors.primary3,
|
|
212
395
|
letterSpacing: 1,
|
|
213
|
-
fontSize: '9px'
|
|
214
|
-
},
|
|
396
|
+
fontSize: '9px'
|
|
397
|
+
},
|
|
398
|
+
children: t === null || t === void 0 ? void 0 : t.fees.upfront.depositDisclaimer
|
|
399
|
+
})
|
|
400
|
+
}),
|
|
401
|
+
/*#__PURE__*/ _jsx(View, {
|
|
402
|
+
style: {
|
|
403
|
+
borderBottom: "1px solid ".concat(colors.primary2)
|
|
404
|
+
}
|
|
405
|
+
}),
|
|
406
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
407
|
+
style: {
|
|
215
408
|
fontWeight: 'bold',
|
|
216
409
|
color: colors.black,
|
|
217
|
-
letterSpacing: 1
|
|
218
|
-
},
|
|
219
|
-
|
|
220
|
-
|
|
410
|
+
letterSpacing: 1
|
|
411
|
+
},
|
|
412
|
+
children: t === null || t === void 0 ? void 0 : t.fees.monthly.title
|
|
413
|
+
}),
|
|
414
|
+
t === null || t === void 0 ? void 0 : t.fees.monthly.content.map(function(fee) {
|
|
415
|
+
var _ref;
|
|
416
|
+
var _getFeeValue, _getQuotedFeeValue;
|
|
417
|
+
var feeValue = (_getFeeValue = getFeeValue(fee.key)) === null || _getFeeValue === void 0 ? void 0 : _getFeeValue.toFixed(2);
|
|
418
|
+
var quotedFeeValue = (_ref = (_getQuotedFeeValue = getQuotedFeeValue(fee.key)) === null || _getQuotedFeeValue === void 0 ? void 0 : _getQuotedFeeValue.toFixed(2)) !== null && _ref !== void 0 ? _ref : undefined;
|
|
221
419
|
if (feeValue === '0.00') {
|
|
222
420
|
return null;
|
|
223
421
|
}
|
|
224
|
-
return
|
|
422
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
423
|
+
style: {
|
|
225
424
|
justifyContent: 'space-between',
|
|
226
425
|
flexDirection: 'row',
|
|
227
|
-
rowGap: 8
|
|
228
|
-
},
|
|
426
|
+
rowGap: 8
|
|
427
|
+
},
|
|
428
|
+
children: [
|
|
429
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
430
|
+
style: {
|
|
229
431
|
paddingRight: 4,
|
|
230
432
|
letterSpacing: 1,
|
|
231
|
-
color: colors.primary3
|
|
232
|
-
},
|
|
433
|
+
color: colors.primary3
|
|
434
|
+
},
|
|
435
|
+
children: fee.title
|
|
436
|
+
}),
|
|
437
|
+
hasDiscounts ? feeValue !== quotedFeeValue ? /*#__PURE__*/ _jsxs(View, {
|
|
438
|
+
style: {
|
|
233
439
|
justifyContent: 'flex-end',
|
|
234
|
-
flexDirection: 'row'
|
|
235
|
-
},
|
|
440
|
+
flexDirection: 'row'
|
|
441
|
+
},
|
|
442
|
+
children: [
|
|
443
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
444
|
+
style: {
|
|
236
445
|
color: colors.primary2,
|
|
237
446
|
letterSpacing: 1,
|
|
238
447
|
textDecoration: 'line-through',
|
|
239
|
-
marginRight: 4
|
|
240
|
-
},
|
|
448
|
+
marginRight: 4
|
|
449
|
+
},
|
|
450
|
+
children: feeValue !== null ? feeValue : ''
|
|
451
|
+
}),
|
|
452
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
453
|
+
style: {
|
|
241
454
|
color: colors.primary3,
|
|
242
|
-
letterSpacing: 1
|
|
243
|
-
},
|
|
455
|
+
letterSpacing: 1
|
|
456
|
+
},
|
|
457
|
+
children: quotedFeeValue
|
|
458
|
+
})
|
|
459
|
+
]
|
|
460
|
+
}) : // When values are the same, just show the single value
|
|
461
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
462
|
+
style: {
|
|
244
463
|
color: colors.primary3,
|
|
245
|
-
letterSpacing: 1
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
464
|
+
letterSpacing: 1
|
|
465
|
+
},
|
|
466
|
+
children: feeValue !== null ? feeValue : ''
|
|
467
|
+
}) : /*#__PURE__*/ _jsx(Text, {
|
|
468
|
+
style: {
|
|
469
|
+
color: colors.primary3,
|
|
470
|
+
letterSpacing: 1
|
|
471
|
+
},
|
|
472
|
+
children: feeValue !== null ? feeValue : ''
|
|
473
|
+
})
|
|
474
|
+
]
|
|
475
|
+
}, fee.key);
|
|
476
|
+
}),
|
|
477
|
+
quotation.fees.extraCharges.length > 0 && quotation.fees.extraCharges.filter(function(charge) {
|
|
478
|
+
return charge.type === 'monthly';
|
|
479
|
+
}).map(function(charge) {
|
|
480
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
481
|
+
style: {
|
|
251
482
|
justifyContent: 'space-between',
|
|
252
483
|
flexDirection: 'row',
|
|
253
|
-
rowGap: 8
|
|
254
|
-
},
|
|
484
|
+
rowGap: 8
|
|
485
|
+
},
|
|
486
|
+
children: [
|
|
487
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
488
|
+
style: {
|
|
255
489
|
paddingRight: 4,
|
|
256
490
|
letterSpacing: 1,
|
|
257
|
-
color: colors.primary3
|
|
258
|
-
},
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
491
|
+
color: colors.primary3
|
|
492
|
+
},
|
|
493
|
+
children: charge.description
|
|
494
|
+
}),
|
|
495
|
+
hasDiscounts ? function() {
|
|
496
|
+
var quotedCharge = quotedPrices.extraCharges.find(function(extraCharge) {
|
|
497
|
+
return extraCharge.description === charge.description;
|
|
498
|
+
});
|
|
499
|
+
var originalAmount = charge.amount.toFixed(2);
|
|
500
|
+
var quotedAmount = quotedCharge === null || quotedCharge === void 0 ? void 0 : quotedCharge.amount.toFixed(2);
|
|
262
501
|
// Only show strikethrough if amounts are different
|
|
263
|
-
return originalAmount !== quotedAmount ?
|
|
502
|
+
return originalAmount !== quotedAmount ? /*#__PURE__*/ _jsxs(View, {
|
|
503
|
+
style: {
|
|
264
504
|
justifyContent: 'flex-end',
|
|
265
|
-
flexDirection: 'row'
|
|
266
|
-
},
|
|
505
|
+
flexDirection: 'row'
|
|
506
|
+
},
|
|
507
|
+
children: [
|
|
508
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
509
|
+
style: {
|
|
267
510
|
color: colors.primary2,
|
|
268
511
|
letterSpacing: 1,
|
|
269
512
|
textDecoration: 'line-through',
|
|
270
|
-
marginRight: 4
|
|
271
|
-
},
|
|
513
|
+
marginRight: 4
|
|
514
|
+
},
|
|
515
|
+
children: originalAmount
|
|
516
|
+
}),
|
|
517
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
518
|
+
style: {
|
|
272
519
|
color: colors.primary3,
|
|
273
|
-
letterSpacing: 1
|
|
274
|
-
},
|
|
520
|
+
letterSpacing: 1
|
|
521
|
+
},
|
|
522
|
+
children: quotedAmount
|
|
523
|
+
})
|
|
524
|
+
]
|
|
525
|
+
}) : // When amounts are the same, show single value
|
|
526
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
527
|
+
style: {
|
|
275
528
|
color: colors.primary3,
|
|
276
|
-
letterSpacing: 1
|
|
277
|
-
},
|
|
278
|
-
|
|
529
|
+
letterSpacing: 1
|
|
530
|
+
},
|
|
531
|
+
children: originalAmount
|
|
532
|
+
});
|
|
533
|
+
}() : /*#__PURE__*/ _jsx(Text, {
|
|
534
|
+
style: {
|
|
279
535
|
color: colors.primary3,
|
|
280
|
-
letterSpacing: 1
|
|
281
|
-
},
|
|
536
|
+
letterSpacing: 1
|
|
537
|
+
},
|
|
538
|
+
children: charge.amount.toFixed(2)
|
|
539
|
+
})
|
|
540
|
+
]
|
|
541
|
+
}, charge.description);
|
|
542
|
+
}),
|
|
543
|
+
quotation.couponCode !== null && couponType === 'monthly' && /*#__PURE__*/ _jsxs(View, {
|
|
544
|
+
style: {
|
|
282
545
|
justifyContent: 'space-between',
|
|
283
546
|
flexDirection: 'row',
|
|
284
|
-
rowGap: 8
|
|
285
|
-
},
|
|
547
|
+
rowGap: 8
|
|
548
|
+
},
|
|
549
|
+
children: [
|
|
550
|
+
/*#__PURE__*/ _jsxs(Text, {
|
|
551
|
+
style: {
|
|
286
552
|
paddingRight: 4,
|
|
287
553
|
letterSpacing: 1,
|
|
288
|
-
color: colors.primary3
|
|
289
|
-
},
|
|
554
|
+
color: colors.primary3
|
|
555
|
+
},
|
|
556
|
+
children: [
|
|
557
|
+
t === null || t === void 0 ? void 0 : t.fees.promo,
|
|
558
|
+
" - ",
|
|
559
|
+
quotation.couponCode
|
|
560
|
+
]
|
|
561
|
+
}),
|
|
562
|
+
/*#__PURE__*/ _jsxs(Text, {
|
|
563
|
+
style: {
|
|
290
564
|
color: colors.success4,
|
|
291
565
|
letterSpacing: 1,
|
|
292
|
-
fontWeight: 'bold'
|
|
293
|
-
},
|
|
566
|
+
fontWeight: 'bold'
|
|
567
|
+
},
|
|
568
|
+
children: [
|
|
569
|
+
"- ",
|
|
570
|
+
(_quotation_fees_discountAmount1 = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount1 === void 0 ? void 0 : _quotation_fees_discountAmount1.toFixed(2)
|
|
571
|
+
]
|
|
572
|
+
})
|
|
573
|
+
]
|
|
574
|
+
}),
|
|
575
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
576
|
+
style: {
|
|
294
577
|
justifyContent: 'space-between',
|
|
295
578
|
flexDirection: 'row',
|
|
296
|
-
rowGap: 8
|
|
297
|
-
},
|
|
579
|
+
rowGap: 8
|
|
580
|
+
},
|
|
581
|
+
children: [
|
|
582
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
583
|
+
style: {
|
|
298
584
|
color: colors.primary3,
|
|
299
585
|
letterSpacing: 1,
|
|
300
|
-
paddingRight: 4
|
|
301
|
-
},
|
|
586
|
+
paddingRight: 4
|
|
587
|
+
},
|
|
588
|
+
children: "".concat(t === null || t === void 0 ? void 0 : t.serviceFee, " (").concat(taxPercentage, "%)")
|
|
589
|
+
}),
|
|
590
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
591
|
+
style: {
|
|
592
|
+
color: colors.primary3,
|
|
593
|
+
letterSpacing: 1
|
|
594
|
+
},
|
|
595
|
+
children: serviceMonthlyFee.toFixed(2)
|
|
596
|
+
})
|
|
597
|
+
]
|
|
598
|
+
}),
|
|
599
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
600
|
+
style: {
|
|
302
601
|
backgroundColor: colors.primary1,
|
|
303
|
-
borderTop:
|
|
602
|
+
borderTop: "1px solid ".concat(colors.primary1),
|
|
304
603
|
justifyContent: 'space-between',
|
|
305
604
|
flexDirection: 'row',
|
|
306
|
-
padding: 4
|
|
307
|
-
},
|
|
605
|
+
padding: 4
|
|
606
|
+
},
|
|
607
|
+
children: [
|
|
608
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
609
|
+
style: {
|
|
308
610
|
letterSpacing: 1,
|
|
309
611
|
paddingRight: 4,
|
|
310
|
-
fontWeight: 'bold'
|
|
311
|
-
},
|
|
612
|
+
fontWeight: 'bold'
|
|
613
|
+
},
|
|
614
|
+
children: "Total"
|
|
615
|
+
}),
|
|
616
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
617
|
+
style: {
|
|
618
|
+
letterSpacing: 1,
|
|
619
|
+
fontWeight: 'bold'
|
|
620
|
+
},
|
|
621
|
+
children: formatMoney(totalMonthlyFee + serviceMonthlyFee)
|
|
622
|
+
})
|
|
623
|
+
]
|
|
624
|
+
})
|
|
625
|
+
]
|
|
626
|
+
}),
|
|
627
|
+
bottomContent: /*#__PURE__*/ _jsxs(View, {
|
|
628
|
+
style: {
|
|
629
|
+
rowGap: 16
|
|
630
|
+
},
|
|
631
|
+
children: [
|
|
632
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
633
|
+
style: {
|
|
312
634
|
textTransform: 'uppercase',
|
|
313
635
|
fontSize: 12,
|
|
314
636
|
fontWeight: 'bold',
|
|
315
|
-
letterSpacing: 1
|
|
316
|
-
},
|
|
637
|
+
letterSpacing: 1
|
|
638
|
+
},
|
|
639
|
+
children: t === null || t === void 0 ? void 0 : t.fees.dueToday.title
|
|
640
|
+
}),
|
|
641
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
642
|
+
style: {
|
|
643
|
+
color: colors.primary3,
|
|
644
|
+
letterSpacing: 1
|
|
645
|
+
},
|
|
646
|
+
children: t === null || t === void 0 ? void 0 : t.fees.dueToday.description
|
|
647
|
+
}),
|
|
648
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
649
|
+
style: {
|
|
317
650
|
justifyContent: 'space-between',
|
|
318
|
-
flexDirection: 'row'
|
|
319
|
-
},
|
|
320
|
-
|
|
321
|
-
|
|
651
|
+
flexDirection: 'row'
|
|
652
|
+
},
|
|
653
|
+
children: [
|
|
654
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
655
|
+
style: {
|
|
656
|
+
letterSpacing: 1,
|
|
657
|
+
color: colors.primary3
|
|
658
|
+
},
|
|
659
|
+
children: t === null || t === void 0 ? void 0 : t.fees.dueToday.subTotal
|
|
660
|
+
}),
|
|
661
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
662
|
+
style: {
|
|
663
|
+
letterSpacing: 1,
|
|
664
|
+
color: colors.primary3
|
|
665
|
+
},
|
|
666
|
+
children: hasDiscounts ? quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.amountBeforeTax.toFixed(2) : quotation.fees.amountBeforeTax.toFixed(2)
|
|
667
|
+
})
|
|
668
|
+
]
|
|
669
|
+
}),
|
|
670
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
671
|
+
style: {
|
|
322
672
|
justifyContent: 'space-between',
|
|
323
|
-
flexDirection: 'row'
|
|
324
|
-
},
|
|
325
|
-
|
|
326
|
-
|
|
673
|
+
flexDirection: 'row'
|
|
674
|
+
},
|
|
675
|
+
children: [
|
|
676
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
677
|
+
style: {
|
|
678
|
+
letterSpacing: 1,
|
|
679
|
+
color: colors.primary3
|
|
680
|
+
},
|
|
681
|
+
children: "".concat(t === null || t === void 0 ? void 0 : t.serviceFee, " (").concat(taxPercentage, "%)")
|
|
682
|
+
}),
|
|
683
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
684
|
+
style: {
|
|
685
|
+
letterSpacing: 1,
|
|
686
|
+
color: colors.primary3
|
|
687
|
+
},
|
|
688
|
+
children: hasDiscounts ? quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.taxAmount.toFixed(2) : quotation.fees.taxAmount.toFixed(2)
|
|
689
|
+
})
|
|
690
|
+
]
|
|
691
|
+
}),
|
|
692
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
693
|
+
style: {
|
|
327
694
|
backgroundColor: colors.primary1,
|
|
328
|
-
borderTop:
|
|
695
|
+
borderTop: "1px solid ".concat(colors.primary1),
|
|
329
696
|
justifyContent: 'space-between',
|
|
330
697
|
flexDirection: 'row',
|
|
331
|
-
padding: 4
|
|
332
|
-
},
|
|
698
|
+
padding: 4
|
|
699
|
+
},
|
|
700
|
+
children: [
|
|
701
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
702
|
+
style: {
|
|
333
703
|
letterSpacing: 1,
|
|
334
704
|
paddingRight: 4,
|
|
335
|
-
fontWeight: 'bold'
|
|
336
|
-
},
|
|
337
|
-
|
|
338
|
-
|
|
705
|
+
fontWeight: 'bold'
|
|
706
|
+
},
|
|
707
|
+
children: t === null || t === void 0 ? void 0 : t.fees.dueToday.grandTotal
|
|
708
|
+
}),
|
|
709
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
710
|
+
style: {
|
|
711
|
+
letterSpacing: 1,
|
|
712
|
+
fontWeight: 'bold'
|
|
713
|
+
},
|
|
714
|
+
children: hasDiscounts ? quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.amountAfterTax.toFixed(2) : quotation.fees.amountAfterTax.toFixed(2)
|
|
715
|
+
})
|
|
716
|
+
]
|
|
717
|
+
})
|
|
718
|
+
]
|
|
719
|
+
})
|
|
720
|
+
})
|
|
721
|
+
});
|
|
339
722
|
};
|
|
340
723
|
export default Pricing;
|
|
341
|
-
//# sourceMappingURL=Pricing.js.map
|