@unimaze/billing 0.21.3 → 0.21.5

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 +275 -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 +4 -1
  227. package/lib/utils/BillingLineUtility.js +36 -4
  228. package/lib/utils/RequirementsUtility.d.ts +4 -1
  229. package/lib/utils/RequirementsUtility.js +56 -1
  230. package/package.json +2 -2
@@ -1,15 +1,4 @@
1
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
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
3
  if (k2 === undefined) k2 = k;
15
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -33,42 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
33
22
  __setModuleDefault(result, mod);
34
23
  return result;
35
24
  };
36
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- };
45
- var __generator = (this && this.__generator) || function (thisArg, body) {
46
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
47
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
- function verb(n) { return function (v) { return step([n, v]); }; }
49
- function step(op) {
50
- if (f) throw new TypeError("Generator is already executing.");
51
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
52
- 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;
53
- if (y = 0, t) op = [op[0] & 2, t.value];
54
- switch (op[0]) {
55
- case 0: case 1: t = op; break;
56
- case 4: _.label++; return { value: op[1], done: false };
57
- case 5: _.label++; y = op[1]; op = [0]; continue;
58
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
59
- default:
60
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
61
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
62
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
63
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
64
- if (t[2]) _.ops.pop();
65
- _.trys.pop(); continue;
66
- }
67
- op = body.call(thisArg, _);
68
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
69
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
- }
71
- };
72
25
  var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
