@unimaze/billing 0.1.2-rc.10 → 0.1.2-rc.2
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 +3 -11
- package/lib/common/components/attachments/Attachment.d.ts +2 -8
- package/lib/common/components/attachments/Attachment.js +8 -33
- package/lib/common/components/attachments/index.d.ts +2 -9
- package/lib/common/components/attachments/index.js +6 -15
- package/lib/common/components/base-information/index.d.ts +3 -6
- package/lib/common/components/base-information/index.js +81 -100
- package/lib/common/components/billing-lines/index.d.ts +23 -9
- package/lib/common/components/billing-lines/index.js +38 -116
- package/lib/common/components/delivery-location/index.d.ts +2 -5
- package/lib/common/components/delivery-location/index.js +11 -43
- package/lib/common/components/editable-cell/index.d.ts +1 -1
- package/lib/common/components/editable-cell/index.js +10 -76
- package/lib/common/components/editable-row/index.d.ts +5 -5
- package/lib/common/components/editable-row/index.js +6 -8
- package/lib/common/components/index.d.ts +5 -10
- package/lib/common/components/index.js +8 -20
- package/lib/common/components/issuer/index.d.ts +7 -0
- package/lib/common/components/{customer/hardCoddedCustomer.js → issuer/index.js} +8 -5
- package/lib/common/components/payer/index.d.ts +3 -0
- package/lib/common/components/payer/index.js +50 -0
- package/lib/common/components/payment-method/index.d.ts +3 -6
- package/lib/common/components/payment-method/index.js +17 -57
- package/lib/common/consts/validationRules.d.ts +3 -2
- package/lib/common/consts/validationRules.js +7 -0
- package/lib/common/enums/index.d.ts +1 -1
- package/lib/common/enums/index.js +4 -2
- package/lib/common/types/BillingLineMetadataOverride.d.ts +0 -1
- package/lib/create-credit-note/index.d.ts +2 -1
- package/lib/create-credit-note/index.js +14 -6
- package/lib/create-invoice/index.d.ts +2 -1
- package/lib/create-invoice/index.js +21 -79
- package/lib/example/src/index.d.ts +1 -1
- package/lib/index.js +0 -5
- package/lib/src/common/components/attachments/Attachment.d.ts +2 -8
- package/lib/src/common/components/attachments/index.d.ts +2 -9
- package/lib/src/common/components/base-information/index.d.ts +3 -6
- package/lib/src/common/components/billing-lines/index.d.ts +23 -9
- package/lib/src/common/components/delivery-location/index.d.ts +2 -5
- package/lib/src/common/components/editable-cell/index.d.ts +1 -1
- package/lib/src/common/components/editable-row/index.d.ts +5 -5
- package/lib/src/common/components/issuer/index.d.ts +7 -0
- package/lib/src/common/components/payer/index.d.ts +3 -0
- package/lib/src/common/components/payment-method/index.d.ts +3 -6
- package/lib/src/common/consts/validationRules.d.ts +3 -2
- package/lib/src/create-credit-note/index.d.ts +9 -0
- package/lib/src/create-invoice/index.d.ts +2 -1
- package/lib/src/index.d.ts +4 -0
- package/lib/style/index.css +1222 -0
- package/lib/utils/ApiUtility.d.ts +1 -8
- package/lib/utils/ApiUtility.js +1 -17
- package/lib/utils/ConversionUtility.d.ts +4 -5
- package/lib/utils/ConversionUtility.js +133 -121
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +2 -2
- package/package.json +7 -12
- package/lib/common/components/base-information/ReferenceIdentifiers.d.ts +0 -6
- package/lib/common/components/base-information/ReferenceIdentifiers.js +0 -40
- package/lib/common/components/billing-lines/BillingCalculations.d.ts +0 -11
- package/lib/common/components/billing-lines/BillingCalculations.js +0 -61
- package/lib/common/components/billing-lines/BillingTaxSummary.d.ts +0 -10
- package/lib/common/components/billing-lines/BillingTaxSummary.js +0 -51
- package/lib/common/components/billing-lines/billingLIneFormData.d.ts +0 -7
- package/lib/common/components/billing-lines/billingLIneFormData.js +0 -63
- package/lib/common/components/customer/hardCoddedCustomer.d.ts +0 -7
- package/lib/common/components/customer/index.d.ts +0 -6
- package/lib/common/components/customer/index.js +0 -93
- package/lib/common/components/form-item/index.d.ts +0 -21
- package/lib/common/components/form-item/index.js +0 -27
- package/lib/common/components/locale-intl/index.d.ts +0 -10
- package/lib/common/components/locale-intl/index.js +0 -45
- package/lib/common/components/supplier/index.d.ts +0 -6
- package/lib/common/components/supplier/index.js +0 -93
- package/lib/common/types/ReceiverRequirements.d.ts +0 -81
- package/lib/common/types/ReceiverRequirements.js +0 -379
- package/lib/src/common/components/base-information/ReferenceIdentifiers.d.ts +0 -6
- package/lib/src/common/components/billing-lines/BillingCalculations.d.ts +0 -11
- package/lib/src/common/components/billing-lines/BillingTaxSummary.d.ts +0 -10
- package/lib/src/common/components/billing-lines/billingLIneFormData.d.ts +0 -7
- package/lib/src/common/components/customer/index.d.ts +0 -6
- package/lib/src/common/components/form-item/index.d.ts +0 -21
- package/lib/src/common/components/index.d.ts +0 -10
- package/lib/src/common/components/locale-intl/index.d.ts +0 -10
- package/lib/src/common/components/supplier/index.d.ts +0 -6
- package/lib/src/common/types/ReceiverRequirements.d.ts +0 -81
- package/lib/src/translations/locales.d.ts +0 -74
- package/lib/src/utils/ApiUtility.d.ts +0 -21
- package/lib/src/utils/BillingLineUtility.d.ts +0 -8
- package/lib/src/utils/ConversionUtility.d.ts +0 -5
- package/lib/src/utils/RequirementsUtility.d.ts +0 -5
- package/lib/src/utils/billingLineFormData.d.ts +0 -7
- package/lib/src/utils/index.d.ts +0 -2
- package/lib/translations/locales/is.json +0 -70
- package/lib/translations/locales.d.ts +0 -74
- package/lib/translations/locales.js +0 -10
- package/lib/utils/BillingLineUtility.d.ts +0 -8
- package/lib/utils/BillingLineUtility.js +0 -66
- package/lib/utils/RequirementsUtility.d.ts +0 -5
- package/lib/utils/RequirementsUtility.js +0 -23
- package/lib/utils/billingLineFormData.d.ts +0 -7
- package/lib/utils/billingLineFormData.js +0 -63
|
@@ -35,87 +35,33 @@ 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 component_container_1 = __importDefault(require("../component-container"));
|
|
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
42
|
var models_1 = require("@unimaze/api-clients/lib/mapi/models");
|
|
43
|
-
var
|
|
44
|
-
var
|
|
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
|
-
});
|
|
43
|
+
var editable_cell_1 = __importDefault(require("../editable-cell"));
|
|
44
|
+
var editable_row_1 = __importDefault(require("../editable-row"));
|
|
98
45
|
var BillingLines = /** @class */ (function (_super) {
|
|
99
46
|
__extends(BillingLines, _super);
|
|
100
47
|
function BillingLines(props) {
|
|
101
48
|
var _this = _super.call(this, props) || this;
|
|
102
49
|
_this.renderCurrencyColumn = function (text) {
|
|
103
|
-
var currency = _this.props.
|
|
50
|
+
var currency = _this.props.form.getFieldValue("baseInformation:currency") ? _this.props.form.getFieldValue("baseInformation:currency") : "";
|
|
104
51
|
return text + " " + currency;
|
|
105
52
|
};
|
|
106
53
|
_this.handleDelete = function (index) {
|
|
107
|
-
var newDataSource = _this.state.dataSource
|
|
54
|
+
var newDataSource = _this.state.dataSource;
|
|
108
55
|
newDataSource.splice(index, 1);
|
|
109
56
|
_this.setState(function (prevState) { return (__assign({}, prevState, { dataSource: newDataSource })); });
|
|
110
57
|
};
|
|
111
58
|
_this.handleAdd = function () {
|
|
112
59
|
var dataSource = _this.state.dataSource;
|
|
113
60
|
var newData = {
|
|
114
|
-
key: _this.state.editableIndex,
|
|
115
61
|
itemNo: "Item No.",
|
|
116
62
|
quantity: 0,
|
|
117
63
|
taxAmount: 0,
|
|
118
|
-
name: "New
|
|
64
|
+
name: "New item",
|
|
119
65
|
unitOfMeasure: models_1.UnitOfMeasureMetadataUnitEnum.Piece,
|
|
120
66
|
unitPriceAmount: 0,
|
|
121
67
|
taxCategoryType: models_1.BillingLineMetadataTaxCategoryTypeEnum.StandardRated,
|
|
@@ -123,12 +69,12 @@ var BillingLines = /** @class */ (function (_super) {
|
|
|
123
69
|
taxableAmount: 0,
|
|
124
70
|
taxPercentage: null
|
|
125
71
|
};
|
|
126
|
-
_this.setState(__assign({},
|
|
72
|
+
_this.setState(function (prevState) { return (__assign({}, prevState, { dataSource: prevState.dataSource.concat([newData]), editableIndex: prevState.dataSource.length + 1 })); });
|
|
127
73
|
};
|
|
128
|
-
_this.handleSave = function (row,
|
|
74
|
+
_this.handleSave = function (row, form) {
|
|
129
75
|
var newData = _this.state.dataSource.slice();
|
|
130
76
|
var index = newData.findIndex(function (i) {
|
|
131
|
-
return row.
|
|
77
|
+
return row.itemNo === i.itemNo;
|
|
132
78
|
});
|
|
133
79
|
var item = newData[index];
|
|
134
80
|
newData.splice(index, 1, __assign({}, item, row));
|
|
@@ -137,83 +83,58 @@ var BillingLines = /** @class */ (function (_super) {
|
|
|
137
83
|
unit: current.unitOfMeasure,
|
|
138
84
|
} });
|
|
139
85
|
});
|
|
140
|
-
_this.setState(
|
|
141
|
-
_this.props.setBillingLineMetadata(
|
|
86
|
+
_this.setState({ dataSource: newData });
|
|
87
|
+
_this.props.setBillingLineMetadata(form, billingLineMetadata);
|
|
142
88
|
};
|
|
143
89
|
_this.state = {
|
|
144
90
|
dataSource: [],
|
|
145
|
-
editableIndex:
|
|
91
|
+
editableIndex: null,
|
|
146
92
|
};
|
|
147
93
|
_this.columns = [
|
|
148
94
|
{
|
|
149
|
-
title:
|
|
95
|
+
title: "Item No",
|
|
150
96
|
dataIndex: 'itemNo',
|
|
151
97
|
editable: true,
|
|
152
98
|
},
|
|
153
99
|
{
|
|
154
|
-
title:
|
|
100
|
+
title: "Name",
|
|
155
101
|
dataIndex: 'name',
|
|
156
102
|
editable: true,
|
|
157
103
|
},
|
|
158
104
|
{
|
|
159
|
-
title:
|
|
105
|
+
title: "Quantity",
|
|
160
106
|
dataIndex: 'quantity',
|
|
161
107
|
editable: true,
|
|
162
|
-
align: "right",
|
|
163
108
|
},
|
|
164
109
|
{
|
|
165
|
-
title:
|
|
110
|
+
title: "Unit of measure",
|
|
166
111
|
dataIndex: 'unitOfMeasure',
|
|
167
112
|
editable: true,
|
|
168
113
|
},
|
|
169
114
|
{
|
|
170
|
-
title:
|
|
115
|
+
title: "Unit price amount",
|
|
171
116
|
dataIndex: 'unitPriceAmount',
|
|
172
117
|
editable: true,
|
|
173
|
-
align: "right",
|
|
174
118
|
},
|
|
175
119
|
{
|
|
176
|
-
title:
|
|
120
|
+
title: "Tax category",
|
|
177
121
|
dataIndex: 'taxCategoryType',
|
|
178
122
|
editable: true,
|
|
179
123
|
},
|
|
180
124
|
{
|
|
181
|
-
title:
|
|
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),
|
|
125
|
+
title: "Discount",
|
|
194
126
|
dataIndex: 'discountValue',
|
|
195
127
|
editable: true,
|
|
196
|
-
align: "right",
|
|
197
128
|
},
|
|
198
129
|
{
|
|
199
|
-
title:
|
|
130
|
+
title: "Line amount",
|
|
200
131
|
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",
|
|
212
132
|
render: function (text, record) {
|
|
213
|
-
var
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
133
|
+
var lineAmount = 0;
|
|
134
|
+
if (record.quantity && record.unitPriceAmount) {
|
|
135
|
+
lineAmount = record.quantity * record.unitPriceAmount;
|
|
136
|
+
}
|
|
137
|
+
return (React.createElement("span", null, lineAmount));
|
|
217
138
|
}
|
|
218
139
|
},
|
|
219
140
|
{
|
|
@@ -234,8 +155,8 @@ var BillingLines = /** @class */ (function (_super) {
|
|
|
234
155
|
// console.log(dataSource);
|
|
235
156
|
var components = {
|
|
236
157
|
body: {
|
|
237
|
-
row:
|
|
238
|
-
cell:
|
|
158
|
+
row: editable_row_1.default,
|
|
159
|
+
cell: editable_cell_1.default,
|
|
239
160
|
},
|
|
240
161
|
};
|
|
241
162
|
var columns = this.columns.map(function (col) {
|
|
@@ -247,18 +168,19 @@ var BillingLines = /** @class */ (function (_super) {
|
|
|
247
168
|
editable: col.editable,
|
|
248
169
|
dataIndex: col.dataIndex,
|
|
249
170
|
title: col.title ? col.title.toString() : "",
|
|
250
|
-
handleSave:
|
|
171
|
+
handleSave: _this.handleSave,
|
|
251
172
|
}); } });
|
|
252
173
|
});
|
|
253
|
-
return (React.createElement(
|
|
254
|
-
React.createElement(antd_1.Table, {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
174
|
+
return (React.createElement(component_container_1.default, { title: "Document Lines", action: React.createElement(antd_1.Button, { onClick: this.handleAdd, type: "primary", style: { marginBottom: 16 } }, "Add a row") },
|
|
175
|
+
React.createElement(antd_1.Table, { components: components, dataSource: dataSource, columns: columns, pagination: false, rowKey: function (record, index) {
|
|
176
|
+
if (index) {
|
|
177
|
+
return (index.toString());
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
return Math.random().toString();
|
|
181
|
+
}
|
|
182
|
+
} })));
|
|
260
183
|
};
|
|
261
184
|
return BillingLines;
|
|
262
185
|
}(React.Component));
|
|
263
|
-
|
|
264
|
-
exports.default = BillingLinesIntl;
|
|
186
|
+
exports.default = BillingLines;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
WrappedComponent: React.ComponentType<InjectedIntlProps>;
|
|
5
|
-
};
|
|
6
|
-
export default DeliveryLocationIntl;
|
|
2
|
+
declare const DeliveryLocation: React.FC;
|
|
3
|
+
export default DeliveryLocation;
|
|
@@ -11,50 +11,18 @@ 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 component_container_1 = __importDefault(require("../component-container"));
|
|
15
15
|
var antd_1 = require("antd");
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
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"] },
|
|
16
|
+
var DeliveryLocation = function () {
|
|
17
|
+
return (React.createElement(component_container_1.default, { title: "Delivery location" },
|
|
18
|
+
React.createElement(antd_1.Form.Item, { label: "Description", name: "deliveryLocation:description" },
|
|
49
19
|
React.createElement(antd_1.Input, null)),
|
|
50
|
-
React.createElement(
|
|
20
|
+
React.createElement(antd_1.Form.Item, { label: "Address", name: "deliveryLocation:address" },
|
|
51
21
|
React.createElement(antd_1.Input, null)),
|
|
52
|
-
React.createElement(
|
|
53
|
-
React.createElement(antd_1.
|
|
54
|
-
|
|
55
|
-
React.createElement(antd_1.
|
|
56
|
-
|
|
57
|
-
React.createElement(antd_1.Input, null))));
|
|
22
|
+
React.createElement(antd_1.Form.Item, { label: "Post no., town/city", style: { marginBottom: 0 } },
|
|
23
|
+
React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, name: "deliveryLocation:postNo" },
|
|
24
|
+
React.createElement(antd_1.Input, null)),
|
|
25
|
+
React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "70%", paddingLeft: "3px" }, name: "deliveryLocation:city" },
|
|
26
|
+
React.createElement(antd_1.Input, null)))));
|
|
58
27
|
};
|
|
59
|
-
|
|
60
|
-
exports.default = DeliveryLocationIntl;
|
|
28
|
+
exports.default = DeliveryLocation;
|
|
@@ -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
|
|
6
|
+
dataIndex: keyof BillingLineMetadataOverride;
|
|
7
7
|
editable: boolean;
|
|
8
8
|
index: number;
|
|
9
9
|
}
|
|
@@ -10,41 +10,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
13
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
49
14
|
var t = {};
|
|
50
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -63,7 +28,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
63
28
|
result["default"] = mod;
|
|
64
29
|
return result;
|
|
65
30
|
};
|
|
66
|
-
var _this = this;
|
|
67
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68
32
|
var react_1 = __importStar(require("react"));
|
|
69
33
|
var antd_1 = require("antd");
|
|
@@ -76,66 +40,36 @@ var EditableCell = function (props) {
|
|
|
76
40
|
record = props.record, index = props.index, handleSave = props.handleSave, children = props.children, restProps = __rest(props, ["editable", "dataIndex", "record", "index", "handleSave", "children"]);
|
|
77
41
|
var _a = react_1.useState(false), editing = _a[0], setEditing = _a[1];
|
|
78
42
|
var input = null;
|
|
79
|
-
var form = react_1.useContext(editable_row_1.EditableContext);
|
|
80
43
|
var toggleEdit = function () {
|
|
81
44
|
setEditing(!editing);
|
|
82
45
|
if (!editing && input)
|
|
83
46
|
input.focus();
|
|
84
47
|
};
|
|
85
|
-
var save = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
86
|
-
var values, errInfo_1;
|
|
87
|
-
return __generator(this, function (_a) {
|
|
88
|
-
switch (_a.label) {
|
|
89
|
-
case 0:
|
|
90
|
-
_a.trys.push([0, 2, , 3]);
|
|
91
|
-
return [4 /*yield*/, form.validateFields()];
|
|
92
|
-
case 1:
|
|
93
|
-
values = _a.sent();
|
|
94
|
-
toggleEdit();
|
|
95
|
-
handleSave(__assign({}, record, values));
|
|
96
|
-
return [3 /*break*/, 3];
|
|
97
|
-
case 2:
|
|
98
|
-
errInfo_1 = _a.sent();
|
|
99
|
-
// tslint:disable-next-line:no-console
|
|
100
|
-
console.log('Save failed:', errInfo_1);
|
|
101
|
-
return [3 /*break*/, 3];
|
|
102
|
-
case 3: return [2 /*return*/];
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}); };
|
|
106
48
|
var getCorrectInputNode = function (dataIdx) {
|
|
107
49
|
switch (dataIdx) {
|
|
108
50
|
case "quantity":
|
|
109
51
|
case "unitPriceAmount":
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
onBlur: save });
|
|
52
|
+
case "taxableAmount":
|
|
53
|
+
case "taxAmount":
|
|
54
|
+
case "taxPercentage":
|
|
114
55
|
case "discountValue":
|
|
115
|
-
|
|
56
|
+
case "accountingCost":
|
|
57
|
+
return react_1.default.createElement(antd_1.InputNumber, { step: 0.01 });
|
|
116
58
|
case "unitOfMeasure":
|
|
117
|
-
return (react_1.default.createElement(antd_1.Select, { ref: function (node) { return (input = node); }, defaultActiveFirstOption: true,
|
|
118
|
-
|
|
119
|
-
onChange: save }, Object.keys(models_1.UnitOfMeasureMetadataUnitEnum).map(function (unitOfMeasure) {
|
|
120
|
-
if (unitOfMeasure !== "Rec20" && unitOfMeasure !== "Rec21")
|
|
121
|
-
return (react_1.default.createElement(antd_1.Select.Option, { value: unitOfMeasure, title: unitOfMeasure, key: unitOfMeasure }, unitOfMeasure));
|
|
59
|
+
return (react_1.default.createElement(antd_1.Select, { ref: function (node) { return (input = node); }, defaultActiveFirstOption: true }, Object.keys(models_1.UnitOfMeasureMetadataUnitEnum).map(function (unitOfMeasure) {
|
|
60
|
+
return (react_1.default.createElement(antd_1.Select.Option, { value: unitOfMeasure, title: unitOfMeasure, key: unitOfMeasure }, unitOfMeasure));
|
|
122
61
|
})));
|
|
123
62
|
case "taxCategoryType":
|
|
124
|
-
return (react_1.default.createElement(antd_1.Select, { ref: function (node) { return (input = node); }, defaultActiveFirstOption: true,
|
|
125
|
-
// onSelect={save}
|
|
126
|
-
onChange: save }, Object.keys(models_1.BillingLineMetadataTaxCategoryTypeEnum).map(function (taxCategoryType) {
|
|
63
|
+
return (react_1.default.createElement(antd_1.Select, { ref: function (node) { return (input = node); }, defaultActiveFirstOption: true }, Object.keys(models_1.BillingLineMetadataTaxCategoryTypeEnum).map(function (taxCategoryType) {
|
|
127
64
|
return (react_1.default.createElement(antd_1.Select.Option, { value: taxCategoryType, title: taxCategoryType, key: taxCategoryType }, taxCategoryType));
|
|
128
65
|
})));
|
|
129
66
|
default:
|
|
130
|
-
return react_1.default.createElement(antd_1.Input, { ref: function (node) { return (input = node); }
|
|
131
|
-
// onPressEnter={save}
|
|
132
|
-
onBlur: save });
|
|
67
|
+
return react_1.default.createElement(antd_1.Input, { ref: function (node) { return (input = node); } });
|
|
133
68
|
}
|
|
134
69
|
};
|
|
135
70
|
var renderCell = function () {
|
|
136
71
|
var inputNode = getCorrectInputNode(dataIndex);
|
|
137
|
-
|
|
138
|
-
return editing ? (react_1.default.createElement(antd_1.Form.Item, { style: { margin: 0 }, rules: rules, name: dataIndex, initialValue: record[dataIndex] }, inputNode)) : (react_1.default.createElement("div", { className: "editable-cell-value-wrap", style: { paddingRight: 24 }, onClick: toggleEdit }, children));
|
|
72
|
+
return editing ? (react_1.default.createElement(antd_1.Form.Item, { style: { margin: 0 }, rules: validationRules_1.validationRules[dataIndex], name: dataIndex, initialValue: record[dataIndex] }, inputNode)) : (react_1.default.createElement("div", { className: "editable-cell-value-wrap", style: { paddingRight: 24 }, onClick: toggleEdit }, children));
|
|
139
73
|
};
|
|
140
74
|
return (react_1.default.createElement("td", __assign({}, restProps), editable ? (react_1.default.createElement(editable_row_1.EditableContext.Consumer, null, renderCell)) : (children)));
|
|
141
75
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import '
|
|
3
|
-
import
|
|
4
|
-
export declare const EditableContext: React.Context<
|
|
5
|
-
declare const
|
|
6
|
-
export default
|
|
2
|
+
import { WrappedFormUtils } from '@ant-design/compatible/es/form/Form';
|
|
3
|
+
import '@ant-design/compatible/assets/index.css';
|
|
4
|
+
export declare const EditableContext: React.Context<WrappedFormUtils<any>>;
|
|
5
|
+
declare const _default: import("@ant-design/compatible/lib/form/interface").ConnectedComponentClass<({ form, index, ...props }: any) => JSX.Element, Pick<import("@ant-design/compatible/lib/form").FormComponentProps<any>, "wrappedComponentRef">>;
|
|
6
|
+
export default _default;
|
|
@@ -30,14 +30,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
var React = __importStar(require("react"));
|
|
33
|
-
var
|
|
34
|
-
require("
|
|
33
|
+
var compatible_1 = require("@ant-design/compatible");
|
|
34
|
+
require("@ant-design/compatible/assets/index.css");
|
|
35
35
|
exports.EditableContext = React.createContext({});
|
|
36
36
|
var EditableRow = function (_a) {
|
|
37
|
-
var index = _a.index, props = __rest(_a, ["index"]);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
React.createElement(exports.EditableContext.Provider, { value: form },
|
|
41
|
-
React.createElement("tr", __assign({}, props))));
|
|
37
|
+
var form = _a.form, index = _a.index, props = __rest(_a, ["form", "index"]);
|
|
38
|
+
return (React.createElement(exports.EditableContext.Provider, { value: form },
|
|
39
|
+
React.createElement("tr", __assign({}, props))));
|
|
42
40
|
};
|
|
43
|
-
exports.default = EditableRow;
|
|
41
|
+
exports.default = compatible_1.Form.create()(EditableRow);
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export { default as DeliveryLocation } from "./delivery-location";
|
|
7
|
-
export { default as EditableCell } from "./editable-cell";
|
|
8
|
-
export { default as EditableRow } from "./editable-row";
|
|
9
|
-
export { default as PaymentMethod } from "./payment-method";
|
|
10
|
-
export { default as Supplier } from "./supplier";
|
|
1
|
+
export * from "./component-container";
|
|
2
|
+
export * from "./payer";
|
|
3
|
+
export * from "./issuer";
|
|
4
|
+
export * from "./base-information";
|
|
5
|
+
export * from "./delivery-location";
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
function __export(m) {
|
|
3
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
4
|
+
}
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.BillingLines = billing_lines_1.default;
|
|
9
|
-
var component_container_1 = require("./component-container");
|
|
10
|
-
exports.ComponentContainer = component_container_1.default;
|
|
11
|
-
var customer_1 = require("./customer");
|
|
12
|
-
exports.Customer = customer_1.default;
|
|
13
|
-
var delivery_location_1 = require("./delivery-location");
|
|
14
|
-
exports.DeliveryLocation = delivery_location_1.default;
|
|
15
|
-
var editable_cell_1 = require("./editable-cell");
|
|
16
|
-
exports.EditableCell = editable_cell_1.default;
|
|
17
|
-
var editable_row_1 = require("./editable-row");
|
|
18
|
-
exports.EditableRow = editable_row_1.default;
|
|
19
|
-
var payment_method_1 = require("./payment-method");
|
|
20
|
-
exports.PaymentMethod = payment_method_1.default;
|
|
21
|
-
var supplier_1 = require("./supplier");
|
|
22
|
-
exports.Supplier = supplier_1.default;
|
|
6
|
+
__export(require("./component-container"));
|
|
7
|
+
__export(require("./payer"));
|
|
8
|
+
__export(require("./issuer"));
|
|
9
|
+
__export(require("./base-information"));
|
|
10
|
+
__export(require("./delivery-location"));
|
|
@@ -6,12 +6,15 @@ 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
|
+
};
|
|
9
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
13
|
var React = __importStar(require("react"));
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var _a = props.
|
|
14
|
-
return (React.createElement(
|
|
14
|
+
var component_container_1 = __importDefault(require("../component-container"));
|
|
15
|
+
var Issuer = function (props) {
|
|
16
|
+
var _a = props.issuer, participantLegalIsoIdentifier = _a.participantLegalIsoIdentifier, participantLegalAddressPostalCode = _a.participantLegalAddressPostalCode, participantLegalAddressCity = _a.participantLegalAddressCity, participantLegalAddressStreet = _a.participantLegalAddressStreet, email = _a.email, name = _a.name, country = _a.country;
|
|
17
|
+
return (React.createElement(component_container_1.default, { title: "Issuer" },
|
|
15
18
|
React.createElement("div", null,
|
|
16
19
|
React.createElement("strong", null, name),
|
|
17
20
|
" (",
|
|
@@ -22,4 +25,4 @@ var Customer = function (props) {
|
|
|
22
25
|
React.createElement("div", null, country),
|
|
23
26
|
React.createElement("div", null, email)));
|
|
24
27
|
};
|
|
25
|
-
exports.default =
|
|
28
|
+
exports.default = Issuer;
|