@driveflux/pdf 1.1.14 → 1.2.1
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/templates/QuotationPdf/CustomerSubscriptionSection.d.ts.map +1 -1
- package/dist/templates/QuotationPdf/Pricing.d.ts.map +1 -1
- package/dist/templates/QuotationPdf/Pricing.js +23 -6
- package/dist/templates/QuotationPdf/TermsSection.js +1 -1
- package/dist/templates/QuotationPdf/index.js +6 -2
- package/dist/templates/SubscriptionAgreement/Details.d.ts +1 -1
- package/dist/templates/SubscriptionAgreement/Details.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/Details.js +49 -52
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +6 -2
- package/dist/templates/SubscriptionAgreement/index.js +7 -2
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomerSubscriptionSection.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/CustomerSubscriptionSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAOhE,KAAK,KAAK,GAAG;IACZ,SAAS,EAAE,SAAS,CAAA;IACpB,CAAC,EAAE,uBAAuB,CAAA;CAC1B,CAAA;AAED,QAAA,MAAM,2BAA2B,EAAE,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"CustomerSubscriptionSection.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/CustomerSubscriptionSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAOhE,KAAK,KAAK,GAAG;IACZ,SAAS,EAAE,SAAS,CAAA;IACpB,CAAC,EAAE,uBAAuB,CAAA;CAC1B,CAAA;AAED,QAAA,MAAM,2BAA2B,EAAE,EAAE,CAAC,KAAK,CA6H1C,CAAA;AAED,eAAe,2BAA2B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pricing.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/Pricing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE,KAAK,KAAK,GAAG;IACZ,SAAS,EAAE,SAAS,CAAA;IACpB,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":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE,KAAK,KAAK,GAAG;IACZ,SAAS,EAAE,SAAS,CAAA;IACpB,CAAC,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAA;CACtC,CAAA;AAED,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,CA2WtB,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -9,13 +9,30 @@ var Pricing = function(param) {
|
|
|
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, couponCode = _quotation_fees.couponCode, couponType = _quotation_fees.couponType, discountAmount = _quotation_fees.discountAmount;
|
|
10
10
|
var totalUpfrontFee = startFee + (reservationFee || 0) + deposit;
|
|
11
11
|
var totalMonthlyFee = subscriptionFee;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
13
|
+
try {
|
|
14
|
+
for(var _iterator = extraCharges[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
15
|
+
var charge = _step.value;
|
|
16
|
+
if (charge.type === 'upfront') {
|
|
17
|
+
totalUpfrontFee += charge.amount;
|
|
18
|
+
} else if (charge.type === 'monthly') {
|
|
19
|
+
totalMonthlyFee += charge.amount;
|
|
20
|
+
}
|
|
17
21
|
}
|
|
18
|
-
})
|
|
22
|
+
} catch (err) {
|
|
23
|
+
_didIteratorError = true;
|
|
24
|
+
_iteratorError = err;
|
|
25
|
+
} finally{
|
|
26
|
+
try {
|
|
27
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
28
|
+
_iterator.return();
|
|
29
|
+
}
|
|
30
|
+
} finally{
|
|
31
|
+
if (_didIteratorError) {
|
|
32
|
+
throw _iteratorError;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
19
36
|
if (couponCode && couponType === 'upfront') {
|
|
20
37
|
totalUpfrontFee -= discountAmount || 0;
|
|
21
38
|
}
|
|
@@ -160,12 +160,16 @@ export var generateQuotationPdf = function() {
|
|
|
160
160
|
}();
|
|
161
161
|
var QuotationPDF = function(param) {
|
|
162
162
|
var _param_locale = param.locale, locale = _param_locale === void 0 ? 'en' : _param_locale, quotation = param.quotation;
|
|
163
|
+
var th = useTranslations(locale);
|
|
163
164
|
var pageProps = useMemo(function() {
|
|
164
165
|
return {
|
|
165
|
-
t:
|
|
166
|
+
t: th,
|
|
166
167
|
quotation: quotation
|
|
167
168
|
};
|
|
168
|
-
}, [
|
|
169
|
+
}, [
|
|
170
|
+
th,
|
|
171
|
+
quotation
|
|
172
|
+
]);
|
|
169
173
|
var t = pageProps.t;
|
|
170
174
|
return /*#__PURE__*/ _jsx(Document, {
|
|
171
175
|
language: locale,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/Details.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/Details.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AAEzE,KAAK,KAAK,GAAG;IACZ,QAAQ,EAAE,gCAAgC,CAAC,SAAS,CAAC,CAAA;IACrD,YAAY,EAAE,wBAAwB,CAAA;CACtC,CAAA;AAED,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,CAsGtB,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -2,62 +2,59 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { userName } from '@driveflux/db/models/user';
|
|
3
3
|
import { format } from '@driveflux/time';
|
|
4
4
|
import { Text, View } from '@react-pdf/renderer';
|
|
5
|
-
import { useMemo } from 'react';
|
|
6
5
|
import { colors } from '../../theme/index.js';
|
|
7
6
|
import LabelValue from './LabelValue.js';
|
|
8
7
|
var Details = function(param) {
|
|
9
8
|
var tDetails = param.tDetails, subscription = param.subscription;
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
60
|
-
}, []);
|
|
9
|
+
var _subscription_user_identification, _subscription_vehicle, _subscription_vehicle1, _subscription_vehicle2, _subscription_vehicle3, _subscription_schedule, _subscription_schedule1;
|
|
10
|
+
var details = {
|
|
11
|
+
member: [
|
|
12
|
+
{
|
|
13
|
+
key: tDetails.member.name,
|
|
14
|
+
value: userName(subscription.user)
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
key: tDetails.member.idOrPassportNo,
|
|
18
|
+
value: (_subscription_user_identification = subscription.user.identification) === null || _subscription_user_identification === void 0 ? void 0 : _subscription_user_identification.number
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
vehicle: [
|
|
22
|
+
{
|
|
23
|
+
key: tDetails.vehicle.make,
|
|
24
|
+
value: (_subscription_vehicle = subscription.vehicle) === null || _subscription_vehicle === void 0 ? void 0 : _subscription_vehicle.make
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: tDetails.vehicle.model,
|
|
28
|
+
value: (_subscription_vehicle1 = subscription.vehicle) === null || _subscription_vehicle1 === void 0 ? void 0 : _subscription_vehicle1.vehicleModel
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: tDetails.vehicle.year,
|
|
32
|
+
value: (_subscription_vehicle2 = subscription.vehicle) === null || _subscription_vehicle2 === void 0 ? void 0 : _subscription_vehicle2.year
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: tDetails.vehicle.plateNo,
|
|
36
|
+
value: (_subscription_vehicle3 = subscription.vehicle) === null || _subscription_vehicle3 === void 0 ? void 0 : _subscription_vehicle3.registrationNumber
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
subscription: [
|
|
40
|
+
{
|
|
41
|
+
key: tDetails.subscription.subscriptionPlan,
|
|
42
|
+
value: getPlanTranslation(subscription.plan)
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: tDetails.subscription.mileagePackage,
|
|
46
|
+
value: getFullMileagePackageTranslation(subscription.mileagePackage)
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: tDetails.subscription.startDate,
|
|
50
|
+
value: subscription.startedAt ? format(subscription.startedAt, 'dd-MM-yyyy') : undefined
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: tDetails.subscription.endDate,
|
|
54
|
+
value: subscription.endedAt ? format(subscription.endedAt, 'dd-MM-yyyy') : ((_subscription_schedule = subscription.schedule) === null || _subscription_schedule === void 0 ? void 0 : _subscription_schedule.endAt) ? format((_subscription_schedule1 = subscription.schedule) === null || _subscription_schedule1 === void 0 ? void 0 : _subscription_schedule1.endAt, 'dd-MM-yyyy') : undefined
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
};
|
|
61
58
|
var border = "1px solid ".concat(colors.primary2);
|
|
62
59
|
return /*#__PURE__*/ _jsxs(View, {
|
|
63
60
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TermsOfUseSubSection.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,KAAK,wBAAwB,GAC1B,MAAM,GACN;IACA,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,wBAAwB,EAAE,CAAA;CACtC,CAAA;AAEJ,KAAK,KAAK,GAAG;IACZ,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,EAAE,wBAAwB,CAAA;CACpC,CAAA;AAED,QAAA,MAAM,oBAAoB,EAAE,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"TermsOfUseSubSection.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,KAAK,wBAAwB,GAC1B,MAAM,GACN;IACA,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,wBAAwB,EAAE,CAAA;CACtC,CAAA;AAEJ,KAAK,KAAK,GAAG;IACZ,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,EAAE,wBAAwB,CAAA;CACpC,CAAA;AAED,QAAA,MAAM,oBAAoB,EAAE,EAAE,CAAC,KAAK,CA4CnC,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
|
@@ -35,7 +35,10 @@ var TermsOfUseSubSection = function(param) {
|
|
|
35
35
|
}, ''),
|
|
36
36
|
paddingLeft: Math.max(indices.length - 2, 0) * 16
|
|
37
37
|
};
|
|
38
|
-
}, [
|
|
38
|
+
}, [
|
|
39
|
+
indices.length,
|
|
40
|
+
indices.reduce
|
|
41
|
+
]), indicesString = _useMemo.indicesString, paddingLeft = _useMemo.paddingLeft;
|
|
39
42
|
return typeof subSection === 'string' ? /*#__PURE__*/ _jsxs(View, {
|
|
40
43
|
style: {
|
|
41
44
|
flexDirection: 'row',
|
|
@@ -90,7 +93,8 @@ var TermsOfUseSubSection = function(param) {
|
|
|
90
93
|
i + 1
|
|
91
94
|
]),
|
|
92
95
|
subSection: subSection
|
|
93
|
-
}, ""
|
|
96
|
+
}, "".// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
|
|
97
|
+
concat(indices, ".").concat(i));
|
|
94
98
|
})
|
|
95
99
|
]
|
|
96
100
|
}, indicesString) : null;
|
|
@@ -219,13 +219,18 @@ var SubscriptionAgreement = function(param) {
|
|
|
219
219
|
if (!signature.signedAt) {
|
|
220
220
|
throw new Error("Missing 'signature.signedAt'");
|
|
221
221
|
}
|
|
222
|
+
var useT = useTranslations(locale);
|
|
222
223
|
var pageProps = useMemo(function() {
|
|
223
224
|
return {
|
|
224
|
-
t:
|
|
225
|
+
t: useT,
|
|
225
226
|
userId: subscription.userId,
|
|
226
227
|
subscriptionId: subscription.id
|
|
227
228
|
};
|
|
228
|
-
}, [
|
|
229
|
+
}, [
|
|
230
|
+
subscription.userId,
|
|
231
|
+
subscription.id,
|
|
232
|
+
useT
|
|
233
|
+
]);
|
|
229
234
|
var t = pageProps.t;
|
|
230
235
|
return /*#__PURE__*/ _jsxs(Document, {
|
|
231
236
|
title: t.title,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@driveflux/pdf",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@driveflux/db": "1.
|
|
16
|
-
"@driveflux/env": "1.
|
|
17
|
-
"@driveflux/format-money": "5.
|
|
18
|
-
"@driveflux/time": "4.
|
|
15
|
+
"@driveflux/db": "1.4.1",
|
|
16
|
+
"@driveflux/env": "1.2.0",
|
|
17
|
+
"@driveflux/format-money": "5.2.0",
|
|
18
|
+
"@driveflux/time": "4.2.0",
|
|
19
19
|
"@react-pdf/renderer": "^3.4.4",
|
|
20
20
|
"date-fns": "^3.6.0",
|
|
21
21
|
"nodemon": "^3.1.4",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@babel/preset-env": "^7.24.8",
|
|
26
|
-
"@driveflux/fab": "2.
|
|
27
|
-
"@driveflux/tsconfig": "1.
|
|
26
|
+
"@driveflux/fab": "2.2.0",
|
|
27
|
+
"@driveflux/tsconfig": "1.2.0",
|
|
28
28
|
"@swc/cli": "^0.4.0",
|
|
29
29
|
"@swc/core": "1.7.2",
|
|
30
30
|
"@types/node": "^20.14.12",
|