73
26
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
74
27
  if (ar || !(i in from)) {
@@ -86,25 +39,13 @@ exports.translationMessages = void 0;
86
39
  var react_1 = __importStar(require("react"));
87
40
  var react_intl_1 = require("react-intl");
88
41
  var antd_1 = require("antd");
89
- var formLayout_1 = require("../../consts/formLayout");
90
- var icons_1 = require("@ant-design/icons");
91
- var form_item_1 = __importDefault(require("../form-item"));
92
- var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
93
- var BillingLineUtility_1 = require("../../../utils/BillingLineUtility");
94
- var CommonTranslations_1 = require("../CommonTranslations");
95
- var IntlUtility_1 = require("../../../utils/IntlUtility");
96
- var enums_1 = require("../../../enums");
97
42
  var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
98
- var Form_1 = require("antd/es/form/Form");
99
- var react_use_1 = require("react-use");
100
- var lodash_1 = require("lodash");
101
- var BillingLinePreview_1 = __importDefault(require("./BillingLinePreview"));
102
- var tooltip_1 = __importDefault(require("../tooltip"));
103
- var api_1 = require("@unimaze/api-clients/lib/mapi/api");
43
+ var SingleBillingLine_1 = __importDefault(require("./SingleBillingLine"));
44
+ var invoice_1 = require("../invoice");
104
45
  exports.translationMessages = (0, react_intl_1.defineMessages)({
105
46
  billingLines_labels_addButton: {
106
47
  id: "billingLines_labels_addButton",
107
- defaultMessage: "Add new line",
48
+ defaultMessage: "Save line",
108
49
  },
109
50
  billingLines_itemNo: {
110
51
  id: "billingLines_itemNo",
@@ -216,279 +157,48 @@ exports.translationMessages = (0, react_intl_1.defineMessages)({
216
157
  },
217
158
  });
218
159
  var BillingLines = function (props) {
219
- var _a = react_1.default.useState(), taxCatType = _a[0], setTaxCatType = _a[1];
220
- var _b = react_1.default.useState([]), billingLineData = _b[0], setBillingLineData = _b[1];
221
- var _c = react_1.default.useState(true), isSaveButtonDisabled = _c[0], setIsSaveButtonDisabled = _c[1];
222
- var _d = react_1.default.useState(false), isCurrencyDisabled = _d[0], setIsCurrencyDisabled = _d[1];
223
- var _e = react_1.default.useState("PERCENTAGE"), discountType = _e[0], setDiscountType = _e[1];
224
- var _f = (0, react_1.useState)(undefined), addNewLinesTooltip = _f[0], setAddNewLinesTooltip = _f[1];
225
- var width = (0, react_use_1.useWindowSize)().width;
226
- var _g = react_1.default.useState(false), isMobile = _g[0], setIsMobile = _g[1];
227
- (0, react_1.useEffect)(function () {
228
- if (props.outsideVatScope) {
229
- setTaxCatType(enums_1.AvailableTaxCategoryTypeEnum.OutsideTaxScope);
230
- }
231
- else {
232
- setTaxCatType(enums_1.AvailableTaxCategoryTypeEnum.StandardRated);
233
- }
234
- }, [props.outsideVatScope]);
235
- (0, react_1.useEffect)(function () {
236
- if (width < 768) {
237
- setIsMobile(true);
238
- }
239
- else {
240
- setIsMobile(false);
241
- }
242
- }, [width]);
243
- var invoiceLines = (0, Form_1.useWatch)(["invoice", "invoiceLines"], props.formInstance);
244
- var validateFormListFields = function () { return __awaiter(void 0, void 0, void 0, function () {
245
- var fieldPaths;
246
- return __generator(this, function (_a) {
247
- switch (_a.label) {
248
- case 0:
249
- if (!invoiceLines)
250
- return [2 /*return*/];
251
- fieldPaths = invoiceLines
252
- .map(function (_, index) { return [
253
- ["invoice", "invoiceLines", index, "itemNo"],
254
- ["invoice", "invoiceLines", index, "name"],
255
- ["invoice", "invoiceLines", index, "quantity"],
256
- ["invoice", "invoiceLines", index, "unitPriceAmount"],
257
- ["invoice", "invoiceLines", index, "taxableAmount"],
258
- ["invoice", "invoiceLines", index, "taxCategoryType"],
259
- ["invoice", "invoiceLines", index, "discountValue"],
260
- ["invoice", "invoiceLines", index, "unitOfMeasure", "unit"],
261
- ]; })
262
- .flat();
263
- return [4 /*yield*/, props.formInstance.validateFields(fieldPaths, { validateOnly: true })
264
- .then(function () {
265
- setIsSaveButtonDisabled(false);
266
- setAddNewLinesTooltip(undefined);
267
- })
268
- .catch(function (error) {
269
- var _a;
270
- var requiredFields = [];
271
- (_a = error.errorFields) === null || _a === void 0 ? void 0 : _a.map(function (errorField) {
272
- requiredFields.push(errorField.name[errorField.name.length - 1]);
273
- });
274
- if ((requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.length) > 0)
275
- setAddNewLinesTooltip((0, RequirementsUtility_1.getRequiredTooltipMessage)(props.intl.formatMessage(CommonTranslations_1.commonTranslationMessages.missingRequiredData), getFieldNames(requiredFields)));
276
- setIsSaveButtonDisabled(true);
277
- })];
278
- case 1:
279
- _a.sent();
280
- return [2 /*return*/];
281
- }
282
- });
283
- }); };
284
- var debouncedValidateFormListFields = react_1.default.useCallback((0, lodash_1.debounce)(validateFormListFields, 500), [invoiceLines]);
285
- (0, react_1.useEffect)(function () {
286
- debouncedValidateFormListFields();
287
- }, [invoiceLines, props.formInstance.getFieldValue(["invoice", "currencyCode"])]);
288
- (0, react_1.useEffect)(function () {
289
- if (billingLineData.length >= 1) {
290
- setIsCurrencyDisabled(true);
291
- }
292
- else {
293
- setIsCurrencyDisabled(false);
294
- }
295
- }, [billingLineData]);
296
- var getFieldNames = function (keys) {
297
- return keys === null || keys === void 0 ? void 0 : keys.map(function (key) {
298
- switch (key) {
299
- case "name":
300
- return props.intl.formatMessage(exports.translationMessages.billingLines_name);
301
- case "quantity":
302
- return props.intl.formatMessage(exports.translationMessages.billingLines_quantity);
303
- case "unitPriceAmount":
304
- return props.intl.formatMessage(exports.translationMessages.billingLines_unitPriceAmount);
305
- default:
306
- return "";
307
- }
308
- });
309
- };
310
- var getTaxCategoryDisabled = function (taxCategoryType, outsideVatScope) {
311
- switch (taxCategoryType) {
312
- case enums_1.AvailableTaxCategoryTypeEnum.StandardRated:
313
- case enums_1.AvailableTaxCategoryTypeEnum.ReducedRated:
314
- case enums_1.AvailableTaxCategoryTypeEnum.ZeroRated:
315
- case enums_1.AvailableTaxCategoryTypeEnum.Exempt:
316
- return outsideVatScope;
317
- case enums_1.AvailableTaxCategoryTypeEnum.OutsideTaxScope:
318
- return !outsideVatScope;
319
- default:
320
- return true;
321
- }
322
- };
323
- var getCurrencies = function (recRequirements) {
324
- var currencies = [
325
- {
326
- key: "ISK",
327
- name: props.intl.formatMessage(exports.translationMessages.billingLines_currency_ISK),
328
- },
329
- {
330
- key: "DKK",
331
- name: props.intl.formatMessage(exports.translationMessages.billingLines_currency_DKK),
332
- },
333
- {
334
- key: "NOK",
335
- name: props.intl.formatMessage(exports.translationMessages.billingLines_currency_NOK),
336
- },
337
- {
338
- key: "SEK",
339
- name: props.intl.formatMessage(exports.translationMessages.billingLines_currency_SEK),
340
- },
341
- {
342
- key: "EUR",
343
- name: props.intl.formatMessage(exports.translationMessages.billingLines_currency_EUR),
344
- },
345
- {
346
- key: "USD",
347
- name: props.intl.formatMessage(exports.translationMessages.billingLines_currency_USD),
348
- },
349
- {
350
- key: "GBP",
351
- name: props.intl.formatMessage(exports.translationMessages.billingLines_currency_GBP),
352
- },
353
- ];
354
- var currencyCodeRequirements = (0, RequirementsUtility_1.getFieldRequirements)(recRequirements, ReceiverRequirements_1.AvailableFields.currencyCode);
355
- if (currencyCodeRequirements &&
356
- currencyCodeRequirements.properties &&
357
- currencyCodeRequirements.properties.values &&
358
- currencyCodeRequirements.properties.values.length > 0) {
359
- return currencyCodeRequirements.properties.values;
360
- }
361
- else {
362
- return currencies;
363
- }
364
- };
365
160
  (0, react_1.useEffect)(function () {
366
161
  if (!props.formInstance.getFieldValue(["invoice", "currencyCode"])) {
367
162
  props.formInstance.setFieldsValue({
368
- invoice: { currencyCode: getCurrencies(props.receiverRequirements)[0].key },
163
+ invoice: { currencyCode: (0, RequirementsUtility_1.getCurrencies)(props.receiverRequirements, props.intl)[0].key },
369
164
  });
370
165
  }
371
166
  }, []);
167
+ (0, react_1.useEffect)(function () {
168
+ var _a;
169
+ var currentLines = ((_a = props.formInstance.getFieldValue(["invoice", "invoiceLines"])) === null || _a === void 0 ? void 0 : _a.filter(function (line) { return line.name; })) || [];
170
+ if (!(currentLines === null || currentLines === void 0 ? void 0 : currentLines.some(function (line) { return line.editing; }))) {
171
+ props.formInstance.setFieldsValue({
172
+ invoice: {
173
+ invoiceLines: __spreadArray(__spreadArray([], currentLines, true), [
174
+ {
175
+ key: currentLines.length + 1,
176
+ name: "",
177
+ editing: true
178
+ },
179
+ ], false),
180
+ }
181
+ });
182
+ }
183
+ }, [props.formInstance]);
184
+ var handeAddNewLine = function (index) {
185
+ var lines = props.formInstance.getFieldValue(["invoice", "invoiceLines"]) || [];
186
+ lines[index].editing = false;
187
+ if (!lines.some(function (line) { return line.editing; })) {
188
+ lines.push({
189
+ key: lines.length + 1,
190
+ name: "",
191
+ editing: true
192
+ });
193
+ }
194
+ props.formInstance.setFieldsValue({ lines: lines });
195
+ props.validateFields(invoice_1.fieldPaths, true);
196
+ };
372
197
  return (react_1.default.createElement(antd_1.Form.List, { name: ["invoice", "invoiceLines"] }, function (fields, _a) {
373
198
  var add = _a.add, remove = _a.remove;
374
- return (react_1.default.createElement(antd_1.Flex, { vertical: true },
375
- fields.map(function (field, index) {
376
- var _a;
377
- var removeBillingLine = function (id) {
378
- remove(index);
379
- var newBillingLines = billingLineData.filter(function (lineData) { return lineData.key !== id; });
380
- setBillingLineData(newBillingLines);
381
- };
382
- var addBillingLine = function () {
383
- var fieldValues = props.formInstance.getFieldsValue(["invoice", "invoiceLines"]);
384
- if (fieldValues &&
385
- fieldValues.invoice &&
386
- fieldValues.invoice.invoiceLines &&
387
- fieldValues.invoice.invoiceLines[field.name]) {
388
- var _a = fieldValues.invoice.invoiceLines[field.name], name_1 = _a.name, taxableAmount = _a.taxableAmount, quantity = _a.quantity, unitOfMeasure = _a.unitOfMeasure, unitPriceAmount = _a.unitPriceAmount, taxCategoryType = _a.taxCategoryType, discountValue = _a.discountValue, _discountType = _a.discountType, currencyCode = _a.currencyCode;
389
- var unit = unitOfMeasure.unit;
390
- var billingLineId_1 = "billingLine-".concat(name_1, "-").concat(field.name);
391
- var newBillingLineData = {
392
- key: billingLineId_1,
393
- name: name_1,
394
- taxableAmount: taxableAmount,
395
- quantity: quantity,
396
- unit: unit,
397
- unitPriceAmount: unitPriceAmount,
398
- taxCategoryType: taxCategoryType,
399
- discountValue: discountValue,
400
- discountType: _discountType,
401
- currencyCode: currencyCode,
402
- onDelete: function () {
403
- removeBillingLine(billingLineId_1);
404
- },
405
- };
406
- setBillingLineData(__spreadArray(__spreadArray([], billingLineData, true), [newBillingLineData], false));
407
- add();
408
- }
409
- };
410
- var getTaxableAmount = function () {
411
- var fieldValues = props.formInstance.getFieldsValue([
412
- ["invoice", "invoiceLines", field.name],
413
- ]);
414
- if (fieldValues &&
415
- fieldValues.invoice &&
416
- fieldValues.invoice.invoiceLines &&
417
- fieldValues.invoice.invoiceLines[field.name]) {
418
- var _a = fieldValues.invoice.invoiceLines[field.name], discountValue = _a.discountValue, quantity = _a.quantity, unitPriceAmount = _a.unitPriceAmount;
419
- var taxableAmount = (0, BillingLineUtility_1.calculateTaxableAmount)(discountValue, quantity, unitPriceAmount, discountType);
420
- props.formInstance.setFields([
421
- {
422
- name: ["invoice", "invoiceLines", field.name, "taxableAmount"],
423
- value: taxableAmount,
424
- },
425
- ]);
426
- return taxableAmount;
427
- }
428
- return 0;
429
- };
430
- var unitOfMeasureSelector = (react_1.default.createElement(form_item_1.default, { className: "umz_noValidationMessage", receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.uniteOfMeasure.unit"], defaultIsRequired: true, fieldName: [field.name, "unitOfMeasure", "unit"], defaultLabel: props.intl.formatMessage(exports.translationMessages.billingLines_unitOfMeasure), verticalLabels: true, onlyLabelOnFirstInList: true, style: { marginBottom: "-2px" }, initialValue: api_1.Units.One }, (0, BillingLineUtility_1.getCorrectInputNode)("unitOfMeasure", props.intl, props.intl.formatMessage(exports.translationMessages.billingLines_unitOfMeasure), (0, RequirementsUtility_1.getFieldIsRequired)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["invoiceLines.uniteOfMeasure.unit"], true), undefined, isMobile)));
431
- var currencySelector = (react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.currencyCode, defaultLabel: props.intl.formatMessage(exports.translationMessages.billingLines_currencyCode), defaultIsRequired: true, fieldName: [field.name, "currencyCode"], initialValue: (_a = props.formInstance.getFieldValue(["invoice", "currencyCode"])) !== null && _a !== void 0 ? _a : getCurrencies(props.receiverRequirements)[0].key, style: { marginBottom: "-2px" } },
432
- react_1.default.createElement(antd_1.Select, { popupMatchSelectWidth: false, style: { width: isMobile ? 64 : "auto" }, placeholder: props.intl.formatMessage(exports.translationMessages.billingLines_currencyCode), onSelect: function (value) {
433
- props.formInstance.setFieldsValue({ invoice: { currencyCode: value } });
434
- }, disabled: isCurrencyDisabled }, getCurrencies(props.receiverRequirements).map(function (currency) {
435
- return (react_1.default.createElement(antd_1.Select.Option, { value: currency.key, title: currency.name, key: currency.key }, currency.name));
436
- }))));
437
- var discountTypeSelector = (react_1.default.createElement(antd_1.Form.Item, { name: [field.name, "discountType"], initialValue: discountType, style: { marginBottom: "-2px" } },
438
- react_1.default.createElement(antd_1.Select, { popupMatchSelectWidth: false, onSelect: function (value) { return setDiscountType(value); }, value: discountType, style: { width: 90 } },
439
- react_1.default.createElement(antd_1.Select.Option, { value: "AMOUNT" }, props.formInstance.getFieldValue(["invoice", "currencyCode"])),
440
- react_1.default.createElement(antd_1.Select.Option, { value: "PERCENTAGE" }, "%"))));
441
- return (react_1.default.createElement(antd_1.Flex, { vertical: true, style: field.name !== fields.length - 1 ? { display: "none" } : {}, key: "invoiceLine-".concat(index) },
442
- react_1.default.createElement(form_item_1.default, { className: "umz_noValidationMessage", receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.itemNo"], defaultIsRequired: false, fieldName: [field.name, "itemNo"], defaultLabel: props.intl.formatMessage(exports.translationMessages.billingLines_itemNo), verticalLabels: true, onlyLabelOnFirstInList: true }, (0, BillingLineUtility_1.getCorrectInputNode)("itemNo", props.intl, props.intl.formatMessage(exports.translationMessages.billingLines_itemNo), (0, RequirementsUtility_1.getFieldIsRequired)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["invoiceLines.itemNo"], false))),
443
- react_1.default.createElement(form_item_1.default, { className: "umz_noValidationMessage", receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.name"], defaultIsRequired: true, fieldName: [field.name, "name"], defaultLabel: props.intl.formatMessage(exports.translationMessages.billingLines_name), verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, (0, BillingLineUtility_1.getCorrectInputNode)("name", props.intl, props.intl.formatMessage(exports.translationMessages.billingLines_name), (0, RequirementsUtility_1.getFieldIsRequired)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["invoiceLines.name"], true))),
444
- react_1.default.createElement(antd_1.Row, { gutter: 20 },
445
- react_1.default.createElement(antd_1.Col, { span: 12 },
446
- react_1.default.createElement(form_item_1.default, { className: "umz_noValidationMessage", receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.quantity"], defaultIsRequired: true, fieldName: [field.name, "quantity"], defaultLabel: props.intl.formatMessage(exports.translationMessages.billingLines_quantity), verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, (0, BillingLineUtility_1.getCorrectInputNode)("quantity", props.intl, props.intl.formatMessage(exports.translationMessages.billingLines_quantity), (0, RequirementsUtility_1.getFieldIsRequired)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["invoiceLines.quantity"], true), unitOfMeasureSelector))),
447
- react_1.default.createElement(antd_1.Col, { span: 12 },
448
- react_1.default.createElement(form_item_1.default, { className: "umz_noValidationMessage", receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.unitPriceAmount"], defaultIsRequired: true, fieldName: [field.name, "unitPriceAmount"], defaultLabel: props.intl.formatMessage(exports.translationMessages.billingLines_unitPriceAmount), verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, (0, BillingLineUtility_1.getCorrectInputNode)("unitPriceAmount", props.intl, props.intl.formatMessage(exports.translationMessages.billingLines_unitPriceAmount), (0, RequirementsUtility_1.getFieldIsRequired)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["invoiceLines.unitPriceAmount"], true), currencySelector)))),
449
- react_1.default.createElement(form_item_1.default, { className: "umz_noValidationMessage", receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.taxableAmount"], defaultIsRequired: false, fieldName: [field.name, "taxableAmount"], defaultLabel: props.intl.formatMessage(exports.translationMessages.billingLines_lineAmount), verticalLabels: true, onlyLabelOnFirstInList: true, index: index },
450
- react_1.default.createElement(antd_1.InputNumber, { style: { width: "100%" }, disabled: true, defaultValue: (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(getTaxableAmount(), props.intl) })),
451
- react_1.default.createElement(antd_1.Row, { gutter: 20 },
452
- react_1.default.createElement(antd_1.Col, { span: 12 },
453
- react_1.default.createElement(form_item_1.default, { className: "umz_noValidationMessage", receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.taxCategoryType"], defaultIsRequired: true, fieldName: [field.name, "taxCategoryType"], name: [field.name, "taxCategoryType"], initialValue: taxCatType, verticalLabels: true, onlyLabelOnFirstInList: true, index: index },
454
- react_1.default.createElement(antd_1.Flex, { gap: "middle", align: "center" },
455
- react_1.default.createElement(antd_1.Select, { style: isMobile ? { maxWidth: "80%" } : {}, value: taxCatType, onChange: function (value) {
456
- var _a;
457
- setTaxCatType(value);
458
- props.formInstance.setFieldsValue({
459
- invoice: {
460
- invoiceLines: (_a = {},
461
- _a[index] = {
462
- taxCategoryType: value,
463
- },
464
- _a),
465
- },
466
- });
467
- }, placeholder: (0, RequirementsUtility_1.getFieldIsRequired)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["invoiceLines.taxCategoryType"], true) ? (react_1.default.createElement(react_1.default.Fragment, null,
468
- react_1.default.createElement(antd_1.Typography.Text, { type: "danger" }, "*"),
469
- " ",
470
- props.intl.formatMessage(exports.translationMessages.billingLines_taxCategoryType))) : (props.intl.formatMessage(exports.translationMessages.billingLines_taxCategoryType)), popupMatchSelectWidth: false }, Object.keys(enums_1.AvailableTaxCategoryTypeEnum).map(function (taxCategoryType) {
471
- var taxPercentage = (0, BillingLineUtility_1.calculateTaxPercentage)(enums_1.AvailableTaxCategoryTypeEnum[taxCategoryType]);
472
- return (react_1.default.createElement(antd_1.Select.Option, { disabled: getTaxCategoryDisabled(enums_1.AvailableTaxCategoryTypeEnum[taxCategoryType], props.outsideVatScope), value: taxCategoryType, title: taxCategoryType, key: taxCategoryType }, "".concat(props.intl.formatMessage(CommonTranslations_1.commonTranslationMessages["taxCategoryType_labels_".concat(taxCategoryType)]), " (").concat(taxPercentage, "%)")));
473
- })),
474
- " ",
475
- react_1.default.createElement(tooltip_1.default, { title: props.intl.formatMessage(exports.translationMessages.billingLines_taxCategoryType_title) })))),
476
- react_1.default.createElement(antd_1.Col, { span: 12 },
477
- react_1.default.createElement(form_item_1.default, { className: "umz_noValidationMessage", receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.discountValue"], defaultIsRequired: false, fieldName: [field.name, "discountValue"], defaultLabel: props.intl.formatMessage(exports.translationMessages.billingLines_discount), verticalLabels: true, onlyLabelOnFirstInList: true, defaultLabelTooltip: props.intl.formatMessage(exports.translationMessages.billingLines_discount_helpText), index: index },
478
- react_1.default.createElement(antd_1.Flex, { gap: "middle", align: "center" },
479
- (0, BillingLineUtility_1.getCorrectInputNode)("discountValue", props.intl, props.intl.formatMessage(exports.translationMessages.billingLines_discount), (0, RequirementsUtility_1.getFieldIsRequired)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["invoiceLines.discountValue"], false), discountTypeSelector),
480
- react_1.default.createElement(tooltip_1.default, { title: (0, RequirementsUtility_1.getFieldLabelTooltipOverride)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["invoiceLines.discountValue"], props.intl.formatMessage(exports.translationMessages.billingLines_discount_helpText)) }))))),
481
- react_1.default.createElement(antd_1.Form.Item, __assign({}, formLayout_1.fullWidthInput),
482
- react_1.default.createElement(antd_1.Tooltip, { title: addNewLinesTooltip },
483
- react_1.default.createElement(antd_1.Button, { type: "primary", onClick: addBillingLine, style: { width: "100%" }, disabled: isSaveButtonDisabled },
484
- react_1.default.createElement(icons_1.CheckCircleOutlined, null),
485
- props.intl.formatMessage(exports.translationMessages.billingLines_labels_addButton))))));
486
- }),
487
- react_1.default.createElement(antd_1.Flex, { vertical: true, gap: "middle", style: isMobile
488
- ? { width: "100vw", backgroundColor: "white", margin: "0 -20px", padding: "20px" }
489
- : {} }, billingLineData.map(function (lineData) {
490
- return react_1.default.createElement(BillingLinePreview_1.default, __assign({ key: lineData.key }, lineData));
491
- }))));
199
+ return (react_1.default.createElement(antd_1.Flex, { vertical: true, gap: 20 }, fields.map(function (field, index) {
200
+ return react_1.default.createElement(SingleBillingLine_1.default, { fieldName: field.name, index: index, receiverRequirements: props.receiverRequirements, outsideVatScope: props.outsideVatScope, formInstance: props.formInstance, handleAddNewLine: handeAddNewLine, remove: remove });
201
+ })));
492
202
  }));
493
203
  };
494
204
  var BillingLinesWithIntl = (0, react_intl_1.injectIntl)(BillingLines);
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { WrappedComponentProps } from "react-intl";
3
+ import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
4
+ import { FormInstance } from "antd/es/form";
5
+ interface Props extends WrappedComponentProps {
6
+ receiverRequirements: NewReceiverRequirements;
7
+ formInstance: FormInstance;
8
+ outsideVatScope: boolean;
9
+ }
10
+ declare const BillingLinesWithIntl: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
11
+ forwardedRef?: React.Ref<any> | undefined;
12
+ } & React.RefAttributes<any>> & {
13
+ WrappedComponent: React.ComponentType<Props>;
14
+ };
15
+ export default BillingLinesWithIntl;
@@ -0,0 +1,36 @@
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 = __importStar(require("react"));
27
+ var react_intl_1 = require("react-intl");
28
+ var antd_1 = require("antd");
29
+ var NewNewBillingLines = function (props) {
30
+ return (React.createElement(antd_1.Form.List, { name: ["invoice", "invoiceLines"] }, function (fields, _a) {
31
+ var add = _a.add, remove = _a.remove;
32
+ return (React.createElement(antd_1.Flex, { vertical: true }));
33
+ }));
34
+ };
35
+ var BillingLinesWithIntl = (0, react_intl_1.injectIntl)(NewNewBillingLines);
36
+ exports.default = BillingLinesWithIntl;
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import { WrappedComponentProps } from "react-intl";
3
+ import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
4
+ import { FormInstance } from "antd/es/form";
5
+ interface Props extends WrappedComponentProps {
6
+ fieldName: any;
7
+ index: number;
8
+ receiverRequirements: NewReceiverRequirements;
9
+ outsideVatScope: boolean;
10
+ formInstance: FormInstance;
11
+ handleAddNewLine(index: number): void;
12
+ remove: (index: (number | number[])) => void;
13
+ }
14
+ declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
15
+ forwardedRef?: React.Ref<any>;
16
+ } & React.RefAttributes<any>> & {
17
+ WrappedComponent: React.ComponentType<Props>;
18
+ };
19
+ export default _default;