@driveflux/pdf 1.5.10 → 1.5.12

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.
@@ -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,wBA80B1B,CAAA"}
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"}
@@ -34,6 +34,7 @@ export var subscription = {
34
34
  mileagePackageAmount: 0,
35
35
  hostPayoutAmount: 3600,
36
36
  hostExcessMileageFee: 1.1,
37
+ isDepositCustom: false,
37
38
  deposit: 0,
38
39
  noDepositReason: null,
39
40
  startFee: 2700,
@@ -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,CAwtBtB,CAAA;AAED,eAAe,OAAO,CAAA"}
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 * 0.08;
72
- var serviceUpfrontFee = (totalUpfrontFee * 0.08).toFixed(2);
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.fees.upfront.serviceFee
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.fees.monthly.serviceFee
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.fees.dueToday.serviceFee
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDrC,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,OAAO,aAAa,CAAA;AAE1D,eAAO,MAAM,eAAe,WAAY,IAAI,KAAG,uBAK9C,CAAA"}
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',
@@ -2,9 +2,9 @@ import type { DiscountType, MileagePackage, PlanType, VehicleType } from '@drive
2
2
  import type { INSPECTION_TYPES } from '@driveflux/db/models/vehicle';
3
3
  import type { Address } from '@driveflux/db/types/helpers';
4
4
  export declare const formatAddress: (originalAddress: Address) => string;
5
- export declare const getSimplifiedPlanTranslation: (plan: PlanType) => "60 Months" | "36 Months" | "24 Months" | "12 Months" | "Weekly" | "Unknown Plan" | "Monthly";
6
- export declare const getMileagePackageTranslation: (mileagePackage?: MileagePackage) => "Unlimited" | "Unknown Mileage Package" | "Lite" | "Standard" | "Plus";
7
- export declare const getFullMileagePackageTranslation: (plan?: MileagePackage | null) => "Lite - 1,250KM" | "Standard - 2,000KM" | "Plus - 2,750KM" | "Unlimited" | "Unknown Mileage Package";
5
+ export declare const getSimplifiedPlanTranslation: (plan: PlanType) => "60 Months" | "36 Months" | "24 Months" | "12 Months" | "Monthly" | "Weekly" | "Unknown Plan";
6
+ export declare const getMileagePackageTranslation: (mileagePackage?: MileagePackage) => "Lite" | "Standard" | "Plus" | "Unlimited" | "Unknown Mileage Package";
7
+ export declare const getFullMileagePackageTranslation: (plan?: MileagePackage | null) => "Unlimited" | "Unknown Mileage Package" | "Lite - 1,250KM" | "Standard - 2,000KM" | "Plus - 2,750KM";
8
8
  export declare const getPromoNotes: (amount: number, discount: {
9
9
  discountType: DiscountType;
10
10
  discountValue: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@driveflux/pdf",
3
- "version": "1.5.10",
3
+ "version": "1.5.12",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -12,7 +12,7 @@
12
12
  "dist"
13
13
  ],
14
14
  "dependencies": {
15
- "@driveflux/db": "1.12.7",
15
+ "@driveflux/db": "1.12.9",
16
16
  "@driveflux/env": "1.4.0",
17
17
  "@driveflux/format-money": "5.3.2",
18
18
  "@driveflux/time": "4.3.2",