@unimaze/billing 0.20.17 → 0.21.1

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 (115) hide show
  1. package/README.md +2 -2
  2. package/lib/common/components/CommonTranslations.d.ts +102 -2
  3. package/lib/common/components/CommonTranslations.js +10 -1
  4. package/lib/common/components/attachments/Attachment.d.ts +6 -4
  5. package/lib/common/components/attachments/Attachment.js +26 -10
  6. package/lib/common/components/attachments/AttachmentModal.d.ts +21 -0
  7. package/lib/common/components/attachments/AttachmentModal.js +203 -0
  8. package/lib/common/components/attachments/index.d.ts +13 -17
  9. package/lib/common/components/attachments/index.js +189 -23
  10. package/lib/common/components/base-information/AccountingCost.d.ts +7 -5
  11. package/lib/common/components/base-information/AccountingCost.js +32 -11
  12. package/lib/common/components/base-information/OrderReference.d.ts +6 -4
  13. package/lib/common/components/base-information/OrderReference.js +31 -14
  14. package/lib/common/components/base-information/ProjectReference.d.ts +9 -5
  15. package/lib/common/components/base-information/ProjectReference.js +8 -6
  16. package/lib/common/components/base-information/ReferenceIdentifiers.d.ts +32 -5
  17. package/lib/common/components/base-information/ReferenceIdentifiers.js +126 -83
  18. package/lib/common/components/base-information/index.d.ts +51 -5
  19. package/lib/common/components/base-information/index.js +99 -154
  20. package/lib/common/components/billing-lines/BillingCalculations.d.ts +7 -5
  21. package/lib/common/components/billing-lines/BillingCalculations.js +79 -46
  22. package/lib/common/components/billing-lines/BillingLinePreview.d.ts +21 -0
  23. package/lib/common/components/billing-lines/BillingLinePreview.js +41 -0
  24. package/lib/common/components/billing-lines/BillingTaxSummary.d.ts +6 -4
  25. package/lib/common/components/billing-lines/BillingTaxSummary.js +39 -13
  26. package/lib/common/components/billing-lines/NewBillingLines.d.ts +120 -4
  27. package/lib/common/components/billing-lines/NewBillingLines.js +396 -72
  28. package/lib/common/components/billing-lines/index.d.ts +33 -6
  29. package/lib/common/components/billing-lines/index.js +71 -244
  30. package/lib/common/components/component-container/Content.d.ts +2 -2
  31. package/lib/common/components/component-container/index.d.ts +1 -0
  32. package/lib/common/components/component-container/index.js +1 -1
  33. package/lib/common/components/customer/CostCenter.d.ts +6 -4
  34. package/lib/common/components/customer/CostCenter.js +25 -9
  35. package/lib/common/components/customer/CustomerContactName.d.ts +6 -4
  36. package/lib/common/components/customer/CustomerContactName.js +24 -8
  37. package/lib/common/components/customer/hardCoddedCustomer.js +19 -3
  38. package/lib/common/components/customer/index.d.ts +11 -5
  39. package/lib/common/components/customer/index.js +97 -42
  40. package/lib/common/components/date-picker/index.d.ts +21 -0
  41. package/lib/common/components/date-picker/index.js +23 -0
  42. package/lib/common/components/delivery-location/index.d.ts +6 -4
  43. package/lib/common/components/delivery-location/index.js +20 -4
  44. package/lib/common/components/editable-cell/index.js +2 -2
  45. package/lib/common/components/editable-row/index.d.ts +1 -1
  46. package/lib/common/components/editable-row/index.js +24 -7
  47. package/lib/common/components/form-item/index.d.ts +13 -6
  48. package/lib/common/components/form-item/index.js +16 -20
  49. package/lib/common/components/index.d.ts +10 -0
  50. package/lib/common/components/index.js +30 -8
  51. package/lib/common/components/input/index.d.ts +23 -0
  52. package/lib/common/components/input/index.js +37 -0
  53. package/lib/common/components/invoice/index.d.ts +40 -0
  54. package/lib/common/components/invoice/index.js +52 -0
  55. package/lib/common/components/invoice-preview/InvoicePreviewHeader.d.ts +12 -0
  56. package/lib/common/components/invoice-preview/InvoicePreviewHeader.js +105 -0
  57. package/lib/common/components/invoice-preview/index.d.ts +16 -0
  58. package/lib/common/components/invoice-preview/index.js +393 -0
  59. package/lib/common/components/locale-intl/index.d.ts +0 -10
  60. package/lib/common/components/locale-intl/index.js +50 -42
  61. package/lib/common/components/payment-method/index.d.ts +69 -6
  62. package/lib/common/components/payment-method/index.js +145 -57
  63. package/lib/common/components/payment-method/paymentMethodForConversion.js +3 -1
  64. package/lib/common/components/submit-confirmation/SubmitConfirmationSVG.d.ts +3 -0
  65. package/lib/common/components/submit-confirmation/SubmitConfirmationSVG.js +17 -0
  66. package/lib/common/components/submit-confirmation/index.d.ts +8 -0
  67. package/lib/common/components/submit-confirmation/index.js +34 -0
  68. package/lib/common/components/supplier/CityAutofill.d.ts +18 -0
  69. package/lib/common/components/supplier/CityAutofill.js +159 -0
  70. package/lib/common/components/supplier/index.d.ts +83 -5
  71. package/lib/common/components/supplier/index.js +200 -104
  72. package/lib/common/components/tooltip/index.d.ts +7 -0
  73. package/lib/common/components/tooltip/index.js +15 -0
  74. package/lib/common/components/welcome-modal/index.d.ts +15 -0
  75. package/lib/common/components/welcome-modal/index.js +26 -0
  76. package/lib/common/consts/formLayout.js +4 -3
  77. package/lib/common/consts/validationRules.d.ts +1 -1
  78. package/lib/common/consts/validationRules.js +6 -0
  79. package/lib/common/enums/index.js +5 -1
  80. package/lib/common/style/index.css +18 -0
  81. package/lib/common/types/BillingLineMetadataOverride.d.ts +2 -0
  82. package/lib/common/types/CommonProps.d.ts +15 -1
  83. package/lib/common/types/DiscountType.d.ts +1 -0
  84. package/lib/common/types/DiscountType.js +2 -0
  85. package/lib/common/types/ReceiverRequirements.d.ts +1 -1
  86. package/lib/common/types/ReceiverRequirements.js +1 -0
  87. package/lib/common/types/index.js +15 -0
  88. package/lib/create-invoice/IntlLoader.d.ts +0 -6
  89. package/lib/create-invoice/IntlLoader.js +78 -13
  90. package/lib/create-invoice/index.d.ts +65 -4
  91. package/lib/create-invoice/index.js +437 -181
  92. package/lib/enums.d.ts +2 -3
  93. package/lib/enums.js +1 -0
  94. package/lib/index.js +22 -6
  95. package/lib/translations/locales/en.json +182 -0
  96. package/lib/translations/locales/is.json +136 -116
  97. package/lib/translations/locales.d.ts +362 -161
  98. package/lib/translations/locales.js +3 -2
  99. package/lib/utils/ApiUtility.d.ts +4 -4
  100. package/lib/utils/ApiUtility.js +13 -10
  101. package/lib/utils/BillingLineUtility.d.ts +16 -5
  102. package/lib/utils/BillingLineUtility.js +65 -26
  103. package/lib/utils/ConversionUtility.js +15 -7
  104. package/lib/utils/FileUploadUtility.d.ts +4 -2
  105. package/lib/utils/FileUploadUtility.js +28 -9
  106. package/lib/utils/IntlUtility.d.ts +3 -2
  107. package/lib/utils/IntlUtility.js +2 -1
  108. package/lib/utils/LocationUtility.d.ts +1 -0
  109. package/lib/utils/LocationUtility.js +81 -0
  110. package/lib/utils/ReferenceIdentifierUtility.js +2 -1
  111. package/lib/utils/RequirementsUtility.d.ts +9 -7
  112. package/lib/utils/RequirementsUtility.js +46 -22
  113. package/lib/utils/index.js +4 -3
  114. package/package.json +36 -18
  115. package/lib/style/index.css +0 -51
