@unimaze/billing 0.1.0 → 0.1.2-rc.10
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/README.md +11 -3
- package/lib/common/components/attachments/Attachment.d.ts +8 -2
- package/lib/common/components/attachments/Attachment.js +33 -8
- package/lib/common/components/attachments/index.d.ts +9 -2
- package/lib/common/components/attachments/index.js +15 -6
- package/lib/common/components/base-information/ReferenceIdentifiers.d.ts +6 -0
- package/lib/common/components/base-information/ReferenceIdentifiers.js +40 -0
- package/lib/common/components/base-information/index.d.ts +6 -3
- package/lib/common/components/base-information/index.js +100 -81
- package/lib/common/components/billing-lines/BillingCalculations.d.ts +11 -0
- package/lib/common/components/billing-lines/BillingCalculations.js +61 -0
- package/lib/common/components/billing-lines/BillingTaxSummary.d.ts +10 -0
- package/lib/common/components/billing-lines/BillingTaxSummary.js +51 -0
- package/lib/common/components/billing-lines/billingLIneFormData.d.ts +7 -0
- package/lib/common/components/billing-lines/billingLIneFormData.js +63 -0
- package/lib/common/components/billing-lines/index.d.ts +10 -24
- package/lib/common/components/billing-lines/index.js +117 -39
- package/lib/common/components/customer/hardCoddedCustomer.d.ts +7 -0
- package/lib/common/components/{issuer/index.js → customer/hardCoddedCustomer.js} +5 -8
- package/lib/common/components/customer/index.d.ts +6 -0
- package/lib/common/components/customer/index.js +93 -0
- package/lib/common/components/delivery-location/index.d.ts +5 -2
- package/lib/common/components/delivery-location/index.js +43 -11
- package/lib/common/components/editable-cell/index.d.ts +1 -1
- package/lib/common/components/editable-cell/index.js +77 -11
- package/lib/common/components/editable-row/index.d.ts +5 -5
- package/lib/common/components/editable-row/index.js +8 -6
- package/lib/common/components/form-item/index.d.ts +21 -0
- package/lib/common/components/form-item/index.js +27 -0
- package/lib/common/components/index.d.ts +10 -5
- package/lib/common/components/index.js +20 -8
- package/lib/common/components/locale-intl/index.d.ts +10 -0
- package/lib/common/components/locale-intl/index.js +45 -0
- package/lib/common/components/payment-method/index.d.ts +6 -3
- package/lib/common/components/payment-method/index.js +67 -27
- package/lib/common/components/supplier/index.d.ts +6 -0
- package/lib/common/components/supplier/index.js +93 -0
- package/lib/common/consts/validationRules.d.ts +2 -3
- package/lib/common/consts/validationRules.js +1 -8
- package/lib/common/enums/index.d.ts +1 -1
- package/lib/common/enums/index.js +2 -4
- package/lib/common/types/BillingLineMetadataOverride.d.ts +2 -1
- package/lib/common/types/ReceiverRequirements.d.ts +81 -0
- package/lib/common/types/ReceiverRequirements.js +379 -0
- package/lib/create-credit-note/index.d.ts +2 -3
- package/lib/create-credit-note/index.js +17 -28
- package/lib/create-invoice/index.d.ts +1 -2
- package/lib/create-invoice/index.js +79 -21
- package/lib/example/src/index.d.ts +1 -1
- package/lib/index.d.ts +2 -3
- package/lib/index.js +8 -5
- package/lib/src/common/components/attachments/Attachment.d.ts +21 -0
- package/lib/src/common/components/attachments/index.d.ts +10 -0
- package/lib/src/common/components/base-information/ReferenceIdentifiers.d.ts +6 -0
- package/lib/src/common/components/base-information/index.d.ts +12 -0
- package/lib/src/common/components/billing-lines/BillingCalculations.d.ts +11 -0
- package/lib/src/common/components/billing-lines/BillingTaxSummary.d.ts +10 -0
- package/lib/src/common/components/billing-lines/billingLIneFormData.d.ts +7 -0
- package/lib/src/common/components/billing-lines/index.d.ts +13 -0
- package/lib/src/common/components/component-container/Content.d.ts +7 -0
- package/lib/src/common/components/component-container/Header.d.ts +9 -0
- package/lib/src/common/components/component-container/index.d.ts +10 -0
- package/lib/src/common/components/customer/index.d.ts +6 -0
- package/lib/src/common/components/delivery-location/index.d.ts +6 -0
- package/lib/src/common/components/editable-cell/index.d.ts +11 -0
- package/lib/src/common/components/editable-row/index.d.ts +6 -0
- package/lib/src/common/components/form-item/index.d.ts +21 -0
- package/lib/src/common/components/index.d.ts +10 -0
- package/lib/src/common/components/locale-intl/index.d.ts +10 -0
- package/lib/src/common/components/payment-method/index.d.ts +6 -0
- package/lib/src/common/components/supplier/index.d.ts +6 -0
- package/lib/src/common/consts/validationRules.d.ts +6 -0
- package/lib/src/common/types/ReceiverRequirements.d.ts +81 -0
- package/lib/src/create-invoice/index.d.ts +14 -0
- package/lib/src/translations/locales.d.ts +74 -0
- package/lib/src/utils/ApiUtility.d.ts +21 -0
- package/lib/src/utils/BillingLineUtility.d.ts +8 -0
- package/lib/src/utils/ConversionUtility.d.ts +5 -0
- package/lib/src/utils/RequirementsUtility.d.ts +5 -0
- package/lib/src/utils/billingLineFormData.d.ts +7 -0
- package/lib/src/utils/index.d.ts +2 -0
- package/lib/style/index.css +0 -1222
- package/lib/translations/locales/is.json +70 -0
- package/lib/translations/locales.d.ts +74 -0
- package/lib/translations/locales.js +10 -0
- package/lib/utils/ApiUtility.d.ts +21 -0
- package/lib/utils/ApiUtility.js +59 -0
- package/lib/utils/BillingLineUtility.d.ts +8 -0
- package/lib/utils/BillingLineUtility.js +66 -0
- package/lib/utils/ConversionUtility.d.ts +5 -0
- package/lib/utils/ConversionUtility.js +146 -0
- package/lib/utils/RequirementsUtility.d.ts +5 -0
- package/lib/utils/RequirementsUtility.js +23 -0
- package/lib/utils/billingLineFormData.d.ts +7 -0
- package/lib/utils/billingLineFormData.js +63 -0
- package/lib/utils/index.d.ts +2 -5
- package/lib/utils/index.js +5 -162
- package/package.json +22 -7
- package/lib/common/components/issuer/index.d.ts +0 -7
- package/lib/common/components/payer/index.d.ts +0 -3
- package/lib/common/components/payer/index.js +0 -50
|
@@ -1,27 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import '@ant-design/compatible/assets/index.css';
|
|
3
|
-
import { BillingLineMetadata } from "
|
|
4
|
-
import {
|
|
3
|
+
import { BillingLineMetadata } from "@unimaze/api-clients/lib/mapi/models";
|
|
4
|
+
import { InjectedIntlProps } from "react-intl";
|
|
5
5
|
import { FormInstance } from "antd/es/form";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
interface States {
|
|
15
|
-
dataSource: BillingLineMetadataOverride[];
|
|
16
|
-
editableIndex: number | null;
|
|
17
|
-
}
|
|
18
|
-
declare class BillingLines extends React.Component<Props, States> {
|
|
19
|
-
columns: EditableColumnProps<BillingLineMetadataOverride>[];
|
|
20
|
-
constructor(props: Props);
|
|
21
|
-
renderCurrencyColumn: (text: string) => string;
|
|
22
|
-
handleDelete: (index: number) => void;
|
|
23
|
-
handleAdd: () => void;
|
|
24
|
-
handleSave: (row: BillingLineMetadataOverride, form: FormInstance) => void;
|
|
25
|
-
render(): JSX.Element;
|
|
26
|
-
}
|
|
27
|
-
export default BillingLines;
|
|
6
|
+
interface Props extends InjectedIntlProps {
|
|
7
|
+
formInstance: FormInstance;
|
|
8
|
+
setBillingLineMetadata: (formInstance: FormInstance, billingLineMetadata: BillingLineMetadata[]) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const BillingLinesIntl: React.ComponentClass<Pick<Props, "formInstance" | "setBillingLineMetadata">, any> & {
|
|
11
|
+
WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
|
|
12
|
+
};
|
|
13
|
+
export default BillingLinesIntl;
|
|
@@ -35,33 +35,87 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
var React = __importStar(require("react"));
|
|
38
|
-
var
|
|
38
|
+
var components_1 = require("../../components");
|
|
39
39
|
var icons_1 = require("@ant-design/icons");
|
|
40
40
|
require("@ant-design/compatible/assets/index.css");
|
|
41
41
|
var antd_1 = require("antd");
|
|
42
|
-
var models_1 = require("
|
|
43
|
-
var
|
|
44
|
-
var
|
|
42
|
+
var models_1 = require("@unimaze/api-clients/lib/mapi/models");
|
|
43
|
+
var react_intl_1 = require("react-intl");
|
|
44
|
+
var BillingLineUtility_1 = require("../../../utils/BillingLineUtility");
|
|
45
|
+
var api_1 = require("@unimaze/api-clients/lib/mapi/api");
|
|
46
|
+
var BillingCalculations_1 = __importDefault(require("./BillingCalculations"));
|
|
47
|
+
var BillingTaxSummary_1 = __importDefault(require("./BillingTaxSummary"));
|
|
48
|
+
var translationMessages = react_intl_1.defineMessages({
|
|
49
|
+
billingLines_title: {
|
|
50
|
+
id: "billingLines_title",
|
|
51
|
+
defaultMessage: "Document lines",
|
|
52
|
+
},
|
|
53
|
+
billingLines_itemNo: {
|
|
54
|
+
id: "billingLines_itemNo",
|
|
55
|
+
defaultMessage: "Item no",
|
|
56
|
+
},
|
|
57
|
+
billingLines_name: {
|
|
58
|
+
id: "billingLines_itemNo",
|
|
59
|
+
defaultMessage: "Name"
|
|
60
|
+
},
|
|
61
|
+
billingLines_quantity: {
|
|
62
|
+
id: "billingLines_quantity",
|
|
63
|
+
defaultMessage: "Quantity"
|
|
64
|
+
},
|
|
65
|
+
billingLines_unitOfMeasure: {
|
|
66
|
+
id: "billingLines_unitOfMeasure",
|
|
67
|
+
defaultMessage: "Unit of measure"
|
|
68
|
+
},
|
|
69
|
+
billingLines_unitPriceAmount: {
|
|
70
|
+
id: "billingLines_unitPriceAmount",
|
|
71
|
+
defaultMessage: "Unit price amount"
|
|
72
|
+
},
|
|
73
|
+
billingLines_taxCategoryType: {
|
|
74
|
+
id: "billingLines_taxCategoryType",
|
|
75
|
+
defaultMessage: "Tax category"
|
|
76
|
+
},
|
|
77
|
+
billingLines_taxCategoryPercentage: {
|
|
78
|
+
id: "billingLines_taxCategoryPercentage",
|
|
79
|
+
defaultMessage: "Tax percentage"
|
|
80
|
+
},
|
|
81
|
+
billingLines_discount: {
|
|
82
|
+
id: "billingLines_discount",
|
|
83
|
+
defaultMessage: "Discount"
|
|
84
|
+
},
|
|
85
|
+
billingLines_lineAmount: {
|
|
86
|
+
id: "billingLines_lineAmount",
|
|
87
|
+
defaultMessage: "Amount"
|
|
88
|
+
},
|
|
89
|
+
billingLines_taxAmount: {
|
|
90
|
+
id: "billingLines_taxAmount",
|
|
91
|
+
defaultMessage: "Tax inclusive amount"
|
|
92
|
+
},
|
|
93
|
+
billingLines_button_addRow: {
|
|
94
|
+
id: "billingLines_button_addRow",
|
|
95
|
+
defaultMessage: "Add a row"
|
|
96
|
+
},
|
|
97
|
+
});
|
|
45
98
|
var BillingLines = /** @class */ (function (_super) {
|
|
46
99
|
__extends(BillingLines, _super);
|
|
47
100
|
function BillingLines(props) {
|
|
48
101
|
var _this = _super.call(this, props) || this;
|
|
49
102
|
_this.renderCurrencyColumn = function (text) {
|
|
50
|
-
var currency = _this.props.
|
|
103
|
+
var currency = _this.props.formInstance.getFieldValue(["invoice", "currencyCode"]) ? _this.props.formInstance.getFieldValue(["invoice", "currencyCode"]) : "";
|
|
51
104
|
return text + " " + currency;
|
|
52
105
|
};
|
|
53
106
|
_this.handleDelete = function (index) {
|
|
54
|
-
var newDataSource = _this.state.dataSource;
|
|
107
|
+
var newDataSource = _this.state.dataSource.slice();
|
|
55
108
|
newDataSource.splice(index, 1);
|
|
56
109
|
_this.setState(function (prevState) { return (__assign({}, prevState, { dataSource: newDataSource })); });
|
|
57
110
|
};
|
|
58
111
|
_this.handleAdd = function () {
|
|
59
112
|
var dataSource = _this.state.dataSource;
|
|
60
113
|
var newData = {
|
|
114
|
+
key: _this.state.editableIndex,
|
|
61
115
|
itemNo: "Item No.",
|
|
62
116
|
quantity: 0,
|
|
63
117
|
taxAmount: 0,
|
|
64
|
-
name: "New
|
|
118
|
+
name: "New Item",
|
|
65
119
|
unitOfMeasure: models_1.UnitOfMeasureMetadataUnitEnum.Piece,
|
|
66
120
|
unitPriceAmount: 0,
|
|
67
121
|
taxCategoryType: models_1.BillingLineMetadataTaxCategoryTypeEnum.StandardRated,
|
|
@@ -69,12 +123,12 @@ var BillingLines = /** @class */ (function (_super) {
|
|
|
69
123
|
taxableAmount: 0,
|
|
70
124
|
taxPercentage: null
|
|
71
125
|
};
|
|
72
|
-
_this.setState(
|
|
126
|
+
_this.setState(__assign({}, _this.state, { dataSource: dataSource.concat([newData]), editableIndex: _this.state.editableIndex + 1 }));
|
|
73
127
|
};
|
|
74
|
-
_this.handleSave = function (row,
|
|
128
|
+
_this.handleSave = function (row, formInstance) {
|
|
75
129
|
var newData = _this.state.dataSource.slice();
|
|
76
130
|
var index = newData.findIndex(function (i) {
|
|
77
|
-
return row.
|
|
131
|
+
return row.key === i.key;
|
|
78
132
|
});
|
|
79
133
|
var item = newData[index];
|
|
80
134
|
newData.splice(index, 1, __assign({}, item, row));
|
|
@@ -83,58 +137,83 @@ var BillingLines = /** @class */ (function (_super) {
|
|
|
83
137
|
unit: current.unitOfMeasure,
|
|
84
138
|
} });
|
|
85
139
|
});
|
|
86
|
-
_this.setState({ dataSource: newData });
|
|
87
|
-
_this.props.setBillingLineMetadata(
|
|
140
|
+
_this.setState(__assign({}, _this.state, { dataSource: newData }));
|
|
141
|
+
_this.props.setBillingLineMetadata(formInstance, billingLineMetadata);
|
|
88
142
|
};
|
|
89
143
|
_this.state = {
|
|
90
144
|
dataSource: [],
|
|
91
|
-
editableIndex:
|
|
145
|
+
editableIndex: 0,
|
|
92
146
|
};
|
|
93
147
|
_this.columns = [
|
|
94
148
|
{
|
|
95
|
-
title:
|
|
149
|
+
title: _this.props.intl.formatMessage(translationMessages.billingLines_itemNo),
|
|
96
150
|
dataIndex: 'itemNo',
|
|
97
151
|
editable: true,
|
|
98
152
|
},
|
|
99
153
|
{
|
|
100
|
-
title:
|
|
154
|
+
title: _this.props.intl.formatMessage(translationMessages.billingLines_name),
|
|
101
155
|
dataIndex: 'name',
|
|
102
156
|
editable: true,
|
|
103
157
|
},
|
|
104
158
|
{
|
|
105
|
-
title:
|
|
159
|
+
title: _this.props.intl.formatMessage(translationMessages.billingLines_quantity),
|
|
106
160
|
dataIndex: 'quantity',
|
|
107
161
|
editable: true,
|
|
162
|
+
align: "right",
|
|
108
163
|
},
|
|
109
164
|
{
|
|
110
|
-
title:
|
|
165
|
+
title: _this.props.intl.formatMessage(translationMessages.billingLines_unitOfMeasure),
|
|
111
166
|
dataIndex: 'unitOfMeasure',
|
|
112
167
|
editable: true,
|
|
113
168
|
},
|
|
114
169
|
{
|
|
115
|
-
title:
|
|
170
|
+
title: _this.props.intl.formatMessage(translationMessages.billingLines_unitPriceAmount),
|
|
116
171
|
dataIndex: 'unitPriceAmount',
|
|
117
172
|
editable: true,
|
|
173
|
+
align: "right",
|
|
118
174
|
},
|
|
119
175
|
{
|
|
120
|
-
title:
|
|
176
|
+
title: _this.props.intl.formatMessage(translationMessages.billingLines_taxCategoryType),
|
|
121
177
|
dataIndex: 'taxCategoryType',
|
|
122
178
|
editable: true,
|
|
123
179
|
},
|
|
124
180
|
{
|
|
125
|
-
title:
|
|
181
|
+
title: _this.props.intl.formatMessage(translationMessages.billingLines_taxCategoryPercentage),
|
|
182
|
+
dataIndex: 'taxCategoryPercentage',
|
|
183
|
+
editable: false,
|
|
184
|
+
align: "right",
|
|
185
|
+
render: (function (text, record) {
|
|
186
|
+
var taxPercentage = BillingLineUtility_1.calculateTaxPercentage(api_1.TaxCategoryTypeEnum[record.taxCategoryType]); // BillingLineMetadataTaxCategoryTypeEnum -> TaxCategoryTypeEnum
|
|
187
|
+
return React.createElement("span", null,
|
|
188
|
+
taxPercentage,
|
|
189
|
+
"%");
|
|
190
|
+
})
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
title: _this.props.intl.formatMessage(translationMessages.billingLines_discount),
|
|
126
194
|
dataIndex: 'discountValue',
|
|
127
195
|
editable: true,
|
|
196
|
+
align: "right",
|
|
128
197
|
},
|
|
129
198
|
{
|
|
130
|
-
title:
|
|
199
|
+
title: _this.props.intl.formatMessage(translationMessages.billingLines_lineAmount),
|
|
131
200
|
dataIndex: 'taxableAmount',
|
|
201
|
+
editable: false,
|
|
202
|
+
align: "right",
|
|
203
|
+
render: function (text, record) {
|
|
204
|
+
return (React.createElement("span", null, BillingLineUtility_1.calculateTaxableAmount(record.discountValue, record.quantity, record.unitPriceAmount).toFixed(2)));
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
title: _this.props.intl.formatMessage(translationMessages.billingLines_taxAmount),
|
|
209
|
+
dataIndex: 'taxInclusiveAmount',
|
|
210
|
+
editable: false,
|
|
211
|
+
align: "right",
|
|
132
212
|
render: function (text, record) {
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return (React.createElement("span", null, lineAmount));
|
|
213
|
+
var taxAmount = BillingLineUtility_1.calculateTaxAmount(BillingLineUtility_1.calculateTaxableAmount(record.discountValue, record.quantity, record.unitPriceAmount), BillingLineUtility_1.calculateTaxPercentage(api_1.TaxCategoryTypeEnum[record.taxCategoryType])); // BillingLineMetadataTaxCategoryTypeEnum -> TaxCategoryTypeEnum
|
|
214
|
+
var taxableAmount = BillingLineUtility_1.calculateTaxableAmount(record.discountValue, record.quantity, record.unitPriceAmount);
|
|
215
|
+
var taxInclusiveAmount = taxableAmount + taxAmount;
|
|
216
|
+
return (React.createElement("span", null, taxInclusiveAmount.toFixed(2)));
|
|
138
217
|
}
|
|
139
218
|
},
|
|
140
219
|
{
|
|
@@ -155,8 +234,8 @@ var BillingLines = /** @class */ (function (_super) {
|
|
|
155
234
|
// console.log(dataSource);
|
|
156
235
|
var components = {
|
|
157
236
|
body: {
|
|
158
|
-
row:
|
|
159
|
-
cell:
|
|
237
|
+
row: components_1.EditableRow,
|
|
238
|
+
cell: components_1.EditableCell,
|
|
160
239
|
},
|
|
161
240
|
};
|
|
162
241
|
var columns = this.columns.map(function (col) {
|
|
@@ -168,19 +247,18 @@ var BillingLines = /** @class */ (function (_super) {
|
|
|
168
247
|
editable: col.editable,
|
|
169
248
|
dataIndex: col.dataIndex,
|
|
170
249
|
title: col.title ? col.title.toString() : "",
|
|
171
|
-
handleSave: _this.handleSave,
|
|
250
|
+
handleSave: function (billingLineMetadataOverrideRecord, rowIndex) { return _this.handleSave(billingLineMetadataOverrideRecord, _this.props.formInstance); },
|
|
172
251
|
}); } });
|
|
173
252
|
});
|
|
174
|
-
return (React.createElement(
|
|
175
|
-
React.createElement(antd_1.Table, { components: components, dataSource: dataSource, columns: columns, pagination: false, rowKey: function (record, index) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
} })));
|
|
253
|
+
return (React.createElement(components_1.ComponentContainer, { title: this.props.intl.formatMessage(translationMessages.billingLines_title), action: React.createElement(antd_1.Button, { onClick: this.handleAdd, type: "primary", style: { marginBottom: 16 } }, this.props.intl.formatMessage(translationMessages.billingLines_button_addRow)) },
|
|
254
|
+
React.createElement(antd_1.Table, { style: { minHeight: "170px" }, components: components, dataSource: dataSource, columns: columns, pagination: false, rowKey: (function (record, index) { return index.toString(); }) }),
|
|
255
|
+
React.createElement(antd_1.Row, { style: { marginTop: "1em" }, align: "top", justify: "space-between", gutter: [16, 16] },
|
|
256
|
+
React.createElement(antd_1.Col, { span: 16 },
|
|
257
|
+
React.createElement(BillingTaxSummary_1.default, { billingLines: dataSource })),
|
|
258
|
+
React.createElement(antd_1.Col, { span: 8 },
|
|
259
|
+
React.createElement(BillingCalculations_1.default, { billingLinesMetadata: dataSource, renderCurrencyColumn: this.renderCurrencyColumn })))));
|
|
183
260
|
};
|
|
184
261
|
return BillingLines;
|
|
185
262
|
}(React.Component));
|
|
186
|
-
|
|
263
|
+
var BillingLinesIntl = react_intl_1.injectIntl(BillingLines);
|
|
264
|
+
exports.default = BillingLinesIntl;
|
|
@@ -6,15 +6,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
6
6
|
result["default"] = mod;
|
|
7
7
|
return result;
|
|
8
8
|
};
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
10
|
var React = __importStar(require("react"));
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var _a = props.
|
|
17
|
-
return (React.createElement(
|
|
11
|
+
var components_1 = require("../../components");
|
|
12
|
+
var Customer = function (props) {
|
|
13
|
+
var _a = props.customer, participantLegalIsoIdentifier = _a.participantLegalIsoIdentifier, participantLegalAddressPostalCode = _a.participantLegalAddressPostalCode, participantLegalAddressCity = _a.participantLegalAddressCity, participantLegalAddressStreet = _a.participantLegalAddressStreet, email = _a.email, name = _a.name, country = _a.country;
|
|
14
|
+
return (React.createElement(components_1.ComponentContainer, { title: "Invoice payer" },
|
|
18
15
|
React.createElement("div", null,
|
|
19
16
|
React.createElement("strong", null, name),
|
|
20
17
|
" (",
|
|
@@ -25,4 +22,4 @@ var Issuer = function (props) {
|
|
|
25
22
|
React.createElement("div", null, country),
|
|
26
23
|
React.createElement("div", null, email)));
|
|
27
24
|
};
|
|
28
|
-
exports.default =
|
|
25
|
+
exports.default = Customer;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
+
if (mod && mod.__esModule) return mod;
|
|
4
|
+
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;
|
|
7
|
+
return result;
|
|
8
|
+
};
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
var React = __importStar(require("react"));
|
|
14
|
+
var components_1 = require("../../components");
|
|
15
|
+
var antd_1 = require("antd");
|
|
16
|
+
var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
|
|
17
|
+
var form_item_1 = __importDefault(require("../form-item"));
|
|
18
|
+
var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
|
|
19
|
+
var react_intl_1 = require("react-intl");
|
|
20
|
+
var translationMessages = react_intl_1.defineMessages({
|
|
21
|
+
customer_title: {
|
|
22
|
+
id: "customer_title",
|
|
23
|
+
defaultMessage: "Customer",
|
|
24
|
+
},
|
|
25
|
+
customer_name: {
|
|
26
|
+
id: "customer_name",
|
|
27
|
+
defaultMessage: "Name",
|
|
28
|
+
},
|
|
29
|
+
customer_identifier: {
|
|
30
|
+
id: "customer_identifier",
|
|
31
|
+
defaultMessage: "Identifier"
|
|
32
|
+
},
|
|
33
|
+
customer_address_streetNameAndNumber: {
|
|
34
|
+
id: "customer_address_streetNameAndNumber",
|
|
35
|
+
defaultMessage: "Address"
|
|
36
|
+
},
|
|
37
|
+
customer_address_zip_postalCode: {
|
|
38
|
+
id: "customer_address_zipPostalCode",
|
|
39
|
+
defaultMessage: "Zip/Postal code"
|
|
40
|
+
},
|
|
41
|
+
customer_address_city: {
|
|
42
|
+
id: "customer_address_city",
|
|
43
|
+
defaultMessage: "City"
|
|
44
|
+
},
|
|
45
|
+
customer_address_countryCode: {
|
|
46
|
+
id: "customer_address_countryCode",
|
|
47
|
+
defaultMessage: "Country code"
|
|
48
|
+
},
|
|
49
|
+
customer_contact_email: {
|
|
50
|
+
id: "customer_contact_email",
|
|
51
|
+
defaultMessage: "E-Mail"
|
|
52
|
+
},
|
|
53
|
+
customer_contact_name: {
|
|
54
|
+
id: "customer_contact_name",
|
|
55
|
+
defaultMessage: "Contact name"
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
var Customer = function (props) {
|
|
59
|
+
return (React.createElement(components_1.ComponentContainer, { title: props.intl.formatMessage(translationMessages.customer_title) },
|
|
60
|
+
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.name"], defaultLabel: props.intl.formatMessage(translationMessages.customer_name), defaultIsRequired: true, fieldName: ["invoice", "customer", "name"], additionalRules: [
|
|
61
|
+
{
|
|
62
|
+
required: RequirementsUtility_1.getReceiverRequirements(ReceiverRequirements_1.receiverRequirementsObject, ReceiverRequirements_1.AvailableFields["customer.name"]).isRequired,
|
|
63
|
+
message: 'Please input customer name',
|
|
64
|
+
},
|
|
65
|
+
] },
|
|
66
|
+
React.createElement(antd_1.Input, null)),
|
|
67
|
+
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.identifier"], defaultLabel: props.intl.formatMessage(translationMessages.customer_identifier), defaultIsRequired: true, fieldName: ["invoice", "customer", "identifier"], additionalRules: [
|
|
68
|
+
{
|
|
69
|
+
required: RequirementsUtility_1.getReceiverRequirements(ReceiverRequirements_1.receiverRequirementsObject, ReceiverRequirements_1.AvailableFields["customer.identifier"]).isRequired,
|
|
70
|
+
message: 'Please input customer identifier',
|
|
71
|
+
},
|
|
72
|
+
] },
|
|
73
|
+
React.createElement(antd_1.Input, null)),
|
|
74
|
+
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.address.streetNameAndNumber"], defaultLabel: props.intl.formatMessage(translationMessages.customer_address_streetNameAndNumber), defaultIsRequired: true, fieldName: ["invoice", "customer", "address", "streetNameAndNumber"] },
|
|
75
|
+
React.createElement(antd_1.Input, null)),
|
|
76
|
+
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.address.postalZone"], defaultLabel: props.intl.formatMessage(translationMessages.customer_address_zip_postalCode), defaultIsRequired: false, fieldName: ["invoice", "customer", "address", "postalZone"] },
|
|
77
|
+
React.createElement(antd_1.Input, null)),
|
|
78
|
+
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.address.city"], defaultLabel: props.intl.formatMessage(translationMessages.customer_address_city), defaultIsRequired: false, fieldName: ["invoice", "customer", "address", "city"] },
|
|
79
|
+
React.createElement(antd_1.Input, null)),
|
|
80
|
+
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.address.countryCode"], defaultLabel: props.intl.formatMessage(translationMessages.customer_address_countryCode), defaultIsRequired: true, fieldName: ["invoice", "customer", "address", "countryCode"] },
|
|
81
|
+
React.createElement(antd_1.Input, { disabled: true })),
|
|
82
|
+
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.contact.electronicMail"], defaultLabel: props.intl.formatMessage(translationMessages.customer_contact_email), defaultIsRequired: false, fieldName: ["invoice", "customer", "contact", "electronicMail"], additionalRules: [
|
|
83
|
+
{
|
|
84
|
+
type: 'email',
|
|
85
|
+
message: 'The input is not valid E-mail!',
|
|
86
|
+
}
|
|
87
|
+
] },
|
|
88
|
+
React.createElement(antd_1.Input, null)),
|
|
89
|
+
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.contact.name"], defaultLabel: props.intl.formatMessage(translationMessages.customer_contact_name), defaultIsRequired: false, fieldName: ["invoice", "customer", "contact", "name"] },
|
|
90
|
+
React.createElement(antd_1.Input, null))));
|
|
91
|
+
};
|
|
92
|
+
var CustomerIntl = react_intl_1.injectIntl(Customer);
|
|
93
|
+
exports.default = CustomerIntl;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { InjectedIntlProps } from "react-intl";
|
|
3
|
+
declare const DeliveryLocationIntl: React.ComponentClass<Pick<InjectedIntlProps, never>, any> & {
|
|
4
|
+
WrappedComponent: React.ComponentType<InjectedIntlProps>;
|
|
5
|
+
};
|
|
6
|
+
export default DeliveryLocationIntl;
|
|
@@ -11,18 +11,50 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
var React = __importStar(require("react"));
|
|
14
|
-
var
|
|
14
|
+
var components_1 = require("../../components");
|
|
15
15
|
var antd_1 = require("antd");
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
var form_item_1 = __importDefault(require("../form-item"));
|
|
17
|
+
var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
|
|
18
|
+
var react_intl_1 = require("react-intl");
|
|
19
|
+
// import {defineMessages} from "react-intl.macro"
|
|
20
|
+
var translationMessages = react_intl_1.defineMessages({
|
|
21
|
+
deliveryLocation_title: {
|
|
22
|
+
id: "deliveryLocation_title",
|
|
23
|
+
defaultMessage: "Delivery location",
|
|
24
|
+
},
|
|
25
|
+
deliveryLocation_partyName: {
|
|
26
|
+
id: "deliveryLocation_partyName",
|
|
27
|
+
defaultMessage: "Party name",
|
|
28
|
+
},
|
|
29
|
+
deliveryLocation_streetNameAndNumber: {
|
|
30
|
+
id: "deliveryLocation_streetNameAndNumber",
|
|
31
|
+
defaultMessage: "Address"
|
|
32
|
+
},
|
|
33
|
+
deliveryLocation_postalZone: {
|
|
34
|
+
id: "deliveryLocation_postalZone",
|
|
35
|
+
defaultMessage: "Postal no"
|
|
36
|
+
},
|
|
37
|
+
deliveryLocation_city: {
|
|
38
|
+
id: "deliveryLocation_city",
|
|
39
|
+
defaultMessage: "Town/City"
|
|
40
|
+
},
|
|
41
|
+
deliveryLocation_countryCode: {
|
|
42
|
+
id: "deliveryLocation_countryCode",
|
|
43
|
+
defaultMessage: "Country code"
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
var DeliveryLocation = function (props) {
|
|
47
|
+
return (React.createElement(components_1.ComponentContainer, { title: props.intl.formatMessage(translationMessages.deliveryLocation_title) },
|
|
48
|
+
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.partyName"], defaultLabel: props.intl.formatMessage(translationMessages.deliveryLocation_partyName), defaultIsRequired: false, fieldName: ["invoice", "delivery", "partyName"] },
|
|
19
49
|
React.createElement(antd_1.Input, null)),
|
|
20
|
-
React.createElement(
|
|
50
|
+
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.address.streetNameAndNumber"], defaultLabel: props.intl.formatMessage(translationMessages.deliveryLocation_streetNameAndNumber), defaultIsRequired: false, fieldName: ["invoice", "delivery", "address", "streetNameAndNumber"] },
|
|
21
51
|
React.createElement(antd_1.Input, null)),
|
|
22
|
-
React.createElement(
|
|
23
|
-
React.createElement(antd_1.
|
|
24
|
-
|
|
25
|
-
React.createElement(antd_1.
|
|
26
|
-
|
|
52
|
+
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.address.postalZone"], defaultLabel: props.intl.formatMessage(translationMessages.deliveryLocation_postalZone), defaultIsRequired: false, fieldName: ["invoice", "delivery", "address", "postalZone"] },
|
|
53
|
+
React.createElement(antd_1.Input, null)),
|
|
54
|
+
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.address.city"], defaultLabel: props.intl.formatMessage(translationMessages.deliveryLocation_city), defaultIsRequired: false, fieldName: ["invoice", "delivery", "address", "city"] },
|
|
55
|
+
React.createElement(antd_1.Input, null)),
|
|
56
|
+
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.address.countryCode"], defaultLabel: props.intl.formatMessage(translationMessages.deliveryLocation_countryCode), defaultIsRequired: true, fieldName: ["invoice", "delivery", "address", "countryCode"] },
|
|
57
|
+
React.createElement(antd_1.Input, null))));
|
|
27
58
|
};
|
|
28
|
-
|
|
59
|
+
var DeliveryLocationIntl = react_intl_1.injectIntl(DeliveryLocation);
|
|
60
|
+
exports.default = DeliveryLocationIntl;
|
|
@@ -3,7 +3,7 @@ import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOver
|
|
|
3
3
|
interface EditableCellProps {
|
|
4
4
|
record: BillingLineMetadataOverride;
|
|
5
5
|
handleSave: (billingLineMetadata: BillingLineMetadataOverride) => void;
|
|
6
|
-
dataIndex: keyof BillingLineMetadataOverride
|
|
6
|
+
dataIndex: keyof Omit<BillingLineMetadataOverride, 'key'>;
|
|
7
7
|
editable: boolean;
|
|
8
8
|
index: number;
|
|
9
9
|
}
|