@unimaze/billing 0.21.3 → 0.21.4

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 (230) hide show
  1. package/lib/common/components/CommonTranslations.d.ts +1 -29
  2. package/lib/common/components/CommonTranslations.js +4 -32
  3. package/lib/common/components/attachments/Attachment.d.ts +1 -1
  4. package/lib/common/components/attachments/AttachmentModal.d.ts +1 -1
  5. package/lib/common/components/attachments/index.d.ts +1 -1
  6. package/lib/common/components/base-information/AccountingCost.d.ts +1 -1
  7. package/lib/common/components/base-information/OrderReference.d.ts +1 -1
  8. package/lib/common/components/base-information/ProjectReference.d.ts +1 -1
  9. package/lib/common/components/base-information/ReferenceIdentifiers.d.ts +2 -1
  10. package/lib/common/components/base-information/ReferenceIdentifiers.js +29 -11
  11. package/lib/common/components/base-information/index.d.ts +10 -1
  12. package/lib/common/components/base-information/index.js +9 -1
  13. package/lib/common/components/billing-lines/BillingCalculations.d.ts +1 -1
  14. package/lib/common/components/billing-lines/BillingLinePreview.d.ts +2 -1
  15. package/lib/common/components/billing-lines/BillingLinePreview.js +4 -2
  16. package/lib/common/components/billing-lines/BillingTaxSummary.d.ts +1 -1
  17. package/lib/common/components/billing-lines/BillingTaxSummary.js +0 -1
  18. package/lib/common/components/billing-lines/CurrencySelector.d.ts +20 -0
  19. package/lib/common/components/billing-lines/CurrencySelector.js +17 -0
  20. package/lib/common/components/billing-lines/DiscountTypeSelector.d.ts +10 -0
  21. package/lib/common/components/billing-lines/DiscountTypeSelector.js +16 -0
  22. package/lib/common/components/billing-lines/NewBillingLines.d.ts +2 -1
  23. package/lib/common/components/billing-lines/NewBillingLines.js +37 -327
  24. package/lib/common/components/billing-lines/NewNewBillingLines.d.ts +15 -0
  25. package/lib/common/components/billing-lines/NewNewBillingLines.js +36 -0
  26. package/lib/common/components/billing-lines/SingleBillingLine.d.ts +19 -0
  27. package/lib/common/components/billing-lines/SingleBillingLine.js +262 -0
  28. package/lib/common/components/billing-lines/UnitOfMeasureSelector.d.ts +14 -0
  29. package/lib/common/components/billing-lines/UnitOfMeasureSelector.js +15 -0
  30. package/lib/common/components/billing-lines/cwdwdw.d.ts +1 -0
  31. package/lib/common/components/billing-lines/cwdwdw.js +14 -0
  32. package/lib/common/components/billing-lines/index.d.ts +3 -6
  33. package/lib/common/components/billing-lines/index.js +1 -1
  34. package/lib/common/components/customer/CostCenter.d.ts +1 -1
  35. package/lib/common/components/customer/CustomerContactName.d.ts +1 -1
  36. package/lib/common/components/customer/index.d.ts +1 -1
  37. package/lib/common/components/customer/index.js +6 -4
  38. package/lib/common/components/delivery-location/index.d.ts +1 -1
  39. package/lib/common/components/form-item/index.d.ts +1 -1
  40. package/lib/common/components/input/index.d.ts +1 -1
  41. package/lib/common/components/invoice/index.d.ts +3 -1
  42. package/lib/common/components/invoice/index.js +21 -14
  43. package/lib/common/components/invoice-preview/InvoicePreviewHeader.d.ts +1 -1
  44. package/lib/common/components/invoice-preview/InvoicePreviewHeader.js +7 -8
  45. package/lib/common/components/invoice-preview/index.d.ts +1 -1
  46. package/lib/common/components/invoice-preview/index.js +8 -2
  47. package/lib/common/components/payment-method/index.d.ts +1 -1
  48. package/lib/common/components/payment-method/index.js +22 -7
  49. package/lib/common/components/supplier/CityAutofill.d.ts +1 -1
  50. package/lib/common/components/supplier/index.d.ts +1 -1
  51. package/lib/common/components/welcome-modal/index.d.ts +1 -1
  52. package/lib/common/types/ReceiverRequirements.d.ts +2 -0
  53. package/lib/common/types/ReceiverRequirements.js +2 -0
  54. package/lib/create-invoice/index.d.ts +9 -1
  55. package/lib/create-invoice/index.js +87 -60
  56. package/lib/enums.d.ts +3 -0
  57. package/lib/translations/locales/en.json +7 -10
  58. package/lib/translations/locales/is.json +5 -8
  59. package/lib/translations/locales.d.ts +10 -16
  60. package/lib/unimaze-api-clients/src/mapi/api.d.ts +6664 -0
  61. package/lib/unimaze-api-clients/src/mapi/api.js +4743 -0
  62. package/lib/unimaze-api-clients/src/mapi/base.d.ts +55 -0
  63. package/lib/unimaze-api-clients/src/mapi/base.js +84 -0
  64. package/lib/unimaze-api-clients/src/mapi/configuration.d.ts +63 -0
  65. package/lib/unimaze-api-clients/src/mapi/configuration.js +28 -0
  66. package/lib/unimaze-api-clients/src/mapi/index.d.ts +13 -0
  67. package/lib/unimaze-api-clients/src/mapi/index.js +30 -0
  68. package/lib/unimaze-api-clients/src/rapi/api.d.ts +5015 -0
  69. package/lib/unimaze-api-clients/src/rapi/api.js +5582 -0
  70. package/lib/unimaze-api-clients/src/rapi/base.d.ts +55 -0
  71. package/lib/unimaze-api-clients/src/rapi/base.js +84 -0
  72. package/lib/unimaze-api-clients/src/rapi/configuration.d.ts +63 -0
  73. package/lib/unimaze-api-clients/src/rapi/configuration.js +28 -0
  74. package/lib/unimaze-api-clients/src/rapi/index.d.ts +13 -0
  75. package/lib/unimaze-api-clients/src/rapi/index.js +30 -0
  76. package/lib/unimaze-billing/src/common/components/CommonTranslations.d.ts +102 -0
  77. package/lib/unimaze-billing/src/common/components/CommonTranslations.js +106 -0
  78. package/lib/unimaze-billing/src/common/components/attachments/Attachment.d.ts +20 -0
  79. package/lib/unimaze-billing/src/common/components/attachments/Attachment.js +164 -0
  80. package/lib/unimaze-billing/src/common/components/attachments/AttachmentModal.d.ts +21 -0
  81. package/lib/unimaze-billing/src/common/components/attachments/AttachmentModal.js +203 -0
  82. package/lib/unimaze-billing/src/common/components/attachments/index.d.ts +27 -0
  83. package/lib/unimaze-billing/src/common/components/attachments/index.js +214 -0
  84. package/lib/unimaze-billing/src/common/components/base-information/AccountingCost.d.ts +17 -0
  85. package/lib/unimaze-billing/src/common/components/base-information/AccountingCost.js +61 -0
  86. package/lib/unimaze-billing/src/common/components/base-information/OrderReference.d.ts +16 -0
  87. package/lib/unimaze-billing/src/common/components/base-information/OrderReference.js +58 -0
  88. package/lib/unimaze-billing/src/common/components/base-information/ProjectReference.d.ts +14 -0
  89. package/lib/unimaze-billing/src/common/components/base-information/ProjectReference.js +30 -0
  90. package/lib/unimaze-billing/src/common/components/base-information/ReferenceIdentifiers.d.ts +48 -0
  91. package/lib/unimaze-billing/src/common/components/base-information/ReferenceIdentifiers.js +306 -0
  92. package/lib/unimaze-billing/src/common/components/base-information/index.d.ts +68 -0
  93. package/lib/unimaze-billing/src/common/components/base-information/index.js +178 -0
  94. package/lib/unimaze-billing/src/common/components/billing-lines/BillingCalculations.d.ts +14 -0
  95. package/lib/unimaze-billing/src/common/components/billing-lines/BillingCalculations.js +153 -0
  96. package/lib/unimaze-billing/src/common/components/billing-lines/BillingLinePreview.d.ts +21 -0
  97. package/lib/unimaze-billing/src/common/components/billing-lines/BillingLinePreview.js +41 -0
  98. package/lib/unimaze-billing/src/common/components/billing-lines/BillingTaxSummary.d.ts +13 -0
  99. package/lib/unimaze-billing/src/common/components/billing-lines/BillingTaxSummary.js +134 -0
  100. package/lib/unimaze-billing/src/common/components/billing-lines/CurrencySelector.d.ts +20 -0
  101. package/lib/unimaze-billing/src/common/components/billing-lines/CurrencySelector.js +17 -0
  102. package/lib/unimaze-billing/src/common/components/billing-lines/DiscountTypeSelector.d.ts +10 -0
  103. package/lib/unimaze-billing/src/common/components/billing-lines/DiscountTypeSelector.js +16 -0
  104. package/lib/unimaze-billing/src/common/components/billing-lines/NewBillingLines.d.ts +129 -0
  105. package/lib/unimaze-billing/src/common/components/billing-lines/NewBillingLines.js +495 -0
  106. package/lib/unimaze-billing/src/common/components/billing-lines/NewNewBillingLines.d.ts +15 -0
  107. package/lib/unimaze-billing/src/common/components/billing-lines/NewNewBillingLines.js +36 -0
  108. package/lib/unimaze-billing/src/common/components/billing-lines/SingleBillingLine.d.ts +14 -0
  109. package/lib/unimaze-billing/src/common/components/billing-lines/SingleBillingLine.js +199 -0
  110. package/lib/unimaze-billing/src/common/components/billing-lines/UnitOfMeasureSelector.d.ts +14 -0
  111. package/lib/unimaze-billing/src/common/components/billing-lines/UnitOfMeasureSelector.js +15 -0
  112. package/lib/unimaze-billing/src/common/components/billing-lines/index.d.ts +52 -0
  113. package/lib/unimaze-billing/src/common/components/billing-lines/index.js +104 -0
  114. package/lib/unimaze-billing/src/common/components/component-container/Content.d.ts +7 -0
  115. package/lib/unimaze-billing/src/common/components/component-container/Content.js +13 -0
  116. package/lib/unimaze-billing/src/common/components/component-container/Header.d.ts +9 -0
  117. package/lib/unimaze-billing/src/common/components/component-container/Header.js +28 -0
  118. package/lib/unimaze-billing/src/common/components/component-container/index.d.ts +12 -0
  119. package/lib/unimaze-billing/src/common/components/component-container/index.js +22 -0
  120. package/lib/unimaze-billing/src/common/components/customer/CostCenter.d.ts +17 -0
  121. package/lib/unimaze-billing/src/common/components/customer/CostCenter.js +163 -0
  122. package/lib/unimaze-billing/src/common/components/customer/CustomerContactName.d.ts +17 -0
  123. package/lib/unimaze-billing/src/common/components/customer/CustomerContactName.js +53 -0
  124. package/lib/unimaze-billing/src/common/components/customer/hardCoddedCustomer.d.ts +7 -0
  125. package/lib/unimaze-billing/src/common/components/customer/hardCoddedCustomer.js +41 -0
  126. package/lib/unimaze-billing/src/common/components/customer/index.d.ts +26 -0
  127. package/lib/unimaze-billing/src/common/components/customer/index.js +168 -0
  128. package/lib/unimaze-billing/src/common/components/date-picker/index.d.ts +21 -0
  129. package/lib/unimaze-billing/src/common/components/date-picker/index.js +23 -0
  130. package/lib/unimaze-billing/src/common/components/delivery-location/index.d.ts +12 -0
  131. package/lib/unimaze-billing/src/common/components/delivery-location/index.js +89 -0
  132. package/lib/unimaze-billing/src/common/components/editable-cell/index.d.ts +0 -0
  133. package/lib/unimaze-billing/src/common/components/editable-cell/index.js +295 -0
  134. package/lib/unimaze-billing/src/common/components/editable-row/index.d.ts +5 -0
  135. package/lib/unimaze-billing/src/common/components/editable-row/index.js +59 -0
  136. package/lib/unimaze-billing/src/common/components/form-item/index.d.ts +35 -0
  137. package/lib/unimaze-billing/src/common/components/form-item/index.js +60 -0
  138. package/lib/unimaze-billing/src/common/components/index.d.ts +18 -0
  139. package/lib/unimaze-billing/src/common/components/index.js +42 -0
  140. package/lib/unimaze-billing/src/common/components/input/index.d.ts +23 -0
  141. package/lib/unimaze-billing/src/common/components/input/index.js +37 -0
  142. package/lib/unimaze-billing/src/common/components/invoice/index.d.ts +40 -0
  143. package/lib/unimaze-billing/src/common/components/invoice/index.js +52 -0
  144. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewHeader.d.ts +12 -0
  145. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewHeader.js +105 -0
  146. package/lib/unimaze-billing/src/common/components/invoice-preview/index.d.ts +16 -0
  147. package/lib/unimaze-billing/src/common/components/invoice-preview/index.js +405 -0
  148. package/lib/unimaze-billing/src/common/components/locale-intl/index.d.ts +0 -0
  149. package/lib/unimaze-billing/src/common/components/locale-intl/index.js +51 -0
  150. package/lib/unimaze-billing/src/common/components/payment-method/index.d.ts +76 -0
  151. package/lib/unimaze-billing/src/common/components/payment-method/index.js +356 -0
  152. package/lib/unimaze-billing/src/common/components/payment-method/paymentMethodForConversion.d.ts +8 -0
  153. package/lib/unimaze-billing/src/common/components/payment-method/paymentMethodForConversion.js +37 -0
  154. package/lib/unimaze-billing/src/common/components/submit-confirmation/SubmitConfirmationSVG.d.ts +3 -0
  155. package/lib/unimaze-billing/src/common/components/submit-confirmation/SubmitConfirmationSVG.js +17 -0
  156. package/lib/unimaze-billing/src/common/components/submit-confirmation/index.d.ts +8 -0
  157. package/lib/unimaze-billing/src/common/components/submit-confirmation/index.js +34 -0
  158. package/lib/unimaze-billing/src/common/components/supplier/CityAutofill.d.ts +18 -0
  159. package/lib/unimaze-billing/src/common/components/supplier/CityAutofill.js +159 -0
  160. package/lib/unimaze-billing/src/common/components/supplier/index.d.ts +94 -0
  161. package/lib/unimaze-billing/src/common/components/supplier/index.js +334 -0
  162. package/lib/unimaze-billing/src/common/components/tooltip/index.d.ts +7 -0
  163. package/lib/unimaze-billing/src/common/components/tooltip/index.js +15 -0
  164. package/lib/unimaze-billing/src/common/components/welcome-modal/index.d.ts +15 -0
  165. package/lib/unimaze-billing/src/common/components/welcome-modal/index.js +26 -0
  166. package/lib/unimaze-billing/src/common/consts/formLayout.d.ts +74 -0
  167. package/lib/unimaze-billing/src/common/consts/formLayout.js +45 -0
  168. package/lib/unimaze-billing/src/common/consts/validationRules.d.ts +6 -0
  169. package/lib/unimaze-billing/src/common/consts/validationRules.js +69 -0
  170. package/lib/unimaze-billing/src/common/enums/DocumentTypeEnum.d.ts +5 -0
  171. package/lib/unimaze-billing/src/common/enums/DocumentTypeEnum.js +8 -0
  172. package/lib/unimaze-billing/src/common/enums/index.d.ts +1 -0
  173. package/lib/unimaze-billing/src/common/enums/index.js +8 -0
  174. package/lib/unimaze-billing/src/common/types/AppConfiguration.d.ts +23 -0
  175. package/lib/unimaze-billing/src/common/types/AppConfiguration.js +2 -0
  176. package/lib/unimaze-billing/src/common/types/BillingLineMetadataOverride.d.ts +10 -0
  177. package/lib/unimaze-billing/src/common/types/BillingLineMetadataOverride.js +2 -0
  178. package/lib/unimaze-billing/src/common/types/CommonProps.d.ts +33 -0
  179. package/lib/unimaze-billing/src/common/types/CommonProps.js +2 -0
  180. package/lib/unimaze-billing/src/common/types/DiscountType.d.ts +1 -0
  181. package/lib/unimaze-billing/src/common/types/DiscountType.js +2 -0
  182. package/lib/unimaze-billing/src/common/types/InvoiceFormFields.d.ts +1 -0
  183. package/lib/unimaze-billing/src/common/types/InvoiceFormFields.js +2 -0
  184. package/lib/unimaze-billing/src/common/types/NewReceiverRequirements.d.ts +27 -0
  185. package/lib/unimaze-billing/src/common/types/NewReceiverRequirements.js +2 -0
  186. package/lib/unimaze-billing/src/common/types/ReceiverRequirements.d.ts +81 -0
  187. package/lib/unimaze-billing/src/common/types/ReceiverRequirements.js +391 -0
  188. package/lib/unimaze-billing/src/common/types/SupplierInfo.d.ts +11 -0
  189. package/lib/unimaze-billing/src/common/types/SupplierInfo.js +2 -0
  190. package/lib/unimaze-billing/src/common/types/index.d.ts +1 -0
  191. package/lib/unimaze-billing/src/common/types/index.js +17 -0
  192. package/lib/unimaze-billing/src/create-credit-note/index.d.ts +9 -0
  193. package/lib/unimaze-billing/src/create-credit-note/index.js +62 -0
  194. package/lib/unimaze-billing/src/create-invoice/IntlLoader.d.ts +11 -0
  195. package/lib/unimaze-billing/src/create-invoice/IntlLoader.js +116 -0
  196. package/lib/unimaze-billing/src/create-invoice/index.d.ts +74 -0
  197. package/lib/unimaze-billing/src/create-invoice/index.js +680 -0
  198. package/lib/unimaze-billing/src/enums.d.ts +11 -0
  199. package/lib/unimaze-billing/src/enums.js +18 -0
  200. package/lib/unimaze-billing/src/index.d.ts +4 -0
  201. package/lib/unimaze-billing/src/index.js +28 -0
  202. package/lib/unimaze-billing/src/translations/locales/en.json +183 -0
  203. package/lib/unimaze-billing/src/translations/locales/is.json +183 -0
  204. package/lib/unimaze-billing/src/translations/locales.d.ts +369 -0
  205. package/lib/unimaze-billing/src/translations/locales.js +11 -0
  206. package/lib/unimaze-billing/src/utils/ApiUtility.d.ts +23 -0
  207. package/lib/unimaze-billing/src/utils/ApiUtility.js +115 -0
  208. package/lib/unimaze-billing/src/utils/BillingLineUtility.d.ts +22 -0
  209. package/lib/unimaze-billing/src/utils/BillingLineUtility.js +158 -0
  210. package/lib/unimaze-billing/src/utils/ConversionUtility.d.ts +9 -0
  211. package/lib/unimaze-billing/src/utils/ConversionUtility.js +223 -0
  212. package/lib/unimaze-billing/src/utils/FileUploadUtility.d.ts +9 -0
  213. package/lib/unimaze-billing/src/utils/FileUploadUtility.js +45 -0
  214. package/lib/unimaze-billing/src/utils/IntlUtility.d.ts +5 -0
  215. package/lib/unimaze-billing/src/utils/IntlUtility.js +55 -0
  216. package/lib/unimaze-billing/src/utils/LocationUtility.d.ts +1 -0
  217. package/lib/unimaze-billing/src/utils/LocationUtility.js +81 -0
  218. package/lib/unimaze-billing/src/utils/ReferenceIdentifierUtility.d.ts +7 -0
  219. package/lib/unimaze-billing/src/utils/ReferenceIdentifierUtility.js +26 -0
  220. package/lib/unimaze-billing/src/utils/RequirementsUtility.d.ts +19 -0
  221. package/lib/unimaze-billing/src/utils/RequirementsUtility.js +189 -0
  222. package/lib/unimaze-billing/src/utils/index.d.ts +2 -0
  223. package/lib/unimaze-billing/src/utils/index.js +8 -0
  224. package/lib/utils/ApiUtility.d.ts +9 -3
  225. package/lib/utils/ApiUtility.js +30 -2
  226. package/lib/utils/BillingLineUtility.d.ts +3 -0
  227. package/lib/utils/BillingLineUtility.js +32 -1
  228. package/lib/utils/RequirementsUtility.d.ts +4 -1
  229. package/lib/utils/RequirementsUtility.js +56 -1
  230. package/package.json +2 -2
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ var react_1 = __importStar(require("react"));
27
+ var react_intl_1 = require("react-intl");
28
+ var __1 = require("..");
29
+ var lodash_1 = require("lodash");
30
+ var Invoice = function (props) {
31
+ var fieldPaths = [
32
+ ["invoice", "invoiceNo"],
33
+ ["invoice", "issueDate"],
34
+ ["invoice", "dueDate"],
35
+ ["invoice", "buyerReference"],
36
+ ["invoice", "orderReference", "documentNo"],
37
+ ["invoice", "accountingCost"],
38
+ ["invoice", "documentReferences", "project", "documentNo"],
39
+ ["invoice", "invoiceLines"]
40
+ ];
41
+ var debouncedValidateFields = (0, lodash_1.debounce)(props.validateFields, 500);
42
+ (0, react_1.useEffect)(function () {
43
+ if (!props.isActiveStep)
44
+ return;
45
+ debouncedValidateFields(fieldPaths, true);
46
+ }, [props.isActiveStep, JSON.stringify(props.form.getFieldsValue(fieldPaths))]);
47
+ return (react_1.default.createElement(react_1.default.Fragment, null,
48
+ react_1.default.createElement(__1.BaseInformation, { receiverRequirements: props.receiverRequirements, form: props.form, documentType: "invoice", updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, rapiBaseUrl: props.rapiBaseUrl, legalIdentifier: props.chosenCustomer.identifier, referenceIdentifiersLabelText: props.referenceIdentifiersLabelText, referenceIdentifiersHelpText: props.referenceIdentifiersHelpText, referenceIdentifierValidateStatus: props.referenceIdentifierValidateStatus, setReferenceIdentifierValidateStatus: props.setReferenceIdentifierValidateStatus, dueDateMinimumOffset: props.dueDateMinimumOffset, isSaveFieldValuesSelected: props.isSaveFieldValuesSelected, onSaveFieldValuesChange: props.onSaveFieldValuesChange }),
49
+ react_1.default.createElement(__1.BillingLines, { formInstance: props.form, billingLinesMetadata: props.billingLinesMetadata, receiverRequirements: props.receiverRequirements, outsideVatScope: props.outsideVatScope }),
50
+ react_1.default.createElement(__1.Attachments, { formInstance: props.form, uploadSizeLimit: props.uploadSizeLimit, attachmentTooltipText: props.attachmentTooltipText, languageString: props.languageString })));
51
+ };
52
+ exports.default = (0, react_intl_1.injectIntl)(Invoice);
@@ -0,0 +1,12 @@
1
+ import { FormInstance } from "antd";
2
+ import React from "react";
3
+ import { WrappedComponentProps } from "react-intl";
4
+ interface Props extends WrappedComponentProps {
5
+ form: FormInstance;
6
+ }
7
+ declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
8
+ forwardedRef?: React.Ref<any> | undefined;
9
+ } & React.RefAttributes<any>> & {
10
+ WrappedComponent: React.ComponentType<Props>;
11
+ };
12
+ export default _default;
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var antd_1 = require("antd");
18
+ var react_1 = __importDefault(require("react"));
19
+ var react_intl_1 = require("react-intl");
20
+ var colors_1 = require("@ant-design/colors");
21
+ var react_intl_2 = require("react-intl");
22
+ var BillingLineUtility_1 = require("../../../utils/BillingLineUtility");
23
+ var supplier_1 = require("../supplier");
24
+ var IntlUtility_1 = require("../../../utils/IntlUtility");
25
+ var translationMessages = (0, react_intl_2.defineMessages)({
26
+ invoicePreview_headerTitle: {
27
+ id: "invoicePreview.headerTitle",
28
+ defaultMessage: "Invoice",
29
+ },
30
+ });
31
+ var WrappedInvoicePreviewHeader = function (props) {
32
+ return (react_1.default.createElement(antd_1.ConfigProvider, { theme: {
33
+ token: {
34
+ colorText: "white",
35
+ colorTextDescription: colors_1.grey[2],
36
+ fontSizeHeading5: 16,
37
+ fontSizeLG: 20,
38
+ fontSizeXL: 30,
39
+ fontSize: 12,
40
+ fontSizeSM: 10,
41
+ fontWeightStrong: 700,
42
+ },
43
+ components: {
44
+ Layout: {
45
+ headerBg: colors_1.grey[7],
46
+ headerPadding: "35px",
47
+ headerHeight: 200,
48
+ },
49
+ },
50
+ } },
51
+ react_1.default.createElement(InvoicePreviewHeader, __assign({}, props))));
52
+ };
53
+ var InvoicePreviewHeader = function (props) {
54
+ var token = antd_1.theme.useToken().token;
55
+ return (react_1.default.createElement(antd_1.Flex, { justify: "center" },
56
+ react_1.default.createElement(antd_1.Flex, { vertical: true, style: { width: "100%", maxWidth: "900px" } },
57
+ react_1.default.createElement(antd_1.Layout.Header, { style: { width: "100vw", maxWidth: "900px" } },
58
+ react_1.default.createElement(antd_1.Flex, { vertical: true },
59
+ react_1.default.createElement(antd_1.Flex, { vertical: true, style: {
60
+ borderBottom: "1px solid ".concat(colors_1.grey[2]),
61
+ paddingBottom: "5px",
62
+ marginBottom: "10px",
63
+ } },
64
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary", style: { fontSize: token.fontSizeSM } },
65
+ props.intl.formatMessage(translationMessages.invoicePreview_headerTitle),
66
+ ":"),
67
+ react_1.default.createElement(antd_1.Typography.Text, null, props.form.getFieldValue(["invoice", "invoiceNo"]))),
68
+ react_1.default.createElement(antd_1.Flex, { vertical: true, style: {
69
+ borderBottom: "1px solid ".concat(colors_1.grey[2]),
70
+ paddingBottom: "5px",
71
+ marginBottom: "10px",
72
+ } },
73
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary", style: { fontSize: token.fontSizeSM } },
74
+ props.intl.formatMessage(supplier_1.translationMessages.supplier_title),
75
+ ":"),
76
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeHeading5, fontWeight: 500 } }, props.form.getFieldValue(["invoice", "supplier", "name"]))),
77
+ react_1.default.createElement(antd_1.Flex, { vertical: true },
78
+ react_1.default.createElement(antd_1.Typography.Text, null,
79
+ props.form.getFieldValue(["invoice", "currencyCode"]),
80
+ react_1.default.createElement(antd_1.Typography.Text, { strong: true, style: {
81
+ fontSize: token.fontSizeLG,
82
+ } }, (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)((0, BillingLineUtility_1.getTotals)(props.form.getFieldValue(["invoice", "invoiceLines"]))
83
+ .totalTaxInclusiveAmount, props.intl)))),
84
+ react_1.default.createElement(antd_1.Flex, { vertical: true, align: "flex-end" },
85
+ props.form.getFieldValue(["invoice", "singleReferenceIdentifier"]) &&
86
+ props.form.getFieldValue(["invoice", "singleReferenceIdentifier"]).code &&
87
+ props.form.getFieldValue(["invoice", "singleReferenceIdentifier"]).value && (react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeSM } },
88
+ props.form.getFieldValue(["invoice", "singleReferenceIdentifier"]).code,
89
+ ":",
90
+ " ",
91
+ props.form.getFieldValue(["invoice", "singleReferenceIdentifier"]).value)),
92
+ props.form.getFieldValue(["invoice", "referenceIdentifiers"]) &&
93
+ props.form
94
+ .getFieldValue(["invoice", "referenceIdentifiers"])
95
+ .map(function (referenceIdentifier, index) {
96
+ var _a, _b;
97
+ if (referenceIdentifier.code && referenceIdentifier.value) {
98
+ return (react_1.default.createElement(antd_1.Typography.Text, { key: index, style: { fontSize: token.fontSizeSM } },
99
+ ((_a = referenceIdentifier === null || referenceIdentifier === void 0 ? void 0 : referenceIdentifier.code) === null || _a === void 0 ? void 0 : _a.label) || ((_b = referenceIdentifier === null || referenceIdentifier === void 0 ? void 0 : referenceIdentifier.code) === null || _b === void 0 ? void 0 : _b.key),
100
+ ": ", referenceIdentifier === null || referenceIdentifier === void 0 ? void 0 :
101
+ referenceIdentifier.value));
102
+ }
103
+ })))))));
104
+ };
105
+ exports.default = (0, react_intl_1.injectIntl)(WrappedInvoicePreviewHeader);
@@ -0,0 +1,16 @@
1
+ import { WrappedComponentProps } from "react-intl";
2
+ import React from "react";
3
+ import { FormInstance } from "antd";
4
+ import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
5
+ import { PartyMetadata } from "@unimaze/api-clients/lib/mapi";
6
+ interface Props extends WrappedComponentProps {
7
+ recieverRequirements: NewReceiverRequirements;
8
+ form: FormInstance;
9
+ chosenCustomer: PartyMetadata;
10
+ }
11
+ declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
12
+ forwardedRef?: React.Ref<any> | undefined;
13
+ } & React.RefAttributes<any>> & {
14
+ WrappedComponent: React.ComponentType<Props>;
15
+ };
16
+ export default _default;
@@ -0,0 +1,405 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var react_intl_1 = require("react-intl");
7
+ var react_1 = __importDefault(require("react"));
8
+ var antd_1 = require("antd");
9
+ var BillingLineUtility_1 = require("../../../utils/BillingLineUtility");
10
+ var enums_1 = require("../../../enums");
11
+ var icons_1 = require("@ant-design/icons");
12
+ var colors_1 = require("@ant-design/colors");
13
+ var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
14
+ var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
15
+ var mapi_1 = require("@unimaze/api-clients/lib/mapi");
16
+ var payment_method_1 = require("../payment-method");
17
+ var IntlUtility_1 = require("../../../utils/IntlUtility");
18
+ var translationMessages = (0, react_intl_1.defineMessages)({
19
+ customer_title: {
20
+ id: "customer_title",
21
+ defaultMessage: "Customer",
22
+ },
23
+ customer_address_streetNameAndNumber: {
24
+ id: "customer_address_streetNameAndNumber",
25
+ defaultMessage: "Address",
26
+ },
27
+ customer_identifier: {
28
+ id: "customer_identifier",
29
+ defaultMessage: "Identifier",
30
+ },
31
+ baseInformation_costCenter: {
32
+ id: "baseInformation_costCenter",
33
+ defaultMessage: "Cost center",
34
+ },
35
+ baseInformation_issueDate: {
36
+ id: "baseInformation_issueDate",
37
+ defaultMessage: "Issue date",
38
+ },
39
+ baseInformation_dueDate: {
40
+ id: "baseInformation_dueDate",
41
+ defaultMessage: "Due date",
42
+ },
43
+ baseInformation_notes: {
44
+ id: "baseInformation_notes",
45
+ defaultMessage: "Notes",
46
+ },
47
+ supplier_title: {
48
+ id: "supplier_title",
49
+ defaultMessage: "Supplier",
50
+ },
51
+ supplier_identifier: {
52
+ id: "supplier_identifier",
53
+ defaultMessage: "Supplier identifier",
54
+ },
55
+ supplier_address_streetNameAndNumber: {
56
+ id: "supplier_address_streetNameAndNumber",
57
+ defaultMessage: "Address",
58
+ },
59
+ supplier_contact_phoneNumber: {
60
+ id: "supplier_contact_phoneNumber",
61
+ defaultMessage: "Phone number",
62
+ },
63
+ billingCalculations_labels_TaxAmountWithoutVat: {
64
+ id: "billingCalculations_labels_TaxAmountWithoutVat",
65
+ defaultMessage: "Total amount without VAT",
66
+ },
67
+ billingCalculations_labels_AmountPayable: {
68
+ id: "billingCalculations_labels_AmountPayable",
69
+ defaultMessage: "Amount payable",
70
+ },
71
+ billingCalculations_labels_TotalAmountWithVat: {
72
+ id: "billingCalculations_labels_TotalAmountWithVat",
73
+ defaultMessage: "Total amount with VAT",
74
+ },
75
+ billingCalculations_labels_TotalRoundingAmount: {
76
+ id: "billingCalculations_labels_TotalRoundingAmount",
77
+ defaultMessage: "Rounding amount",
78
+ },
79
+ billingLines_discount: {
80
+ id: "billingLines_discount",
81
+ defaultMessage: "Discount",
82
+ },
83
+ billingLines_total: {
84
+ id: "billingLines_total",
85
+ defaultMessage: "Total",
86
+ },
87
+ invoicePreview_billingLinesTitle: {
88
+ id: "invoicePreview_billingLinesTitle",
89
+ defaultMessage: "Invoice lines",
90
+ },
91
+ invoicePreview_attachmentsTitle: {
92
+ id: "invoicePreview_attachmentsTitle",
93
+ defaultMessage: "Attachments",
94
+ },
95
+ invoicePreview_paymentInfoTitle: {
96
+ id: "invoicePreview_paymentInfoTitle",
97
+ defaultMessage: "Payment information",
98
+ },
99
+ });
100
+ var InvoicePreview = function (props) {
101
+ var _a, _b, _c, _d, _e, _f;
102
+ var defaultPaymentMethods = [
103
+ {
104
+ key: mapi_1.PaymentMeansType.NotSpecified,
105
+ name: props.intl.formatMessage(payment_method_1.translationMessages.paymentMethod_labels_methods_undefined),
106
+ },
107
+ {
108
+ key: mapi_1.PaymentMeansType.MutuallyAgreed,
109
+ name: props.intl.formatMessage(payment_method_1.translationMessages.paymentMethod_labels_methods_mutuallyAgreed),
110
+ },
111
+ {
112
+ key: mapi_1.PaymentMeansType.DomesticTransfer,
113
+ name: props.intl.formatMessage(payment_method_1.translationMessages.paymentMethod_labels_methods_domesticTransfer),
114
+ },
115
+ {
116
+ key: mapi_1.PaymentMeansType.DomesticClaim,
117
+ name: props.intl.formatMessage(payment_method_1.translationMessages.paymentMethod_labels_methods_domesticClaim),
118
+ },
119
+ ];
120
+ var token = antd_1.theme.useToken().token;
121
+ var getPaymentMeansValue = function (paymentMeansType) {
122
+ var paymentMeansTypes = (0, RequirementsUtility_1.getFieldRequirements)(props.recieverRequirements, ReceiverRequirements_1.AvailableFields["paymentMeans.type"]);
123
+ if (paymentMeansTypes &&
124
+ paymentMeansTypes.hasOwnProperty("properties") &&
125
+ paymentMeansTypes.properties.hasOwnProperty("values") &&
126
+ paymentMeansTypes.properties.values) {
127
+ var paymentMeansValue = paymentMeansTypes.properties.values.find(function (value) { return value.key === paymentMeansType; });
128
+ return paymentMeansValue === null || paymentMeansValue === void 0 ? void 0 : paymentMeansValue.name;
129
+ }
130
+ else {
131
+ var paymentMeansValue = defaultPaymentMethods.find(function (value) { return value.key === paymentMeansType; });
132
+ return paymentMeansValue === null || paymentMeansValue === void 0 ? void 0 : paymentMeansValue.name;
133
+ }
134
+ };
135
+ var formValueFile1 = props.form.getFieldValue(["attachments", "file1", "file"]);
136
+ var formValueFile2 = props.form.getFieldValue(["attachments", "file2", "file"]);
137
+ var formValueFile3 = props.form.getFieldValue(["attachments", "file3", "file"]);
138
+ var _totals = (0, BillingLineUtility_1.getTotals)(props.form.getFieldValue(["invoice", "invoiceLines"]));
139
+ return (react_1.default.createElement(antd_1.Flex, { justify: "center" },
140
+ react_1.default.createElement(antd_1.Flex, { vertical: true, style: { width: "100%", maxWidth: "900px" } },
141
+ react_1.default.createElement(antd_1.Row, { gutter: [20, 20] },
142
+ react_1.default.createElement(antd_1.Col, { span: 24 },
143
+ react_1.default.createElement(antd_1.Card, { bordered: false, style: { backgroundColor: "#F5F5F5" }, title: react_1.default.createElement(antd_1.Row, { gutter: 20 },
144
+ react_1.default.createElement(antd_1.Col, { span: 12 },
145
+ react_1.default.createElement(antd_1.Flex, { justify: "space-between", align: "flex-end", style: { fontWeight: 400 } },
146
+ react_1.default.createElement(antd_1.Typography.Text, null, props.intl.formatMessage(translationMessages.baseInformation_issueDate)),
147
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary", style: { fontSize: token.fontSizeSM } }, (_a = props.form
148
+ .getFieldValue(["invoice", "issueDate"])) === null || _a === void 0 ? void 0 : _a.format("DD.MM.YYYY")))),
149
+ react_1.default.createElement(antd_1.Col, { span: 12, style: { borderLeft: "1px solid ".concat(colors_1.grey[0]) } },
150
+ react_1.default.createElement(antd_1.Flex, { justify: "space-between", align: "flex-end", style: { fontWeight: 400 } },
151
+ react_1.default.createElement(antd_1.Typography.Text, null, props.intl.formatMessage(translationMessages.baseInformation_dueDate)),
152
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary", style: { fontSize: token.fontSizeSM } }, (_b = props.form.getFieldValue(["invoice", "dueDate"])) === null || _b === void 0 ? void 0 : _b.format("DD.MM.YYYY"))))) },
153
+ react_1.default.createElement(antd_1.Flex, { vertical: true, gap: "small" },
154
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeHeading4, fontWeight: 500 } },
155
+ props.intl.formatMessage(translationMessages.customer_title),
156
+ ":"),
157
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" }, props.chosenCustomer.name),
158
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
159
+ props.intl.formatMessage(translationMessages.customer_identifier),
160
+ ":",
161
+ " ",
162
+ props.chosenCustomer.identifier),
163
+ ((_c = props.chosenCustomer.address) === null || _c === void 0 ? void 0 : _c.streetNameAndNumber) &&
164
+ ((_d = props.chosenCustomer.address) === null || _d === void 0 ? void 0 : _d.postalZone) &&
165
+ ((_e = props.chosenCustomer.address) === null || _e === void 0 ? void 0 : _e.city) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
166
+ props.intl.formatMessage(translationMessages.customer_address_streetNameAndNumber),
167
+ ": ",
168
+ props.chosenCustomer.address.streetNameAndNumber,
169
+ ",",
170
+ " ",
171
+ props.chosenCustomer.address.postalZone,
172
+ " ",
173
+ props.chosenCustomer.address.city)),
174
+ props.form.getFieldValue(["invoice", "customer", "locationIdentifier"]) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
175
+ props.intl.formatMessage(translationMessages.baseInformation_costCenter),
176
+ ":",
177
+ " ",
178
+ props.form.getFieldValue(["invoice", "customer", "locationIdentifier"]))),
179
+ react_1.default.createElement(antd_1.Col, { span: 8, style: { padding: 0 } },
180
+ react_1.default.createElement("hr", null)),
181
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeHeading4, fontWeight: 500 } },
182
+ props.intl.formatMessage(translationMessages.supplier_title),
183
+ ":"),
184
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" }, props.form.getFieldValue(["invoice", "supplier", "name"])),
185
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
186
+ props.intl.formatMessage(translationMessages.supplier_identifier),
187
+ ":",
188
+ " ",
189
+ props.form.getFieldValue(["invoice", "supplier", "identifier"])),
190
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
191
+ props.intl.formatMessage(translationMessages.supplier_address_streetNameAndNumber),
192
+ ":",
193
+ " ",
194
+ props.form.getFieldValue([
195
+ "invoice",
196
+ "supplier",
197
+ "address",
198
+ "streetNameAndNumber",
199
+ ]),
200
+ ", ",
201
+ props.form.getFieldValue(["invoice", "supplier", "address", "postalZone"]),
202
+ " ",
203
+ props.form.getFieldValue(["invoice", "supplier", "address", "city"])),
204
+ props.form.getFieldValue(["invoice", "supplier", "contact", "telephone"]) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
205
+ props.intl.formatMessage(translationMessages.supplier_contact_phoneNumber),
206
+ ":",
207
+ props.form.getFieldValue(["invoice", "supplier", "contact", "telephone"]))),
208
+ props.form.getFieldValue(["invoice", "supplier", "contact", "electronicMail"]) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" }, props.form.getFieldValue(["invoice", "supplier", "contact", "electronicMail"])))))),
209
+ react_1.default.createElement(antd_1.Col, { span: 24 },
210
+ react_1.default.createElement(antd_1.Flex, { vertical: true, style: { padding: "0 24px" }, gap: "middle" },
211
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeHeading4 } },
212
+ props.intl.formatMessage(translationMessages.invoicePreview_billingLinesTitle),
213
+ ":"),
214
+ ((_f = props.form.getFieldValue(["invoice", "invoiceLines"])) === null || _f === void 0 ? void 0 : _f.length) > 0 &&
215
+ props.form
216
+ .getFieldValue(["invoice", "invoiceLines"])
217
+ .map(function (line, index) {
218
+ var _a, _b;
219
+ var taxPercentage = (0, BillingLineUtility_1.calculateTaxPercentage)(enums_1.AvailableTaxCategoryTypeEnum[line.taxCategoryType]);
220
+ var calculatedDiscountValue = line.discountType === "PERCENTAGE"
221
+ ? (0, BillingLineUtility_1.calculateDiscountAmount)(line.discountValue, line.quantity, line.unitPriceAmount)
222
+ : line.discountValue;
223
+ return (react_1.default.createElement(antd_1.Flex, { key: index, vertical: true, gap: "small" },
224
+ react_1.default.createElement(antd_1.Flex, { vertical: true },
225
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } }, line.name),
226
+ react_1.default.createElement(antd_1.Flex, { style: {
227
+ backgroundColor: "#F5F5F5",
228
+ margin: "0 -24px",
229
+ padding: "0 24px",
230
+ } },
231
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeSM } },
232
+ line.quantity,
233
+ " ", (_a = line.unitOfMeasure) === null || _a === void 0 ? void 0 :
234
+ _a.unit,
235
+ " -",
236
+ " ",
237
+ (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(line.unitPriceAmount, props.intl),
238
+ " ",
239
+ line.currencyCode,
240
+ " / ", (_b = line.unitOfMeasure) === null || _b === void 0 ? void 0 :
241
+ _b.unit))),
242
+ react_1.default.createElement(antd_1.Flex, { justify: "space-between", align: "center" },
243
+ react_1.default.createElement(antd_1.Typography.Text, null,
244
+ taxPercentage,
245
+ "% VAT"),
246
+ react_1.default.createElement(antd_1.Typography.Text, null,
247
+ (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)((0, BillingLineUtility_1.calculateTaxAmount)(line.taxableAmount, taxPercentage), props.intl),
248
+ " ",
249
+ line.currencyCode)),
250
+ line.discountValue && (react_1.default.createElement(antd_1.Flex, { justify: "space-between", align: "center" },
251
+ react_1.default.createElement(antd_1.Typography.Text, null, "".concat(line.discountValue).concat(line.discountType === "PERCENTAGE" ? "%" : " ".concat(line.currencyCode)),
252
+ " ",
253
+ props.intl.formatMessage(translationMessages.billingLines_discount)),
254
+ react_1.default.createElement(antd_1.Typography.Text, null,
255
+ (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(calculatedDiscountValue, props.intl),
256
+ " ",
257
+ line.currencyCode))),
258
+ react_1.default.createElement(antd_1.Flex, { vertical: true },
259
+ react_1.default.createElement(antd_1.Col, { span: 24, style: { padding: 0 } },
260
+ react_1.default.createElement("hr", null)),
261
+ react_1.default.createElement(antd_1.Flex, { justify: "space-between", align: "center" },
262
+ react_1.default.createElement(antd_1.Typography.Text, null, props.intl.formatMessage(translationMessages.billingLines_total)),
263
+ react_1.default.createElement(antd_1.Typography.Text, null,
264
+ (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(line.taxableAmount, props.intl),
265
+ " ",
266
+ line.currencyCode)))));
267
+ }))),
268
+ react_1.default.createElement(antd_1.Col, { span: 24 },
269
+ react_1.default.createElement(antd_1.Flex, { vertical: true, gap: "small" },
270
+ react_1.default.createElement(antd_1.Card, { bordered: false, style: { backgroundColor: "#F5F5F5" }, size: "small" },
271
+ react_1.default.createElement(antd_1.Flex, { vertical: true, style: { padding: "0 12px" } },
272
+ react_1.default.createElement(antd_1.Flex, { justify: "space-between" },
273
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } }, props.intl.formatMessage(translationMessages.billingCalculations_labels_TaxAmountWithoutVat)),
274
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeSM } },
275
+ props.form.getFieldValue(["invoice", "currencyCode"]),
276
+ " ",
277
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } }, (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(_totals
278
+ .totalTaxableAmount, props.intl)))),
279
+ react_1.default.createElement(antd_1.Flex, { justify: "space-between" },
280
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } }, props.intl.formatMessage(translationMessages.billingCalculations_labels_TotalAmountWithVat)),
281
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeSM } },
282
+ props.form.getFieldValue(["invoice", "currencyCode"]),
283
+ " ",
284
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } }, (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(_totals
285
+ .totalTaxInclusiveAmount, props.intl)))),
286
+ react_1.default.createElement(antd_1.Flex, { justify: "space-between" },
287
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } }, props.intl.formatMessage(translationMessages.billingCalculations_labels_TotalRoundingAmount)),
288
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeSM } },
289
+ props.form.getFieldValue(["invoice", "currencyCode"]),
290
+ " ",
291
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } }, (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(_totals
292
+ .roundingAmount, props.intl)))))),
293
+ react_1.default.createElement(antd_1.Flex, { justify: "space-between", align: "center", style: { padding: "0 24px" } },
294
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } },
295
+ props.intl.formatMessage(translationMessages.billingCalculations_labels_AmountPayable),
296
+ ":"),
297
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeHeading4 } },
298
+ props.form.getFieldValue(["invoice", "currencyCode"]),
299
+ " ",
300
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeXL } }, (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(Math.round(_totals.totalTaxInclusiveAmount), props.intl)))))),
301
+ props.form.getFieldValue(["invoice", "notes"]) && (react_1.default.createElement(antd_1.Col, { span: 24 },
302
+ react_1.default.createElement(antd_1.Card, { bordered: false, size: "small", style: { backgroundColor: "#F5F5F5" } },
303
+ react_1.default.createElement(antd_1.Flex, { vertical: true, style: { padding: "0 12px" } },
304
+ react_1.default.createElement(antd_1.Typography.Text, { disabled: true },
305
+ props.intl.formatMessage(translationMessages.baseInformation_notes),
306
+ ":"),
307
+ react_1.default.createElement(antd_1.Typography.Text, null, props.form.getFieldValue(["invoice", "notes"])))))),
308
+ (formValueFile1 ||
309
+ formValueFile2 ||
310
+ formValueFile3) && (react_1.default.createElement(antd_1.Col, { span: 24 },
311
+ react_1.default.createElement(antd_1.Flex, { vertical: true, gap: "small" },
312
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeHeading4 } }, props.intl.formatMessage(translationMessages.invoicePreview_attachmentsTitle)),
313
+ formValueFile1 && (react_1.default.createElement(antd_1.Flex, { gap: "middle", align: "flex-start" },
314
+ react_1.default.createElement(icons_1.PaperClipOutlined, { style: { fontSize: "18px" } }),
315
+ react_1.default.createElement(antd_1.Flex, { vertical: true },
316
+ react_1.default.createElement(antd_1.Typography.Text, { style: { textDecoration: "underline" } }, formValueFile1.name),
317
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontWeight: 300 } }, props.form.getFieldValue([
318
+ "attachments",
319
+ "file1",
320
+ "description",
321
+ ]))))),
322
+ formValueFile2 && (react_1.default.createElement(antd_1.Flex, { gap: "middle", align: "flex-start" },
323
+ react_1.default.createElement(icons_1.PaperClipOutlined, { style: { fontSize: "18px" } }),
324
+ react_1.default.createElement(antd_1.Flex, { vertical: true },
325
+ react_1.default.createElement(antd_1.Typography.Text, { style: { textDecoration: "underline" } }, formValueFile2.name),
326
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontWeight: 300 } }, props.form.getFieldValue([
327
+ "attachments",
328
+ "file2",
329
+ "description",
330
+ ]))))),
331
+ formValueFile3 && (react_1.default.createElement(antd_1.Flex, { gap: "middle", align: "flex-start" },
332
+ react_1.default.createElement(icons_1.PaperClipOutlined, { style: { fontSize: "18px" } }),
333
+ react_1.default.createElement(antd_1.Flex, { vertical: true },
334
+ react_1.default.createElement(antd_1.Typography.Text, { style: { textDecoration: "underline" } }, formValueFile3.name),
335
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontWeight: 300 } }, props.form.getFieldValue([
336
+ "attachments",
337
+ "file3",
338
+ "description",
339
+ ])))))))),
340
+ react_1.default.createElement(antd_1.Col, { span: 24 },
341
+ react_1.default.createElement(antd_1.Card, { bordered: false, style: { backgroundColor: "#F5F5F5" }, size: "small" },
342
+ react_1.default.createElement(antd_1.Flex, { vertical: true, style: { padding: "0 12px" }, gap: "small" },
343
+ react_1.default.createElement(antd_1.Typography.Text, { style: { fontWeight: 700 } }, props.intl.formatMessage(translationMessages.invoicePreview_paymentInfoTitle)),
344
+ react_1.default.createElement(antd_1.Flex, { vertical: true },
345
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
346
+ props.form.getFieldValue(["invoice", "supplier", "name"]),
347
+ " Kt:",
348
+ " ",
349
+ props.form.getFieldValue(["invoice", "supplier", "identifier"])),
350
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" }, getPaymentMeansValue(props.form.getFieldValue(["invoice", "paymentMeans", "type"]))),
351
+ props.form.getFieldValue(["invoice", "paymentMeans", "domesticTransfer"]) && (react_1.default.createElement(react_1.default.Fragment, null,
352
+ react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
353
+ "Reikningsn\u00FAmer:",
354
+ " ",
355
+ props.form.getFieldValue([
356
+ "invoice",
357
+ "paymentMeans",
358
+ "domesticTransfer",
359
+ "bankNumber",
360
+ ]),
361
+ "-",
362
+ props.form.getFieldValue([
363
+ "invoice",
364
+ "paymentMeans",
365
+ "domesticTransfer",
366
+ "accountTypeNumber",
367
+ ]),
368
+ "-",
369
+ props.form.getFieldValue([
370
+ "invoice",
371
+ "paymentMeans",
372
+ "domesticTransfer",
373
+ "accountNumber",
374
+ ])),
375
+ props.form.getFieldValue([
376
+ "invoice",
377
+ "paymentMeans",
378
+ "domesticTransfer",
379
+ "paymentIdentifier",
380
+ ]) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
381
+ props.intl.formatMessage(payment_method_1.translationMessages.paymentMethod_labels_domesticTransfer_paymentReference),
382
+ ":",
383
+ " ",
384
+ props.form.getFieldValue([
385
+ "invoice",
386
+ "paymentMeans",
387
+ "domesticTransfer",
388
+ "paymentIdentifier",
389
+ ]))))),
390
+ props.form.getFieldValue(["invoice", "paymentMeans", "domesticClaim"]) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
391
+ props.form.getFieldValue([
392
+ "invoice",
393
+ "paymentMeans",
394
+ "domesticClaim",
395
+ "bankNumber",
396
+ ]),
397
+ "-66-",
398
+ props.form.getFieldValue([
399
+ "invoice",
400
+ "paymentMeans",
401
+ "domesticClaim",
402
+ "accountNumber",
403
+ ])))))))))));
404
+ };
405
+ exports.default = (0, react_intl_1.injectIntl)(InvoicePreview);