@@ -1,30 +1,48 @@
1
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
+ });
2
18
  var __importStar = (this && this.__importStar) || function (mod) {
3
19
  if (mod && mod.__esModule) return mod;
4
20
  var result = {};
5
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
- result["default"] = mod;
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);
7
23
  return result;
8
24
  };
9
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
10
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
11
27
  };
12
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.translationMessages = void 0;
13
30
  var React = __importStar(require("react"));
14
- var components_1 = require("../../components");
15
31
  var antd_1 = require("antd");
16
- var moment_1 = __importDefault(require("moment"));
32
+ var dayjs_1 = __importDefault(require("dayjs"));
17
33
  var form_item_1 = __importDefault(require("../form-item"));
18
34
  var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
19
35
  var react_intl_1 = require("react-intl");
20
- var ReferenceIdentifiers_1 = __importStar(require("./ReferenceIdentifiers"));
21
- var icons_1 = require("@ant-design/icons");
36
+ var ReferenceIdentifiers_1 = __importDefault(require("./ReferenceIdentifiers"));
22
37
  var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
23
38
  var OrderReference_1 = __importDefault(require("./OrderReference"));
24
39
  var AccountingCost_1 = __importDefault(require("./AccountingCost"));
25
40
  var react_1 = require("react");
26
41
  var ProjectReference_1 = __importDefault(require("./ProjectReference"));
