@driveflux/pdf 4.0.77 → 5.0.0-feature-e-invoicing.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.
Files changed (282) hide show
  1. package/.env +0 -0
  2. package/.env.development +4 -0
  3. package/.turbo/turbo-build.log +14 -0
  4. package/CHANGELOG.md +15 -0
  5. package/build.ts +45 -0
  6. package/bun-env.d.ts +34 -0
  7. package/bunfig.toml +8 -0
  8. package/catalog-version-stamp.json +8 -0
  9. package/dist/main.js +4 -0
  10. package/dist/main.js.map +11 -0
  11. package/dist/src/config.d.ts +20 -0
  12. package/dist/src/create-logger.d.ts +1 -0
  13. package/dist/src/errors.d.ts +43 -0
  14. package/dist/src/main.d.ts +1 -0
  15. package/dist/src/preview/api.d.ts +264 -0
  16. package/dist/src/preview/client/app.d.ts +2 -0
  17. package/dist/src/preview/client/invoice/invoice-display.d.ts +5 -0
  18. package/dist/src/preview/client/invoice/invoice-setup.d.ts +8 -0
  19. package/dist/src/preview/client/preview-targets.d.ts +12 -0
  20. package/dist/src/preview/client/preview.d.ts +6 -0
  21. package/dist/src/preview/client/sidebar.d.ts +7 -0
  22. package/dist/src/preview/client/treaty.d.ts +200 -0
  23. package/dist/src/preview/client/use-target.d.ts +1 -0
  24. package/dist/src/preview/fonts/register-fonts.d.ts +1 -0
  25. package/dist/src/preview/frontend.d.ts +1 -0
  26. package/dist/src/preview/server.d.ts +1 -0
  27. package/dist/src/repository.d.ts +171 -0
  28. package/dist/src/templates/invoice/colors.d.ts +6 -0
  29. package/dist/src/templates/invoice/company-details.d.ts +10 -0
  30. package/dist/src/templates/invoice/flux-invoice.d.ts +6 -0
  31. package/dist/src/templates/invoice/footer.d.ts +2 -0
  32. package/dist/src/templates/invoice/host-invoice.d.ts +9 -0
  33. package/dist/src/templates/invoice/invoice-details.d.ts +13 -0
  34. package/dist/src/templates/invoice/invoice-notes.d.ts +1 -0
  35. package/dist/src/templates/invoice/invoice-summary.d.ts +7 -0
  36. package/dist/src/templates/invoice/letter-head.d.ts +10 -0
  37. package/dist/src/templates/invoice/li.d.ts +10 -0
  38. package/dist/src/templates/invoice/platform-and-host-details.d.ts +11 -0
  39. package/dist/src/templates/invoice/spacer.d.ts +3 -0
  40. package/dist/src/templates/invoice/split-container-items.d.ts +10 -0
  41. package/dist/src/templates/invoice/split-container.d.ts +7 -0
  42. package/dist/src/templates/invoice/standard-page.d.ts +7 -0
  43. package/dist/src/templates/invoice/types.d.ts +3 -0
  44. package/dist/src/templates/invoice/ul.d.ts +8 -0
  45. package/dist/src/templates/invoice/utils.d.ts +2 -0
  46. package/dist/tsconfig.tsbuildinfo +1 -0
  47. package/package.json +34 -40
  48. package/src/config.ts +42 -0
  49. package/src/create-logger.ts +4 -0
  50. package/src/errors.ts +35 -0
  51. package/src/main.ts +7 -0
  52. package/src/preview/api.ts +33 -0
  53. package/src/preview/client/app.tsx +30 -0
  54. package/src/preview/client/invoice/invoice-display.tsx +27 -0
  55. package/src/preview/client/invoice/invoice-setup.tsx +95 -0
  56. package/src/preview/client/preview-targets.ts +30 -0
  57. package/src/preview/client/preview.tsx +37 -0
  58. package/src/preview/client/sidebar.tsx +39 -0
  59. package/src/preview/client/treaty.ts +8 -0
  60. package/src/preview/client/use-target.ts +11 -0
  61. package/src/preview/fonts/GOTHAM-BLACK.TTF +0 -0
  62. package/src/preview/fonts/GOTHAM-BLACKITALIC.TTF +0 -0
  63. package/src/preview/fonts/GOTHAM-BOLD.TTF +0 -0
  64. package/src/preview/fonts/GOTHAM-BOLDITALIC.TTF +0 -0
  65. package/src/preview/fonts/GOTHAM-LIGHT.TTF +0 -0
  66. package/src/preview/fonts/GOTHAM-LIGHTITALIC.TTF +0 -0
  67. package/src/preview/fonts/GOTHAM-MEDIUM.TTF +0 -0
  68. package/src/preview/fonts/GOTHAM-MEDIUMITALIC.TTF +0 -0
  69. package/src/preview/fonts/GOTHAM-THIN.TTF +0 -0
  70. package/src/preview/fonts/GOTHAM-THINITALIC.TTF +0 -0
  71. package/src/preview/fonts/GOTHAM-ULTRA.TTF +0 -0
  72. package/src/preview/fonts/GOTHAM-ULTRAITALIC.TTF +0 -0
  73. package/src/preview/fonts/GOTHAM-XLIGHT.TTF +0 -0
  74. package/src/preview/fonts/GOTHAM-XLIGHTITALIC.TTF +0 -0
  75. package/src/preview/fonts/Gotham Book Italic.otf +0 -0
  76. package/src/preview/fonts/Gotham-BoldItalic.otf +0 -0
  77. package/src/preview/fonts/Gotham-Book.otf +0 -0
  78. package/src/preview/fonts/Gotham-BookItalic.otf +0 -0
  79. package/src/preview/fonts/Gotham-ExtraLight.otf +0 -0
  80. package/src/preview/fonts/Gotham-ExtraLightItalic.otf +0 -0
  81. package/src/preview/fonts/Gotham-Light.otf +0 -0
  82. package/src/preview/fonts/Gotham-LightItalic.otf +0 -0
  83. package/src/preview/fonts/Gotham-Medium.otf +0 -0
  84. package/src/preview/fonts/Gotham-MediumItalic.otf +0 -0
  85. package/src/preview/fonts/Gotham-Thin.otf +0 -0
  86. package/src/preview/fonts/Gotham-ThinItalic.otf +0 -0
  87. package/src/preview/fonts/Gotham-Ultra.otf +0 -0
  88. package/src/preview/fonts/Gotham-UltraItalic.otf +0 -0
  89. package/src/preview/fonts/GothamNarrow-Black.otf +0 -0
  90. package/src/preview/fonts/GothamNarrow-BlackItalic.otf +0 -0
  91. package/src/preview/fonts/GothamNarrow-Book.otf +0 -0
  92. package/src/preview/fonts/GothamNarrow-BookItalic.otf +0 -0
  93. package/src/preview/fonts/GothamNarrow-Light.otf +0 -0
  94. package/src/preview/fonts/GothamNarrow-LightItalic.otf +0 -0
  95. package/src/preview/fonts/GothamNarrow-Medium.otf +0 -0
  96. package/src/preview/fonts/GothamNarrow-MediumItalic.otf +0 -0
  97. package/src/preview/fonts/GothamNarrow-Thin.otf +0 -0
  98. package/src/preview/fonts/GothamNarrow-ThinItalic.otf +0 -0
  99. package/src/preview/fonts/GothamNarrow-Ultra.otf +0 -0
  100. package/src/preview/fonts/GothamNarrow-UltraItalic.otf +0 -0
  101. package/src/preview/fonts/GothamNarrow-XLight.otf +0 -0
  102. package/src/preview/fonts/GothamNarrow-XLightItalic.otf +0 -0
  103. package/src/preview/fonts/gotham-extra-narrow-bold-italic.otf +0 -0
  104. package/src/preview/fonts/gotham-extra-narrow-bold.otf +0 -0
  105. package/src/preview/fonts/gotham-extra-narrow-book-italic.otf +0 -0
  106. package/src/preview/fonts/gotham-extra-narrow-book.otf +0 -0
  107. package/src/preview/fonts/gotham-extra-narrow-light-italic.otf +0 -0
  108. package/src/preview/fonts/gotham-extra-narrow-light.otf +0 -0
  109. package/src/preview/fonts/gotham-extra-narrow-medium-italic.otf +0 -0
  110. package/src/preview/fonts/gotham-extra-narrow-medium.otf +0 -0
  111. package/src/preview/fonts/gotham-rounded-bold-italic.otf +0 -0
  112. package/src/preview/fonts/gotham-rounded-bold.otf +0 -0
  113. package/src/preview/fonts/gotham-rounded-book-italic.otf +0 -0
  114. package/src/preview/fonts/gotham-rounded-book.otf +0 -0
  115. package/src/preview/fonts/gotham-rounded-light-italic.otf +0 -0
  116. package/src/preview/fonts/gotham-rounded-light.otf +0 -0
  117. package/src/preview/fonts/gotham-rounded-medium-italic.otf +0 -0
  118. package/src/preview/fonts/gotham-rounded-medium.otf +0 -0
  119. package/src/preview/fonts/register-fonts.ts +395 -0
  120. package/src/preview/frontend.tsx +23 -0
  121. package/src/preview/global.css +39 -0
  122. package/src/preview/preview.html +12 -0
  123. package/src/preview/server.ts +28 -0
  124. package/src/repository.ts +39 -0
  125. package/src/templates/invoice/E Invoice Format.pdf +0 -0
  126. package/src/templates/invoice/colors.ts +6 -0
  127. package/src/templates/invoice/company-details.tsx +124 -0
  128. package/src/templates/invoice/flux-invoice.tsx +134 -0
  129. package/src/templates/invoice/footer.tsx +46 -0
  130. package/src/templates/invoice/host-invoice.tsx +134 -0
  131. package/src/templates/invoice/images/logo.png +0 -0
  132. package/src/templates/invoice/images/logo.svg +41 -0
  133. package/src/templates/invoice/invoice-details.tsx +231 -0
  134. package/src/templates/invoice/invoice-notes.tsx +74 -0
  135. package/src/templates/invoice/invoice-summary.tsx +135 -0
  136. package/src/templates/invoice/letter-head.tsx +132 -0
  137. package/src/templates/invoice/li.tsx +48 -0
  138. package/src/templates/invoice/platform-and-host-details.tsx +56 -0
  139. package/src/templates/invoice/spacer.tsx +5 -0
  140. package/src/templates/invoice/split-container-items.tsx +80 -0
  141. package/src/templates/invoice/split-container.tsx +35 -0
  142. package/src/templates/invoice/standard-page.tsx +45 -0
  143. package/src/templates/invoice/types.ts +6 -0
  144. package/src/templates/invoice/ul.tsx +19 -0
  145. package/src/templates/invoice/utils.ts +5 -0
  146. package/tsconfig.json +21 -0
  147. package/dist/components/FluxLogo.d.ts +0 -3
  148. package/dist/components/FluxLogo.d.ts.map +0 -1
  149. package/dist/components/FluxLogo.js +0 -66
  150. package/dist/components/FluxLogo.js.map +0 -1
  151. package/dist/components/StandardPage.d.ts +0 -7
  152. package/dist/components/StandardPage.d.ts.map +0 -1
  153. package/dist/components/StandardPage.js +0 -132
  154. package/dist/components/StandardPage.js.map +0 -1
  155. package/dist/index.d.ts +0 -4
  156. package/dist/index.d.ts.map +0 -1
  157. package/dist/index.js +0 -3
  158. package/dist/index.js.map +0 -1
  159. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts +0 -10
  160. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts.map +0 -1
  161. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +0 -165
  162. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js.map +0 -1
  163. package/dist/templates/QuotationPdf/GFV.d.ts +0 -10
  164. package/dist/templates/QuotationPdf/GFV.d.ts.map +0 -1
  165. package/dist/templates/QuotationPdf/GFV.js +0 -61
  166. package/dist/templates/QuotationPdf/GFV.js.map +0 -1
  167. package/dist/templates/QuotationPdf/Header.d.ts +0 -9
  168. package/dist/templates/QuotationPdf/Header.d.ts.map +0 -1
  169. package/dist/templates/QuotationPdf/Header.js +0 -71
  170. package/dist/templates/QuotationPdf/Header.js.map +0 -1
  171. package/dist/templates/QuotationPdf/Pricing.d.ts +0 -10
  172. package/dist/templates/QuotationPdf/Pricing.d.ts.map +0 -1
  173. package/dist/templates/QuotationPdf/Pricing.js +0 -723
  174. package/dist/templates/QuotationPdf/Pricing.js.map +0 -1
  175. package/dist/templates/QuotationPdf/QuotationPdfPage.d.ts +0 -8
  176. package/dist/templates/QuotationPdf/QuotationPdfPage.d.ts.map +0 -1
  177. package/dist/templates/QuotationPdf/QuotationPdfPage.js +0 -30
  178. package/dist/templates/QuotationPdf/QuotationPdfPage.js.map +0 -1
  179. package/dist/templates/QuotationPdf/SectionBoxNew.d.ts +0 -9
  180. package/dist/templates/QuotationPdf/SectionBoxNew.d.ts.map +0 -1
  181. package/dist/templates/QuotationPdf/SectionBoxNew.js +0 -38
  182. package/dist/templates/QuotationPdf/SectionBoxNew.js.map +0 -1
  183. package/dist/templates/QuotationPdf/TermsSection.d.ts +0 -8
  184. package/dist/templates/QuotationPdf/TermsSection.d.ts.map +0 -1
  185. package/dist/templates/QuotationPdf/TermsSection.js +0 -50
  186. package/dist/templates/QuotationPdf/TermsSection.js.map +0 -1
  187. package/dist/templates/QuotationPdf/VehiclePhotos.d.ts +0 -10
  188. package/dist/templates/QuotationPdf/VehiclePhotos.d.ts.map +0 -1
  189. package/dist/templates/QuotationPdf/VehiclePhotos.js +0 -66
  190. package/dist/templates/QuotationPdf/VehiclePhotos.js.map +0 -1
  191. package/dist/templates/QuotationPdf/index.d.ts +0 -12
  192. package/dist/templates/QuotationPdf/index.d.ts.map +0 -1
  193. package/dist/templates/QuotationPdf/index.js +0 -214
  194. package/dist/templates/QuotationPdf/index.js.map +0 -1
  195. package/dist/templates/QuotationPdf/translations.d.ts +0 -68
  196. package/dist/templates/QuotationPdf/translations.d.ts.map +0 -1
  197. package/dist/templates/QuotationPdf/translations.js +0 -101
  198. package/dist/templates/QuotationPdf/translations.js.map +0 -1
  199. package/dist/templates/QuotationPdf/utils.d.ts +0 -14
  200. package/dist/templates/QuotationPdf/utils.d.ts.map +0 -1
  201. package/dist/templates/QuotationPdf/utils.js +0 -152
  202. package/dist/templates/QuotationPdf/utils.js.map +0 -1
  203. package/dist/templates/SubscriptionAgreement/Confirmation.d.ts +0 -12
  204. package/dist/templates/SubscriptionAgreement/Confirmation.d.ts.map +0 -1
  205. package/dist/templates/SubscriptionAgreement/Confirmation.js +0 -80
  206. package/dist/templates/SubscriptionAgreement/Confirmation.js.map +0 -1
  207. package/dist/templates/SubscriptionAgreement/CoverPage.d.ts +0 -14
  208. package/dist/templates/SubscriptionAgreement/CoverPage.d.ts.map +0 -1
  209. package/dist/templates/SubscriptionAgreement/CoverPage.js +0 -111
  210. package/dist/templates/SubscriptionAgreement/CoverPage.js.map +0 -1
  211. package/dist/templates/SubscriptionAgreement/CoverPageSection.d.ts +0 -7
  212. package/dist/templates/SubscriptionAgreement/CoverPageSection.d.ts.map +0 -1
  213. package/dist/templates/SubscriptionAgreement/CoverPageSection.js +0 -25
  214. package/dist/templates/SubscriptionAgreement/CoverPageSection.js.map +0 -1
  215. package/dist/templates/SubscriptionAgreement/Details.d.ts +0 -10
  216. package/dist/templates/SubscriptionAgreement/Details.d.ts.map +0 -1
  217. package/dist/templates/SubscriptionAgreement/Details.js +0 -223
  218. package/dist/templates/SubscriptionAgreement/Details.js.map +0 -1
  219. package/dist/templates/SubscriptionAgreement/Footer.d.ts +0 -10
  220. package/dist/templates/SubscriptionAgreement/Footer.d.ts.map +0 -1
  221. package/dist/templates/SubscriptionAgreement/Footer.js +0 -58
  222. package/dist/templates/SubscriptionAgreement/Footer.js.map +0 -1
  223. package/dist/templates/SubscriptionAgreement/Header.d.ts +0 -10
  224. package/dist/templates/SubscriptionAgreement/Header.d.ts.map +0 -1
  225. package/dist/templates/SubscriptionAgreement/Header.js +0 -46
  226. package/dist/templates/SubscriptionAgreement/Header.js.map +0 -1
  227. package/dist/templates/SubscriptionAgreement/LabelValue.d.ts +0 -8
  228. package/dist/templates/SubscriptionAgreement/LabelValue.d.ts.map +0 -1
  229. package/dist/templates/SubscriptionAgreement/LabelValue.js +0 -29
  230. package/dist/templates/SubscriptionAgreement/LabelValue.js.map +0 -1
  231. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.d.ts +0 -10
  232. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.d.ts.map +0 -1
  233. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +0 -33
  234. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js.map +0 -1
  235. package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts +0 -8
  236. package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts.map +0 -1
  237. package/dist/templates/SubscriptionAgreement/TermsOfUse.js +0 -101
  238. package/dist/templates/SubscriptionAgreement/TermsOfUse.js.map +0 -1
  239. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts +0 -12
  240. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts.map +0 -1
  241. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +0 -103
  242. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js.map +0 -1
  243. package/dist/templates/SubscriptionAgreement/index.d.ts +0 -13
  244. package/dist/templates/SubscriptionAgreement/index.d.ts.map +0 -1
  245. package/dist/templates/SubscriptionAgreement/index.js +0 -271
  246. package/dist/templates/SubscriptionAgreement/index.js.map +0 -1
  247. package/dist/templates/SubscriptionAgreement/translations.d.ts +0 -78
  248. package/dist/templates/SubscriptionAgreement/translations.d.ts.map +0 -1
  249. package/dist/templates/SubscriptionAgreement/translations.js +0 -662
  250. package/dist/templates/SubscriptionAgreement/translations.js.map +0 -1
  251. package/dist/templates/SubscriptionAgreement/types.d.ts +0 -7
  252. package/dist/templates/SubscriptionAgreement/types.d.ts.map +0 -1
  253. package/dist/templates/SubscriptionAgreement/types.js +0 -1
  254. package/dist/templates/SubscriptionAgreement/types.js.map +0 -1
  255. package/dist/templates/SubscriptionAgreement/utils.d.ts +0 -6
  256. package/dist/templates/SubscriptionAgreement/utils.d.ts.map +0 -1
  257. package/dist/templates/SubscriptionAgreement/utils.js +0 -37
  258. package/dist/templates/SubscriptionAgreement/utils.js.map +0 -1
  259. package/dist/templates/index.d.ts +0 -3
  260. package/dist/templates/index.d.ts.map +0 -1
  261. package/dist/templates/index.js +0 -2
  262. package/dist/templates/index.js.map +0 -1
  263. package/dist/theme/colors.d.ts +0 -148
  264. package/dist/theme/colors.d.ts.map +0 -1
  265. package/dist/theme/colors.js +0 -137
  266. package/dist/theme/colors.js.map +0 -1
  267. package/dist/theme/index.d.ts +0 -2
  268. package/dist/theme/index.d.ts.map +0 -1
  269. package/dist/theme/index.js +0 -1
  270. package/dist/theme/index.js.map +0 -1
  271. package/dist/types.d.ts +0 -2
  272. package/dist/types.d.ts.map +0 -1
  273. package/dist/types.js +0 -1
  274. package/dist/types.js.map +0 -1
  275. package/dist/utils.d.ts +0 -10
  276. package/dist/utils.d.ts.map +0 -1
  277. package/dist/utils.js +0 -175
  278. package/dist/utils.js.map +0 -1
  279. package/dist/watch.d.ts +0 -2
  280. package/dist/watch.d.ts.map +0 -1
  281. package/dist/watch.js +0 -11
  282. package/dist/watch.js.map +0 -1
