@unimaze/billing 0.20.17 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/components/CommonTranslations.d.ts +102 -2
- package/lib/common/components/CommonTranslations.js +10 -1
- package/lib/common/components/attachments/Attachment.d.ts +6 -4
- package/lib/common/components/attachments/Attachment.js +26 -10
- package/lib/common/components/attachments/AttachmentModal.d.ts +21 -0
- package/lib/common/components/attachments/AttachmentModal.js +195 -0
- package/lib/common/components/attachments/index.d.ts +13 -17
- package/lib/common/components/attachments/index.js +189 -23
- package/lib/common/components/base-information/AccountingCost.d.ts +7 -5
- package/lib/common/components/base-information/AccountingCost.js +32 -11
- package/lib/common/components/base-information/OrderReference.d.ts +6 -4
- package/lib/common/components/base-information/OrderReference.js +31 -14
- package/lib/common/components/base-information/ProjectReference.d.ts +9 -5
- package/lib/common/components/base-information/ProjectReference.js +8 -6
- package/lib/common/components/base-information/ReferenceIdentifiers.d.ts +32 -5
- package/lib/common/components/base-information/ReferenceIdentifiers.js +126 -83
- package/lib/common/components/base-information/index.d.ts +51 -5
- package/lib/common/components/base-information/index.js +99 -154
- package/lib/common/components/billing-lines/BillingCalculations.d.ts +7 -5
- package/lib/common/components/billing-lines/BillingCalculations.js +79 -46
- package/lib/common/components/billing-lines/BillingLinePreview.d.ts +21 -0
- package/lib/common/components/billing-lines/BillingLinePreview.js +41 -0
- package/lib/common/components/billing-lines/BillingTaxSummary.d.ts +6 -4
- package/lib/common/components/billing-lines/BillingTaxSummary.js +39 -13
- package/lib/common/components/billing-lines/NewBillingLines.d.ts +120 -4
- package/lib/common/components/billing-lines/NewBillingLines.js +396 -72
- package/lib/common/components/billing-lines/index.d.ts +33 -6
- package/lib/common/components/billing-lines/index.js +71 -244
- package/lib/common/components/component-container/Content.d.ts +2 -2
- package/lib/common/components/component-container/index.d.ts +1 -0
- package/lib/common/components/component-container/index.js +1 -1
- package/lib/common/components/customer/CostCenter.d.ts +6 -4
- package/lib/common/components/customer/CostCenter.js +25 -9
- package/lib/common/components/customer/CustomerContactName.d.ts +6 -4
- package/lib/common/components/customer/CustomerContactName.js +24 -8
- package/lib/common/components/customer/hardCoddedCustomer.js +19 -3
- package/lib/common/components/customer/index.d.ts +11 -5
- package/lib/common/components/customer/index.js +97 -42
- package/lib/common/components/date-picker/index.d.ts +21 -0
- package/lib/common/components/date-picker/index.js +23 -0
- package/lib/common/components/delivery-location/index.d.ts +6 -4
- package/lib/common/components/delivery-location/index.js +20 -4
- package/lib/common/components/editable-cell/index.js +2 -2
- package/lib/common/components/editable-row/index.d.ts +1 -1
- package/lib/common/components/editable-row/index.js +24 -7
- package/lib/common/components/form-item/index.d.ts +13 -6
- package/lib/common/components/form-item/index.js +16 -20
- package/lib/common/components/index.d.ts +10 -0
- package/lib/common/components/index.js +30 -8
- package/lib/common/components/input/index.d.ts +23 -0
- package/lib/common/components/input/index.js +37 -0
- package/lib/common/components/invoice/index.d.ts +40 -0
- package/lib/common/components/invoice/index.js +52 -0
- package/lib/common/components/invoice-preview/InvoicePreviewHeader.d.ts +12 -0
- package/lib/common/components/invoice-preview/InvoicePreviewHeader.js +105 -0
- package/lib/common/components/invoice-preview/index.d.ts +16 -0
- package/lib/common/components/invoice-preview/index.js +393 -0
- package/lib/common/components/locale-intl/index.d.ts +0 -10
- package/lib/common/components/locale-intl/index.js +50 -42
- package/lib/common/components/payment-method/index.d.ts +69 -6
- package/lib/common/components/payment-method/index.js +145 -57
- package/lib/common/components/payment-method/paymentMethodForConversion.js +3 -1
- package/lib/common/components/submit-confirmation/SubmitConfirmationSVG.d.ts +3 -0
- package/lib/common/components/submit-confirmation/SubmitConfirmationSVG.js +17 -0
- package/lib/common/components/submit-confirmation/index.d.ts +8 -0
- package/lib/common/components/submit-confirmation/index.js +34 -0
- package/lib/common/components/supplier/CityAutofill.d.ts +18 -0
- package/lib/common/components/supplier/CityAutofill.js +159 -0
- package/lib/common/components/supplier/index.d.ts +79 -5
- package/lib/common/components/supplier/index.js +195 -103
- package/lib/common/components/tooltip/index.d.ts +7 -0
- package/lib/common/components/tooltip/index.js +15 -0
- package/lib/common/components/welcome-modal/index.d.ts +15 -0
- package/lib/common/components/welcome-modal/index.js +26 -0
- package/lib/common/consts/formLayout.js +4 -3
- package/lib/common/consts/validationRules.d.ts +1 -1
- package/lib/common/consts/validationRules.js +6 -0
- package/lib/common/enums/index.js +5 -1
- package/lib/common/style/index.css +18 -0
- package/lib/common/types/BillingLineMetadataOverride.d.ts +2 -0
- package/lib/common/types/CommonProps.d.ts +15 -1
- package/lib/common/types/DiscountType.d.ts +1 -0
- package/lib/common/types/DiscountType.js +2 -0
- package/lib/common/types/ReceiverRequirements.d.ts +1 -1
- package/lib/common/types/ReceiverRequirements.js +1 -0
- package/lib/common/types/index.js +15 -0
- package/lib/create-invoice/IntlLoader.d.ts +0 -6
- package/lib/create-invoice/IntlLoader.js +78 -13
- package/lib/create-invoice/index.d.ts +65 -4
- package/lib/create-invoice/index.js +437 -181
- package/lib/enums.d.ts +2 -3
- package/lib/enums.js +1 -0
- package/lib/index.js +22 -6
- package/lib/translations/locales/en.json +181 -0
- package/lib/translations/locales/is.json +135 -116
- package/lib/translations/locales.d.ts +360 -161
- package/lib/translations/locales.js +3 -2
- package/lib/utils/ApiUtility.d.ts +4 -4
- package/lib/utils/ApiUtility.js +13 -10
- package/lib/utils/BillingLineUtility.d.ts +16 -5
- package/lib/utils/BillingLineUtility.js +65 -26
- package/lib/utils/ConversionUtility.js +15 -7
- package/lib/utils/FileUploadUtility.d.ts +4 -2
- package/lib/utils/FileUploadUtility.js +28 -9
- package/lib/utils/IntlUtility.d.ts +3 -2
- package/lib/utils/IntlUtility.js +2 -1
- package/lib/utils/LocationUtility.d.ts +1 -0
- package/lib/utils/LocationUtility.js +81 -0
- package/lib/utils/ReferenceIdentifierUtility.js +2 -1
- package/lib/utils/RequirementsUtility.d.ts +9 -7
- package/lib/utils/RequirementsUtility.js +46 -22
- package/lib/utils/index.js +4 -3
- package/package.json +36 -18
- package/lib/style/index.css +0 -51
|
@@ -1,277 +1,104 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
15
18
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
16
19
|
if (mod && mod.__esModule) return mod;
|
|
17
20
|
var result = {};
|
|
18
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result
|
|
19
|
-
result
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
20
23
|
return result;
|
|
21
24
|
};
|
|
22
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
27
|
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.translationMessages = void 0;
|
|
26
30
|
var React = __importStar(require("react"));
|
|
27
|
-
var components_1 = require("../../components");
|
|
28
|
-
var icons_1 = require("@ant-design/icons");
|
|
29
|
-
// import '@ant-design/compatible/assets/index.css';
|
|
30
31
|
var antd_1 = require("antd");
|
|
32
|
+
var form_item_1 = __importDefault(require("../form-item"));
|
|
31
33
|
var react_intl_1 = require("react-intl");
|
|
32
|
-
// import {defineMessages} from "react-intl.macro"
|
|
33
34
|
var NewBillingLines_1 = __importDefault(require("./NewBillingLines"));
|
|
34
35
|
var BillingCalculations_1 = __importDefault(require("./BillingCalculations"));
|
|
35
|
-
var
|
|
36
|
-
|
|
36
|
+
var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
|
|
37
|
+
var react_use_1 = require("react-use");
|
|
38
|
+
var tooltip_1 = __importDefault(require("../tooltip"));
|
|
39
|
+
exports.translationMessages = (0, react_intl_1.defineMessages)({
|
|
37
40
|
billingLines_title: {
|
|
38
41
|
id: "billingLines_title",
|
|
39
42
|
defaultMessage: "Document lines",
|
|
40
43
|
},
|
|
41
44
|
billingLines_tooltip_title: {
|
|
42
45
|
id: "billingLines_tooltip_title",
|
|
43
|
-
defaultMessage: "Item number, Name, Quantity, Unit of measure, Unit price amount Tax category and Discount need to be defined here.\n" +
|
|
44
|
-
"
|
|
46
|
+
defaultMessage: "Item number, Name, Quantity, Unit of measure, Unit price amount Tax category and Discount need to be defined here.\n" +
|
|
47
|
+
"VAT is automatically applied.\n" +
|
|
48
|
+
'Click "Add a row" to add a new line', // "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",
|
|
49
|
+
},
|
|
50
|
+
baseInformation_notes: {
|
|
51
|
+
id: "baseInformation_notes",
|
|
52
|
+
defaultMessage: "Notes",
|
|
45
53
|
},
|
|
46
|
-
// billingLines_itemNo: {
|
|
47
|
-
// id: "billingLines_itemNo",
|
|
48
|
-
// defaultMessage: "Item no",
|
|
49
|
-
// },
|
|
50
|
-
// billingLines_name: {
|
|
51
|
-
// id: "billingLines_name",
|
|
52
|
-
// defaultMessage: "Name"
|
|
53
|
-
// },
|
|
54
|
-
// billingLines_quantity: {
|
|
55
|
-
// id: "billingLines_quantity",
|
|
56
|
-
// defaultMessage: "Quantity"
|
|
57
|
-
// },
|
|
58
|
-
// billingLines_unitOfMeasure: {
|
|
59
|
-
// id: "billingLines_unitOfMeasure",
|
|
60
|
-
// defaultMessage: "Unit of measure"
|
|
61
|
-
// },
|
|
62
|
-
// billingLines_unitPriceAmount: {
|
|
63
|
-
// id: "billingLines_unitPriceAmount",
|
|
64
|
-
// defaultMessage: "Unit price amount"
|
|
65
|
-
// },
|
|
66
|
-
// billingLines_taxCategoryType: {
|
|
67
|
-
// id: "billingLines_taxCategoryType",
|
|
68
|
-
// defaultMessage: "Tax category"
|
|
69
|
-
// },
|
|
70
|
-
// billingLines_taxCategoryType_title: {
|
|
71
|
-
// id: "billingLines_taxCategoryType_title",
|
|
72
|
-
// defaultMessage: "A product can not contain VAT unless a VAT number is present" // Ekki er hægt að leggja virðisauka á vöru nema gefa upp VSK númer
|
|
73
|
-
// },
|
|
74
|
-
// billingLines_taxCategoryPercentage: {
|
|
75
|
-
// id: "billingLines_taxCategoryPercentage",
|
|
76
|
-
// defaultMessage: "Tax percentage"
|
|
77
|
-
// },
|
|
78
|
-
// billingLines_discount: {
|
|
79
|
-
// id: "billingLines_discount",
|
|
80
|
-
// defaultMessage: "Discount"
|
|
81
|
-
// },
|
|
82
|
-
// billingLines_lineAmount: {
|
|
83
|
-
// id: "billingLines_lineAmount",
|
|
84
|
-
// defaultMessage: "Amount"
|
|
85
|
-
// },
|
|
86
|
-
// billingLines_taxAmount: {
|
|
87
|
-
// id: "billingLines_taxAmount",
|
|
88
|
-
// defaultMessage: "Tax inclusive amount"
|
|
89
|
-
// },
|
|
90
54
|
billingLines_button_addRow: {
|
|
91
55
|
id: "billingLines_button_addRow",
|
|
92
|
-
defaultMessage: "Add a row"
|
|
56
|
+
defaultMessage: "Add a row",
|
|
93
57
|
},
|
|
94
58
|
billingLines_placeholders_itemNo: {
|
|
95
59
|
id: "billingLines_placeholders_itemNo",
|
|
96
|
-
defaultMessage: "Item No"
|
|
60
|
+
defaultMessage: "Item No",
|
|
97
61
|
},
|
|
98
62
|
billingLines_placeholders_newItem: {
|
|
99
63
|
id: "billingLines_placeholders_newItem",
|
|
100
|
-
defaultMessage: "New Item"
|
|
64
|
+
defaultMessage: "New Item",
|
|
101
65
|
},
|
|
102
66
|
});
|
|
103
|
-
var BillingLines =
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
// render: (text, record) => {
|
|
141
|
-
// return icelandicNumberLocaleWorkaroundChrome(record.unitPriceAmount ? record.unitPriceAmount : 0, props.intl);
|
|
142
|
-
// }
|
|
143
|
-
// // render: this.renderCurrencyColumn,
|
|
144
|
-
// },
|
|
145
|
-
// {
|
|
146
|
-
// title: (
|
|
147
|
-
// <Tooltip
|
|
148
|
-
// title={this.props.intl.formatMessage(translationMessages.billingLines_taxCategoryType_title)}
|
|
149
|
-
// placement={"right"}
|
|
150
|
-
// >
|
|
151
|
-
// <span>{this.props.intl.formatMessage(translationMessages.billingLines_taxCategoryType)} <QuestionCircleOutlined/></span>
|
|
152
|
-
// </Tooltip>
|
|
153
|
-
// ),
|
|
154
|
-
// dataIndex: 'taxCategoryType',
|
|
155
|
-
// align: "right",
|
|
156
|
-
// editable: true,
|
|
157
|
-
// render: ((text, record) => {
|
|
158
|
-
// const taxPercentage = calculateTaxPercentage(TaxCategoryTypeEnum[record.taxCategoryType.value]);
|
|
159
|
-
// return <span>{`${this.props.intl.formatMessage(commonTranslationMessages[`taxCategoryType_labels_${record.taxCategoryType.value}` as keyof typeof commonTranslationMessages])} (${taxPercentage}%)`}</span>
|
|
160
|
-
// })
|
|
161
|
-
// },
|
|
162
|
-
// // {
|
|
163
|
-
// // title: this.props.intl.formatMessage(translationMessages.billingLines_taxCategoryPercentage),
|
|
164
|
-
// // dataIndex: 'taxCategoryPercentage',
|
|
165
|
-
// // editable: false,
|
|
166
|
-
// // align: "right",
|
|
167
|
-
// // render: ((text, record) => {
|
|
168
|
-
// // const taxPercentage = calculateTaxPercentage(TaxCategoryTypeEnum[record.taxCategoryType]); // BillingLineMetadataTaxCategoryTypeEnum -> TaxCategoryTypeEnum
|
|
169
|
-
// // return <span>{taxPercentage}%</span>
|
|
170
|
-
// // })
|
|
171
|
-
// // },
|
|
172
|
-
// {
|
|
173
|
-
// title: this.props.intl.formatMessage(translationMessages.billingLines_discount),
|
|
174
|
-
// dataIndex: 'discountValue',
|
|
175
|
-
// editable: true,
|
|
176
|
-
// align: "right",
|
|
177
|
-
// width: "5em",
|
|
178
|
-
// render: ((text, record) => {
|
|
179
|
-
// return <div>{record.discountValue}</div>
|
|
180
|
-
// })
|
|
181
|
-
// },
|
|
182
|
-
// {
|
|
183
|
-
// title: this.props.intl.formatMessage(translationMessages.billingLines_lineAmount),
|
|
184
|
-
// dataIndex: 'taxableAmount',
|
|
185
|
-
// editable: false,
|
|
186
|
-
// align: "right",
|
|
187
|
-
// render: (text, record) => {
|
|
188
|
-
// const taxableAmount = calculateTaxableAmount(record.discountValue, record.quantity, record.unitPriceAmount);
|
|
189
|
-
// return (
|
|
190
|
-
// <span>{icelandicNumberLocaleWorkaroundChrome(taxableAmount, props.intl, {style: "decimal"})}</span>
|
|
191
|
-
// );
|
|
192
|
-
// }
|
|
193
|
-
// },
|
|
194
|
-
// {
|
|
195
|
-
// title: this.props.intl.formatMessage(translationMessages.billingLines_taxAmount),
|
|
196
|
-
// dataIndex: 'taxInclusiveAmount',
|
|
197
|
-
// editable: false,
|
|
198
|
-
// align: "right",
|
|
199
|
-
// render: (text, record) => {
|
|
200
|
-
// const taxAmount = calculateTaxAmount(calculateTaxableAmount(record.discountValue, record.quantity, record.unitPriceAmount), calculateTaxPercentage(TaxCategoryTypeEnum[record.taxCategoryType.value])); // BillingLineMetadataTaxCategoryTypeEnum -> TaxCategoryTypeEnum
|
|
201
|
-
// const taxableAmount = calculateTaxableAmount(record.discountValue, record.quantity, record.unitPriceAmount);
|
|
202
|
-
// const taxInclusiveAmount = taxableAmount + taxAmount;
|
|
203
|
-
// return (
|
|
204
|
-
// <span>{icelandicNumberLocaleWorkaroundChrome(taxInclusiveAmount, props.intl, {style: "decimal"})}</span>
|
|
205
|
-
// );
|
|
206
|
-
// }
|
|
207
|
-
// },
|
|
208
|
-
// {
|
|
209
|
-
// title: "",
|
|
210
|
-
// render: (text, record) => {
|
|
211
|
-
// return <>
|
|
212
|
-
// <MinusCircleOutlined
|
|
213
|
-
// onClick={() => {
|
|
214
|
-
// this.props.handleDelete(record.key);
|
|
215
|
-
// }}/>
|
|
216
|
-
// </>;
|
|
217
|
-
// }
|
|
218
|
-
// }
|
|
219
|
-
// ]
|
|
220
|
-
}
|
|
221
|
-
// renderCurrencyColumn = (text: string | number) => {
|
|
222
|
-
// const currency = this.props.formInstance.getFieldValue(["invoice", "currencyCode"]) ? this.props.formInstance.getFieldValue(["invoice", "currencyCode"]) : "";
|
|
223
|
-
// return text + " " + currency;
|
|
224
|
-
// };
|
|
225
|
-
BillingLines.prototype.render = function () {
|
|
226
|
-
// const dataSource = this.props.formInstance.getFieldValue(["invoice", "invoiceLines"]);
|
|
227
|
-
// const {dataSource} = this.props;
|
|
228
|
-
// const components = {
|
|
229
|
-
// body: {
|
|
230
|
-
// row: EditableRow,
|
|
231
|
-
// cell: EditableCell,
|
|
232
|
-
// },
|
|
233
|
-
// };
|
|
234
|
-
// const columns: ColumnsType<BillingLineMetadataOverride> = this.columns.map(col => {
|
|
235
|
-
// if (!col.editable) {
|
|
236
|
-
// return col;
|
|
237
|
-
// }
|
|
238
|
-
// return {
|
|
239
|
-
// ...col,
|
|
240
|
-
// onCell: (record: BillingLineMetadataOverride) => ({
|
|
241
|
-
// record,
|
|
242
|
-
// editable: col.editable,
|
|
243
|
-
// dataIndex: col.dataIndex,
|
|
244
|
-
// title: col.title ? col.title.toString() : "", // TODO: will this work?????
|
|
245
|
-
// handleSave: (billingLineMetadataOverrideRecord: BillingLineMetadataOverride, rowIndex: number) => this.props.handleSave(billingLineMetadataOverrideRecord, this.props.formInstance),
|
|
246
|
-
// }),
|
|
247
|
-
// };
|
|
248
|
-
// });
|
|
249
|
-
var billingLinesLabelNode = (React.createElement(antd_1.Tooltip, { title: this.props.intl.formatMessage(exports.translationMessages.billingLines_tooltip_title), placement: "right" },
|
|
250
|
-
React.createElement("span", null,
|
|
251
|
-
this.props.intl.formatMessage(exports.translationMessages.billingLines_title),
|
|
252
|
-
"\u00A0",
|
|
253
|
-
React.createElement(icons_1.QuestionCircleOutlined, null))));
|
|
254
|
-
var currencyCode = this.props.formInstance.getFieldValue(["invoice", "currencyCode"]) ? this.props.formInstance.getFieldValue(["invoice", "currencyCode"]) : "";
|
|
255
|
-
var billingLinesFormValues = this.props.formInstance.getFieldsValue(["invoice", "invoiceLines"]);
|
|
256
|
-
return (React.createElement(components_1.ComponentContainer, { title: billingLinesLabelNode },
|
|
257
|
-
React.createElement(NewBillingLines_1.default, { formInstance: this.props.formInstance, receiverRequirements: this.props.receiverRequirements, outsideVatScope: this.props.outsideVatScope }),
|
|
258
|
-
React.createElement(antd_1.Row, { style: { marginTop: "1em" }, align: "top", justify: "space-between", gutter: [16, 16] },
|
|
259
|
-
React.createElement(antd_1.Col, { span: 16 },
|
|
260
|
-
React.createElement(BillingTaxSummary_1.default
|
|
261
|
-
// billingLines={this.props.billingLinesMetadata}
|
|
262
|
-
, {
|
|
263
|
-
// billingLines={this.props.billingLinesMetadata}
|
|
264
|
-
formInstance: this.props.formInstance, outsideVatScope: this.props.outsideVatScope })),
|
|
265
|
-
React.createElement(antd_1.Col, { span: 8 },
|
|
266
|
-
React.createElement(BillingCalculations_1.default
|
|
267
|
-
// billingLinesMetadata={this.props.billingLinesMetadata}
|
|
268
|
-
// renderCurrencyColumn={this.renderCurrencyColumn}
|
|
269
|
-
, {
|
|
270
|
-
// billingLinesMetadata={this.props.billingLinesMetadata}
|
|
271
|
-
// renderCurrencyColumn={this.renderCurrencyColumn}
|
|
272
|
-
currencyCode: currencyCode, formInstance: this.props.formInstance, outsideVatScope: this.props.outsideVatScope })))));
|
|
273
|
-
};
|
|
274
|
-
return BillingLines;
|
|
275
|
-
}(React.Component));
|
|
276
|
-
var BillingLinesIntl = react_intl_1.injectIntl(BillingLines);
|
|
67
|
+
var BillingLines = function (props) {
|
|
68
|
+
var _a;
|
|
69
|
+
var width = (0, react_use_1.useWindowSize)().width;
|
|
70
|
+
var _b = React.useState(false), isMobile = _b[0], setIsMobile = _b[1];
|
|
71
|
+
var token = antd_1.theme.useToken().token;
|
|
72
|
+
React.useEffect(function () {
|
|
73
|
+
if (width < 768) {
|
|
74
|
+
setIsMobile(true);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
setIsMobile(false);
|
|
78
|
+
}
|
|
79
|
+
}, [width]);
|
|
80
|
+
var currencyCode = props.formInstance.getFieldValue(["invoice", "currencyCode"])
|
|
81
|
+
? props.formInstance.getFieldValue(["invoice", "currencyCode"])
|
|
82
|
+
: "";
|
|
83
|
+
return (React.createElement(antd_1.Flex, { justify: "center" },
|
|
84
|
+
React.createElement(antd_1.Flex, { vertical: true, style: { width: "100%", maxWidth: "900px", paddingBottom: isMobile ? "20px" : "35px" }, gap: "middle" },
|
|
85
|
+
React.createElement(antd_1.Flex, { gap: isMobile ? "small" : "middle", vertical: true, style: isMobile
|
|
86
|
+
? {
|
|
87
|
+
width: "100vw",
|
|
88
|
+
backgroundColor: token.colorInfoBg,
|
|
89
|
+
margin: "0 -20px",
|
|
90
|
+
padding: "20px 20px 0 20px",
|
|
91
|
+
}
|
|
92
|
+
: { paddingTop: "20px" } },
|
|
93
|
+
React.createElement(antd_1.Flex, { gap: "small" },
|
|
94
|
+
React.createElement(antd_1.Typography.Title, { level: 5 }, props.intl.formatMessage(exports.translationMessages.billingLines_title)),
|
|
95
|
+
React.createElement(antd_1.Flex, { style: { marginBottom: (_a = token.Typography) === null || _a === void 0 ? void 0 : _a.titleMarginBottom } },
|
|
96
|
+
React.createElement(tooltip_1.default, { title: props.intl.formatMessage(exports.translationMessages.billingLines_tooltip_title) }))),
|
|
97
|
+
React.createElement(NewBillingLines_1.default, { formInstance: props.formInstance, receiverRequirements: props.receiverRequirements, outsideVatScope: props.outsideVatScope })),
|
|
98
|
+
React.createElement(antd_1.Flex, { gap: "middle", vertical: true },
|
|
99
|
+
React.createElement(BillingCalculations_1.default, { currencyCode: currencyCode, formInstance: props.formInstance, outsideVatScope: props.outsideVatScope }),
|
|
100
|
+
React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.notes, defaultLabel: props.intl.formatMessage(exports.translationMessages.baseInformation_notes), defaultIsRequired: false, fieldName: ["invoice", "notes"], style: { marginBottom: 0 } },
|
|
101
|
+
React.createElement(antd_1.Input.TextArea, { placeholder: props.intl.formatMessage(exports.translationMessages.baseInformation_notes) }))))));
|
|
102
|
+
};
|
|
103
|
+
var BillingLinesIntl = (0, react_intl_1.injectIntl)(BillingLines);
|
|
277
104
|
exports.default = BillingLinesIntl;
|
|
@@ -16,7 +16,7 @@ var ComponentContainer = function (props) {
|
|
|
16
16
|
react_1.default.createElement(antd_1.Col, { span: 24 },
|
|
17
17
|
react_1.default.createElement(Header_1.default, { iconProps: iconProps, title: title, action: action }))),
|
|
18
18
|
react_1.default.createElement(antd_1.Row, null,
|
|
19
|
-
react_1.default.createElement(antd_1.Col, { span: 24, className: ""
|
|
19
|
+
react_1.default.createElement(antd_1.Col, { span: 24, className: "".concat(noPadding ? '' : 'component_wrapper_padding') },
|
|
20
20
|
react_1.default.createElement(Content_1.default, null, props.children)))));
|
|
21
21
|
};
|
|
22
22
|
exports.default = ComponentContainer;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WrappedComponentProps } from "react-intl";
|
|
3
3
|
import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
|
|
4
4
|
import { FormInstance } from "antd/es/form";
|
|
5
|
-
interface Props extends
|
|
5
|
+
interface Props extends WrappedComponentProps {
|
|
6
6
|
receiverRequirements: NewReceiverRequirements;
|
|
7
7
|
updateReceiverRequirementsProp: (receiverRequirements: NewReceiverRequirements) => void;
|
|
8
8
|
rapiBaseUrl: string;
|
|
9
9
|
formInstance: FormInstance;
|
|
10
10
|
legalIdentifier: string;
|
|
11
11
|
}
|
|
12
|
-
declare const _default: React.
|
|
13
|
-
|
|
12
|
+
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
|
|
13
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
14
|
+
} & React.RefAttributes<any>> & {
|
|
15
|
+
WrappedComponent: React.ComponentType<Props>;
|
|
14
16
|
};
|
|
15
17
|
export default _default;
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
2
18
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
19
|
if (mod && mod.__esModule) return mod;
|
|
4
20
|
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result
|
|
6
|
-
result
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
7
23
|
return result;
|
|
8
24
|
};
|
|
9
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
@@ -108,7 +124,7 @@ var translationMessages = {
|
|
|
108
124
|
// : {}
|
|
109
125
|
//
|
|
110
126
|
// return <Select
|
|
111
|
-
//
|
|
127
|
+
// popupMatchSelectWidth={false}
|
|
112
128
|
// allowClear
|
|
113
129
|
// {...selectProps}
|
|
114
130
|
// placeholder={getFieldPlaceholderOverride(receiverRequirements,AvailableFields["customer.locationIdentifier"], constCenterPlaceholderSearch)}
|
|
@@ -133,15 +149,15 @@ var translationMessages = {
|
|
|
133
149
|
// }
|
|
134
150
|
// }
|
|
135
151
|
var CostCenter = function (props) {
|
|
136
|
-
var _a = react_1.useState(""), costCenterHandlingValidationStatus = _a[0], setCostCenterHandlingValidationStatus = _a[1];
|
|
137
|
-
var _b = react_1.useState({}), costCenterFieldProps = _b[0], setCostCenterFieldProps = _b[1];
|
|
138
|
-
var _c = react_1.useState(false), loadingCostCenterValues = _c[0], setLoadingCostCenterValues = _c[1];
|
|
139
|
-
var costCenterFieldDefinition = RequirementsUtility_1.getFieldRequirements(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["customer.locationIdentifier"]);
|
|
152
|
+
var _a = (0, react_1.useState)(""), costCenterHandlingValidationStatus = _a[0], setCostCenterHandlingValidationStatus = _a[1];
|
|
153
|
+
var _b = (0, react_1.useState)({}), costCenterFieldProps = _b[0], setCostCenterFieldProps = _b[1];
|
|
154
|
+
var _c = (0, react_1.useState)(false), loadingCostCenterValues = _c[0], setLoadingCostCenterValues = _c[1];
|
|
155
|
+
var costCenterFieldDefinition = (0, RequirementsUtility_1.getFieldRequirements)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["customer.locationIdentifier"]);
|
|
140
156
|
if (costCenterFieldDefinition) {
|
|
141
|
-
return (react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.locationIdentifier"], defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_costCenter), defaultIsRequired: false, fieldName: ["invoice", "customer", "locationIdentifier"], validateStatus: costCenterHandlingValidationStatus }, RequirementsUtility_1.getInput(costCenterFieldDefinition, ["invoice", "customer", "locationIdentifier"], "handleCostCenterValidation", props.legalIdentifier, props.formInstance, props.rapiBaseUrl, props.receiverRequirements, props.updateReceiverRequirementsProp, setCostCenterFieldProps, costCenterFieldProps, setLoadingCostCenterValues, loadingCostCenterValues, setCostCenterHandlingValidationStatus, true)));
|
|
157
|
+
return (react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.locationIdentifier"], defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_costCenter), defaultIsRequired: false, fieldName: ["invoice", "customer", "locationIdentifier"], validateStatus: costCenterHandlingValidationStatus }, (0, RequirementsUtility_1.getInput)(costCenterFieldDefinition, ["invoice", "customer", "locationIdentifier"], "handleCostCenterValidation", props.legalIdentifier, props.formInstance, props.rapiBaseUrl, props.receiverRequirements, props.updateReceiverRequirementsProp, setCostCenterFieldProps, costCenterFieldProps, setLoadingCostCenterValues, loadingCostCenterValues, setCostCenterHandlingValidationStatus, props.intl.formatMessage(translationMessages.baseInformation_costCenter), true)));
|
|
142
158
|
}
|
|
143
159
|
else {
|
|
144
160
|
return null;
|
|
145
161
|
}
|
|
146
162
|
};
|
|
147
|
-
exports.default = react_intl_1.injectIntl(CostCenter);
|
|
163
|
+
exports.default = (0, react_intl_1.injectIntl)(CostCenter);
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WrappedComponentProps } from "react-intl";
|
|
3
3
|
import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
|
|
4
4
|
import { FormInstance } from "antd/es/form";
|
|
5
|
-
interface CustomerContactNameProps extends
|
|
5
|
+
interface CustomerContactNameProps extends WrappedComponentProps {
|
|
6
6
|
receiverRequirements: NewReceiverRequirements;
|
|
7
7
|
updateReceiverRequirementsProp: (receiverRequirements: NewReceiverRequirements) => void;
|
|
8
8
|
rapiBaseUrl: string;
|
|
9
9
|
formInstance: FormInstance;
|
|
10
10
|
legalIdentifier: string;
|
|
11
11
|
}
|
|
12
|
-
declare const _default: React.
|
|
13
|
-
|
|
12
|
+
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<CustomerContactNameProps, "intl"> & {
|
|
13
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
14
|
+
} & React.RefAttributes<any>> & {
|
|
15
|
+
WrappedComponent: React.ComponentType<CustomerContactNameProps>;
|
|
14
16
|
};
|
|
15
17
|
export default _default;
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
2
18
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
19
|
if (mod && mod.__esModule) return mod;
|
|
4
20
|
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result
|
|
6
|
-
result
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
7
23
|
return result;
|
|
8
24
|
};
|
|
9
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
@@ -23,15 +39,15 @@ var translationMessages = {
|
|
|
23
39
|
},
|
|
24
40
|
};
|
|
25
41
|
var CustomerContactName = function (props) {
|
|
26
|
-
var _a = react_1.useState(""), customerContactNameHandlingValidationStatus = _a[0], setCustomerContactNameHandlingValidationStatus = _a[1];
|
|
27
|
-
var _b = react_1.useState({}), customerContactNameFieldProps = _b[0], setCustomerContactNameFieldProps = _b[1];
|
|
28
|
-
var _c = react_1.useState(false), loadingCustomerContactNameValues = _c[0], setLoadingCustomerContactNameValues = _c[1];
|
|
29
|
-
var customerContactNameFieldDefinition = RequirementsUtility_1.getFieldRequirements(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["customer.contact.name"]);
|
|
42
|
+
var _a = (0, react_1.useState)(""), customerContactNameHandlingValidationStatus = _a[0], setCustomerContactNameHandlingValidationStatus = _a[1];
|
|
43
|
+
var _b = (0, react_1.useState)({}), customerContactNameFieldProps = _b[0], setCustomerContactNameFieldProps = _b[1];
|
|
44
|
+
var _c = (0, react_1.useState)(false), loadingCustomerContactNameValues = _c[0], setLoadingCustomerContactNameValues = _c[1];
|
|
45
|
+
var customerContactNameFieldDefinition = (0, RequirementsUtility_1.getFieldRequirements)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["customer.contact.name"]);
|
|
30
46
|
if (customerContactNameFieldDefinition) {
|
|
31
|
-
return (React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.contact.name"],
|
|
47
|
+
return (React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.contact.name"], defaultIsRequired: false, fieldName: ["invoice", "customer", "contact", "name"], validateStatus: customerContactNameHandlingValidationStatus }, (0, RequirementsUtility_1.getInput)(customerContactNameFieldDefinition, ["invoice", "customer", "contact", "name"], "handleCostCenterValidation", props.legalIdentifier, props.formInstance, props.rapiBaseUrl, props.receiverRequirements, props.updateReceiverRequirementsProp, setCustomerContactNameFieldProps, customerContactNameFieldProps, setLoadingCustomerContactNameValues, loadingCustomerContactNameValues, setCustomerContactNameHandlingValidationStatus, props.intl.formatMessage(translationMessages.baseInformation_customerContactName), true)));
|
|
32
48
|
}
|
|
33
49
|
else {
|
|
34
50
|
return null;
|
|
35
51
|
}
|
|
36
52
|
};
|
|
37
|
-
exports.default = react_intl_1.injectIntl(CustomerContactName);
|
|
53
|
+
exports.default = (0, react_intl_1.injectIntl)(CustomerContactName);
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
2
18
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
19
|
if (mod && mod.__esModule) return mod;
|
|
4
20
|
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result
|
|
6
|
-
result
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
7
23
|
return result;
|
|
8
24
|
};
|
|
9
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -17,7 +33,7 @@ var Customer = function (props) {
|
|
|
17
33
|
" (",
|
|
18
34
|
participantLegalIsoIdentifier,
|
|
19
35
|
")"),
|
|
20
|
-
React.createElement("div", null, participantLegalAddressPostalCode
|
|
36
|
+
React.createElement("div", null, "".concat(participantLegalAddressPostalCode, " ").concat(participantLegalAddressCity)),
|
|
21
37
|
React.createElement("div", null, participantLegalAddressStreet),
|
|
22
38
|
React.createElement("div", null, country),
|
|
23
39
|
React.createElement("div", null, email)));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { WrappedComponentProps } from "react-intl";
|
|
3
3
|
import { FormInstance } from "antd/es/form";
|
|
4
4
|
import { PartyMetadata } from "@unimaze/api-clients/lib/mapi";
|
|
5
5
|
import { ProfileOutputWithApiKey } from "../../types/AppConfiguration";
|
|
6
6
|
import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
|
|
7
|
-
interface Props extends
|
|
7
|
+
interface Props extends WrappedComponentProps {
|
|
8
8
|
receiverRequirements: NewReceiverRequirements;
|
|
9
9
|
customers: ProfileOutputWithApiKey[];
|
|
10
10
|
formInstance: FormInstance;
|
|
@@ -13,8 +13,14 @@ interface Props extends InjectedIntlProps {
|
|
|
13
13
|
setChosenCustomerApiKey: (chosenCustomerApiKey: string) => void;
|
|
14
14
|
rapiBaseUrl: string;
|
|
15
15
|
updateReceiverRequirementsProp: (newReceiverRequirements: NewReceiverRequirements) => void;
|
|
16
|
+
validateFields: (fieldNames: string[][], validateOnly?: boolean | undefined) => void;
|
|
17
|
+
isSaveFieldValuesSelected: boolean;
|
|
18
|
+
onSaveFieldValuesChange: () => void;
|
|
19
|
+
isActiveStep: boolean;
|
|
16
20
|
}
|
|
17
|
-
declare const CustomerIntl: React.
|
|
18
|
-
|
|
21
|
+
declare const CustomerIntl: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
|
|
22
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
23
|
+
} & React.RefAttributes<any>> & {
|
|
24
|
+
WrappedComponent: React.ComponentType<Props>;
|
|
19
25
|
};
|
|
20
26
|
export default CustomerIntl;
|