27
- var translationMessages = react_intl_1.defineMessages({
42
+ var __1 = require("..");
43
+ var react_use_1 = require("react-use");
44
+ var CommonTranslations_1 = require("../CommonTranslations");
45
+ exports.translationMessages = (0, react_intl_1.defineMessages)({
28
46
  baseInformation_title: {
29
47
  id: "baseInformation_title",
30
48
  defaultMessage: "Base Information",
@@ -35,125 +53,65 @@ var translationMessages = react_intl_1.defineMessages({
35
53
  },
36
54
  baseInformation_issueDate: {
37
55
  id: "baseInformation_issueDate",
38
- defaultMessage: "Issue date"
56
+ defaultMessage: "Issue date",
39
57
  },
40
58
  baseInformation_issueDate_title: {
41
59
  id: "baseInformation_issueDate_title",
42
- defaultMessage: "The issue date controls on which settlement period the transfer is registered" // "Útgáfudagsetning stjórnar á hvaða uppgjörstímabili færslan skráist"
60
+ defaultMessage: "The issue date controls on which settlement period the transfer is registered", // "Útgáfudagsetning stjórnar á hvaða uppgjörstímabili færslan skráist"
43
61
  },
44
62
  baseInformation_dueDate: {
45
63
  id: "baseInformation_dueDate",
46
- defaultMessage: "Due date"
64
+ defaultMessage: "Due date",
47
65
  },
48
66
  baseInformation_dueDate_title: {
49
67
  id: "baseInformation_dueDate_title",
50
- defaultMessage: "Grace date should be the same as due date" // "Eindagi skal vera sá sami og gjalddagi"
68
+ defaultMessage: "Grace date should be the same as due date", // "Eindagi skal vera sá sami og gjalddagi"
51
69
  },
52
70
  baseInformation_buyerReferenceLabel: {
53
71
  id: "baseInformation_buyerReferenceLabel",
54
- defaultMessage: "Buyer reference"
72
+ defaultMessage: "Buyer reference",
55
73
  },
56
74
  baseInformation_buyerReferenceLabel_helpText: {
57
75
  id: "baseInformation_buyerReferenceLabel_helpText",
58
- defaultMessage: "A reference the buyer has requested to be assigned to the invoice, often called \"your reference\". Used by the buyer for internal routing. If buyer has not specifically requested it, the name of the person who ordered or requested the products or services can be used. Must be used when order number is not specified."
76
+ defaultMessage: 'A reference the buyer has requested to be assigned to the invoice, often called "your reference". Used by the buyer for internal routing. If buyer has not specifically requested it, the name of the person who ordered or requested the products or services can be used. Must be used when order number is not specified.',
59
77
  },
60
78
  baseInformation_projectReferenceLabel: {
61
79
  id: "baseInformation_projectReferenceLabel",
62
- defaultMessage: "Project reference"
63
- },
64
- baseInformation_notes: {
65
- id: "baseInformation_notes",
66
- defaultMessage: "Notes"
67
- },
68
- baseInformation_currencyCode: {
69
- id: "baseInformation_currencyCode",
70
- defaultMessage: "Currency"
80
+ defaultMessage: "Project reference",
71
81
  },
72
82
  baseInformation_dueDateErrorMsg: {
73
83
  id: "baseInformation_dueDateErrorMsg",
74
- defaultMessage: "Due date must be after the issue date"
75
- },
76
- baseInformation_currency_ISK: {
77
- id: "baseInformation_currency_ISK",
78
- defaultMessage: "Icelandic krona (ISK)"
79
- },
80
- baseInformation_currency_DKK: {
81
- id: "baseInformation_currency_DKK",
82
- defaultMessage: "Danish krona (DKK)"
83
- },
84
- baseInformation_currency_NOK: {
85
- id: "baseInformation_currency_NOK",
86
- defaultMessage: "Norwegian krona (NOK)"
87
- },
88
- baseInformation_currency_SEK: {
89
- id: "baseInformation_currency_SEK",
90
- defaultMessage: "Swedish krona (SEK)"
91
- },
92
- baseInformation_currency_EUR: {
93
- id: "baseInformation_currency_EUR",
94
- defaultMessage: "Euro (EUR)"
95
- },
96
- baseInformation_currency_USD: {
97
- id: "baseInformation_currency_USD",
98
- defaultMessage: "US dollar (USD)"
99
- },
100
- baseInformation_currency_GBP: {
101
- id: "baseInformation_currency_GBP",
102
- defaultMessage: "British pound (GBP)"
84
+ defaultMessage: "Due date must be after the issue date",
103
85
  },
104
86
  });
105
87
  var BaseInformation = function (props) {
106
- var _a = react_1.useState(), dueDateDefaultPickerValue = _a[0], setDueDateDefaultPickerValue = _a[1];
107
- react_1.useEffect(function () {
108
- var a = getDueDateLimit(props.form.getFieldValue(["invoice", "issueDate"]), props.dueDateMinimumOffset);
109
- setDueDateDefaultPickerValue(a);
110
- }, [props.form.getFieldValue(["invoice", "issueDate"])]);
111
- var getCurrencies = function (recRequirements) {
112
- var currencies = [
113
- {
114
- key: "ISK",
115
- name: props.intl.formatMessage(translationMessages.baseInformation_currency_ISK)
116
- },
117
- {
118
- key: "DKK",
119
- name: props.intl.formatMessage(translationMessages.baseInformation_currency_DKK)
120
- },
121
- {
122
- key: "NOK",
123
- name: props.intl.formatMessage(translationMessages.baseInformation_currency_NOK)
124
- },
125
- {
126
- key: "SEK",
127
- name: props.intl.formatMessage(translationMessages.baseInformation_currency_SEK)
128
- },
129
- {
130
- key: "EUR",
131
- name: props.intl.formatMessage(translationMessages.baseInformation_currency_EUR)
132
- },
133
- {
134
- key: "USD",
135
- name: props.intl.formatMessage(translationMessages.baseInformation_currency_USD)
136
- },
137
- {
138
- key: "GBP",
139
- name: props.intl.formatMessage(translationMessages.baseInformation_currency_GBP)
140
- },
141
- ];
142
- var currencyCodeRequirements = RequirementsUtility_1.getFieldRequirements(recRequirements, ReceiverRequirements_1.AvailableFields.currencyCode);
143
- if (currencyCodeRequirements && currencyCodeRequirements.properties && currencyCodeRequirements.properties.values && currencyCodeRequirements.properties.values.length > 0) {
144
- return currencyCodeRequirements.properties.values;
88
+ var _a, _b;
89
+ var width = (0, react_use_1.useWindowSize)().width;
90
+ var _c = (0, react_1.useState)(false), isMobile = _c[0], setIsMobile = _c[1];
91
+ var _d = (0, react_1.useState)(), dueDateDefaultPickerValue = _d[0], setDueDateDefaultPickerValue = _d[1];
92
+ var formData = props.form.getFieldsValue();
93
+ var token = antd_1.theme.useToken().token;
94
+ (0, react_1.useEffect)(function () {
95
+ if (width < 768) {
96
+ setIsMobile(true);
145
97
  }
146
98
  else {
147
- return currencies;
99
+ setIsMobile(false);
148
100
  }
149
- };
101
+ }, [width]);
102
+ (0, react_1.useEffect)(function () {
103
+ var a = getDueDateLimit(props.form.getFieldValue(["invoice", "issueDate"]), props.dueDateMinimumOffset);
104
+ setDueDateDefaultPickerValue(a);
105
+ }, [props.form.getFieldValue(["invoice", "issueDate"])]);
150
106
  var getDueDateLimit = function (issueDate, dueDateMinimumOffset) {
151
107
  var dueDateLimit;
152
108
  if (issueDate) {
153
- dueDateLimit = moment_1.default.max(moment_1.default().startOf("day").add(dueDateMinimumOffset, "days"), issueDate.startOf("day"));
109
+ dueDateLimit = (0, dayjs_1.default)().startOf("day").add(dueDateMinimumOffset, "days").isAfter(issueDate.startOf("day"))
110
+ ? (0, dayjs_1.default)().startOf("day").add(dueDateMinimumOffset, "days")
111
+ : issueDate.startOf("day");
154
112
  }
155
113
  else {
156
- dueDateLimit = moment_1.default().startOf("day").add(dueDateMinimumOffset, "days");
114
+ dueDateLimit = (0, dayjs_1.default)().startOf("day").add(dueDateMinimumOffset, "days");
157
115
  }
158
116
  return dueDateLimit;
159
117
  };
@@ -164,70 +122,57 @@ var BaseInformation = function (props) {
164
122
  var checkIfEmpty = function (date) {
165
123
  if (!date) {
166
124
  props.form.resetFields(["invoice", "dueDate"]);
167
- props.form.validateFields(["invoice", "dueDate"]).then(function (values) {
168
- // console.log(values);
169
- });
125
+ props.form.validateFields(["invoice", "dueDate"]);
170
126
  }
171
127
  };
172
- var dueDateLabelNode = (React.createElement(antd_1.Tooltip, { title: props.intl.formatMessage(translationMessages.baseInformation_dueDate_title), placement: "right" },
173
- React.createElement("span", null,
174
- props.intl.formatMessage(translationMessages.baseInformation_dueDate),
175
- "\u00A0",
176
- React.createElement(icons_1.QuestionCircleOutlined, null))));
177
- var issueDateLabelNode = (React.createElement(antd_1.Tooltip, { title: props.intl.formatMessage(translationMessages.baseInformation_issueDate_title), placement: "right" },
178
- React.createElement("span", null,
179
- props.intl.formatMessage(translationMessages.baseInformation_issueDate),
180
- "\u00A0",
181
- React.createElement(icons_1.QuestionCircleOutlined, null))));
182
- var referenceIdentifierLabelNode = (React.createElement(antd_1.Tooltip, { title: props.intl.formatMessage(ReferenceIdentifiers_1.translationMessages.referenceIdentifiers_labels_referenceIdentifier_title), placement: "right" },
183
- React.createElement("span", null,
184
- props.intl.formatMessage(ReferenceIdentifiers_1.translationMessages.referenceIdentifiers_labels_referenceIdentifier),
185
- "\u00A0",
186
- React.createElement(icons_1.QuestionCircleOutlined, null))));
187
128
  var onlyOneOption = function (receiverRequirements, fieldName) {
188
- var a = RequirementsUtility_1.getFieldRequirements(receiverRequirements, fieldName);
129
+ var a = (0, RequirementsUtility_1.getFieldRequirements)(receiverRequirements, fieldName);
189
130
  return !!(a && a.properties && a.properties.values && a.properties.values.length === 1);
190
131
  };
191
- return (React.createElement(components_1.ComponentContainer, { title: props.intl.formatMessage(translationMessages.baseInformation_title) },
192
- React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.invoiceNo, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_invoiceNo), defaultIsRequired: true, fieldName: ["invoice", "invoiceNo"] },
193
- React.createElement(antd_1.Input, null)),
194
- React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.issueDate, defaultLabel: issueDateLabelNode, defaultIsRequired: true, fieldName: ["invoice", "issueDate"] },
195
- React.createElement(antd_1.DatePicker, { style: { width: "100%" }, format: "DD.MM.YYYY" })),
196
- React.createElement(form_item_1.default
197
- // dependencies={[["invoice", "issueDate"]]}
198
- , {
199
- // dependencies={[["invoice", "issueDate"]]}
200
- receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.dueDate, defaultLabel: dueDateLabelNode, defaultIsRequired: true, fieldName: ["invoice", "dueDate"], additionalRules: [
201
- {
202
- validator: (function (rule, value, callback) {
203
- if (!value) {
204
- callback();
205
- }
206
- var issueDate = props.form.getFieldValue(["invoice", "issueDate"]);
207
- value < issueDate
208
- ? callback(props.intl.formatMessage(translationMessages.baseInformation_dueDateErrorMsg))
209
- : callback();
210
- }),
211
- },
212
- ] },
213
- React.createElement(antd_1.DatePicker, { defaultPickerValue: dueDateDefaultPickerValue, style: { width: "100%" }, format: "DD.MM.YYYY", onChange: checkIfEmpty, getPopupContainer: function (trigger) { return trigger.parentElement; }, disabledDate: (function (current) {
214
- var currentDate = current;
215
- var dueDateMinimumOffset = props.dueDateMinimumOffset;
216
- var issueDate = props.form.getFieldValue(["invoice", "issueDate"]);
217
- return disabledDate(currentDate, issueDate, dueDateMinimumOffset);
218
- }) })),
219
- React.createElement(OrderReference_1.default, { receiverRequirements: props.receiverRequirements, formInstance: props.form, dependencies: [["invoice", "buyerReference"]] }),
220
- React.createElement(form_item_1.default, { shouldUpdate: true, dependencies: [["invoice", "orderReference", "documentNo"]], receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.buyerReference, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_buyerReferenceLabel), defaultLabelTooltip: props.intl.formatMessage(translationMessages.baseInformation_buyerReferenceLabel_helpText), defaultIsRequired: !(props.form.getFieldValue(["invoice", "orderReference", "documentNo"])), fieldName: ["invoice", "buyerReference"] },
221
- React.createElement(antd_1.Input, null)),
222
- React.createElement(ReferenceIdentifiers_1.default, { receiverRequirements: props.receiverRequirements, formInstance: props.form, updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, rapiBaseUrl: props.rapiBaseUrl, legalIdentifier: props.legalIdentifier, referenceIdentifiersLabelText: props.referenceIdentifiersLabelText, referenceIdentifiersHelpText: props.referenceIdentifiersHelpText, referenceIdentifierValidateStatus: props.referenceIdentifierValidateStatus, setReferenceIdentifierValidateStatus: props.setReferenceIdentifierValidateStatus }),
223
- React.createElement(AccountingCost_1.default, { formInstance: props.form, rapiBaseUrl: props.rapiBaseUrl, receiverRequirements: props.receiverRequirements, updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, legalIdentifier: props.legalIdentifier }),
224
- React.createElement(ProjectReference_1.default, { receiverRequirements: props.receiverRequirements }),
225
- React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.notes, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_notes), defaultIsRequired: false, fieldName: ["invoice", "notes"] },
226
- React.createElement(antd_1.Input.TextArea, null)),
227
- React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.currencyCode, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_currencyCode), defaultIsRequired: true, fieldName: ["invoice", "currencyCode"], initialValue: getCurrencies(props.receiverRequirements)[0].key },
228
- React.createElement(antd_1.Select, { dropdownMatchSelectWidth: false }, getCurrencies(props.receiverRequirements).map(function (currency) {
229
- return (React.createElement(antd_1.Select.Option, { value: currency.key, title: currency.name, key: currency.key }, currency.name));
230
- })))));
132
+ return (React.createElement(antd_1.Flex, { style: {
133
+ backgroundColor: isMobile ? undefined : token.colorInfoBg,
134
+ padding: isMobile ? "0 0 15px 0" : "35px",
135
+ }, justify: "center" },
136
+ React.createElement(antd_1.Flex, { vertical: true, style: { width: "100%", maxWidth: "900px" } },
137
+ React.createElement(antd_1.Row, { gutter: 20 },
138
+ React.createElement(antd_1.Col, { span: 24 },
139
+ React.createElement(antd_1.Typography.Title, { level: 5 }, props.intl.formatMessage(exports.translationMessages.baseInformation_title))),
140
+ React.createElement(antd_1.Col, { span: isMobile ? 24 : 12 },
141
+ React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.invoiceNo, defaultLabel: props.intl.formatMessage(exports.translationMessages.baseInformation_invoiceNo), defaultIsRequired: true, fieldName: ["invoice", "invoiceNo"] },
142
+ React.createElement(__1.UmzInput, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.invoiceNo, defaultIsRequired: true, defaultPlaceholder: props.intl.formatMessage(exports.translationMessages.baseInformation_invoiceNo), defaultValue: (_a = formData.invoice) === null || _a === void 0 ? void 0 : _a.invoiceNo }))),
143
+ React.createElement(antd_1.Col, { span: isMobile ? 24 : 12 },
144
+ React.createElement(antd_1.Row, { gutter: 20 },
145
+ React.createElement(antd_1.Col, { span: 12 },
146
+ React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.issueDate, defaultIsRequired: true, fieldName: ["invoice", "issueDate"] },
147
+ React.createElement(__1.UmzDatePicker, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.issueDate, defaultPlaceholder: props.intl.formatMessage(exports.translationMessages.baseInformation_issueDate), defaultIsRequired: true, defaultValue: (0, dayjs_1.default)(), format: "DD.MM.YYYY", style: { width: "100%" }, defaultTooltip: props.intl.formatMessage(exports.translationMessages.baseInformation_issueDate_title) }))),
148
+ React.createElement(antd_1.Col, { span: 12 },
149
+ React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.dueDate, defaultIsRequired: true, fieldName: ["invoice", "dueDate"], additionalRules: [
150
+ {
151
+ validator: function (rule, value, callback) {
152
+ if (!value) {
153
+ callback();
154
+ }
155
+ var issueDate = props.form.getFieldValue(["invoice", "issueDate"]);
156
+ value < issueDate
157
+ ? callback(props.intl.formatMessage(exports.translationMessages.baseInformation_dueDateErrorMsg))
158
+ : callback();
159
+ },
160
+ },
161
+ ] },
162
+ React.createElement(__1.UmzDatePicker, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.dueDate, defaultPlaceholder: props.intl.formatMessage(exports.translationMessages.baseInformation_dueDate), format: "DD.MM.YYYY", style: { width: "100%" }, defaultTooltip: props.intl.formatMessage(exports.translationMessages.baseInformation_dueDate_title), defaultIsRequired: true, defaultPickerValue: dueDateDefaultPickerValue, onChange: checkIfEmpty, getPopupContainer: function (trigger) { return trigger.parentElement; }, disabledDate: function (current) {
163
+ var currentDate = current;
164
+ var dueDateMinimumOffset = props.dueDateMinimumOffset;
165
+ var issueDate = props.form.getFieldValue(["invoice", "issueDate"]);
166
+ return disabledDate(currentDate, issueDate, dueDateMinimumOffset);
167
+ } }))))),
168
+ React.createElement(antd_1.Col, { span: 24 },
169
+ React.createElement(OrderReference_1.default, { receiverRequirements: props.receiverRequirements, formInstance: props.form, dependencies: [["invoice", "buyerReference"]] }),
170
+ React.createElement(form_item_1.default, { shouldUpdate: true, dependencies: [["invoice", "orderReference", "documentNo"]], receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.buyerReference, defaultLabel: props.intl.formatMessage(exports.translationMessages.baseInformation_buyerReferenceLabel), defaultLabelTooltip: props.intl.formatMessage(exports.translationMessages.baseInformation_buyerReferenceLabel_helpText), defaultIsRequired: !props.form.getFieldValue(["invoice", "orderReference", "documentNo"]), fieldName: ["invoice", "buyerReference"] },
171
+ React.createElement(__1.UmzInput, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.buyerReference, defaultIsRequired: !props.form.getFieldValue(["invoice", "orderReference", "documentNo"]), defaultPlaceholder: props.intl.formatMessage(exports.translationMessages.baseInformation_buyerReferenceLabel), defaultTooltip: props.intl.formatMessage(exports.translationMessages.baseInformation_buyerReferenceLabel_helpText), defaultValue: (_b = formData.invoice) === null || _b === void 0 ? void 0 : _b.buyerReference })),
172
+ React.createElement(ReferenceIdentifiers_1.default, { receiverRequirements: props.receiverRequirements, formInstance: props.form, updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, rapiBaseUrl: props.rapiBaseUrl, legalIdentifier: props.legalIdentifier, referenceIdentifiersLabelText: props.referenceIdentifiersLabelText, referenceIdentifiersHelpText: props.referenceIdentifiersHelpText, referenceIdentifierValidateStatus: props.referenceIdentifierValidateStatus, setReferenceIdentifierValidateStatus: props.setReferenceIdentifierValidateStatus }),
173
+ React.createElement(AccountingCost_1.default, { formInstance: props.form, rapiBaseUrl: props.rapiBaseUrl, receiverRequirements: props.receiverRequirements, updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, legalIdentifier: props.legalIdentifier }),
174
+ React.createElement(ProjectReference_1.default, { receiverRequirements: props.receiverRequirements, form: props.form }))),
175
+ React.createElement(antd_1.Checkbox, { checked: props.isSaveFieldValuesSelected, onChange: props.onSaveFieldValuesChange }, props.intl.formatMessage(CommonTranslations_1.commonTranslationMessages.saveInformation_label)))));
231
176
  };
