@unimaze/billing 0.21.46 → 0.21.48

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 (193) hide show
  1. package/lib/common/components/billing-lines/CurrencySelector.d.ts +1 -3
  2. package/lib/common/components/billing-lines/CurrencySelector.js +45 -8
  3. package/lib/common/components/billing-lines/NewBillingLines.js +0 -8
  4. package/lib/common/components/billing-lines/NewNewBillingLines.d.ts +15 -0
  5. package/lib/common/components/billing-lines/NewNewBillingLines.js +36 -0
  6. package/lib/common/components/billing-lines/SingleBillingLine.js +9 -5
  7. package/lib/common/components/billing-lines/cwdwdw.d.ts +1 -0
  8. package/lib/common/components/billing-lines/cwdwdw.js +14 -0
  9. package/lib/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfo.d.ts +0 -0
  10. package/lib/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfo.js +109 -0
  11. package/lib/common/components/invoice-preview/InvoicePreviewPaymentInfo.d.ts +0 -0
  12. package/lib/common/components/invoice-preview/InvoicePreviewPaymentInfo.js +110 -0
  13. package/lib/translations/locales/is.json +1 -1
  14. package/lib/unimaze-api-clients/src/mapi/api.d.ts +6664 -0
  15. package/lib/unimaze-api-clients/src/mapi/api.js +4743 -0
  16. package/lib/unimaze-api-clients/src/mapi/base.d.ts +55 -0
  17. package/lib/unimaze-api-clients/src/mapi/base.js +84 -0
  18. package/lib/unimaze-api-clients/src/mapi/configuration.d.ts +63 -0
  19. package/lib/unimaze-api-clients/src/mapi/configuration.js +28 -0
  20. package/lib/unimaze-api-clients/src/mapi/index.d.ts +13 -0
  21. package/lib/unimaze-api-clients/src/mapi/index.js +30 -0
  22. package/lib/unimaze-api-clients/src/rapi/api.d.ts +5015 -0
  23. package/lib/unimaze-api-clients/src/rapi/api.js +5582 -0
  24. package/lib/unimaze-api-clients/src/rapi/base.d.ts +55 -0
  25. package/lib/unimaze-api-clients/src/rapi/base.js +84 -0
  26. package/lib/unimaze-api-clients/src/rapi/configuration.d.ts +63 -0
  27. package/lib/unimaze-api-clients/src/rapi/configuration.js +28 -0
  28. package/lib/unimaze-api-clients/src/rapi/index.d.ts +13 -0
  29. package/lib/unimaze-api-clients/src/rapi/index.js +30 -0
  30. package/lib/unimaze-billing/src/common/components/CommonTranslations.d.ts +74 -0
  31. package/lib/unimaze-billing/src/common/components/CommonTranslations.js +78 -0
  32. package/lib/unimaze-billing/src/common/components/attachments/Attachment.d.ts +20 -0
  33. package/lib/unimaze-billing/src/common/components/attachments/Attachment.js +164 -0
  34. package/lib/unimaze-billing/src/common/components/attachments/AttachmentModal.d.ts +21 -0
  35. package/lib/unimaze-billing/src/common/components/attachments/AttachmentModal.js +206 -0
  36. package/lib/unimaze-billing/src/common/components/attachments/index.d.ts +27 -0
  37. package/lib/unimaze-billing/src/common/components/attachments/index.js +214 -0
  38. package/lib/unimaze-billing/src/common/components/base-information/AccountingCost.d.ts +17 -0
  39. package/lib/unimaze-billing/src/common/components/base-information/AccountingCost.js +61 -0
  40. package/lib/unimaze-billing/src/common/components/base-information/OrderReference.d.ts +16 -0
  41. package/lib/unimaze-billing/src/common/components/base-information/OrderReference.js +58 -0
  42. package/lib/unimaze-billing/src/common/components/base-information/ProjectReference.d.ts +14 -0
  43. package/lib/unimaze-billing/src/common/components/base-information/ProjectReference.js +30 -0
  44. package/lib/unimaze-billing/src/common/components/base-information/ReferenceIdentifiers.d.ts +53 -0
  45. package/lib/unimaze-billing/src/common/components/base-information/ReferenceIdentifiers.js +328 -0
  46. package/lib/unimaze-billing/src/common/components/base-information/index.d.ts +77 -0
  47. package/lib/unimaze-billing/src/common/components/base-information/index.js +186 -0
  48. package/lib/unimaze-billing/src/common/components/billing-lines/BillingCalculations.d.ts +14 -0
  49. package/lib/unimaze-billing/src/common/components/billing-lines/BillingCalculations.js +151 -0
  50. package/lib/unimaze-billing/src/common/components/billing-lines/BillingLinePreview.d.ts +24 -0
  51. package/lib/unimaze-billing/src/common/components/billing-lines/BillingLinePreview.js +61 -0
  52. package/lib/unimaze-billing/src/common/components/billing-lines/BillingTaxSummary.d.ts +13 -0
  53. package/lib/unimaze-billing/src/common/components/billing-lines/BillingTaxSummary.js +133 -0
  54. package/lib/unimaze-billing/src/common/components/billing-lines/CurrencySelector.d.ts +20 -0
  55. package/lib/unimaze-billing/src/common/components/billing-lines/CurrencySelector.js +17 -0
  56. package/lib/unimaze-billing/src/common/components/billing-lines/DiscountTypeSelector.d.ts +10 -0
  57. package/lib/unimaze-billing/src/common/components/billing-lines/DiscountTypeSelector.js +16 -0
  58. package/lib/unimaze-billing/src/common/components/billing-lines/NewBillingLines.d.ts +134 -0
  59. package/lib/unimaze-billing/src/common/components/billing-lines/NewBillingLines.js +209 -0
  60. package/lib/unimaze-billing/src/common/components/billing-lines/NewNewBillingLines.d.ts +15 -0
  61. package/lib/unimaze-billing/src/common/components/billing-lines/NewNewBillingLines.js +36 -0
  62. package/lib/unimaze-billing/src/common/components/billing-lines/SingleBillingLine.d.ts +19 -0
  63. package/lib/unimaze-billing/src/common/components/billing-lines/SingleBillingLine.js +275 -0
  64. package/lib/unimaze-billing/src/common/components/billing-lines/UnitOfMeasureSelector.d.ts +14 -0
  65. package/lib/unimaze-billing/src/common/components/billing-lines/UnitOfMeasureSelector.js +15 -0
  66. package/lib/unimaze-billing/src/common/components/billing-lines/index.d.ts +49 -0
  67. package/lib/unimaze-billing/src/common/components/billing-lines/index.js +104 -0
  68. package/lib/unimaze-billing/src/common/components/component-container/Content.d.ts +7 -0
  69. package/lib/unimaze-billing/src/common/components/component-container/Content.js +13 -0
  70. package/lib/unimaze-billing/src/common/components/component-container/Header.d.ts +9 -0
  71. package/lib/unimaze-billing/src/common/components/component-container/Header.js +28 -0
  72. package/lib/unimaze-billing/src/common/components/component-container/index.d.ts +12 -0
  73. package/lib/unimaze-billing/src/common/components/component-container/index.js +22 -0
  74. package/lib/unimaze-billing/src/common/components/customer/CostCenter.d.ts +17 -0
  75. package/lib/unimaze-billing/src/common/components/customer/CostCenter.js +163 -0
  76. package/lib/unimaze-billing/src/common/components/customer/CustomerContactName.d.ts +17 -0
  77. package/lib/unimaze-billing/src/common/components/customer/CustomerContactName.js +53 -0
  78. package/lib/unimaze-billing/src/common/components/customer/hardCoddedCustomer.d.ts +7 -0
  79. package/lib/unimaze-billing/src/common/components/customer/hardCoddedCustomer.js +41 -0
  80. package/lib/unimaze-billing/src/common/components/customer/index.d.ts +26 -0
  81. package/lib/unimaze-billing/src/common/components/customer/index.js +166 -0
  82. package/lib/unimaze-billing/src/common/components/date-picker/index.d.ts +21 -0
  83. package/lib/unimaze-billing/src/common/components/date-picker/index.js +23 -0
  84. package/lib/unimaze-billing/src/common/components/delivery-location/index.d.ts +12 -0
  85. package/lib/unimaze-billing/src/common/components/delivery-location/index.js +89 -0
  86. package/lib/unimaze-billing/src/common/components/editable-cell/index.d.ts +0 -0
  87. package/lib/unimaze-billing/src/common/components/editable-cell/index.js +295 -0
  88. package/lib/unimaze-billing/src/common/components/editable-row/index.d.ts +5 -0
  89. package/lib/unimaze-billing/src/common/components/editable-row/index.js +59 -0
  90. package/lib/unimaze-billing/src/common/components/form-item/index.d.ts +35 -0
  91. package/lib/unimaze-billing/src/common/components/form-item/index.js +60 -0
  92. package/lib/unimaze-billing/src/common/components/index.d.ts +18 -0
  93. package/lib/unimaze-billing/src/common/components/index.js +42 -0
  94. package/lib/unimaze-billing/src/common/components/input/index.d.ts +23 -0
  95. package/lib/unimaze-billing/src/common/components/input/index.js +37 -0
  96. package/lib/unimaze-billing/src/common/components/invoice/index.d.ts +42 -0
  97. package/lib/unimaze-billing/src/common/components/invoice/index.js +59 -0
  98. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfo.d.ts +14 -0
  99. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfo.js +75 -0
  100. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfoBox.d.ts +14 -0
  101. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfoBox.js +73 -0
  102. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewHeader.d.ts +12 -0
  103. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewHeader.js +104 -0
  104. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewInvoiceLines.d.ts +12 -0
  105. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewInvoiceLines.js +93 -0
  106. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewPaymentInfo.d.ts +14 -0
  107. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewPaymentInfo.js +77 -0
  108. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewPaymentInfoBox.d.ts +14 -0
  109. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewPaymentInfoBox.js +58 -0
  110. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewTotalAmountPreview.d.ts +14 -0
  111. package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewTotalAmountPreview.js +52 -0
  112. package/lib/unimaze-billing/src/common/components/invoice-preview/index.d.ts +102 -0
  113. package/lib/unimaze-billing/src/common/components/invoice-preview/index.js +196 -0
  114. package/lib/unimaze-billing/src/common/components/locale-intl/index.d.ts +0 -0
  115. package/lib/unimaze-billing/src/common/components/locale-intl/index.js +51 -0
  116. package/lib/unimaze-billing/src/common/components/payment-method/index.d.ts +76 -0
  117. package/lib/unimaze-billing/src/common/components/payment-method/index.js +356 -0
  118. package/lib/unimaze-billing/src/common/components/payment-method/paymentMethodForConversion.d.ts +8 -0
  119. package/lib/unimaze-billing/src/common/components/payment-method/paymentMethodForConversion.js +37 -0
  120. package/lib/unimaze-billing/src/common/components/submit-confirmation/SubmitConfirmationSVG.d.ts +3 -0
  121. package/lib/unimaze-billing/src/common/components/submit-confirmation/SubmitConfirmationSVG.js +17 -0
  122. package/lib/unimaze-billing/src/common/components/submit-confirmation/index.d.ts +8 -0
  123. package/lib/unimaze-billing/src/common/components/submit-confirmation/index.js +34 -0
  124. package/lib/unimaze-billing/src/common/components/supplier/CityAutofill.d.ts +18 -0
  125. package/lib/unimaze-billing/src/common/components/supplier/CityAutofill.js +159 -0
  126. package/lib/unimaze-billing/src/common/components/supplier/index.d.ts +94 -0
  127. package/lib/unimaze-billing/src/common/components/supplier/index.js +334 -0
  128. package/lib/unimaze-billing/src/common/components/tooltip/index.d.ts +7 -0
  129. package/lib/unimaze-billing/src/common/components/tooltip/index.js +15 -0
  130. package/lib/unimaze-billing/src/common/components/welcome-modal/index.d.ts +15 -0
  131. package/lib/unimaze-billing/src/common/components/welcome-modal/index.js +26 -0
  132. package/lib/unimaze-billing/src/common/consts/formLayout.d.ts +74 -0
  133. package/lib/unimaze-billing/src/common/consts/formLayout.js +45 -0
  134. package/lib/unimaze-billing/src/common/consts/validationRules.d.ts +6 -0
  135. package/lib/unimaze-billing/src/common/consts/validationRules.js +69 -0
  136. package/lib/unimaze-billing/src/common/enums/DocumentTypeEnum.d.ts +5 -0
  137. package/lib/unimaze-billing/src/common/enums/DocumentTypeEnum.js +8 -0
  138. package/lib/unimaze-billing/src/common/enums/index.d.ts +1 -0
  139. package/lib/unimaze-billing/src/common/enums/index.js +8 -0
  140. package/lib/unimaze-billing/src/common/types/AppConfiguration.d.ts +26 -0
  141. package/lib/unimaze-billing/src/common/types/AppConfiguration.js +2 -0
  142. package/lib/unimaze-billing/src/common/types/BillingLineMetadataOverride.d.ts +10 -0
  143. package/lib/unimaze-billing/src/common/types/BillingLineMetadataOverride.js +2 -0
  144. package/lib/unimaze-billing/src/common/types/CommonProps.d.ts +33 -0
  145. package/lib/unimaze-billing/src/common/types/CommonProps.js +2 -0
  146. package/lib/unimaze-billing/src/common/types/DiscountType.d.ts +1 -0
  147. package/lib/unimaze-billing/src/common/types/DiscountType.js +2 -0
  148. package/lib/unimaze-billing/src/common/types/InvoiceFormFields.d.ts +1 -0
  149. package/lib/unimaze-billing/src/common/types/InvoiceFormFields.js +2 -0
  150. package/lib/unimaze-billing/src/common/types/NewReceiverRequirements.d.ts +27 -0
  151. package/lib/unimaze-billing/src/common/types/NewReceiverRequirements.js +2 -0
  152. package/lib/unimaze-billing/src/common/types/ReceiverRequirements.d.ts +83 -0
  153. package/lib/unimaze-billing/src/common/types/ReceiverRequirements.js +393 -0
  154. package/lib/unimaze-billing/src/common/types/SupplierInfo.d.ts +11 -0
  155. package/lib/unimaze-billing/src/common/types/SupplierInfo.js +2 -0
  156. package/lib/unimaze-billing/src/common/types/index.d.ts +1 -0
  157. package/lib/unimaze-billing/src/common/types/index.js +17 -0
  158. package/lib/unimaze-billing/src/create-credit-note/index.d.ts +9 -0
  159. package/lib/unimaze-billing/src/create-credit-note/index.js +62 -0
  160. package/lib/unimaze-billing/src/create-invoice/IntlLoader.d.ts +11 -0
  161. package/lib/unimaze-billing/src/create-invoice/IntlLoader.js +116 -0
  162. package/lib/unimaze-billing/src/create-invoice/index.d.ts +82 -0
  163. package/lib/unimaze-billing/src/create-invoice/index.js +710 -0
  164. package/lib/unimaze-billing/src/enums.d.ts +14 -0
  165. package/lib/unimaze-billing/src/enums.js +18 -0
  166. package/lib/unimaze-billing/src/index.d.ts +4 -0
  167. package/lib/unimaze-billing/src/index.js +28 -0
  168. package/lib/unimaze-billing/src/translations/locales/en.json +183 -0
  169. package/lib/unimaze-billing/src/translations/locales/is.json +183 -0
  170. package/lib/unimaze-billing/src/translations/locales.d.ts +369 -0
  171. package/lib/unimaze-billing/src/translations/locales.js +11 -0
  172. package/lib/unimaze-billing/src/utils/ApiUtility.d.ts +29 -0
  173. package/lib/unimaze-billing/src/utils/ApiUtility.js +133 -0
  174. package/lib/unimaze-billing/src/utils/BillingLineUtility.d.ts +25 -0
  175. package/lib/unimaze-billing/src/utils/BillingLineUtility.js +190 -0
  176. package/lib/unimaze-billing/src/utils/ConversionUtility.d.ts +9 -0
  177. package/lib/unimaze-billing/src/utils/ConversionUtility.js +222 -0
  178. package/lib/unimaze-billing/src/utils/FileUploadUtility.d.ts +9 -0
  179. package/lib/unimaze-billing/src/utils/FileUploadUtility.js +45 -0
  180. package/lib/unimaze-billing/src/utils/IntlUtility.d.ts +6 -0
  181. package/lib/unimaze-billing/src/utils/IntlUtility.js +78 -0
  182. package/lib/unimaze-billing/src/utils/LocationUtility.d.ts +1 -0
  183. package/lib/unimaze-billing/src/utils/LocationUtility.js +81 -0
  184. package/lib/unimaze-billing/src/utils/ReferenceIdentifierUtility.d.ts +7 -0
  185. package/lib/unimaze-billing/src/utils/ReferenceIdentifierUtility.js +26 -0
  186. package/lib/unimaze-billing/src/utils/RequirementsUtility.d.ts +21 -0
  187. package/lib/unimaze-billing/src/utils/RequirementsUtility.js +237 -0
  188. package/lib/unimaze-billing/src/utils/index.d.ts +2 -0
  189. package/lib/unimaze-billing/src/utils/index.js +8 -0
  190. package/lib/utils/RequirementsUtility.d.ts +3 -2
  191. package/lib/utils/RequirementsUtility.js +12 -2
  192. package/package.json +1 -1
  193. package/lib/style/index.css +0 -51
