@unimaze/billing 0.11.3 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/components/base-information/OrderReference.d.ts +12 -0
- package/lib/common/components/base-information/OrderReference.js +41 -0
- package/lib/common/components/base-information/ReferenceIdentifiers.d.ts +1 -10
- package/lib/common/components/base-information/ReferenceIdentifiers.js +78 -16
- package/lib/common/components/base-information/index.js +26 -36
- package/lib/common/components/billing-lines/BillingCalculations.js +11 -9
- package/lib/common/components/billing-lines/BillingTaxSummary.js +5 -4
- package/lib/common/components/billing-lines/NewBillingLines.js +91 -16
- package/lib/common/components/billing-lines/index.d.ts +6 -10
- package/lib/common/components/billing-lines/index.js +188 -195
- package/lib/common/components/form-item/index.d.ts +1 -1
- package/lib/common/components/form-item/index.js +1 -1
- package/lib/common/components/supplier/index.d.ts +1 -3
- package/lib/common/components/supplier/index.js +16 -5
- package/lib/common/types/BillingLineMetadataOverride.d.ts +3 -2
- package/lib/create-invoice/index.js +122 -69
- package/lib/style/index.css +4 -0
- package/lib/translations/locales/is.json +4 -2
- package/lib/translations/locales.d.ts +2 -0
- package/lib/utils/BillingLineUtility.d.ts +2 -2
- package/lib/utils/BillingLineUtility.js +5 -3
- package/lib/utils/ConversionUtility.d.ts +1 -1
- package/lib/utils/ConversionUtility.js +3 -2
- package/lib/utils/ReferenceIdentifierUtility.d.ts +2 -1
- package/lib/utils/ReferenceIdentifierUtility.js +1 -0
- package/lib/utils/RequirementsUtility.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { InjectedIntlProps } from "react-intl";
|
|
4
|
+
import { FormInstance } from "antd/es/form";
|
|
5
|
+
interface Props extends InjectedIntlProps {
|
|
6
|
+
receiverRequirements: NewReceiverRequirements;
|
|
7
|
+
formInstance: FormInstance;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.ComponentClass<Pick<Props, "formInstance" | "receiverRequirements">, any> & {
|
|
10
|
+
WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
|
|
11
|
+
};
|
|
12
|
+
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
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
6
|
+
if (mod && mod.__esModule) return mod;
|
|
7
|
+
var result = {};
|
|
8
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
9
|
+
result["default"] = mod;
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
var form_item_1 = __importDefault(require("../form-item"));
|
|
14
|
+
var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
|
|
15
|
+
var antd_1 = require("antd");
|
|
16
|
+
var React = __importStar(require("react"));
|
|
17
|
+
var react_intl_1 = require("react-intl");
|
|
18
|
+
var translationMessages = react_intl_1.defineMessages({
|
|
19
|
+
baseInformation_orderReferenceLabel: {
|
|
20
|
+
id: "baseInformation_orderReferenceLabel",
|
|
21
|
+
defaultMessage: "Order number"
|
|
22
|
+
},
|
|
23
|
+
baseInformation_orderReferenceLabel_helpText: {
|
|
24
|
+
id: "baseInformation_orderReferenceLabel_helpText",
|
|
25
|
+
defaultMessage: "Only use a reference to an actual order here. If no order exists, the buyer reference must be specified."
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
var getOrderReferenceFieldDefinitions = function (receiverRequirements) {
|
|
29
|
+
return receiverRequirements && receiverRequirements.fieldDefinitions.find(function (fieldRequirement) { return fieldRequirement.key === "orderReference.documentNo"; });
|
|
30
|
+
};
|
|
31
|
+
var OrderReference = function (props) {
|
|
32
|
+
if (getOrderReferenceFieldDefinitions(props.receiverRequirements)) {
|
|
33
|
+
var required = !(props.formInstance.getFieldValue(["invoice", "buyerReference"]));
|
|
34
|
+
return React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["orderReference.documentNo"], defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_orderReferenceLabel), defaultLabelTooltip: props.intl.formatMessage(translationMessages.baseInformation_orderReferenceLabel_helpText), defaultIsRequired: required, fieldName: ["invoice", "orderReference", "documentNo"] },
|
|
35
|
+
React.createElement(antd_1.Input, null));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.default = react_intl_1.injectIntl(OrderReference);
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { InjectedIntlProps } from "react-intl";
|
|
3
|
-
import { StoreValue } from "rc-field-form/lib/interface";
|
|
4
3
|
import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
|
|
5
4
|
import { FormInstance } from "antd/es/form";
|
|
6
|
-
interface FieldData {
|
|
7
|
-
name: number;
|
|
8
|
-
key: number;
|
|
9
|
-
fieldKey: number;
|
|
10
|
-
}
|
|
11
5
|
export declare const translationMessages: ReactIntl.Messages<"referenceIdentifiers_labels_addButton" | "referenceIdentifiers_labels_referenceIdentifier" | "referenceIdentifiers_labels_referenceIdentifier_title" | "referenceIdentifiers_labels_AKY" | "referenceIdentifiers_labels_ARR" | "referenceIdentifiers_labels_LOC">;
|
|
12
6
|
interface Props extends InjectedIntlProps {
|
|
13
|
-
fields: FieldData[];
|
|
14
|
-
add: (defaultValue?: StoreValue) => void;
|
|
15
|
-
remove: (index: number) => void;
|
|
16
7
|
receiverRequirements: NewReceiverRequirements;
|
|
17
8
|
formInstance: FormInstance;
|
|
18
9
|
updateReceiverRequirementsProp: (newReceiverRequirements: NewReceiverRequirements) => void;
|
|
@@ -21,7 +12,7 @@ interface Props extends InjectedIntlProps {
|
|
|
21
12
|
referenceIdentifiersLabelText?: string;
|
|
22
13
|
referenceIdentifiersHelpText?: string;
|
|
23
14
|
}
|
|
24
|
-
declare const _default: React.ComponentClass<Pick<Props, "
|
|
15
|
+
declare const _default: React.ComponentClass<Pick<Props, "formInstance" | "receiverRequirements" | "updateReceiverRequirementsProp" | "rapiBaseUrl" | "legalIdentifier" | "referenceIdentifiersLabelText" | "referenceIdentifiersHelpText">, any> & {
|
|
25
16
|
WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
|
|
26
17
|
};
|
|
27
18
|
export default _default;
|
|
@@ -65,7 +65,7 @@ var ReferenceIdentifiers = function (props) {
|
|
|
65
65
|
var referenceIdentifierLabelNode = (react_1.default.createElement(antd_1.Tooltip, { title: referenceIdentifiersHelp, placement: "right" },
|
|
66
66
|
react_1.default.createElement("span", null,
|
|
67
67
|
referenceIdentifiersLabel,
|
|
68
|
-
"
|
|
68
|
+
"\u00A0",
|
|
69
69
|
react_1.default.createElement(icons_1.QuestionCircleOutlined, null))));
|
|
70
70
|
var getReferenceIdentifier = function (receiverRequirements) {
|
|
71
71
|
var options = ReferenceIdentifierUtility_1.getReferenceIdentifierOptions(receiverRequirements);
|
|
@@ -120,7 +120,7 @@ var ReferenceIdentifiers = function (props) {
|
|
|
120
120
|
});
|
|
121
121
|
}, 500);
|
|
122
122
|
var getReferenceIdentifierValueFormItemInput = function (value, receiverRequirements, rapiBaseUrl, legalIdentifier, field) {
|
|
123
|
-
var fieldProps = __assign({}, field, { name: [field.name, "value"], fieldKey: [field.fieldKey, "value"], rules: [{ required: false }]
|
|
123
|
+
var fieldProps = __assign({}, field, { name: [field.name, "value"], fieldKey: [field.fieldKey, "value"], rules: [{ required: false }] });
|
|
124
124
|
if (value && value.key) {
|
|
125
125
|
var options = ReferenceIdentifierUtility_1.getReferenceIdentifierOptions(receiverRequirements);
|
|
126
126
|
var fieldDefinition_1 = options.find(function (el) { return el.key.endsWith(value.key); });
|
|
@@ -163,19 +163,81 @@ var ReferenceIdentifiers = function (props) {
|
|
|
163
163
|
return (react_1.default.createElement(antd_1.Form.Item, __assign({}, fieldProps),
|
|
164
164
|
react_1.default.createElement(antd_1.Input, { disabled: true })));
|
|
165
165
|
};
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
react_1.default.createElement(
|
|
179
|
-
|
|
166
|
+
var referenceIdentifiersDefinitions = ReferenceIdentifierUtility_1.getReferenceIdentifierFieldDefinitions(props.receiverRequirements);
|
|
167
|
+
var getSingleReferenceIdentifierInput = function () {
|
|
168
|
+
var fieldHandling = null;
|
|
169
|
+
var fieldDefinition = referenceIdentifiersDefinitions[0];
|
|
170
|
+
var singleReferenceIdentifierLabel = fieldDefinition.properties.label;
|
|
171
|
+
var singleReferenceIdentifiersHelp;
|
|
172
|
+
if (fieldDefinition.properties.hasOwnProperty("handling") && fieldDefinition.properties.handling) {
|
|
173
|
+
fieldHandling = JSON.parse(fieldDefinition.properties.handling);
|
|
174
|
+
singleReferenceIdentifiersHelp = fieldHandling.hasOwnProperty("helpText") ? fieldHandling.helpText : undefined;
|
|
175
|
+
}
|
|
176
|
+
var singleReferenceIdentifierLabelNode = singleReferenceIdentifiersHelp
|
|
177
|
+
? (react_1.default.createElement(antd_1.Tooltip, { title: singleReferenceIdentifiersHelp, placement: "right" },
|
|
178
|
+
react_1.default.createElement("span", null,
|
|
179
|
+
singleReferenceIdentifierLabel,
|
|
180
|
+
"\u00A0",
|
|
181
|
+
react_1.default.createElement(icons_1.QuestionCircleOutlined, null))))
|
|
182
|
+
: singleReferenceIdentifierLabel;
|
|
183
|
+
if (fieldHandling && fieldHandling.shouldBeValidated) {
|
|
184
|
+
return (react_1.default.createElement(antd_1.Form.Item, { name: ["invoice", "referenceIdentifiers", "0", "value"], label: singleReferenceIdentifierLabelNode, validateStatus: validateStatus, hasFeedback: true },
|
|
185
|
+
react_1.default.createElement(antd_1.Input, { onBlur: function (event) { return handleReferenceIdentifierValueValidation(props.legalIdentifier, fieldDefinition.name, event.currentTarget.value, props.rapiBaseUrl); } })));
|
|
186
|
+
}
|
|
187
|
+
if (fieldDefinition.properties.hasOwnProperty("values") && fieldDefinition.properties.values) {
|
|
188
|
+
var selectProps = fieldDefinition.properties.hasOwnProperty("href")
|
|
189
|
+
? {
|
|
190
|
+
showSearch: true,
|
|
191
|
+
filterOption: false,
|
|
192
|
+
onSearch: function (searchValue) {
|
|
193
|
+
handleReferenceIdentifierValueSearch(searchValue, __assign({}, fieldDefinition, { originalKey: fieldDefinition.key }), props.receiverRequirements, props.rapiBaseUrl);
|
|
194
|
+
},
|
|
195
|
+
loading: loadingReferenceIdentifierValues,
|
|
196
|
+
}
|
|
197
|
+
: {};
|
|
198
|
+
return (react_1.default.createElement(antd_1.Form.Item, { name: ["invoice", "referenceIdentifiers", "0", "value"], label: singleReferenceIdentifierLabel },
|
|
199
|
+
react_1.default.createElement(antd_1.Select, __assign({ dropdownMatchSelectWidth: false }, selectProps), fieldDefinition.properties.values.map(function (op) {
|
|
200
|
+
return react_1.default.createElement(antd_1.Select.Option, { key: op.key, value: op.key }, op.name);
|
|
201
|
+
}))));
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
return (react_1.default.createElement(antd_1.Form.Item, { name: ["invoice", "referenceIdentifiers", "0", "value"], label: singleReferenceIdentifierLabel },
|
|
205
|
+
react_1.default.createElement(antd_1.Input, null)));
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
if (referenceIdentifiersDefinitions.length === 0) {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
if (referenceIdentifiersDefinitions.length === 1) {
|
|
213
|
+
props.formInstance.setFieldsValue({
|
|
214
|
+
invoice: {
|
|
215
|
+
referenceIdentifiers: [
|
|
216
|
+
{
|
|
217
|
+
code: referenceIdentifiersDefinitions[0].key.replace("referenceIdentifier.", "")
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
return (getSingleReferenceIdentifierInput());
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return (react_1.default.createElement(antd_1.Form.List, { name: ["invoice", "referenceIdentifiers"] }, function (fields, _a) {
|
|
226
|
+
var add = _a.add, remove = _a.remove;
|
|
227
|
+
return (fields.map(function (field, index) {
|
|
228
|
+
return (react_1.default.createElement(antd_1.Form.Item, __assign({ key: "referenceIdentifier-" + index }, (index === 0 ? formLayout_1.formItemLayout : formLayout_1.formItemLayoutWithOutLabel), { label: index === 0 ? referenceIdentifierLabelNode : "" }),
|
|
229
|
+
react_1.default.createElement(antd_1.Row, { gutter: [16, 0] },
|
|
230
|
+
react_1.default.createElement(antd_1.Col, { span: 12 },
|
|
231
|
+
react_1.default.createElement(antd_1.Form.Item, __assign({}, field, { name: [field.name, "code"], fieldKey: [field.fieldKey, "code"], rules: [{ required: false }] }),
|
|
232
|
+
react_1.default.createElement(antd_1.Select, { labelInValue: true, allowClear: true, style: { width: "100%" }, dropdownMatchSelectWidth: false, onChange: function (a) {
|
|
233
|
+
var newState = referenceIdentifierValue.slice();
|
|
234
|
+
newState.splice(index, 1, a);
|
|
235
|
+
setReferenceIdentifierValue(newState);
|
|
236
|
+
setValidateStatus("");
|
|
237
|
+
props.formInstance.resetFields([["invoice", "referenceIdentifiers", index, "value"]]);
|
|
238
|
+
} }, getReferenceIdentifier(props.receiverRequirements)))),
|
|
239
|
+
react_1.default.createElement(antd_1.Col, { span: 12 }, getReferenceIdentifierValueFormItemInput(referenceIdentifierValue[index], props.receiverRequirements, props.rapiBaseUrl, props.legalIdentifier, field)))));
|
|
240
|
+
}));
|
|
241
|
+
}));
|
|
180
242
|
};
|
|
181
243
|
exports.default = react_intl_1.injectIntl(ReferenceIdentifiers);
|
|
@@ -19,6 +19,7 @@ var react_intl_1 = require("react-intl");
|
|
|
19
19
|
var ReferenceIdentifiers_1 = __importStar(require("./ReferenceIdentifiers"));
|
|
20
20
|
var icons_1 = require("@ant-design/icons");
|
|
21
21
|
var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
|
|
22
|
+
var OrderReference_1 = __importDefault(require("./OrderReference"));
|
|
22
23
|
var translationMessages = react_intl_1.defineMessages({
|
|
23
24
|
baseInformation_title: {
|
|
24
25
|
id: "baseInformation_title",
|
|
@@ -26,7 +27,7 @@ var translationMessages = react_intl_1.defineMessages({
|
|
|
26
27
|
},
|
|
27
28
|
baseInformation_invoiceNo: {
|
|
28
29
|
id: "baseInformation_invoiceNo",
|
|
29
|
-
defaultMessage: "Invoice
|
|
30
|
+
defaultMessage: "Invoice no.",
|
|
30
31
|
},
|
|
31
32
|
baseInformation_issueDate: {
|
|
32
33
|
id: "baseInformation_issueDate",
|
|
@@ -50,7 +51,7 @@ var translationMessages = react_intl_1.defineMessages({
|
|
|
50
51
|
},
|
|
51
52
|
baseInformation_buyerReferenceLabel_helpText: {
|
|
52
53
|
id: "baseInformation_buyerReferenceLabel_helpText",
|
|
53
|
-
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."
|
|
54
|
+
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."
|
|
54
55
|
},
|
|
55
56
|
baseInformation_notes: {
|
|
56
57
|
id: "baseInformation_notes",
|
|
@@ -98,54 +99,39 @@ var BaseInformation = function (props) {
|
|
|
98
99
|
var currencies = [
|
|
99
100
|
{
|
|
100
101
|
key: "ISK",
|
|
101
|
-
|
|
102
|
+
name: props.intl.formatMessage(translationMessages.baseInformation_currency_ISK)
|
|
102
103
|
},
|
|
103
104
|
{
|
|
104
105
|
key: "DKK",
|
|
105
|
-
|
|
106
|
+
name: props.intl.formatMessage(translationMessages.baseInformation_currency_DKK)
|
|
106
107
|
},
|
|
107
108
|
{
|
|
108
109
|
key: "NOK",
|
|
109
|
-
|
|
110
|
+
name: props.intl.formatMessage(translationMessages.baseInformation_currency_NOK)
|
|
110
111
|
},
|
|
111
112
|
{
|
|
112
113
|
key: "SEK",
|
|
113
|
-
|
|
114
|
+
name: props.intl.formatMessage(translationMessages.baseInformation_currency_SEK)
|
|
114
115
|
},
|
|
115
116
|
{
|
|
116
117
|
key: "EUR",
|
|
117
|
-
|
|
118
|
+
name: props.intl.formatMessage(translationMessages.baseInformation_currency_EUR)
|
|
118
119
|
},
|
|
119
120
|
{
|
|
120
121
|
key: "USD",
|
|
121
|
-
|
|
122
|
+
name: props.intl.formatMessage(translationMessages.baseInformation_currency_USD)
|
|
122
123
|
},
|
|
123
124
|
{
|
|
124
125
|
key: "GBP",
|
|
125
|
-
|
|
126
|
+
name: props.intl.formatMessage(translationMessages.baseInformation_currency_GBP)
|
|
126
127
|
},
|
|
127
128
|
];
|
|
128
|
-
// if (recRequirements.currencyCode && recRequirements.currencyCode.values && recRequirements.currencyCode.values.length > 0) {
|
|
129
|
-
// return recRequirements.currencyCode.values.map(currency => {
|
|
130
|
-
// return <Select.Option value={currency.key as string} title={currency.label}
|
|
131
|
-
// key={currency.key}>{currency.label}</Select.Option>
|
|
132
|
-
// })
|
|
133
|
-
// } else {
|
|
134
|
-
// return currencies.map(currency => {
|
|
135
|
-
// return <Select.Option value={currency.key as string} title={currency.label}
|
|
136
|
-
// key={currency.key}>{currency.label}</Select.Option>
|
|
137
|
-
// })
|
|
138
|
-
// }
|
|
139
129
|
var currencyCodeRequirements = RequirementsUtility_1.getFieldRequirements(recRequirements, ReceiverRequirements_1.AvailableFields.currencyCode);
|
|
140
130
|
if (currencyCodeRequirements && currencyCodeRequirements.properties && currencyCodeRequirements.properties.values && currencyCodeRequirements.properties.values.length > 0) {
|
|
141
|
-
return currencyCodeRequirements.properties.values
|
|
142
|
-
return React.createElement(antd_1.Select.Option, { value: currency.key, title: currency.name, key: currency.key }, currency.name);
|
|
143
|
-
});
|
|
131
|
+
return currencyCodeRequirements.properties.values;
|
|
144
132
|
}
|
|
145
133
|
else {
|
|
146
|
-
return currencies
|
|
147
|
-
return React.createElement(antd_1.Select.Option, { value: currency.key, title: currency.label, key: currency.key }, currency.label);
|
|
148
|
-
});
|
|
134
|
+
return currencies;
|
|
149
135
|
}
|
|
150
136
|
};
|
|
151
137
|
var disabledDate = function (dueDate, issueDate) {
|
|
@@ -162,18 +148,22 @@ var BaseInformation = function (props) {
|
|
|
162
148
|
var dueDateLabelNode = (React.createElement(antd_1.Tooltip, { title: props.intl.formatMessage(translationMessages.baseInformation_dueDate_title), placement: "right" },
|
|
163
149
|
React.createElement("span", null,
|
|
164
150
|
props.intl.formatMessage(translationMessages.baseInformation_dueDate),
|
|
165
|
-
"
|
|
151
|
+
"\u00A0",
|
|
166
152
|
React.createElement(icons_1.QuestionCircleOutlined, null))));
|
|
167
153
|
var issueDateLabelNode = (React.createElement(antd_1.Tooltip, { title: props.intl.formatMessage(translationMessages.baseInformation_issueDate_title), placement: "right" },
|
|
168
154
|
React.createElement("span", null,
|
|
169
155
|
props.intl.formatMessage(translationMessages.baseInformation_issueDate),
|
|
170
|
-
"
|
|
156
|
+
"\u00A0",
|
|
171
157
|
React.createElement(icons_1.QuestionCircleOutlined, null))));
|
|
172
158
|
var referenceIdentifierLabelNode = (React.createElement(antd_1.Tooltip, { title: props.intl.formatMessage(ReferenceIdentifiers_1.translationMessages.referenceIdentifiers_labels_referenceIdentifier_title), placement: "right" },
|
|
173
159
|
React.createElement("span", null,
|
|
174
160
|
props.intl.formatMessage(ReferenceIdentifiers_1.translationMessages.referenceIdentifiers_labels_referenceIdentifier),
|
|
175
|
-
"
|
|
161
|
+
"\u00A0",
|
|
176
162
|
React.createElement(icons_1.QuestionCircleOutlined, null))));
|
|
163
|
+
var onlyOneOption = function (receiverRequirements, fieldName) {
|
|
164
|
+
var a = RequirementsUtility_1.getFieldRequirements(receiverRequirements, fieldName);
|
|
165
|
+
return !!(a && a.properties && a.properties.values && a.properties.values.length === 1);
|
|
166
|
+
};
|
|
177
167
|
return (React.createElement(components_1.ComponentContainer, { title: props.intl.formatMessage(translationMessages.baseInformation_title) },
|
|
178
168
|
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"] },
|
|
179
169
|
React.createElement(antd_1.Input, null)),
|
|
@@ -193,16 +183,16 @@ var BaseInformation = function (props) {
|
|
|
193
183
|
},
|
|
194
184
|
] },
|
|
195
185
|
React.createElement(antd_1.DatePicker, { style: { width: "100%" }, format: "DD.MM.YYYY", onChange: checkIfEmpty, disabledDate: (function (current) { return disabledDate(current, props.form.getFieldValue(["invoice", "issueDate"])); }) })),
|
|
196
|
-
React.createElement(
|
|
186
|
+
React.createElement(OrderReference_1.default, { receiverRequirements: props.receiverRequirements, formInstance: props.form }),
|
|
187
|
+
React.createElement(form_item_1.default, { 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"] },
|
|
197
188
|
React.createElement(antd_1.Input, null)),
|
|
198
|
-
React.createElement(
|
|
199
|
-
var add = _a.add, remove = _a.remove;
|
|
200
|
-
return (React.createElement(ReferenceIdentifiers_1.default, { fields: fields, add: add, remove: remove, receiverRequirements: props.receiverRequirements, formInstance: props.form, updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, rapiBaseUrl: props.rapiBaseUrl, legalIdentifier: props.legalIdentifier, referenceIdentifiersLabelText: props.referenceIdentifiersLabelText, referenceIdentifiersHelpText: props.referenceIdentifiersHelpText }));
|
|
201
|
-
}),
|
|
189
|
+
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 }),
|
|
202
190
|
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"] },
|
|
203
191
|
React.createElement(antd_1.Input.TextArea, null)),
|
|
204
|
-
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"] },
|
|
205
|
-
React.createElement(antd_1.Select, { dropdownMatchSelectWidth: false }, getCurrencies(props.receiverRequirements))
|
|
192
|
+
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 },
|
|
193
|
+
React.createElement(antd_1.Select, { dropdownMatchSelectWidth: false, disabled: onlyOneOption(props.receiverRequirements, ReceiverRequirements_1.AvailableFields.currencyCode) }, getCurrencies(props.receiverRequirements).map(function (currency) {
|
|
194
|
+
return (React.createElement(antd_1.Select.Option, { value: currency.key, title: currency.name, key: currency.key }, currency.name));
|
|
195
|
+
})))));
|
|
206
196
|
};
|
|
207
197
|
var BaseInformationIntl = react_intl_1.injectIntl(BaseInformation);
|
|
208
198
|
exports.default = BaseInformationIntl;
|
|
@@ -41,15 +41,17 @@ var BillingCalculations = function (props) {
|
|
|
41
41
|
};
|
|
42
42
|
if (billingLinesMetadata) {
|
|
43
43
|
billingLinesMetadata.map(function (billingLine) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
if (billingLine) {
|
|
45
|
+
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
|
|
46
|
+
var taxableAmount = BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount);
|
|
47
|
+
var taxInclusiveAmount = taxableAmount + taxAmount;
|
|
48
|
+
totals = {
|
|
49
|
+
totalTaxAmount: totals.totalTaxAmount + taxAmount,
|
|
50
|
+
totalTaxableAmount: totals.totalTaxableAmount + taxableAmount,
|
|
51
|
+
totalTaxInclusiveAmount: totals.totalTaxInclusiveAmount + taxInclusiveAmount,
|
|
52
|
+
roundingAmount: Math.abs(totals.totalTaxInclusiveAmount + taxInclusiveAmount - Math.round(totals.totalTaxInclusiveAmount + taxInclusiveAmount))
|
|
53
|
+
};
|
|
54
|
+
}
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
57
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -47,14 +47,15 @@ var translationMessages = react_intl_1.defineMessages({
|
|
|
47
47
|
var BillingTaxSummary = function (props) {
|
|
48
48
|
var dataSource = props.billingLines
|
|
49
49
|
? props.billingLines.map(function (billingLine) {
|
|
50
|
-
var taxCategoryType = api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType
|
|
50
|
+
var taxCategoryType = billingLine.taxCategoryType ? api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType] : undefined;
|
|
51
51
|
var translationString = "taxCategoryType_labels_" + taxCategoryType;
|
|
52
|
-
var
|
|
53
|
-
|
|
52
|
+
var taxCategoryTypeTranslated = editable_cell_1.commonTranslationMessages.hasOwnProperty(translationString)
|
|
53
|
+
? props.intl.formatMessage(editable_cell_1.commonTranslationMessages[translationString])
|
|
54
|
+
: "";
|
|
54
55
|
return {
|
|
55
56
|
taxOverview: BillingLineUtility_1.generateTaxCategoryLabel(taxCategoryType, taxCategoryTypeTranslated),
|
|
56
57
|
taxableAmount: BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount),
|
|
57
|
-
taxAmount: BillingLineUtility_1.calculateTaxAmount(BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount), BillingLineUtility_1.calculateTaxPercentage(api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType
|
|
58
|
+
taxAmount: BillingLineUtility_1.calculateTaxAmount(BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount), BillingLineUtility_1.calculateTaxPercentage(billingLine.taxCategoryType ? api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType] : undefined))
|
|
58
59
|
};
|
|
59
60
|
})
|
|
60
61
|
: [];
|
|
@@ -23,11 +23,57 @@ var form_item_1 = __importDefault(require("../form-item"));
|
|
|
23
23
|
var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
|
|
24
24
|
var BillingLineUtility_1 = require("../../../utils/BillingLineUtility");
|
|
25
25
|
var mapi_1 = require("@unimaze/api-clients/lib/mapi");
|
|
26
|
+
var editable_cell_1 = require("../editable-cell");
|
|
27
|
+
var IntlUtility_1 = require("../../../utils/IntlUtility");
|
|
26
28
|
var translationMessages = react_intl_1.defineMessages({
|
|
27
29
|
billingLines_labels_addButton: {
|
|
28
30
|
id: "billingLines_labels_addButton",
|
|
29
31
|
defaultMessage: "Add new line",
|
|
30
32
|
},
|
|
33
|
+
billingLines_itemNo: {
|
|
34
|
+
id: "billingLines_itemNo",
|
|
35
|
+
defaultMessage: "Item no",
|
|
36
|
+
},
|
|
37
|
+
billingLines_name: {
|
|
38
|
+
id: "billingLines_name",
|
|
39
|
+
defaultMessage: "Name"
|
|
40
|
+
},
|
|
41
|
+
billingLines_quantity: {
|
|
42
|
+
id: "billingLines_quantity",
|
|
43
|
+
defaultMessage: "Quantity"
|
|
44
|
+
},
|
|
45
|
+
billingLines_unitOfMeasure: {
|
|
46
|
+
id: "billingLines_unitOfMeasure",
|
|
47
|
+
defaultMessage: "Unit of measure"
|
|
48
|
+
},
|
|
49
|
+
billingLines_unitPriceAmount: {
|
|
50
|
+
id: "billingLines_unitPriceAmount",
|
|
51
|
+
defaultMessage: "Unit price"
|
|
52
|
+
},
|
|
53
|
+
billingLines_taxCategoryType: {
|
|
54
|
+
id: "billingLines_taxCategoryType",
|
|
55
|
+
defaultMessage: "Tax category"
|
|
56
|
+
},
|
|
57
|
+
billingLines_taxCategoryType_title: {
|
|
58
|
+
id: "billingLines_taxCategoryType_title",
|
|
59
|
+
defaultMessage: "A product can not contain VAT unless a VAT number is present" // Ekki er hægt að leggja virðisauka á vöru nema gefa upp VSK númer
|
|
60
|
+
},
|
|
61
|
+
billingLines_taxCategoryPercentage: {
|
|
62
|
+
id: "billingLines_taxCategoryPercentage",
|
|
63
|
+
defaultMessage: "Tax percentage"
|
|
64
|
+
},
|
|
65
|
+
billingLines_discount: {
|
|
66
|
+
id: "billingLines_discount",
|
|
67
|
+
defaultMessage: "Discount"
|
|
68
|
+
},
|
|
69
|
+
billingLines_lineAmount: {
|
|
70
|
+
id: "billingLines_lineAmount",
|
|
71
|
+
defaultMessage: "Amount"
|
|
72
|
+
},
|
|
73
|
+
billingLines_taxAmount: {
|
|
74
|
+
id: "billingLines_taxAmount",
|
|
75
|
+
defaultMessage: "Tax inclusive amount"
|
|
76
|
+
},
|
|
31
77
|
});
|
|
32
78
|
var BillingLines = function (props) {
|
|
33
79
|
return (react_1.default.createElement(antd_1.Form.List, { name: ["invoice", "invoiceLines"] }, function (fields, _a) {
|
|
@@ -35,32 +81,61 @@ var BillingLines = function (props) {
|
|
|
35
81
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
36
82
|
fields.map(function (field, index) {
|
|
37
83
|
var taxCatType = null;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
84
|
+
var getTaxableAmount = function () {
|
|
85
|
+
var fieldValues = props.formInstance.getFieldsValue([["invoice", "invoiceLines", field.name]]);
|
|
86
|
+
if (fieldValues && fieldValues.invoice && fieldValues.invoice.invoiceLines && fieldValues.invoice.invoiceLines[field.name]) {
|
|
87
|
+
var _a = fieldValues.invoice.invoiceLines[field.name], discountValue = _a.discountValue, quantity = _a.quantity, unitPriceAmount = _a.unitPriceAmount;
|
|
88
|
+
var taxableAmount = BillingLineUtility_1.calculateTaxableAmount(discountValue, quantity, unitPriceAmount);
|
|
89
|
+
props.formInstance.setFields([
|
|
90
|
+
{
|
|
91
|
+
name: ["invoice", "invoiceLines", field.name, "taxableAmount"],
|
|
92
|
+
value: taxableAmount
|
|
93
|
+
}
|
|
94
|
+
]);
|
|
95
|
+
return taxableAmount;
|
|
96
|
+
}
|
|
97
|
+
return 0;
|
|
98
|
+
};
|
|
99
|
+
var getTaxInclusiveAmount = function () {
|
|
100
|
+
var fieldValues = props.formInstance.getFieldsValue([["invoice", "invoiceLines", field.name]]);
|
|
101
|
+
if (fieldValues && fieldValues.invoice && fieldValues.invoice.invoiceLines && fieldValues.invoice.invoiceLines[field.name]) {
|
|
102
|
+
var _a = fieldValues.invoice.invoiceLines[field.name], taxCategoryType = _a.taxCategoryType, taxableAmount = _a.taxableAmount;
|
|
103
|
+
var taxPercentage = BillingLineUtility_1.calculateTaxPercentage(taxCategoryType);
|
|
104
|
+
return taxableAmount + BillingLineUtility_1.calculateTaxAmount(taxableAmount, taxPercentage);
|
|
105
|
+
}
|
|
106
|
+
return 0;
|
|
107
|
+
};
|
|
108
|
+
return (react_1.default.createElement(antd_1.Row, { gutter: [8, 0], justify: "space-between", align: "bottom", key: index.toString() },
|
|
41
109
|
react_1.default.createElement(antd_1.Col, { span: 2 },
|
|
42
|
-
react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.
|
|
110
|
+
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(translationMessages.billingLines_itemNo), verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, BillingLineUtility_1.getCorrectInputNode("itemNo"))),
|
|
111
|
+
react_1.default.createElement(antd_1.Col, { span: 3 },
|
|
112
|
+
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(translationMessages.billingLines_name), verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, BillingLineUtility_1.getCorrectInputNode("name"))),
|
|
43
113
|
react_1.default.createElement(antd_1.Col, { span: 2 },
|
|
44
|
-
react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.quantity"], defaultIsRequired: true, fieldName: [field.name, "quantity"], defaultLabel:
|
|
114
|
+
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(translationMessages.billingLines_quantity), verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, BillingLineUtility_1.getCorrectInputNode("quantity"))),
|
|
115
|
+
react_1.default.createElement(antd_1.Col, { span: 3 },
|
|
116
|
+
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(translationMessages.billingLines_unitOfMeasure), verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, BillingLineUtility_1.getCorrectInputNode("unitOfMeasure"))),
|
|
45
117
|
react_1.default.createElement(antd_1.Col, { span: 2 },
|
|
46
|
-
react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.
|
|
47
|
-
react_1.default.createElement(antd_1.Col, { span:
|
|
48
|
-
react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.
|
|
49
|
-
|
|
50
|
-
|
|
118
|
+
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(translationMessages.billingLines_unitPriceAmount), verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, BillingLineUtility_1.getCorrectInputNode("unitPriceAmount"))),
|
|
119
|
+
react_1.default.createElement(antd_1.Col, { span: 3 },
|
|
120
|
+
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"], initialValue: mapi_1.TaxCategoryTypeEnum.OutsideTaxScope, defaultLabel: react_1.default.createElement(antd_1.Tooltip, { title: props.intl.formatMessage(translationMessages.billingLines_taxCategoryType_title), placement: "right" },
|
|
121
|
+
react_1.default.createElement("span", null,
|
|
122
|
+
props.intl.formatMessage(translationMessages.billingLines_taxCategoryType),
|
|
123
|
+
"\u00A0",
|
|
124
|
+
react_1.default.createElement(icons_1.QuestionCircleOutlined, null))), verticalLabels: true, onlyLabelOnFirstInList: true, index: index },
|
|
51
125
|
react_1.default.createElement(antd_1.Select, { onChange: function (value) {
|
|
52
126
|
// console.log("valueChanged", value);
|
|
53
127
|
taxCatType = value;
|
|
54
128
|
}, dropdownMatchSelectWidth: false }, Object.keys(mapi_1.TaxCategoryTypeEnum).map(function (taxCategoryType) {
|
|
55
|
-
|
|
129
|
+
var taxPercentage = BillingLineUtility_1.calculateTaxPercentage(mapi_1.TaxCategoryTypeEnum[taxCategoryType]);
|
|
130
|
+
return (react_1.default.createElement(antd_1.Select.Option, { value: taxCategoryType, title: taxCategoryType, key: taxCategoryType }, props.intl.formatMessage(editable_cell_1.commonTranslationMessages["taxCategoryType_labels_" + taxCategoryType]) + " (" + taxPercentage + "%)"));
|
|
56
131
|
})))),
|
|
57
132
|
react_1.default.createElement(antd_1.Col, { span: 2 },
|
|
58
|
-
react_1.default.createElement("
|
|
59
|
-
react_1.default.createElement(antd_1.Col, { span: 2 },
|
|
60
|
-
react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.discountValue"], defaultIsRequired: true, fieldName: [field.name, "discountValue"], defaultLabel: "Discount value", verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, BillingLineUtility_1.getCorrectInputNode("discountValue"))),
|
|
61
|
-
react_1.default.createElement(antd_1.Col, { span: 2 },
|
|
62
|
-
react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.taxableAmount"], defaultIsRequired: true, fieldName: [field.name, "taxableAmount"], defaultLabel: "Amount", verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, BillingLineUtility_1.getCorrectInputNode("taxableAmount"))),
|
|
133
|
+
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(translationMessages.billingLines_discount), verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, BillingLineUtility_1.getCorrectInputNode("discountValue"))),
|
|
63
134
|
react_1.default.createElement(antd_1.Col, { span: 2 },
|
|
135
|
+
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(translationMessages.billingLines_lineAmount), verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(getTaxableAmount(), props.intl))),
|
|
136
|
+
react_1.default.createElement(antd_1.Col, { span: 3 },
|
|
137
|
+
react_1.default.createElement(form_item_1.default, { className: "umz_noValidationMessage", receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["invoiceLines.taxAmount"], defaultIsRequired: false, fieldName: [field.name, "taxAmount"], defaultLabel: props.intl.formatMessage(translationMessages.billingLines_taxAmount), verticalLabels: true, onlyLabelOnFirstInList: true, index: index }, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(getTaxInclusiveAmount(), props.intl))),
|
|
138
|
+
react_1.default.createElement(antd_1.Col, { span: 1 },
|
|
64
139
|
react_1.default.createElement(icons_1.MinusCircleOutlined, { style: { marginBottom: "22px" }, onClick: function () {
|
|
65
140
|
remove(field.name);
|
|
66
141
|
} }))));
|
|
@@ -2,7 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { InjectedIntlProps } from "react-intl";
|
|
3
3
|
import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOverride";
|
|
4
4
|
import { FormInstance } from "antd/es/form";
|
|
5
|
-
import { TaxCategoryTypeEnum, Units
|
|
5
|
+
import { TaxCategoryTypeEnum, Units } from "@unimaze/api-clients/lib/mapi/api";
|
|
6
|
+
import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
|
|
6
7
|
export interface TaxCategoryTypeWithPercentageEnum {
|
|
7
8
|
value: TaxCategoryTypeEnum;
|
|
8
9
|
label: string;
|
|
@@ -13,16 +14,11 @@ export interface UnitOfMeasureLabelInValueEnum {
|
|
|
13
14
|
}
|
|
14
15
|
interface Props extends InjectedIntlProps {
|
|
15
16
|
formInstance: FormInstance;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
handleDelete: (index: number) => void;
|
|
19
|
-
handleAdd: (billingLineToAdd: BillingLineMetadataOverride) => void;
|
|
20
|
-
handleSave: (row: BillingLineMetadataOverride, formInstance: FormInstance) => void;
|
|
21
|
-
initialBillingLineData: BillingLineMetadataOverride;
|
|
22
|
-
editableIndex: number;
|
|
17
|
+
billingLinesMetadata: BillingLineMetadataOverride[] | undefined;
|
|
18
|
+
receiverRequirements: NewReceiverRequirements;
|
|
23
19
|
}
|
|
24
|
-
export declare const translationMessages: ReactIntl.Messages<"billingLines_title" | "billingLines_tooltip_title" | "
|
|
25
|
-
declare const BillingLinesIntl: React.ComponentClass<Pick<Props, "
|
|
20
|
+
export declare const translationMessages: ReactIntl.Messages<"billingLines_title" | "billingLines_tooltip_title" | "billingLines_button_addRow" | "billingLines_placeholders_itemNo" | "billingLines_placeholders_newItem">;
|
|
21
|
+
declare const BillingLinesIntl: React.ComponentClass<Pick<Props, "formInstance" | "receiverRequirements" | "billingLinesMetadata">, any> & {
|
|
26
22
|
WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
|
|
27
23
|
};
|
|
28
24
|
export default BillingLinesIntl;
|