232
- var BaseInformationIntl = react_intl_1.injectIntl(BaseInformation);
177
+ var BaseInformationIntl = (0, react_intl_1.injectIntl)(BaseInformation);
233
178
  exports.default = BaseInformationIntl;
@@ -1,12 +1,14 @@
1
- import React from 'react';
2
- import { InjectedIntlProps } from "react-intl";
1
+ import React from "react";
2
+ import { WrappedComponentProps } from "react-intl";
3
3
  import { FormInstance } from "antd/es/form";
4
- interface Props extends InjectedIntlProps {
4
+ interface Props extends WrappedComponentProps {
5
5
  currencyCode: string;
6
6
  formInstance: FormInstance;
7
7
  outsideVatScope: boolean;
8
8
  }
9
- declare const _default: React.ComponentClass<Pick<Props, "formInstance" | "currencyCode" | "outsideVatScope">, any> & {
10
- WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
9
+ declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
10
+ forwardedRef?: React.Ref<any> | undefined;
11
+ } & React.RefAttributes<any>> & {
12
+ WrappedComponent: React.ComponentType<Props>;
11
13
  };
12
14
  export default _default;
@@ -1,9 +1,25 @@
1
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
+ });
2
18
  var __importStar = (this && this.__importStar) || function (mod) {
3
19
  if (mod && mod.__esModule) return mod;
4
20
  var result = {};
5
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
- result["default"] = mod;
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);
7
23
  return result;