@@ -0,0 +1,206 @@
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
37
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
38
+ if (ar || !(i in from)) {
39
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
40
+ ar[i] = from[i];
41
+ }
42
+ }
43
+ return to.concat(ar || Array.prototype.slice.call(from));
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ var React = __importStar(require("react"));
47
+ var react_intl_1 = require("react-intl");
48
+ var antd_1 = require("antd");
49
+ var icons_1 = require("@ant-design/icons");
50
+ var FileUploadUtility_1 = require("../../../utils/FileUploadUtility");
51
+ var lib_1 = require("antd/lib");
52
+ var formLayout_1 = require("../../consts/formLayout");
53
+ var translationMessages = (0, react_intl_1.defineMessages)({
54
+ attachment_title: {
55
+ id: "attachment_title",
56
+ defaultMessage: "Attachments",
57
+ },
58
+ attachment_saveButton_title: {
59
+ id: "attachment_saveButton_title",
60
+ defaultMessage: "Save attachments",
61
+ },
62
+ attachment_error_fileTooLarge: {
63
+ id: "attachment_error_fileTooLarge",
64
+ defaultMessage: "File size must be less than {uploadSizeLimit}KB",
65
+ },
66
+ attachment_error_fileWrongType: {
67
+ id: "attachment_error_fileWrongType",
68
+ defaultMessage: "Wrong file type",
69
+ },
70
+ attachment_error_fileFailedToUpload: {
71
+ id: "attachment_error_fileFailedToUpload",
72
+ defaultMessage: "File failed to upload",
73
+ },
74
+ attachment_labels_uploadFileMsg: {
75
+ id: "attachment_labels_uploadFileMsg",
76
+ defaultMessage: "Upload attachment",
77
+ },
78
+ attachment_labels_onUploadFileMsg: {
79
+ id: "attachment_labels_onUploadFileMsg",
80
+ defaultMessage: "Uploading",
81
+ },
82
+ attachment_labels_Description_requiredMessage: {
83
+ id: "attachment_labels_Description_requiredMessage",
84
+ defaultMessage: "Please input the description",
85
+ },
86
+ attachment_labels_Description: {
87
+ id: "attachment_labels_Description",
88
+ defaultMessage: "Description",
89
+ },
90
+ });
91
+ var AttachmentModal = function (props) {
92
+ var _a = React.useState(false), isUploading = _a[0], setIsUploading = _a[1];
93
+ var _b = React.useState(true), isSaveAttachmentsDisabled = _b[0], setIsSaveAttachmentsDisabled = _b[1];
94
+ var normFile = function (e) {
95
+ if (!e)
96
+ return;
97
+ if (Array.isArray(e)) {
98
+ return e;
99
+ }
100
+ return e.fileList;
101
+ };
102
+ var updateFile = function (file, updatedProps) {
103
+ var fileIndex = props.attachments.findIndex(function (attachment) { return attachment.file.uid === file.uid; });
104
+ if (fileIndex === -1) {
105
+ props.setAttachments(__spreadArray(__spreadArray([], props.attachments, true), [{ uid: file.uid, file: file, description: "", fieldValidation: "" }], false));
106
+ }
107
+ else {
108
+ var updatedAttachments = props.attachments.map(function (attachment) {
109
+ if (attachment.file.uid === file.uid) {
110
+ return __assign(__assign({}, attachment), updatedProps);
111
+ }
112
+ return attachment;
113
+ });
114
+ props.setAttachments(updatedAttachments);
115
+ }
116
+ };
117
+ React.useEffect(function () {
118
+ var _isSaveAttachmentsDisabled = props.attachments.length > 0 ? props.attachments.some(function (attachment) { return attachment.fieldValidation !== "success" || !attachment.description; }) : true;
119
+ setIsSaveAttachmentsDisabled(_isSaveAttachmentsDisabled);
120
+ }, [props.attachments]);
121
+ var verifyAttachment = function (info, uploadSizeLimit, formInstance) {
122
+ if (info.file.status === "removed")
123
+ return;
124
+ var isValid = (0, FileUploadUtility_1.reportIfFileIsValid)(info.file, uploadSizeLimit, {
125
+ uploadErrorToLarge: props.intl.formatMessage(translationMessages.attachment_error_fileTooLarge, {
126
+ uploadSizeLimit: uploadSizeLimit / 1024,
127
+ }),
128
+ uploadErrorWrongType: props.intl.formatMessage(translationMessages.attachment_error_fileWrongType),
129
+ uploadFailed: props.intl.formatMessage(translationMessages.attachment_error_fileFailedToUpload),
130
+ });
131
+ if (!isValid) {
132
+ info.file.status = "error";
133
+ updateFile(info.file, { file: __assign({}, info.file), fieldValidation: "error" });
134
+ }
135
+ else {
136
+ updateFile(info.file, { file: __assign({}, info.file), fieldValidation: "success" });
137
+ }
138
+ };
139
+ var uploadProps = {
140
+ name: "file",
141
+ headers: {
142
+ authorization: "authorization-text",
143
+ },
144
+ accept: FileUploadUtility_1.validFileTypes.join(","),
145
+ showUploadList: false,
146
+ onRemove: function (file) {
147
+ props.onRemove(file);
148
+ },
149
+ onChange: function (info) {
150
+ if (info.file.status === "uploading") {
151
+ setIsUploading(true);
152
+ var fileIndex = props.attachments.findIndex(function (attachment) { return attachment.file.uid === info.file.uid; });
153
+ if (fileIndex === -1) {
154
+ props.setAttachments(__spreadArray(__spreadArray([], props.attachments, true), [
155
+ { uid: info.file.uid, file: info.file, description: "", fieldValidation: "" },
156
+ ], false));
157
+ }
158
+ }
159
+ else if (info.file.status === "done" || info.file.status === "error") {
160
+ setIsUploading(false);
161
+ verifyAttachment(info, props.uploadSizeLimit, props.formInstance);
162
+ }
163
+ },
164
+ fileList: props.attachments.map(function (attachment) { return attachment.file; }),
165
+ disabled: isUploading || props.attachments.length >= 3,
166
+ customRequest: function (_a) {
167
+ var onSuccess = _a.onSuccess;
168
+ if (onSuccess) {
169
+ setTimeout(function () {
170
+ onSuccess("ok");
171
+ }, 0);
172
+ }
173
+ }
174
+ };
175
+ return (React.createElement(antd_1.Modal, { open: props.isModalOpen, onCancel: function () { return props.setIsModalOpen(false); }, title: props.intl.formatMessage(translationMessages.attachment_title), footer: React.createElement(antd_1.Button, { disabled: isSaveAttachmentsDisabled, icon: React.createElement(icons_1.CheckCircleOutlined, null), type: "primary", style: { width: "100%" }, size: "large", onClick: function () {
176
+ props.onSave();
177
+ props.setIsModalOpen(false);
178
+ } }, props.intl.formatMessage(translationMessages.attachment_saveButton_title)) },
179
+ React.createElement(lib_1.Form.Item, __assign({}, formLayout_1.fullWidthInput, { valuePropName: "fileList", getValueFromEvent: normFile, className: "upload-container" }),
180
+ React.createElement(antd_1.Upload, __assign({}, uploadProps, { style: { width: '100%' } }),
181
+ React.createElement(antd_1.Button, { loading: isUploading, disabled: uploadProps.disabled, icon: React.createElement(icons_1.UploadOutlined, null), size: "large", style: { width: "100%" } }, isUploading
182
+ ? props.intl.formatMessage(translationMessages.attachment_labels_onUploadFileMsg)
183
+ : props.intl.formatMessage(translationMessages.attachment_labels_uploadFileMsg)))),
184
+ props.attachments.length > 0 && (React.createElement(antd_1.Flex, { vertical: true },
185
+ React.createElement(antd_1.Typography.Text, null, props.intl.formatMessage(translationMessages.attachment_title)),
186
+ React.createElement("hr", null),
187
+ props.attachments.map(function (attachment, index) { return (React.createElement(antd_1.Flex, { gap: "middle", vertical: true },
188
+ React.createElement(antd_1.Flex, { gap: "middle", justify: "space-between" },
189
+ React.createElement(antd_1.Typography.Text, { type: attachment.file.status === "error" ? "danger" : undefined },
190
+ React.createElement(icons_1.PaperClipOutlined, null)),
191
+ React.createElement(antd_1.Typography.Text, { type: attachment.file.status === "error" ? "danger" : undefined, style: { width: "100%" } }, attachment.file.name),
192
+ React.createElement(lib_1.Form.Item, { name: ["attachments", "file".concat(index + 1), "file"], initialValue: attachment.file, hidden: true }),
193
+ attachment.file.status === "uploading" ? (React.createElement(icons_1.LoadingOutlined, null)) : (React.createElement(antd_1.Typography.Text, { type: attachment.file.status === "error" ? "danger" : undefined },
194
+ React.createElement(icons_1.DeleteOutlined, { onClick: function () {
195
+ props.formInstance.setFieldValue(["attachments", "file".concat(index + 1), "description"], "");
196
+ props.onRemove(attachment.file);
197
+ } })))),
198
+ attachment.fieldValidation === "success" && (React.createElement(lib_1.Form.Item, __assign({}, formLayout_1.fullWidthInput, { rules: [
199
+ {
200
+ required: true,
201
+ message: props.intl.formatMessage(translationMessages.attachment_labels_Description_requiredMessage),
202
+ },
203
+ ], name: ["attachments", "file".concat(index + 1), "description"] }),
204
+ React.createElement(antd_1.Input, { prefix: React.createElement(antd_1.Typography.Text, { type: "danger" }, "*"), placeholder: props.intl.formatMessage(translationMessages.attachment_labels_Description), onChange: function (e) { return updateFile(attachment.file, { description: e.target.value }); } }))))); })))));
205
+ };
206
+ exports.default = (0, react_intl_1.injectIntl)(AttachmentModal);
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ import { WrappedComponentProps } from "react-intl";
3
+ import { FormInstance } from "antd/es/form";
4
+ import { LanguageProp } from "../../types/CommonProps";
5
+ import { UploadFile } from "antd/es/upload/interface";
6
+ import { ValidateStatus } from "antd/lib/form/FormItem";
7
+ interface Props extends WrappedComponentProps {
8
+ formInstance: FormInstance;
9
+ uploadSizeLimit: number;
10
+ attachmentTooltipText?: {
11
+ is: string;
12
+ en: string;
13
+ };
14
+ languageString: LanguageProp;
15
+ }
16
+ export type AttachmentType = {
17
+ uid: string;
18
+ file: UploadFile;
19
+ fieldValidation: ValidateStatus;
20
+ description: string;
21
+ };
22
+ declare const AttachmentGroupIntl: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
23
+ forwardedRef?: React.Ref<any>;
24
+ } & React.RefAttributes<any>> & {
25
+ WrappedComponent: React.ComponentType<Props>;
26
+ };
27
+ export default AttachmentGroupIntl;
@@ -0,0 +1,214 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ var __generator = (this && this.__generator) || function (thisArg, body) {
35
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
+ function verb(n) { return function (v) { return step([n, v]); }; }
38
+ function step(op) {
39
+ if (f) throw new TypeError("Generator is already executing.");
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
+ if (y = 0, t) op = [op[0] & 2, t.value];
43
+ switch (op[0]) {
44
+ case 0: case 1: t = op; break;
45
+ case 4: _.label++; return { value: op[1], done: false };
46
+ case 5: _.label++; y = op[1]; op = [0]; continue;
47
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
+ default:
49
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
+ if (t[2]) _.ops.pop();
54
+ _.trys.pop(); continue;
55
+ }
56
+ op = body.call(thisArg, _);
57
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
+ }
60
+ };
61
+ var __importDefault = (this && this.__importDefault) || function (mod) {
62
+ return (mod && mod.__esModule) ? mod : { "default": mod };
63
+ };
64
+ Object.defineProperty(exports, "__esModule", { value: true });
65
+ var React = __importStar(require("react"));
66
+ var react_intl_1 = require("react-intl");
67
+ var antd_1 = require("antd");
68
+ var icons_1 = require("@ant-design/icons");
69
+ var AttachmentModal_1 = __importDefault(require("./AttachmentModal"));
70
+ var react_use_1 = require("react-use");
71
+ var FileUploadUtility_1 = require("../../../utils/FileUploadUtility");
72
+ var translationMessages = (0, react_intl_1.defineMessages)({
73
+ attachment_title: {
74
+ id: "attachment_title",
75
+ defaultMessage: "Attachments",
76
+ },
77
+ attachment_tooltip_title: {
78
+ id: "attachment_tooltip_title",
79
+ defaultMessage: "The maximum size is {uploadSizeLimit}KB. Accepted file formats are JPG, PNG, PDF, CSV, XLSX and ODS.. Enclosed documents can be a copy of the original invoice, or timesheets for example.",
80
+ },
81
+ attachment_addAttachmentButton_title: {
82
+ id: "attachment_addAttachmentButton_title",
83
+ defaultMessage: "Add attachment",
84
+ },
85
+ });
86
+ var AttachmentsGroup = function (props) {
87
+ var _a = React.useState(false), isModalOpen = _a[0], setIsModalOpen = _a[1];
88
+ var _b = React.useState([]), attachments = _b[0], setAttachments = _b[1];
89
+ var _c = React.useState(false), displayAttachments = _c[0], setDisplayAttachments = _c[1];
90
+ var _d = React.useState(false), previewOpen = _d[0], setPreviewOpen = _d[1];
91
+ var _e = React.useState(undefined), previewImage = _e[0], setPreviewImage = _e[1];
92
+ var _f = React.useState(""), previewDescription = _f[0], setPreviewDescription = _f[1];
93
+ var _g = React.useState(""), previewPDFUrl = _g[0], setPreviewPDFUrl = _g[1];
94
+ var width = (0, react_use_1.useWindowSize)().width;
95
+ var _h = React.useState(false), isMobile = _h[0], setIsMobile = _h[1];
96
+ var token = antd_1.theme.useToken().token;
97
+ React.useEffect(function () {
98
+ if (width < 768) {
99
+ setIsMobile(true);
100
+ }
101
+ else {
102
+ setIsMobile(false);
103
+ }
104
+ }, [width]);
105
+ var removeFile = function (file) {
106
+ var updatedAttachments = attachments.filter(function (attachment) { return attachment.file.uid !== file.uid; });
107
+ setAttachments(updatedAttachments);
108
+ };
109
+ var clearFileFields = function (file) {
110
+ var fileIndex = attachments.findIndex(function (attachment) { return attachment.file.uid === file.uid; });
111
+ if (fileIndex === -1)
112
+ return;
113
+ props.formInstance.setFields([
114
+ {
115
+ name: ["attachments", "file".concat(fileIndex + 1), "file"],
116
+ value: undefined,
117
+ },
118
+ ]);
119
+ props.formInstance.setFields([
120
+ {
121
+ name: ["attachments", "file".concat(fileIndex + 1), "description"],
122
+ value: undefined,
123
+ },
124
+ ]);
125
+ };
126
+ var handlePreview = function (file, description) { return __awaiter(void 0, void 0, void 0, function () {
127
+ var reader, _a;
128
+ return __generator(this, function (_b) {
129
+ switch (_b.label) {
130
+ case 0:
131
+ if (!file.originFileObj)
132
+ return [2 /*return*/];
133
+ if (!(file.type === "application/pdf")) return [3 /*break*/, 1];
134
+ reader = new FileReader();
135
+ reader.onload = function (e) {
136
+ var blob = file.originFileObj ? new Blob([file.originFileObj], { type: "application/pdf" }) : null;
137
+ if (blob) {
138
+ var url = URL.createObjectURL(blob);
139
+ setPreviewPDFUrl(url);
140
+ }
141
+ };
142
+ reader.readAsArrayBuffer(file.originFileObj);
143
+ return [3 /*break*/, 4];
144
+ case 1:
145
+ if (!(!file.url && !file.preview)) return [3 /*break*/, 3];
146
+ _a = file;
147
+ return [4 /*yield*/, (0, FileUploadUtility_1.getBase64)(file.originFileObj)];
148
+ case 2:
149
+ _a.preview = (_b.sent());
150
+ _b.label = 3;
151
+ case 3:
152
+ setPreviewImage(file.url || file.preview);
153
+ _b.label = 4;
154
+ case 4:
155
+ setPreviewDescription(description);
156
+ setPreviewOpen(true);
157
+ return [2 /*return*/];
158
+ }
159
+ });
160
+ }); };
161
+ var handleClosePreview = function () {
162
+ if (previewPDFUrl) {
163
+ URL.revokeObjectURL(previewPDFUrl);
164
+ setPreviewPDFUrl("");
165
+ }
166
+ if (previewImage) {
167
+ setPreviewImage("");
168
+ }
169
+ setPreviewDescription("");
170
+ setPreviewOpen(false);
171
+ };
172
+ var saveFiles = function () {
173
+ setDisplayAttachments(true);
174
+ setIsModalOpen(false);
175
+ };
176
+ return (React.createElement(antd_1.Flex, { style: {
177
+ backgroundColor: token.colorInfoBg,
178
+ margin: isMobile ? "0 -20px" : 0,
179
+ width: isMobile ? "100vw" : "100%",
180
+ padding: isMobile ? "20px" : "35px 0",
181
+ }, justify: "center" },
182
+ React.createElement(antd_1.Flex, { vertical: true, style: { width: "100%", maxWidth: "900px" }, gap: "small" },
183
+ React.createElement(antd_1.Typography.Title, { level: 5, style: { margin: 0 } }, props.intl.formatMessage(translationMessages.attachment_title)),
184
+ React.createElement(antd_1.Typography.Text, { type: "secondary" }, (props.languageString === "en" || props.languageString === "is") && props.attachmentTooltipText
185
+ ? props.attachmentTooltipText[props.languageString]
186
+ : props.intl.formatMessage(translationMessages.attachment_tooltip_title, {
187
+ uploadSizeLimit: props.uploadSizeLimit / 1024,
188
+ })),
189
+ React.createElement(antd_1.Button, { size: "large", style: { width: "100%" }, onClick: function () { return setIsModalOpen(true); }, icon: React.createElement(icons_1.PaperClipOutlined, null) }, props.intl.formatMessage(translationMessages.attachment_addAttachmentButton_title)),
190
+ displayAttachments && attachments.length > 0 && (React.createElement(antd_1.Flex, { vertical: true, gap: "small" },
191
+ React.createElement(antd_1.Flex, { vertical: true },
192
+ React.createElement(antd_1.Typography.Text, { disabled: true }, props.intl.formatMessage(translationMessages.attachment_title))),
193
+ React.createElement(antd_1.Divider, { style: { padding: 0, margin: 0 } }),
194
+ attachments.map(function (attachment) { return (React.createElement(React.Fragment, null,
195
+ React.createElement(antd_1.Flex, { gap: "middle", justify: "space-between" },
196
+ React.createElement(antd_1.Button, { type: "link", onClick: function () { return handlePreview(attachment.file, attachment.description); }, style: { padding: 0 }, size: "small" },
197
+ React.createElement(icons_1.PaperClipOutlined, { style: { fontSize: token.fontSizeIcon } }),
198
+ attachment.file.name),
199
+ React.createElement(antd_1.Flex, { gap: "middle" },
200
+ React.createElement(icons_1.EditOutlined, { style: { fontSize: token.fontSizeHeading4 }, onClick: function () {
201
+ setIsModalOpen(true);
202
+ } }),
203
+ React.createElement(icons_1.DeleteOutlined, { style: { fontSize: token.fontSizeHeading4 }, onClick: function () {
204
+ removeFile(attachment.file);
205
+ clearFileFields(attachment.file);
206
+ } }))))); }))),
207
+ React.createElement(AttachmentModal_1.default, { isModalOpen: isModalOpen, setIsModalOpen: setIsModalOpen, attachments: attachments, setAttachments: setAttachments, uploadSizeLimit: props.uploadSizeLimit, formInstance: props.formInstance, onRemove: removeFile, onSave: saveFiles }),
208
+ React.createElement(antd_1.Modal, { open: previewOpen, onCancel: handleClosePreview, footer: null },
209
+ previewPDFUrl && (React.createElement("iframe", { src: previewPDFUrl, style: { width: "100%", height: "700px", maxHeight: "75vh" } })),
210
+ previewImage && React.createElement(antd_1.Image, { src: previewImage, preview: false }),
211
+ React.createElement(antd_1.Typography.Text, null, previewDescription)))));
212
+ };
213
+ var AttachmentGroupIntl = (0, react_intl_1.injectIntl)(AttachmentsGroup);
214
+ exports.default = AttachmentGroupIntl;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
3
+ import { FormInstance } from "antd/es/form";
4
+ import { WrappedComponentProps } from "react-intl";
5
+ interface Props extends WrappedComponentProps {
6
+ receiverRequirements: NewReceiverRequirements;
7
+ updateReceiverRequirementsProp: (receiverRequirements: NewReceiverRequirements) => void;
8
+ formInstance: FormInstance;
9
+ rapiBaseUrl: string;
10
+ legalIdentifier: string;
11
+ }
12
+ declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
13
+ forwardedRef?: React.Ref<any>;
14
+ } & React.RefAttributes<any>> & {
15
+ WrappedComponent: React.ComponentType<Props>;
16
+ };
17
+ export default _default;
@@ -0,0 +1,61 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ var react_1 = __importStar(require("react"));
30
+ var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
31
+ var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
32
+ var form_item_1 = __importDefault(require("../form-item"));
33
+ var react_intl_1 = require("react-intl");
34
+ var tooltip_1 = __importDefault(require("../tooltip"));
35
+ var antd_1 = require("antd");
36
+ var translationMessages = (0, react_intl_1.defineMessages)({
37
+ baseInformation_accountingCostLabel: {
38
+ id: "baseInformation_accountingCostLabel",
39
+ defaultMessage: "Accounting cost",
40
+ },
41
+ baseInformation_accountingCostLabel_helpText: {
42
+ id: "baseInformation_accountingCostLabel_helpText",
43
+ defaultMessage: "Accounting cost is a code provided by the buyer, either via phone or e-mail or taken directly from the an order associated with the invoice",
44
+ },
45
+ });
46
+ var AccountingCost = function (props) {
47
+ var _a = (0, react_1.useState)(""), accountingCostHandlingValidationStatus = _a[0], setAccountingCostHandlingValidationStatus = _a[1];
48
+ var _b = (0, react_1.useState)({}), accountingCostFieldProps = _b[0], setAccountingCostFieldProps = _b[1];
49
+ var _c = (0, react_1.useState)(false), loadingAccountingCostValues = _c[0], setLoadingAccountingCostValues = _c[1];
50
+ var accountingCostFieldDefinition = (0, RequirementsUtility_1.getFieldRequirements)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields.accountingCost);
51
+ if (accountingCostFieldDefinition) {
52
+ return (react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.accountingCost, defaultIsRequired: false, fieldName: ["invoice", "accountingCost"], validateStatus: accountingCostHandlingValidationStatus, hasFeedback: true },
53
+ react_1.default.createElement(antd_1.Flex, { gap: "middle", align: "center" },
54
+ (0, RequirementsUtility_1.getInput)(accountingCostFieldDefinition, ["invoice", "accountingCost"], "handleAccountingCostValidation", props.legalIdentifier, props.formInstance, props.rapiBaseUrl, props.receiverRequirements, props.updateReceiverRequirementsProp, setAccountingCostFieldProps, accountingCostFieldProps, setLoadingAccountingCostValues, loadingAccountingCostValues, setAccountingCostHandlingValidationStatus, props.intl.formatMessage(translationMessages.baseInformation_accountingCostLabel)),
55
+ react_1.default.createElement(tooltip_1.default, { title: props.intl.formatMessage(translationMessages.baseInformation_accountingCostLabel_helpText) }))));
56
+ }
57
+ else {
58
+ return null;
59
+ }
60
+ };
61
+ exports.default = (0, react_intl_1.injectIntl)(AccountingCost);
@@ -0,0 +1,16 @@
1
+ import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
2
+ import * as React from "react";
3
+ import { WrappedComponentProps } from "react-intl";
4
+ import { FormInstance } from "antd/es/form";
5
+ import { NamePath } from "rc-field-form/lib/interface";
6
+ interface Props extends WrappedComponentProps {
7
+ receiverRequirements: NewReceiverRequirements;
8
+ formInstance: FormInstance;
9
+ dependencies: NamePath[];
10
+ }
11
+ declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
12
+ forwardedRef?: React.Ref<any>;
13
+ } & React.RefAttributes<any>> & {
14
+ WrappedComponent: React.ComponentType<Props>;
15
+ };
16
+ export default _default;
@@ -0,0 +1,58 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ var form_item_1 = __importDefault(require("../form-item"));
30
+ var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
31
+ var React = __importStar(require("react"));
32
+ var react_intl_1 = require("react-intl");
33
+ var __1 = require("..");
34
+ var translationMessages = (0, react_intl_1.defineMessages)({
35
+ baseInformation_orderReferenceLabel: {
36
+ id: "baseInformation_orderReferenceLabel",
37
+ defaultMessage: "Order number",
38
+ },
39
+ baseInformation_orderReferenceLabel_helpText: {
40
+ id: "baseInformation_orderReferenceLabel_helpText",
41
+ defaultMessage: "Only use a reference to an actual order here. If no order exists, the buyer reference must be specified.",
42
+ },
43
+ });
44
+ var getOrderReferenceFieldDefinitions = function (receiverRequirements) {
45
+ return (receiverRequirements &&
46
+ receiverRequirements.fieldDefinitions.find(function (fieldRequirement) { return fieldRequirement.key === "orderReference.documentNo"; }));
47
+ };
48
+ var OrderReference = function (props) {
49
+ if (getOrderReferenceFieldDefinitions(props.receiverRequirements)) {
50
+ var required = !props.formInstance.getFieldValue(["invoice", "buyerReference"]);
51
+ return (React.createElement(form_item_1.default, { shouldUpdate: true, dependencies: props.dependencies, receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["orderReference.documentNo"], defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_orderReferenceLabel), defaultLabelTooltip: props.intl.formatMessage(translationMessages.baseInformation_orderReferenceLabel_helpText), defaultIsRequired: required, fieldName: ["invoice", "orderReference", "documentNo"] },
52
+ React.createElement(__1.UmzInput, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["orderReference.documentNo"], defaultIsRequired: required, defaultPlaceholder: props.intl.formatMessage(translationMessages.baseInformation_orderReferenceLabel), defaultTooltip: props.intl.formatMessage(translationMessages.baseInformation_orderReferenceLabel_helpText) })));
53
+ }
54
+ else {
55
+ return null;
56
+ }
57
+ };
58
+ exports.default = (0, react_intl_1.injectIntl)(OrderReference);
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
3
+ import { WrappedComponentProps } from "react-intl";
4
+ import { FormInstance } from "antd";
5
+ interface Props extends WrappedComponentProps {
6
+ receiverRequirements: NewReceiverRequirements;
7
+ form: FormInstance;
8
+ }
9
+ declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
10
+ forwardedRef?: React.Ref<any>;
11
+ } & React.RefAttributes<any>> & {
12
+ WrappedComponent: React.ComponentType<Props>;
13
+ };
14
+ export default _default;
@@ -0,0 +1,30 @@
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_1 = __importDefault(require("react"));
7
+ var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
8
+ var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
9
+ var form_item_1 = __importDefault(require("../form-item"));
10
+ var react_intl_1 = require("react-intl");
11
+ var __1 = require("..");
12
+ var translationMessages = (0, react_intl_1.defineMessages)({
13
+ baseInformation_projectReferenceLabel: {
14
+ id: "baseInformation_projectReferenceLabel",
15
+ defaultMessage: "Project reference",
16
+ },
17
+ });
18
+ var ProjectReference = function (props) {
19
+ var _a, _b, _c;
20
+ var projectReferenceFieldDefinition = (0, RequirementsUtility_1.getFieldRequirements)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["documentReferences.project.documentNo"]);
21
+ var formData = props.form.getFieldsValue();
22
+ if (projectReferenceFieldDefinition) {
23
+ return (react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["documentReferences.project.documentNo"], defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_projectReferenceLabel), defaultIsRequired: false, fieldName: ["invoice", "documentReferences", "project", "documentNo"] },
24
+ react_1.default.createElement(__1.UmzInput, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["documentReferences.project.documentNo"], defaultPlaceholder: props.intl.formatMessage(translationMessages.baseInformation_projectReferenceLabel), defaultValue: (_c = (_b = (_a = formData.invoice) === null || _a === void 0 ? void 0 : _a.documentReferences) === null || _b === void 0 ? void 0 : _b.project) === null || _c === void 0 ? void 0 : _c.documentNo })));
25
+ }
26
+ else {
27
+ return null;
28
+ }
29
+ };
30
+ exports.default = (0, react_intl_1.injectIntl)(ProjectReference);