@@ -1,723 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { formatMoney } from '@driveflux/format-money';
3
- import { Text, View } from '@react-pdf/renderer';
4
- import { colors } from '../../theme/colors.js';
5
- import SectionBoxNew from './SectionBoxNew.js';
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;
15
- if (hasDiscounts) {
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
- }
25
- }
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
- }
38
- }
39
- }
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
- }
50
- }
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
- }
63
- }
64
- }
65
- }
66
- if (quotation.couponCode) {
67
- if (couponType === 'upfront') {
68
- totalUpfrontFee -= discountAmount || 0;
69
- } else if (couponType === 'monthly') {
70
- totalMonthlyFee -= discountAmount || 0;
71
- }
72
- }
73
- var serviceMonthlyFee = totalMonthlyFee * taxRate;
74
- var serviceUpfrontFee = (totalUpfrontFee * taxRate).toFixed(2);
75
- var getFeeValue = function getFeeValue(key) {
76
- switch(key){
77
- case 'reservationFee':
78
- return reservationFee;
79
- case 'deposit':
80
- return deposit;
81
- case 'subscriptionFee':
82
- return subscriptionFee;
83
- default:
84
- return null;
85
- }
86
- };
87
- var getQuotedFeeValue = function getQuotedFeeValue(key) {
88
- switch(key){
89
- case 'deposit':
90
- return quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.deposit;
91
- case 'subscriptionFee':
92
- return quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.subscriptionFee;
93
- case 'reservationFee':
94
- return reservationFee;
95
- default:
96
- return null;
97
- }
98
- };
99
- var upfrontTotalDiscount = function upfrontTotalDiscount() {
100
- var _quotedPrices_extraCharges;
101
- // Calculate base fees total (deposit)
102
- var originalBaseTotal = deposit;
103
- var quotedBaseTotal = (quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.deposit) || 0;
104
- // Calculate original upfront extra charges
105
- var originalExtraCharges = extraCharges.filter(function(charge) {
106
- return charge.type === 'upfront';
107
- }).reduce(function(sum, charge) {
108
- return sum + charge.amount;
109
- }, 0);
110
- // Calculate quoted upfront extra charges
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;
118
- // Calculate total discount (original - quoted)
119
- var totalDiscount = originalTotal - quotedTotal;
120
- return totalDiscount;
121
- };
122
- return /*#__PURE__*/ _jsx(View, {
123
- children: /*#__PURE__*/ _jsx(SectionBoxNew, {
124
- topContent: /*#__PURE__*/ _jsxs(_Fragment, {
125
- children: [
126
- /*#__PURE__*/ _jsx(Text, {
127
- style: {
128
- textTransform: 'uppercase',
129
- fontSize: 12,
130
- fontWeight: 'bold'
131
- },
132
- children: t === null || t === void 0 ? void 0 : t.title
133
- }),
134
- /*#__PURE__*/ _jsx(Text, {
135
- style: {
136
- fontWeight: 'bold',
137
- color: colors.black,
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;
147
- if (feeValue === '0.00') {
148
- return null;
149
- }
150
- return /*#__PURE__*/ _jsxs(View, {
151
- style: {
152
- justifyContent: 'space-between',
153
- flexDirection: 'row',
154
- rowGap: 8
155
- },
156
- children: [
157
- /*#__PURE__*/ _jsx(Text, {
158
- style: {
159
- paddingRight: 4,
160
- letterSpacing: 1,
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: {
168
- justifyContent: 'flex-end',
169
- flexDirection: 'row'
170
- },
171
- children: [
172
- /*#__PURE__*/ _jsx(Text, {
173
- style: {
174
- color: colors.primary2,
175
- letterSpacing: 1,
176
- textDecoration: 'line-through',
177
- marginRight: 4
178
- },
179
- children: feeValue !== null ? feeValue : ''
180
- }),
181
- /*#__PURE__*/ _jsx(Text, {
182
- style: {
183
- color: colors.primary3,
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: {
192
- color: colors.primary3,
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: {
199
- color: colors.primary3,
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: {
214
- justifyContent: 'space-between',
215
- flexDirection: 'row',
216
- rowGap: 8
217
- },
218
- children: [
219
- /*#__PURE__*/ _jsx(Text, {
220
- style: {
221
- paddingRight: 4,
222
- letterSpacing: 1,
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);
233
- // Only show strikethrough if amounts are different
234
- return originalAmount !== quotedAmount ? /*#__PURE__*/ _jsxs(View, {
235
- style: {
236
- justifyContent: 'flex-end',
237
- flexDirection: 'row'
238
- },
239
- children: [
240
- /*#__PURE__*/ _jsx(Text, {
241
- style: {
242
- color: colors.primary2,
243
- letterSpacing: 1,
244
- textDecoration: 'line-through',
245
- marginRight: 4
246
- },
247
- children: originalAmount
248
- }),
249
- /*#__PURE__*/ _jsx(Text, {
250
- style: {
251
- color: colors.primary3,
252
- letterSpacing: 1
253
- },
254
- children: quotedAmount
255
- })
256
- ]
257
- }) : // When amounts are the same, show single value
258
- /*#__PURE__*/ _jsx(Text, {
259
- style: {
260
- color: colors.primary3,
261
- letterSpacing: 1
262
- },
263
- children: originalAmount
264
- });
265
- }() : /*#__PURE__*/ _jsx(Text, {
266
- style: {
267
- color: colors.primary3,
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: {
277
- justifyContent: 'space-between',
278
- flexDirection: 'row',
279
- rowGap: 8
280
- },
281
- children: [
282
- /*#__PURE__*/ _jsxs(Text, {
283
- style: {
284
- paddingRight: 4,
285
- letterSpacing: 1,
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: {
296
- color: colors.success4,
297
- letterSpacing: 1,
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: {
309
- justifyContent: 'space-between',
310
- flexDirection: 'row',
311
- rowGap: 8
312
- },
313
- children: [
314
- /*#__PURE__*/ _jsx(Text, {
315
- style: {
316
- color: colors.primary3,
317
- letterSpacing: 1,
318
- paddingRight: 4
319
- },
320
- children: t === null || t === void 0 ? void 0 : t.fees.totalDiscount
321
- }),
322
- /*#__PURE__*/ _jsxs(Text, {
323
- style: {
324
- color: colors.success4,
325
- fontWeight: 'bold',
326
- letterSpacing: 1
327
- },
328
- children: [
329
- "- ",
330
- upfrontTotalDiscount()
331
- ]
332
- })
333
- ]
334
- }),
335
- /*#__PURE__*/ _jsxs(View, {
336
- style: {
337
- justifyContent: 'space-between',
338
- flexDirection: 'row',
339
- rowGap: 8
340
- },
341
- children: [
342
- /*#__PURE__*/ _jsx(Text, {
343
- style: {
344
- color: colors.primary3,
345
- letterSpacing: 1,
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: {
367
- backgroundColor: colors.primary1,
368
- borderTop: "1px solid ".concat(colors.primary1),
369
- justifyContent: 'space-between',
370
- flexDirection: 'row',
371
- padding: 4
372
- },
373
- children: [
374
- /*#__PURE__*/ _jsx(Text, {
375
- style: {
376
- letterSpacing: 1,
377
- paddingRight: 4,
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: {
394
- color: colors.primary3,
395
- letterSpacing: 1,
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: {
408
- fontWeight: 'bold',
409
- color: colors.black,
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;
419
- if (feeValue === '0.00') {
420
- return null;
421
- }
422
- return /*#__PURE__*/ _jsxs(View, {
423
- style: {
424
- justifyContent: 'space-between',
425
- flexDirection: 'row',
426
- rowGap: 8
427
- },
428
- children: [
429
- /*#__PURE__*/ _jsx(Text, {
430
- style: {
431
- paddingRight: 4,
432
- letterSpacing: 1,
433
- color: colors.primary3
434
- },
435
- children: fee.title
436
- }),
437
- hasDiscounts ? feeValue !== quotedFeeValue ? /*#__PURE__*/ _jsxs(View, {
438
- style: {
439
- justifyContent: 'flex-end',
440
- flexDirection: 'row'
441
- },
442
- children: [
443
- /*#__PURE__*/ _jsx(Text, {
444
- style: {
445
- color: colors.primary2,
446
- letterSpacing: 1,
447
- textDecoration: 'line-through',
448
- marginRight: 4
449
- },
450
- children: feeValue !== null ? feeValue : ''
451
- }),
452
- /*#__PURE__*/ _jsx(Text, {
453
- style: {
454
- color: colors.primary3,
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: {
463
- color: colors.primary3,
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: {
482
- justifyContent: 'space-between',
483
- flexDirection: 'row',
484
- rowGap: 8
485
- },
486
- children: [
487
- /*#__PURE__*/ _jsx(Text, {
488
- style: {
489
- paddingRight: 4,
490
- letterSpacing: 1,
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);
501
- // Only show strikethrough if amounts are different
502
- return originalAmount !== quotedAmount ? /*#__PURE__*/ _jsxs(View, {
503
- style: {
504
- justifyContent: 'flex-end',
505
- flexDirection: 'row'
506
- },
507
- children: [
508
- /*#__PURE__*/ _jsx(Text, {
509
- style: {
510
- color: colors.primary2,
511
- letterSpacing: 1,
512
- textDecoration: 'line-through',
513
- marginRight: 4
514
- },
515
- children: originalAmount
516
- }),
517
- /*#__PURE__*/ _jsx(Text, {
518
- style: {
519
- color: colors.primary3,
520
- letterSpacing: 1
521
- },
522
- children: quotedAmount
523
- })
524
- ]
525
- }) : // When amounts are the same, show single value
526
- /*#__PURE__*/ _jsx(Text, {
527
- style: {
528
- color: colors.primary3,
529
- letterSpacing: 1
530
- },
531
- children: originalAmount
532
- });
533
- }() : /*#__PURE__*/ _jsx(Text, {
534
- style: {
535
- color: colors.primary3,
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: {
545
- justifyContent: 'space-between',
546
- flexDirection: 'row',
547
- rowGap: 8
548
- },
549
- children: [
550
- /*#__PURE__*/ _jsxs(Text, {
551
- style: {
552
- paddingRight: 4,
553
- letterSpacing: 1,
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: {
564
- color: colors.success4,
565
- letterSpacing: 1,
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: {
577
- justifyContent: 'space-between',
578
- flexDirection: 'row',
579
- rowGap: 8
580
- },
581
- children: [
582
- /*#__PURE__*/ _jsx(Text, {
583
- style: {
584
- color: colors.primary3,
585
- letterSpacing: 1,
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: {
601
- backgroundColor: colors.primary1,
602
- borderTop: "1px solid ".concat(colors.primary1),
603
- justifyContent: 'space-between',
604
- flexDirection: 'row',
605
- padding: 4
606
- },
607
- children: [
608
- /*#__PURE__*/ _jsx(Text, {
609
- style: {
610
- letterSpacing: 1,
611
- paddingRight: 4,
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: {
634
- textTransform: 'uppercase',
635
- fontSize: 12,
636
- fontWeight: 'bold',
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: {
650
- justifyContent: 'space-between',
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: {
672
- justifyContent: 'space-between',
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: {
694
- backgroundColor: colors.primary1,
695
- borderTop: "1px solid ".concat(colors.primary1),
696
- justifyContent: 'space-between',
697
- flexDirection: 'row',
698
- padding: 4
699
- },
700
- children: [
701
- /*#__PURE__*/ _jsx(Text, {
702
- style: {
703
- letterSpacing: 1,
704
- paddingRight: 4,
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
- });
722
- };
723
- export default Pricing;