8
24
  };
9
25
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -13,7 +29,7 @@ var BillingLineUtility_1 = require("../../../utils/BillingLineUtility");
13
29
  var api_1 = require("@unimaze/api-clients/lib/mapi/api");
14
30
  var react_intl_1 = require("react-intl");
15
31
  var IntlUtility_1 = require("../../../utils/IntlUtility");
16
- var translationMessages = react_intl_1.defineMessages({
32
+ var translationMessages = (0, react_intl_1.defineMessages)({
17
33
  billingCalculations_labels_TaxAmountWithoutVat: {
18
34
  id: "billingCalculations_labels_TaxAmountWithoutVat",
19
35
  defaultMessage: "Total amount without VAT",
@@ -34,10 +50,15 @@ var translationMessages = react_intl_1.defineMessages({
34
50
  id: "billingCalculations_labels_RoundingAmount",
35
51
  defaultMessage: "Rounding amount",
36
52
  },
53
+ billingLines_discount: {
54
+ id: "billingLines_discount",
55
+ defaultMessage: "Discount",
56
+ },
37
57
  });
58
+ ;
38
59
  var BillingCalculations = function (props) {
39
- var _a = react_1.useState(props.formInstance.getFieldValue(["invoice", "invoiceLines"])), invoiceLines = _a[0], setInvoiceLines = _a[1];
40
- react_1.useEffect(function () {
60
+ var _a = (0, react_1.useState)(props.formInstance.getFieldValue(["invoice", "invoiceLines"])), invoiceLines = _a[0], setInvoiceLines = _a[1];
61
+ (0, react_1.useEffect)(function () {
41
62
  setInvoiceLines(props.formInstance.getFieldValue(["invoice", "invoiceLines"]));
42
63
  }, [props.outsideVatScope, props.formInstance.getFieldValue(["invoice", "invoiceLines"])]);
43
64
  var totals = {
@@ -45,61 +66,73 @@ var BillingCalculations = function (props) {
45
66
  totalTaxAmount: 0,
46
67
  totalTaxInclusiveAmount: 0,
47
68
  roundingAmount: 0,
69
+ discountAmount: 0,
48
70
  };
49
71
  if (invoiceLines) {
50
72
  invoiceLines.map(function (billingLine) {
51
73
  if (billingLine) {
52
- var taxAmount = BillingLineUtility_1.calculateTaxAmount(BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount), BillingLineUtility_1.calculateTaxPercentage(billingLine.taxCategoryType ? api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType] : undefined)); // BillingLineMetadataTaxCategoryTypeEnum -> TaxCategoryTypeEnum
53
- var taxableAmount = BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount);
74
+ var taxAmount = (0, BillingLineUtility_1.calculateTaxAmount)((0, BillingLineUtility_1.calculateTaxableAmount)(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount, billingLine.discountType), (0, BillingLineUtility_1.calculateTaxPercentage)(billingLine.taxCategoryType ? api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType] : undefined));
75
+ var taxableAmount = (0, BillingLineUtility_1.calculateTaxableAmount)(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount, billingLine.discountType);
54
76
  var taxInclusiveAmount = taxableAmount + taxAmount;
77
+ var discountAmount = (0, BillingLineUtility_1.calculateDiscountAmount)(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount);
55
78
  totals = {
56
79
  totalTaxAmount: totals.totalTaxAmount + taxAmount,
57
80
  totalTaxableAmount: totals.totalTaxableAmount + taxableAmount,
58
81
  totalTaxInclusiveAmount: totals.totalTaxInclusiveAmount + taxInclusiveAmount,
59
- roundingAmount: Math.abs(totals.totalTaxInclusiveAmount + taxInclusiveAmount - Math.round(totals.totalTaxInclusiveAmount + taxInclusiveAmount))
82
+ roundingAmount: Math.abs(totals.totalTaxInclusiveAmount +
83
+ taxInclusiveAmount -
84
+ Math.round(totals.totalTaxInclusiveAmount + taxInclusiveAmount)),
85
+ discountAmount: totals.discountAmount + discountAmount,
60
86
  };
61
87
  }
62
88
  });
63
89
  }
64
- return (react_1.default.createElement(react_1.default.Fragment, null,
65
- react_1.default.createElement(antd_1.Row, null,
66
- react_1.default.createElement(antd_1.Col, { span: 18, style: { textAlign: "right" } },
67
- props.intl.formatMessage(translationMessages.billingCalculations_labels_TaxAmountWithoutVat),
68
- ":"),
69
- react_1.default.createElement(antd_1.Col, { span: 6, style: { textAlign: "right" } }, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(totals.totalTaxableAmount, props.intl, { style: "decimal" }))),
70
- react_1.default.createElement(antd_1.Row, null,
71
- react_1.default.createElement(antd_1.Col, { span: 18, style: { textAlign: "right" } },
72
- props.intl.formatMessage(translationMessages.billingCalculations_labels_TotalVatAmount),
73
- ":"),
74
- react_1.default.createElement(antd_1.Col, { span: 6, style: { textAlign: "right" } }, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(totals.totalTaxAmount, props.intl, { style: "decimal" }))),
75
- react_1.default.createElement(antd_1.Row, null,
76
- react_1.default.createElement(antd_1.Col, { span: 12, offset: 12 },
77
- react_1.default.createElement("hr", null))),
78
- react_1.default.createElement(antd_1.Row, null,
79
- react_1.default.createElement(antd_1.Col, { span: 18, style: { textAlign: "right" } },
80
- react_1.default.createElement("span", { style: { fontWeight: 600 } },
90
+ if (totals.totalTaxableAmount <= 0 || totals.totalTaxInclusiveAmount <= 0) {
91
+ return null;
92
+ }
93
+ return (react_1.default.createElement(antd_1.Flex, { vertical: true },
94
+ react_1.default.createElement(antd_1.Flex, { justify: "end", gap: 'large' },
95
+ react_1.default.createElement(antd_1.Flex, { vertical: true, style: { fontWeight: 300 } },
96
+ react_1.default.createElement(antd_1.Typography.Text, null,
97
+ props.intl.formatMessage(translationMessages.billingCalculations_labels_TaxAmountWithoutVat),
98
+ ":"),
99
+ react_1.default.createElement(antd_1.Typography.Text, null,
81
100
  props.intl.formatMessage(translationMessages.billingCalculations_labels_TotalAmountWithVat),
82
- ":")),
83
- react_1.default.createElement(antd_1.Col, { span: 6, style: { textAlign: "right" } },
84
- react_1.default.createElement("span", { style: { fontWeight: 600 } }, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(totals.totalTaxInclusiveAmount, props.intl, { style: "decimal" })))),
101
+ ":"),
102
+ totals.discountAmount > 0 && (react_1.default.createElement(antd_1.Typography.Text, null,
103
+ props.intl.formatMessage(translationMessages.billingLines_discount),
104
+ ":"))),
105
+ react_1.default.createElement(antd_1.Flex, { vertical: true },
106
+ react_1.default.createElement(antd_1.Typography.Text, { strong: true },
107
+ (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(totals.totalTaxableAmount, props.intl, {
108
+ style: "decimal",
109
+ }),
110
+ " ",
111
+ props.formInstance.getFieldValue(["invoice", "currencyCode"])),
112
+ react_1.default.createElement(antd_1.Typography.Text, { strong: true },
113
+ (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(totals.totalTaxInclusiveAmount, props.intl, {
114
+ style: "decimal",
115
+ }),
116
+ " ",
117
+ props.formInstance.getFieldValue(["invoice", "currencyCode"])),
118
+ totals.discountAmount > 0 && (react_1.default.createElement(antd_1.Typography.Text, { strong: true },
119
+ (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(totals.discountAmount, props.intl, {
120
+ style: "decimal",
121
+ }),
122
+ " ",
123
+ props.formInstance.getFieldValue(["invoice", "currencyCode"]))))),
85
124
  react_1.default.createElement(antd_1.Row, null,
86
- react_1.default.createElement(antd_1.Col, { span: 18, style: { textAlign: "right" } },
87
- react_1.default.createElement("span", null,
88
- props.intl.formatMessage(translationMessages.billingCalculations_labels_RoundingAmount),
89
- ":")),
90
- react_1.default.createElement(antd_1.Col, { span: 6, style: { textAlign: "right" } },
91
- react_1.default.createElement("span", { style: { fontWeight: 600 } }, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(totals.roundingAmount, props.intl, { style: "decimal" })))),
92
- react_1.default.createElement(antd_1.Row, null,
93
- react_1.default.createElement(antd_1.Col, { span: 12, offset: 12 },
125
+ react_1.default.createElement(antd_1.Col, { span: 24 },
94
126
  react_1.default.createElement("hr", null))),
95
- react_1.default.createElement(antd_1.Row, null,
96
- react_1.default.createElement(antd_1.Col, { span: 18, style: { textAlign: "right" } },
97
- react_1.default.createElement("span", { style: { fontWeight: 600 } },
98
- props.intl.formatMessage(translationMessages.billingCalculations_labels_AmountPayable),
99
- ":")),
100
- react_1.default.createElement(antd_1.Col, { span: 6, style: { textAlign: "right" } },
101
- react_1.default.createElement("span", { style: { fontWeight: 600 } }, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(Math.round(totals.totalTaxInclusiveAmount), props.intl, {
102
- style: "decimal"
103
- }))))));
127
+ react_1.default.createElement(antd_1.Flex, { justify: "end" },
128
+ react_1.default.createElement(antd_1.Typography.Text, { strong: true, style: { fontSize: "18px" } },
129
+ " ",
130
+ "=",
131
+ " ",
132
+ (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(Math.round(totals.totalTaxInclusiveAmount), props.intl, {
133
+ style: "decimal",
134
+ }),
135
+ " ",
136
+ props.formInstance.getFieldValue(["invoice", "currencyCode"])))));
104
137
  };
105
- exports.default = react_intl_1.injectIntl(BillingCalculations);
138
+ exports.default = (0, react_intl_1.injectIntl)(BillingCalculations);
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { AvailableTaxCategoryTypeEnum } from "../../../enums";
3
+ import { WrappedComponentProps } from "react-intl";
4
+ interface BillingLinePreviewProps extends WrappedComponentProps {
5
+ name?: string;
6
+ taxableAmount?: number;
7
+ quantity?: number;
8
+ unit?: string;
9
+ unitPriceAmount?: number;
10
+ taxCategoryType?: AvailableTaxCategoryTypeEnum;
11
+ discountValue?: string;
12
+ discountType?: string;
13
+ currencyCode: string;
14
+ onDelete: () => void;
15
+ }
16
+ declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<BillingLinePreviewProps, "intl"> & {
17
+ forwardedRef?: React.Ref<any> | undefined;
18
+ } & React.RefAttributes<any>> & {
19
+ WrappedComponent: React.ComponentType<BillingLinePreviewProps>;
20
+ };
21
+ export default _default;
@@ -0,0 +1,41 @@
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 enums_1 = require("../../../enums");
8
+ var BillingLineUtility_1 = require("../../../utils/BillingLineUtility");
9
+ var antd_1 = require("antd");
10
+ var icons_1 = require("@ant-design/icons");
11
+ var NewBillingLines_1 = require("./NewBillingLines");
12
+ var react_intl_1 = require("react-intl");
13
+ var BillingLinePreview = function (props) {
14
+ var taxPercentage = (0, BillingLineUtility_1.calculateTaxPercentage)(enums_1.AvailableTaxCategoryTypeEnum[props.taxCategoryType]);
15
+ return (react_1.default.createElement(antd_1.Card, { style: { backgroundColor: "#F5F5F5", width: "full" }, size: "small", bordered: false },
16
+ react_1.default.createElement(antd_1.Flex, { gap: "middle", align: "center", justify: "space-between" },
17
+ react_1.default.createElement(antd_1.Flex, { vertical: true },
18
+ react_1.default.createElement(antd_1.Typography.Text, { strong: true },
19
+ props.name,
20
+ " = ",
21
+ props.taxableAmount,
22
+ " ",
23
+ props.currencyCode),
24
+ react_1.default.createElement(antd_1.Typography.Text, null,
25
+ props.quantity,
26
+ " ",
27
+ props.unit,
28
+ " | ",
29
+ props.unitPriceAmount,
30
+ " ",
31
+ props.currencyCode,
32
+ " / ",
33
+ props.unit,
34
+ " | ",
35
+ taxPercentage,
36
+ "%",
37
+ " ",
38
+ props.discountValue && " | ".concat(props.discountValue).concat(props.discountType === "PERCENTAGE" ? "%" : " ".concat(props.currencyCode), " ").concat(props.intl.formatMessage(NewBillingLines_1.translationMessages.billingLines_discount)))),
39
+ react_1.default.createElement(antd_1.Button, { onClick: props.onDelete, icon: react_1.default.createElement(icons_1.DeleteOutlined, null), type: "text", danger: true }))));
40
+ };
41
+ exports.default = (0, react_intl_1.injectIntl)(BillingLinePreview);
@@ -1,11 +1,13 @@
1
1
  import React from "react";
2
- import { InjectedIntlProps } from "react-intl";
2
+ import { WrappedComponentProps } from "react-intl";
3
3
  import { FormInstance } from "antd/es/form";
4
- interface Props extends InjectedIntlProps {
4
+ interface Props extends WrappedComponentProps {
5
5
  formInstance: FormInstance;
6
6
  outsideVatScope: boolean;
7
7
  }
8
- declare const _default: React.ComponentClass<Pick<Props, "formInstance" | "outsideVatScope">, any> & {
9
- WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
8
+ declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
9
+ forwardedRef?: React.Ref<any> | undefined;
10
+ } & React.RefAttributes<any>> & {
11
+ WrappedComponent: React.ComponentType<Props>;
10
12
  };
11
13
  export default _default;