@unimaze/billing 0.2.8-rc.0 → 0.2.9
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/attachments/index.js +9 -2
- package/lib/common/components/base-information/ReferenceIdentifiers.js +10 -6
- package/lib/common/components/base-information/index.js +19 -6
- package/lib/common/components/billing-lines/BillingTaxSummary.js +16 -1
- package/lib/common/components/billing-lines/index.js +16 -5
- package/lib/common/components/component-container/Header.d.ts +1 -1
- package/lib/common/components/component-container/index.d.ts +1 -1
- package/lib/common/components/customer/index.js +9 -1
- package/lib/common/components/supplier/index.js +13 -6
- package/lib/common/types/ReceiverRequirements.js +1 -1
- package/lib/create-invoice/index.js +39 -32
- package/lib/src/common/components/component-container/Header.d.ts +1 -1
- package/lib/src/common/components/component-container/index.d.ts +1 -1
- package/lib/src/common/components/form-item/index.d.ts +1 -1
- package/lib/src/translations/locales.d.ts +1 -0
- package/lib/translations/locales/is.json +1 -0
- package/lib/translations/locales.d.ts +1 -0
- package/lib/utils/ConversionUtility.js +2 -1
- package/package.json +1 -1
|
@@ -15,6 +15,7 @@ var components_1 = require("../../components");
|
|
|
15
15
|
var Attachment_1 = __importDefault(require("./Attachment"));
|
|
16
16
|
var react_intl_1 = require("react-intl");
|
|
17
17
|
var antd_1 = require("antd");
|
|
18
|
+
var icons_1 = require("@ant-design/icons");
|
|
18
19
|
var translationMessages = react_intl_1.defineMessages({
|
|
19
20
|
attachment_title: {
|
|
20
21
|
id: "attachment.title",
|
|
@@ -22,9 +23,15 @@ var translationMessages = react_intl_1.defineMessages({
|
|
|
22
23
|
},
|
|
23
24
|
});
|
|
24
25
|
var AttachmentsGroup = function (props) {
|
|
25
|
-
|
|
26
|
+
var attachmentLabelNode = (React.createElement(antd_1.Tooltip
|
|
26
27
|
// props.intl.formatMessage(translationMessages.attachment_title)}
|
|
27
|
-
|
|
28
|
+
, {
|
|
29
|
+
// props.intl.formatMessage(translationMessages.attachment_title)}
|
|
30
|
+
title: "Hámarks stærð er ??MB. Fylgigögn reiknings geta verið afrit af upprunalega reikningnum eða fylgigögn, svo sem tímaskýrslur", placement: "right" },
|
|
31
|
+
React.createElement("span", null,
|
|
32
|
+
"Vi\u00F0hengi ",
|
|
33
|
+
React.createElement(icons_1.QuestionCircleOutlined, null))));
|
|
34
|
+
return (React.createElement(components_1.ComponentContainer, { title: attachmentLabelNode },
|
|
28
35
|
React.createElement(antd_1.Row, null,
|
|
29
36
|
React.createElement(antd_1.Col, { span: 24 },
|
|
30
37
|
React.createElement(Attachment_1.default, { key: "attachment1", fieldName: "file1" })),
|
|
@@ -30,10 +30,16 @@ var translationMessages = react_intl_1.defineMessages({
|
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
32
|
var ReferenceIdentifiers = function (props) {
|
|
33
|
+
var referenceIdentifierLabelNode = (react_1.default.createElement(antd_1.Tooltip
|
|
34
|
+
// props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_referenceIdentifier)
|
|
35
|
+
, {
|
|
36
|
+
// props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_referenceIdentifier)
|
|
37
|
+
title: "Númer er á við tjónið sem um ræðir (bílnúmer, fasteignanúmer eða kennitala)", placement: "right" },
|
|
38
|
+
react_1.default.createElement("span", null,
|
|
39
|
+
"Tilv\u00EDsunarn\u00FAmer ",
|
|
40
|
+
react_1.default.createElement(icons_1.QuestionCircleOutlined, null))));
|
|
33
41
|
return (react_1.default.createElement("div", null,
|
|
34
|
-
props.fields.map(function (field, index) { return (react_1.default.createElement(antd_1.Form.Item, __assign({ key: "referenceIdentifier-" + index }, (index === 0 ? formLayout_1.formItemLayout : formLayout_1.formItemLayoutWithOutLabel), {
|
|
35
|
-
// props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_referenceIdentifier)
|
|
36
|
-
label: index === 0 ? "Tilvísunarnúmer" : "" }),
|
|
42
|
+
props.fields.map(function (field, index) { 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 : "" }),
|
|
37
43
|
react_1.default.createElement(antd_1.Space, { key: field.key, style: { display: "flex", marginBottom: 0 }, align: "start" },
|
|
38
44
|
react_1.default.createElement(antd_1.Form.Item, __assign({}, field, { name: [field.name, "code"], fieldKey: [field.fieldKey, "code"], rules: [{ required: true }] }),
|
|
39
45
|
react_1.default.createElement(antd_1.Select, { labelInValue: true, style: { width: "150px" } },
|
|
@@ -45,9 +51,7 @@ var ReferenceIdentifiers = function (props) {
|
|
|
45
51
|
react_1.default.createElement(icons_1.MinusCircleOutlined, { onClick: function () {
|
|
46
52
|
props.remove(field.name);
|
|
47
53
|
} })))); }),
|
|
48
|
-
react_1.default.createElement(antd_1.Form.Item, __assign({}, (props.fields.length === 0 ? formLayout_1.formItemLayout : formLayout_1.formItemLayoutWithOutLabel), {
|
|
49
|
-
// props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_referenceIdentifier)
|
|
50
|
-
label: props.fields.length === 0 ? "Tilvísunarnúmer" : "" }),
|
|
54
|
+
react_1.default.createElement(antd_1.Form.Item, __assign({}, (props.fields.length === 0 ? formLayout_1.formItemLayout : formLayout_1.formItemLayoutWithOutLabel), { label: props.fields.length === 0 ? referenceIdentifierLabelNode : "" }),
|
|
51
55
|
react_1.default.createElement(antd_1.Button, { type: "dashed", onClick: function () {
|
|
52
56
|
props.add();
|
|
53
57
|
}, style: { width: "100%" } },
|
|
@@ -18,6 +18,7 @@ var form_item_1 = __importDefault(require("../form-item"));
|
|
|
18
18
|
var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
|
|
19
19
|
var react_intl_1 = require("react-intl");
|
|
20
20
|
var ReferenceIdentifiers_1 = __importDefault(require("./ReferenceIdentifiers"));
|
|
21
|
+
var icons_1 = require("@ant-design/icons");
|
|
21
22
|
var translationMessages = react_intl_1.defineMessages({
|
|
22
23
|
baseInformation_title: {
|
|
23
24
|
id: "baseInformation_title",
|
|
@@ -103,6 +104,22 @@ var BaseInformation = function (props) {
|
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
106
|
};
|
|
107
|
+
var dueDateLabelNode = (React.createElement(antd_1.Tooltip
|
|
108
|
+
// props.intl.formatMessage(translationMessages.baseInformation_dueDate)
|
|
109
|
+
, {
|
|
110
|
+
// props.intl.formatMessage(translationMessages.baseInformation_dueDate)
|
|
111
|
+
title: "Eindagi skal vera sá sami og gjalddagi", placement: "right" },
|
|
112
|
+
React.createElement("span", null,
|
|
113
|
+
"Gjalddagi ",
|
|
114
|
+
React.createElement(icons_1.QuestionCircleOutlined, null))));
|
|
115
|
+
var issueDateLabelNode = (React.createElement(antd_1.Tooltip
|
|
116
|
+
// props.intl.formatMessage(translationMessages.baseInformation_issueDate)
|
|
117
|
+
, {
|
|
118
|
+
// props.intl.formatMessage(translationMessages.baseInformation_issueDate)
|
|
119
|
+
title: "Útgáfudagsetning stjórnar á hvaða uppgjörstímabili færslan skráist", placement: "right" },
|
|
120
|
+
React.createElement("span", null,
|
|
121
|
+
"\u00DAtg\u00E1fudags. ",
|
|
122
|
+
React.createElement(icons_1.QuestionCircleOutlined, null))));
|
|
106
123
|
return (
|
|
107
124
|
// props.intl.formatMessage(translationMessages.baseInformation_title)
|
|
108
125
|
React.createElement(components_1.ComponentContainer, { title: "Grunnupplýsingar" },
|
|
@@ -118,17 +135,13 @@ var BaseInformation = function (props) {
|
|
|
118
135
|
// // receiverRequirements={receiverRequirementsObject}
|
|
119
136
|
, {
|
|
120
137
|
// // receiverRequirements={receiverRequirementsObject}
|
|
121
|
-
receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.issueDate,
|
|
122
|
-
// props.intl.formatMessage(translationMessages.baseInformation_issueDate)
|
|
123
|
-
defaultLabel: "Útgáfudags.", defaultIsRequired: true, fieldName: ["invoice", "issueDate"] },
|
|
138
|
+
receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.issueDate, defaultLabel: issueDateLabelNode, defaultIsRequired: true, fieldName: ["invoice", "issueDate"] },
|
|
124
139
|
React.createElement(antd_1.DatePicker, null)),
|
|
125
140
|
React.createElement(form_item_1.default
|
|
126
141
|
// // receiverRequirements={receiverRequirementsObject}
|
|
127
142
|
, {
|
|
128
143
|
// // receiverRequirements={receiverRequirementsObject}
|
|
129
|
-
receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.dueDate,
|
|
130
|
-
// props.intl.formatMessage(translationMessages.baseInformation_dueDate)
|
|
131
|
-
defaultLabel: "Gjalddagi", defaultIsRequired: false, fieldName: ["invoice", "dueDate"], additionalRules: [
|
|
144
|
+
receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.dueDate, defaultLabel: dueDateLabelNode, defaultIsRequired: false, fieldName: ["invoice", "dueDate"], additionalRules: [
|
|
132
145
|
{
|
|
133
146
|
validator: (function (rule, value, callback) {
|
|
134
147
|
if (!value) {
|
|
@@ -32,6 +32,21 @@ var BillingTaxSummary = function (props) {
|
|
|
32
32
|
};
|
|
33
33
|
})
|
|
34
34
|
: [];
|
|
35
|
+
var hlpArray = dataSource ? dataSource.slice() : [];
|
|
36
|
+
var helper = {};
|
|
37
|
+
var result = hlpArray.reduce(function (r, o) {
|
|
38
|
+
var key = o.taxOverview;
|
|
39
|
+
if (!helper[key]) {
|
|
40
|
+
helper[key] = Object.assign({}, o); // create a copy of o
|
|
41
|
+
r.push(helper[key]);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
helper[key].taxAmount += o.taxAmount;
|
|
45
|
+
helper[key].taxableAmount += o.taxableAmount;
|
|
46
|
+
}
|
|
47
|
+
return r;
|
|
48
|
+
}, []);
|
|
49
|
+
// console.log(result);
|
|
35
50
|
var columns = [
|
|
36
51
|
{
|
|
37
52
|
title: "Skattsyfirlit",
|
|
@@ -48,6 +63,6 @@ var BillingTaxSummary = function (props) {
|
|
|
48
63
|
];
|
|
49
64
|
return (react_1.default.createElement(antd_1.Table, { style: { minHeight: "170px" },
|
|
50
65
|
// showHeader={false}
|
|
51
|
-
columns: columns, dataSource:
|
|
66
|
+
columns: columns, dataSource: result, pagination: false, rowKey: (function (record, index) { return index.toString(); }) }));
|
|
52
67
|
};
|
|
53
68
|
exports.default = react_intl_1.injectIntl(BillingTaxSummary);
|
|
@@ -132,7 +132,14 @@ var BillingLines = /** @class */ (function (_super) {
|
|
|
132
132
|
align: "right",
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
|
-
title:
|
|
135
|
+
title: (React.createElement(antd_1.Tooltip
|
|
136
|
+
// this.props.intl.formatMessage(translationMessages.billingLines_taxCategoryType)
|
|
137
|
+
, {
|
|
138
|
+
// this.props.intl.formatMessage(translationMessages.billingLines_taxCategoryType)
|
|
139
|
+
title: " Ekki er hægt að leggja virðisauka á vöru nema gefa upp VSK númer", placement: "right" },
|
|
140
|
+
React.createElement("span", null,
|
|
141
|
+
"Skattflokkur ",
|
|
142
|
+
React.createElement(icons_1.QuestionCircleOutlined, null)))),
|
|
136
143
|
dataIndex: 'taxCategoryType',
|
|
137
144
|
editable: true,
|
|
138
145
|
},
|
|
@@ -177,10 +184,10 @@ var BillingLines = /** @class */ (function (_super) {
|
|
|
177
184
|
},
|
|
178
185
|
{
|
|
179
186
|
title: "",
|
|
180
|
-
render: function (text, record
|
|
187
|
+
render: function (text, record) {
|
|
181
188
|
return React.createElement(React.Fragment, null,
|
|
182
189
|
React.createElement(icons_1.MinusCircleOutlined, { onClick: function () {
|
|
183
|
-
_this.props.handleDelete(
|
|
190
|
+
_this.props.handleDelete(record.key);
|
|
184
191
|
} }));
|
|
185
192
|
}
|
|
186
193
|
}
|
|
@@ -210,11 +217,15 @@ var BillingLines = /** @class */ (function (_super) {
|
|
|
210
217
|
handleSave: function (billingLineMetadataOverrideRecord, rowIndex) { return _this.props.handleSave(billingLineMetadataOverrideRecord, _this.props.formInstance); },
|
|
211
218
|
}); } });
|
|
212
219
|
});
|
|
213
|
-
|
|
220
|
+
var billingLinesLabelNode = (React.createElement(antd_1.Tooltip
|
|
214
221
|
// this.props.intl.formatMessage(translationMessages.billingLines_title)
|
|
215
222
|
, {
|
|
216
223
|
// this.props.intl.formatMessage(translationMessages.billingLines_title)
|
|
217
|
-
title: "
|
|
224
|
+
title: "Hér þarf að skilgreina Vörunr, Nafn, Fjölda, Mælieiningu, Verð pr. einingu og upphæð. Virðisauki reiknast sjálfkrafa. Smelltu á \"Bæta við röð\" til þess að bæta við vörulínu", placement: "right" },
|
|
225
|
+
React.createElement("span", null,
|
|
226
|
+
"Reikningsl\u00EDnur ",
|
|
227
|
+
React.createElement(icons_1.QuestionCircleOutlined, null))));
|
|
228
|
+
return (React.createElement(components_1.ComponentContainer, { title: billingLinesLabelNode },
|
|
218
229
|
React.createElement(antd_1.Table, {
|
|
219
230
|
// style={{minHeight: "170px"}}
|
|
220
231
|
components: components, dataSource: dataSource, columns: columns, pagination: false, rowKey: (function (record, index) { return index.toString(); }) }),
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { IconProps } from "@ant-design/compatible/es/icon";
|
|
3
3
|
interface HeaderProps {
|
|
4
4
|
iconProps?: IconProps;
|
|
5
|
-
title?: string;
|
|
5
|
+
title?: string | React.ReactNode;
|
|
6
6
|
action?: React.ReactNode;
|
|
7
7
|
}
|
|
8
8
|
declare const Header: React.FC<HeaderProps>;
|
|
@@ -27,6 +27,10 @@ var translationMessages = react_intl_1.defineMessages({
|
|
|
27
27
|
id: "customer_title",
|
|
28
28
|
defaultMessage: "Customer",
|
|
29
29
|
},
|
|
30
|
+
customer_selectTheCustomer: {
|
|
31
|
+
id: "customer_selectTheCustomer",
|
|
32
|
+
defaultMessage: "Select the customer",
|
|
33
|
+
},
|
|
30
34
|
customer_name: {
|
|
31
35
|
id: "customer_name",
|
|
32
36
|
defaultMessage: "Name",
|
|
@@ -72,7 +76,11 @@ var Customer = function (props) {
|
|
|
72
76
|
return (
|
|
73
77
|
// props.intl.formatMessage(translationMessages.customer_title)
|
|
74
78
|
react_1.default.createElement(components_1.ComponentContainer, { title: "Viðskiptavinur" },
|
|
75
|
-
react_1.default.createElement(form_item_1.default
|
|
79
|
+
react_1.default.createElement(form_item_1.default
|
|
80
|
+
// defaultLabel={"Select the customer"}
|
|
81
|
+
, {
|
|
82
|
+
// defaultLabel={"Select the customer"}
|
|
83
|
+
defaultLabel: "Veldu viðskiptavin", defaultIsRequired: true, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.identifier"], fieldName: ["invoice", "customer", "name"] },
|
|
76
84
|
react_1.default.createElement(antd_1.Select, { onChange: function (value) {
|
|
77
85
|
onCustomerChange(value);
|
|
78
86
|
} }, props.customers.map(function (customer, index) { return (react_1.default.createElement(antd_1.Select.Option, { key: index, value: index }, customer.name)); }))),
|
|
@@ -17,6 +17,7 @@ var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
|
|
|
17
17
|
var form_item_1 = __importDefault(require("../form-item"));
|
|
18
18
|
var react_intl_1 = require("react-intl");
|
|
19
19
|
var models_1 = require("@unimaze/api-clients/lib/mapi/models");
|
|
20
|
+
var icons_1 = require("@ant-design/icons");
|
|
20
21
|
// import {defineMessages} from "react-intl.macro"
|
|
21
22
|
var translationMessages = react_intl_1.defineMessages({
|
|
22
23
|
supplier_title: {
|
|
@@ -65,6 +66,14 @@ var translationMessages = react_intl_1.defineMessages({
|
|
|
65
66
|
}
|
|
66
67
|
});
|
|
67
68
|
var Supplier = function (props) {
|
|
69
|
+
var electronicMailLabelNode = (React.createElement(antd_1.Tooltip
|
|
70
|
+
// props.intl.formatMessage(translationMessages.supplier_contact_email)
|
|
71
|
+
, {
|
|
72
|
+
// props.intl.formatMessage(translationMessages.supplier_contact_email)
|
|
73
|
+
title: "Send verður greiðslutilkynning á þetta netfang", placement: "right" },
|
|
74
|
+
React.createElement("span", null,
|
|
75
|
+
"Netfang ",
|
|
76
|
+
React.createElement(icons_1.QuestionCircleOutlined, null))));
|
|
68
77
|
return (
|
|
69
78
|
// props.intl.formatMessage(translationMessages.supplier_title)
|
|
70
79
|
React.createElement(components_1.ComponentContainer, { title: "Birgi" },
|
|
@@ -92,9 +101,9 @@ var Supplier = function (props) {
|
|
|
92
101
|
// props.intl.formatMessage(translationMessages.supplier_vatNumber)
|
|
93
102
|
defaultLabel: "VSK nr.", defaultIsRequired: true, fieldName: ["invoice", "supplier", "vatNumber"], additionalRules: [
|
|
94
103
|
{
|
|
95
|
-
required: props.billingLinesDataSource.some(function (billingLine) { return (
|
|
96
|
-
// message: "VAT number is required if some document lines are using any tax category type other than Exempt
|
|
97
|
-
message: "
|
|
104
|
+
required: props.billingLinesDataSource.some(function (billingLine) { return (billingLine.taxCategoryType !== models_1.BillingLineMetadataTaxCategoryTypeEnum.Exempt); }),
|
|
105
|
+
// message: "VAT number is required if some document lines are using any tax category type other than Exempt"
|
|
106
|
+
message: ""
|
|
98
107
|
}
|
|
99
108
|
] },
|
|
100
109
|
React.createElement(antd_1.Input, null)),
|
|
@@ -134,9 +143,7 @@ var Supplier = function (props) {
|
|
|
134
143
|
// receiverRequirements={receiverRequirementsObject}
|
|
135
144
|
, {
|
|
136
145
|
// receiverRequirements={receiverRequirementsObject}
|
|
137
|
-
receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["supplier.contact.electronicMail"],
|
|
138
|
-
// props.intl.formatMessage(translationMessages.supplier_contact_email)
|
|
139
|
-
defaultLabel: "Netfang", defaultIsRequired: false, fieldName: ["invoice", "supplier", "contact", "electronicMail"], additionalRules: [
|
|
146
|
+
receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["supplier.contact.electronicMail"], defaultLabel: electronicMailLabelNode, defaultIsRequired: false, fieldName: ["invoice", "supplier", "contact", "electronicMail"], additionalRules: [
|
|
140
147
|
{
|
|
141
148
|
type: 'email',
|
|
142
149
|
message: "Þetta er ekki gilt netfang",
|
|
@@ -42,8 +42,9 @@ var paymentMethodForConversion_1 = require("../common/components/payment-method/
|
|
|
42
42
|
var CreateInvoice = function (props) {
|
|
43
43
|
// const [submitInvoiceRequest, setSubmitInvoiceRequest] = React.useState<CreateSubmitInvoiceRequest>();
|
|
44
44
|
var form = antd_1.Form.useForm()[0];
|
|
45
|
-
var _a = react_1.useState(
|
|
46
|
-
var _b = react_1.useState(
|
|
45
|
+
var _a = react_1.useState(false), submitting = _a[0], setSubmitting = _a[1];
|
|
46
|
+
var _b = react_1.useState(/*profileOutputToPartyMetadata(props.customers[0])*/ undefined), chosenCustomer = _b[0], setChosenCustomer = _b[1];
|
|
47
|
+
var _c = react_1.useState(1), billingLinesEditableIndex = _c[0], setBillingLinesEditableIndex = _c[1];
|
|
47
48
|
var initialBillingLineData = {
|
|
48
49
|
key: billingLinesEditableIndex,
|
|
49
50
|
itemNo: "Item No.",
|
|
@@ -57,7 +58,7 @@ var CreateInvoice = function (props) {
|
|
|
57
58
|
taxableAmount: 0,
|
|
58
59
|
taxPercentage: null
|
|
59
60
|
};
|
|
60
|
-
var
|
|
61
|
+
var _d = react_1.useState([__assign({}, initialBillingLineData, { key: 0 })]), billingLinesDataSource = _d[0], setBillingLinesDataSource = _d[1];
|
|
61
62
|
// BILLING LINES
|
|
62
63
|
var handleBillingLinesDelete = function (index) {
|
|
63
64
|
var newDataSource = billingLinesDataSource.slice();
|
|
@@ -91,6 +92,7 @@ var CreateInvoice = function (props) {
|
|
|
91
92
|
});
|
|
92
93
|
};
|
|
93
94
|
var handleSubmit = function (values) {
|
|
95
|
+
setSubmitting(true);
|
|
94
96
|
var attachments = [
|
|
95
97
|
values.attachments.file1 && values.attachments.file1,
|
|
96
98
|
values.attachments.file2 && values.attachments.file2,
|
|
@@ -129,16 +131,20 @@ var CreateInvoice = function (props) {
|
|
|
129
131
|
more: attachments.length > 0,
|
|
130
132
|
name: nextFileDescription // nextFile.name,
|
|
131
133
|
};
|
|
134
|
+
setSubmitting(true);
|
|
132
135
|
utils_1.submitDocument(nextFile, createAttachDocument, props.mapiBaseUrl, props.apiKey)
|
|
133
136
|
.then(function (submitDocumentResponse) {
|
|
134
137
|
antd_1.message.success("successfully uploaded attachment " + nextFileDescription);
|
|
138
|
+
setSubmitting(false);
|
|
135
139
|
});
|
|
136
140
|
};
|
|
137
141
|
while (attachments.length > 0) {
|
|
138
142
|
_loop_1();
|
|
139
143
|
}
|
|
144
|
+
setSubmitting(false);
|
|
140
145
|
form.resetFields();
|
|
141
146
|
// Clear the billing line dataSource
|
|
147
|
+
setChosenCustomer(undefined);
|
|
142
148
|
setBillingLinesDataSource([__assign({}, initialBillingLineData, { key: 0 })]);
|
|
143
149
|
setBillingLinesEditableIndex(0);
|
|
144
150
|
})
|
|
@@ -157,36 +163,37 @@ var CreateInvoice = function (props) {
|
|
|
157
163
|
}
|
|
158
164
|
};
|
|
159
165
|
return (react_1.default.createElement(antd_1.ConfigProvider, { locale: setLocale(props.language), componentSize: "small" },
|
|
160
|
-
react_1.default.createElement(antd_1.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
166
|
+
react_1.default.createElement(antd_1.Spin, { spinning: submitting },
|
|
167
|
+
react_1.default.createElement(antd_1.Form, __assign({}, formLayout_1.formItemLayout, { form: form, onFinish: handleSubmit, initialValues: {
|
|
168
|
+
invoice: {
|
|
169
|
+
currencyCode: "ISK",
|
|
170
|
+
supplier: {
|
|
171
|
+
address: {
|
|
172
|
+
countryCode: "IS"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
customer: {
|
|
176
|
+
address: {
|
|
177
|
+
countryCode: "IS"
|
|
178
|
+
}
|
|
171
179
|
}
|
|
172
180
|
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
react_1.default.createElement(
|
|
178
|
-
|
|
179
|
-
react_1.default.createElement(
|
|
180
|
-
|
|
181
|
-
react_1.default.createElement(
|
|
182
|
-
|
|
183
|
-
react_1.default.createElement(
|
|
184
|
-
|
|
185
|
-
react_1.default.createElement(
|
|
186
|
-
|
|
187
|
-
react_1.default.createElement(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
react_1.default.createElement(antd_1.Button, { type: "primary", htmlType: "submit", size: "large" }, "Senda")))))));
|
|
181
|
+
} }),
|
|
182
|
+
react_1.default.createElement(antd_1.Row, { gutter: [16, 16] },
|
|
183
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 } },
|
|
184
|
+
react_1.default.createElement(components_1.Supplier, { billingLinesDataSource: billingLinesDataSource })),
|
|
185
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 } },
|
|
186
|
+
react_1.default.createElement(components_1.Customer, { formInstance: form, customers: props.customers, chosenCustomer: chosenCustomer, setChosenCustomer: setChosenCustomer })),
|
|
187
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 } },
|
|
188
|
+
react_1.default.createElement(components_1.BillingLines, { setBillingLineMetadata: handleSetBillingLineMetadata, formInstance: form, dataSource: billingLinesDataSource, editableIndex: billingLinesEditableIndex, handleAdd: handleBillingLinesAdd, initialBillingLineData: initialBillingLineData, handleDelete: handleBillingLinesDelete, handleSave: handleBillingLinesSave })),
|
|
189
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 8 } },
|
|
190
|
+
react_1.default.createElement(components_1.BaseInformation, { form: form, documentType: "invoice" })),
|
|
191
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 8 } },
|
|
192
|
+
react_1.default.createElement(components_1.PaymentMethod, null)),
|
|
193
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 8 } },
|
|
194
|
+
react_1.default.createElement(components_1.Attachments /*handleAddFile={handleAddFile}*/, null)),
|
|
195
|
+
react_1.default.createElement(antd_1.Row, { style: { width: "100%", padding: "8px" }, justify: "end" },
|
|
196
|
+
react_1.default.createElement(antd_1.Col, null,
|
|
197
|
+
react_1.default.createElement(antd_1.Button, { type: "primary", htmlType: "submit", size: "large" }, "Senda"))))))));
|
|
191
198
|
};
|
|
192
199
|
exports.default = CreateInvoice;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { IconProps } from "@ant-design/compatible/es/icon";
|
|
3
3
|
interface HeaderProps {
|
|
4
4
|
iconProps?: IconProps;
|
|
5
|
-
title?: string;
|
|
5
|
+
title?: string | React.ReactNode;
|
|
6
6
|
action?: React.ReactNode;
|
|
7
7
|
}
|
|
8
8
|
declare const Header: React.FC<HeaderProps>;
|
|
@@ -17,7 +17,7 @@ interface Props extends InjectedIntlProps {
|
|
|
17
17
|
onlyLabelOnFirstInList?: boolean;
|
|
18
18
|
index?: number;
|
|
19
19
|
}
|
|
20
|
-
declare const _default: React.ComponentClass<Pick<Props, "style" | "initialValue" | "
|
|
20
|
+
declare const _default: React.ComponentClass<Pick<Props, "style" | "initialValue" | "receiverRequirementsKey" | "defaultLabel" | "defaultIsRequired" | "fieldName" | "additionalRules" | "verticalLabels" | "onlyLabelOnFirstInList" | "index">, any> & {
|
|
21
21
|
WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
|
|
22
22
|
};
|
|
23
23
|
export default _default;
|
|
@@ -62,6 +62,7 @@ declare const _default: {
|
|
|
62
62
|
"supplier_contact_name": string;
|
|
63
63
|
"supplier_notValidEmail": string;
|
|
64
64
|
"customer_title": string;
|
|
65
|
+
"customer_selectTheCustomer": string;
|
|
65
66
|
"customer_name": string;
|
|
66
67
|
"customer_identifier": string;
|
|
67
68
|
"customer_address_streetNameAndNumber": string;
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"supplier_contact_name": "Nafn tengiliðs",
|
|
61
61
|
"supplier_notValidEmail": "Þetta er ekki gilt netfang",
|
|
62
62
|
"customer_title": "Viðskiptavinur",
|
|
63
|
+
"customer_selectTheCustomer": "Veldu viðskiptavini",
|
|
63
64
|
"customer_name": "Nafn viðskiptavinar",
|
|
64
65
|
"customer_identifier": "Kennitala",
|
|
65
66
|
"customer_address_streetNameAndNumber": "Heimilisfang",
|
|
@@ -62,6 +62,7 @@ declare const _default: {
|
|
|
62
62
|
"supplier_contact_name": string;
|
|
63
63
|
"supplier_notValidEmail": string;
|
|
64
64
|
"customer_title": string;
|
|
65
|
+
"customer_selectTheCustomer": string;
|
|
65
66
|
"customer_name": string;
|
|
66
67
|
"customer_identifier": string;
|
|
67
68
|
"customer_address_streetNameAndNumber": string;
|
|
@@ -79,6 +79,7 @@ var convertToInvoiceMetadataInput = function (formValues, billingLines, paymentM
|
|
|
79
79
|
fallbackContactName: partyMetadata.name
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
+
var vatNumber = invoice.supplier.vatNumber ? invoice.supplier.vatNumber : "N/A";
|
|
82
83
|
var resp = {
|
|
83
84
|
messageHandling: getMessageHandling(chosenCustomer),
|
|
84
85
|
invoice: {
|
|
@@ -104,7 +105,7 @@ var convertToInvoiceMetadataInput = function (formValues, billingLines, paymentM
|
|
|
104
105
|
city: invoice.supplier.address.city,
|
|
105
106
|
countryCode: invoice.supplier.address.countryCode,
|
|
106
107
|
},
|
|
107
|
-
vatNumber:
|
|
108
|
+
vatNumber: vatNumber,
|
|
108
109
|
name: invoice.supplier.name,
|
|
109
110
|
contact: {
|
|
110
111
|
electronicMail: invoice.supplier.contact.electronicMail,
|