@unimaze/billing 0.16.0 → 0.17.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.
- package/lib/common/components/base-information/ReferenceIdentifiers.js +32 -34
- package/lib/create-invoice/index.js +7 -2
- package/lib/style/index.css +50 -50
- package/lib/translations/locales/is.json +1 -0
- package/lib/translations/locales.d.ts +1 -0
- package/lib/utils/ConversionUtility.js +8 -1
- package/package.json +1 -1
|
@@ -199,8 +199,8 @@ var ReferenceIdentifiers = function (props) {
|
|
|
199
199
|
react_1.default.createElement(icons_1.QuestionCircleOutlined, null))))
|
|
200
200
|
: singleReferenceIdentifierLabel;
|
|
201
201
|
if (fieldHandling && fieldHandling.shouldBeValidated) {
|
|
202
|
-
return (react_1.default.createElement(antd_1.Form.Item, { name: ["invoice", "
|
|
203
|
-
react_1.default.createElement(antd_1.Input, { onBlur: function (event) { return handleReferenceIdentifierValueValidation(props.legalIdentifier, fieldDefinition.name, event.currentTarget.value, props.rapiBaseUrl, ["invoice", "
|
|
202
|
+
return (react_1.default.createElement(antd_1.Form.Item, { name: ["invoice", "singleReferenceIdentifier", "value"], label: singleReferenceIdentifierLabelNode, validateStatus: props.referenceIdentifierValidateStatus, hasFeedback: true },
|
|
203
|
+
react_1.default.createElement(antd_1.Input, { onBlur: function (event) { return handleReferenceIdentifierValueValidation(props.legalIdentifier, fieldDefinition.name, event.currentTarget.value, props.rapiBaseUrl, ["invoice", "singleReferenceIdentifier", "value"], props.setReferenceIdentifierValidateStatus); } })));
|
|
204
204
|
}
|
|
205
205
|
if (fieldDefinition.properties.hasOwnProperty("values") && fieldDefinition.properties.values) {
|
|
206
206
|
var selectProps = fieldDefinition.properties.hasOwnProperty("href")
|
|
@@ -213,51 +213,49 @@ var ReferenceIdentifiers = function (props) {
|
|
|
213
213
|
loading: loadingReferenceIdentifierValues,
|
|
214
214
|
}
|
|
215
215
|
: {};
|
|
216
|
-
return (react_1.default.createElement(antd_1.Form.Item, { name: ["invoice", "
|
|
216
|
+
return (react_1.default.createElement(antd_1.Form.Item, { name: ["invoice", "singleReferenceIdentifier", "value"], label: singleReferenceIdentifierLabel },
|
|
217
217
|
react_1.default.createElement(antd_1.Select, __assign({ dropdownMatchSelectWidth: false }, selectProps), fieldDefinition.properties.values.map(function (op) {
|
|
218
218
|
return react_1.default.createElement(antd_1.Select.Option, { key: op.key, value: op.key }, op.name);
|
|
219
219
|
}))));
|
|
220
220
|
}
|
|
221
221
|
else {
|
|
222
|
-
return (react_1.default.createElement(antd_1.Form.Item, { name: ["invoice", "
|
|
222
|
+
return (react_1.default.createElement(antd_1.Form.Item, { name: ["invoice", "singleReferenceIdentifier", "value"], label: singleReferenceIdentifierLabel },
|
|
223
223
|
react_1.default.createElement(antd_1.Input, null)));
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
226
|
if (referenceIdentifiersDefinitions.length === 0) {
|
|
227
227
|
return null;
|
|
228
228
|
}
|
|
229
|
-
else {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
{
|
|
235
|
-
code: referenceIdentifiersDefinitions[0].key.replace("referenceIdentifier.", "")
|
|
236
|
-
}
|
|
237
|
-
]
|
|
229
|
+
else if (referenceIdentifiersDefinitions.length === 1) {
|
|
230
|
+
props.formInstance.setFieldsValue({
|
|
231
|
+
invoice: {
|
|
232
|
+
singleReferenceIdentifier: {
|
|
233
|
+
code: referenceIdentifiersDefinitions[0].key.replace("referenceIdentifier.", "")
|
|
238
234
|
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
return (getSingleReferenceIdentifierInput());
|
|
242
238
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
return (
|
|
247
|
-
react_1.default.createElement(antd_1.
|
|
248
|
-
react_1.default.createElement(antd_1.
|
|
249
|
-
react_1.default.createElement(antd_1.
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
239
|
+
else {
|
|
240
|
+
return (react_1.default.createElement(antd_1.Form.List, { name: ["invoice", "referenceIdentifiers"] }, function (fields, _a) {
|
|
241
|
+
var add = _a.add, remove = _a.remove;
|
|
242
|
+
return (fields.map(function (field, index) {
|
|
243
|
+
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 : "" }),
|
|
244
|
+
react_1.default.createElement(antd_1.Row, { gutter: [16, 0] },
|
|
245
|
+
react_1.default.createElement(antd_1.Col, { span: 12 },
|
|
246
|
+
react_1.default.createElement(antd_1.Form.Item, __assign({}, field, { name: [field.name, "code"],
|
|
247
|
+
// fieldKey={[field.fieldKey, "code"]}
|
|
248
|
+
rules: [{ required: false }] }),
|
|
249
|
+
react_1.default.createElement(antd_1.Select, { labelInValue: true, allowClear: true, style: { width: "100%" }, dropdownMatchSelectWidth: false, onChange: function (a) {
|
|
250
|
+
var newState = referenceIdentifierValue.slice();
|
|
251
|
+
newState.splice(index, 1, a);
|
|
252
|
+
setReferenceIdentifierValue(newState);
|
|
253
|
+
props.setReferenceIdentifierValidateStatus("");
|
|
254
|
+
props.formInstance.resetFields([["invoice", "referenceIdentifiers", index, "value"]]);
|
|
255
|
+
} }, getReferenceIdentifier(props.receiverRequirements)))),
|
|
256
|
+
react_1.default.createElement(antd_1.Col, { span: 12 }, getReferenceIdentifierValueFormItemInput(referenceIdentifierValue[index], props.receiverRequirements, props.rapiBaseUrl, props.legalIdentifier, field, props.referenceIdentifierValidateStatus, props.setReferenceIdentifierValidateStatus)))));
|
|
257
|
+
}));
|
|
260
258
|
}));
|
|
261
|
-
}
|
|
259
|
+
}
|
|
262
260
|
};
|
|
263
261
|
exports.default = react_intl_1.injectIntl(ReferenceIdentifiers);
|
|
@@ -137,11 +137,11 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
137
137
|
react_1.useEffect(function () {
|
|
138
138
|
if (supplierEmailValue) {
|
|
139
139
|
form.validateFields([["invoice", "supplier", "contact", "electronicMail"]])
|
|
140
|
-
.then(function (
|
|
140
|
+
.then(function () {
|
|
141
141
|
setSendCopyDisabled(!supplierEmailValue);
|
|
142
142
|
setSendCopy(true);
|
|
143
143
|
})
|
|
144
|
-
.catch(function (
|
|
144
|
+
.catch(function () {
|
|
145
145
|
setSendCopyDisabled(true);
|
|
146
146
|
setSendCopy(false);
|
|
147
147
|
});
|
|
@@ -362,6 +362,9 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
362
362
|
referenceIdentifiers: [
|
|
363
363
|
{}
|
|
364
364
|
],
|
|
365
|
+
singleReferenceIdentifier: {
|
|
366
|
+
code: undefined
|
|
367
|
+
},
|
|
365
368
|
invoiceLines: [{}],
|
|
366
369
|
attachments: {
|
|
367
370
|
file1: { file: undefined, description: undefined },
|
|
@@ -372,6 +375,8 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
372
375
|
} }),
|
|
373
376
|
react_1.default.createElement(antd_1.Row, { gutter: [16, 16] },
|
|
374
377
|
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 8 } },
|
|
378
|
+
react_1.default.createElement(antd_1.Form.Item, { noStyle: true, name: ["invoice", "singleReferenceIdentifier", "code"] },
|
|
379
|
+
react_1.default.createElement(antd_1.Input, { type: "hidden" })),
|
|
375
380
|
react_1.default.createElement(components_1.Supplier, { receiverRequirements: props.receiverRequirements,
|
|
376
381
|
// billingLinesDataSource={billingLinesDataSource}
|
|
377
382
|
rapiBaseUrl: props.rapiBaseUrl, rapiApiKey: props.rapiApiKey, form: form, outsideVatScope: outsideVatScope, setOutsideVatScope: setOutsideVatScope })),
|
package/lib/style/index.css
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
.component_header {
|
|
2
|
-
height: 3.3em;
|
|
3
|
-
background-color: #fff;
|
|
4
|
-
border-bottom: solid 1px #d9d9d9;
|
|
5
|
-
border-radius: 4px 4px 0 0;
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-content: space-between;
|
|
9
|
-
padding: 1em 2em;
|
|
10
|
-
}
|
|
11
|
-
.component_header_title {
|
|
12
|
-
font-size: 1.1em;
|
|
13
|
-
}
|
|
14
|
-
.component_header_title > span > i {
|
|
15
|
-
font-size: 20px;
|
|
16
|
-
}
|
|
17
|
-
.header_icon {
|
|
18
|
-
font-size: 1.5em;
|
|
19
|
-
margin-right: 0.75em;
|
|
20
|
-
color: #1890ff;
|
|
21
|
-
}
|
|
22
|
-
.header_right {
|
|
23
|
-
display: flex;
|
|
24
|
-
justify-content: flex-end;
|
|
25
|
-
}
|
|
26
|
-
@media screen and (max-width: 768px) {
|
|
27
|
-
.header_right {
|
|
28
|
-
justify-content: flex-start;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
.header_right > button {
|
|
32
|
-
margin-bottom: unset !important;
|
|
33
|
-
}
|
|
34
|
-
.component_body {
|
|
35
|
-
border-radius: 0 0 4px 4px;
|
|
36
|
-
}
|
|
37
|
-
.component_wrapper {
|
|
38
|
-
align-self: stretch;
|
|
39
|
-
height: 100%;
|
|
40
|
-
background-color: #fff;
|
|
41
|
-
border: solid 1px #d9d9d9;
|
|
42
|
-
border-radius: 4px;
|
|
43
|
-
}
|
|
44
|
-
.component_wrapper_padding {
|
|
45
|
-
padding: 1em;
|
|
46
|
-
}
|
|
47
|
-
.umz_noValidationMessage .ant-form-item-explain {
|
|
48
|
-
height: 20px !important;
|
|
49
|
-
visibility: hidden !important;
|
|
50
|
-
}
|
|
1
|
+
.component_header {
|
|
2
|
+
height: 3.3em;
|
|
3
|
+
background-color: #fff;
|
|
4
|
+
border-bottom: solid 1px #d9d9d9;
|
|
5
|
+
border-radius: 4px 4px 0 0;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
padding: 1em 2em;
|
|
10
|
+
}
|
|
11
|
+
.component_header_title {
|
|
12
|
+
font-size: 1.1em;
|
|
13
|
+
}
|
|
14
|
+
.component_header_title > span > i {
|
|
15
|
+
font-size: 20px;
|
|
16
|
+
}
|
|
17
|
+
.header_icon {
|
|
18
|
+
font-size: 1.5em;
|
|
19
|
+
margin-right: 0.75em;
|
|
20
|
+
color: #1890ff;
|
|
21
|
+
}
|
|
22
|
+
.header_right {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
}
|
|
26
|
+
@media screen and (max-width: 768px) {
|
|
27
|
+
.header_right {
|
|
28
|
+
justify-content: flex-start;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.header_right > button {
|
|
32
|
+
margin-bottom: unset !important;
|
|
33
|
+
}
|
|
34
|
+
.component_body {
|
|
35
|
+
border-radius: 0 0 4px 4px;
|
|
36
|
+
}
|
|
37
|
+
.component_wrapper {
|
|
38
|
+
align-self: stretch;
|
|
39
|
+
height: 100%;
|
|
40
|
+
background-color: #fff;
|
|
41
|
+
border: solid 1px #d9d9d9;
|
|
42
|
+
border-radius: 4px;
|
|
43
|
+
}
|
|
44
|
+
.component_wrapper_padding {
|
|
45
|
+
padding: 1em;
|
|
46
|
+
}
|
|
47
|
+
.umz_noValidationMessage .ant-form-item-explain {
|
|
48
|
+
height: 20px !important;
|
|
49
|
+
visibility: hidden !important;
|
|
50
|
+
}
|
|
51
51
|
/*# sourceMappingURL=index.css.map */
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"baseInformation_costCenter": "Kostnaðarstöð",
|
|
25
25
|
"baseInformation_accountingCostLabel": "Bókunarlykill",
|
|
26
26
|
"baseInformation_accountingCostLabel_helpText": "Bókunarlykill er kóti gefinn upp af kaupanda, gegnum tölvupóst eða síma eða fenginn beint úr pöntun sem tengist þessum reikningi",
|
|
27
|
+
"baseInformation_projectReferenceLabel": "Verknúmer",
|
|
27
28
|
"billingCalculations_labels_TaxAmountWithoutVat": "Samtals án VSK",
|
|
28
29
|
"billingCalculations_labels_TotalVatAmount": "Samtals VSK upphæð",
|
|
29
30
|
"billingCalculations_labels_TotalAmountWithVat": "Samtals með VSK",
|
|
@@ -26,6 +26,7 @@ declare const _default: {
|
|
|
26
26
|
"baseInformation_costCenter": string;
|
|
27
27
|
"baseInformation_accountingCostLabel": string;
|
|
28
28
|
"baseInformation_accountingCostLabel_helpText": string;
|
|
29
|
+
"baseInformation_projectReferenceLabel": string;
|
|
29
30
|
"billingCalculations_labels_TaxAmountWithoutVat": string;
|
|
30
31
|
"billingCalculations_labels_TotalVatAmount": string;
|
|
31
32
|
"billingCalculations_labels_TotalAmountWithVat": string;
|
|
@@ -48,7 +48,14 @@ var cleanIdentifier = function (identifier) {
|
|
|
48
48
|
var convertToInvoiceMetadataInput = function (formValues, invoiceLinesWithCalculations, paymentMethod, chosenCustomer) {
|
|
49
49
|
var issueDate = convertDates(formValues.invoice.issueDate);
|
|
50
50
|
var dueDate = convertDates(formValues.invoice.dueDate);
|
|
51
|
-
var referenceIdentifiersArray = formValues.invoice.
|
|
51
|
+
var referenceIdentifiersArray = formValues.invoice && formValues.invoice.singleReferenceIdentifier && formValues.invoice.singleReferenceIdentifier.code
|
|
52
|
+
? [{
|
|
53
|
+
code: {
|
|
54
|
+
value: formValues.invoice.singleReferenceIdentifier.code
|
|
55
|
+
},
|
|
56
|
+
value: formValues.invoice.singleReferenceIdentifier.value
|
|
57
|
+
}]
|
|
58
|
+
: formValues.invoice.referenceIdentifiers;
|
|
52
59
|
var cleanedFormValues = removeEmpty(formValues);
|
|
53
60
|
var invoice = cleanedFormValues.invoice;
|
|
54
61
|
// fix delivery
|