@unimaze/billing 0.21.68 → 0.21.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/components/attachments/AttachmentList.d.ts +10 -0
- package/lib/common/components/attachments/AttachmentList.js +143 -0
- package/lib/common/components/attachments/AttachmentModal.d.ts +44 -5
- package/lib/common/components/attachments/AttachmentModal.js +54 -80
- package/lib/common/components/attachments/index.d.ts +20 -6
- package/lib/common/components/attachments/index.js +25 -206
- package/lib/common/components/billing-lines/SingleBillingLine.js +12 -3
- package/lib/common/components/form-item/index.d.ts +4 -0
- package/lib/common/components/form-item/index.js +4 -0
- package/lib/common/consts/validationRules.d.ts +2 -0
- package/lib/common/consts/validationRules.js +18 -1
- package/lib/create-invoice/index.js +121 -120
- package/lib/translations/locales/en.json +1 -0
- package/lib/translations/locales/is.json +1 -0
- package/lib/translations/locales.d.ts +2 -0
- package/lib/utils/ApiUtility.js +85 -13
- package/lib/utils/AttachmentsUtility.d.ts +13 -2
- package/lib/utils/AttachmentsUtility.js +98 -11
- package/lib/utils/BillingLineUtility.d.ts +1 -1
- package/lib/utils/BillingLineUtility.js +2 -2
- package/lib/utils/FileUploadUtility.d.ts +2 -1
- package/lib/utils/FileUploadUtility.js +10 -1
- package/package.json +2 -1
|
@@ -174,33 +174,31 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
174
174
|
setIsMobile(false);
|
|
175
175
|
}
|
|
176
176
|
}, [width]);
|
|
177
|
-
var _g = (0, react_1.useState)(
|
|
178
|
-
var _h = (0, react_1.useState)(
|
|
179
|
-
var _j = (0, react_1.useState)(
|
|
180
|
-
var _k = (0, react_1.useState)(
|
|
181
|
-
var _l = (0, react_1.useState)(
|
|
182
|
-
var _m = (0, react_1.useState)(
|
|
183
|
-
var _o = (0, react_1.useState)(
|
|
184
|
-
var _p = (0, react_1.useState)(
|
|
185
|
-
var _q = (0, react_1.useState)(
|
|
186
|
-
var _r = (0, react_1.useState)(
|
|
187
|
-
var _s =
|
|
188
|
-
var _t = (0, react_1.useState)(
|
|
189
|
-
var _u = react_1.
|
|
190
|
-
var _v = (0, react_1.useState)(
|
|
191
|
-
var _w = (0, react_1.useState)(
|
|
192
|
-
var _x = (0, react_1.useState)(
|
|
193
|
-
var _y = (0, react_1.useState)(
|
|
194
|
-
var _z = (0, react_1.useState)(
|
|
195
|
-
var _0 = (0, react_1.useState)(
|
|
196
|
-
var _1 = (0, react_1.useState)(
|
|
197
|
-
var _2 = (0, react_1.useState)(
|
|
198
|
-
var _3 = (0, react_1.useState)(
|
|
199
|
-
var _4 = (0, react_1.useState)(
|
|
200
|
-
var _5 = (0, react_1.useState)(
|
|
201
|
-
var _6 = (0, react_1.useState)(
|
|
202
|
-
var _7 = (0, react_1.useState)([]), allAttachmentsWithStatuses = _7[0], setAllAttachmentsWithStatuses = _7[1];
|
|
203
|
-
var _8 = (0, react_1.useState)(true), showWelcomeModal = _8[0], setShowWelcomeModal = _8[1];
|
|
177
|
+
var _g = (0, react_1.useState)(true), isSubmitDisabled = _g[0], setIsSubmitDisabled = _g[1];
|
|
178
|
+
var _h = (0, react_1.useState)(false), isBackButtonVisible = _h[0], setIsBackButtonVisible = _h[1];
|
|
179
|
+
var _j = (0, react_1.useState)(true), isNextStepDisabled = _j[0], setIsNextStepDisabled = _j[1];
|
|
180
|
+
var _k = (0, react_1.useState)(false), isNextStepVisible = _k[0], setIsNextStepVisible = _k[1];
|
|
181
|
+
var _l = (0, react_1.useState)(0), activeStep = _l[0], setActiveStep = _l[1];
|
|
182
|
+
var _m = (0, react_1.useState)(true), isWelcomeModalOpen = _m[0], setIsWelcomeModalOpen = _m[1];
|
|
183
|
+
var _o = (0, react_1.useState)(""), supplierEmail = _o[0], setSupplierEmail = _o[1];
|
|
184
|
+
var _p = (0, react_1.useState)(false), isSaveFieldValuesSelected = _p[0], setIsSaveFieldValuesSelected = _p[1];
|
|
185
|
+
var _q = (0, react_1.useState)((0, ConversionUtility_1.profileOutputToPartyMetadata)(props.customers[0])), chosenCustomer = _q[0], setChosenCustomer = _q[1];
|
|
186
|
+
var _r = (0, react_1.useState)(false), sendCopy = _r[0], setSendCopy = _r[1];
|
|
187
|
+
var _s = react_1.default.useState(""), referenceIdentifierValidateStatus = _s[0], setReferenceIdentifierValidateStatus = _s[1];
|
|
188
|
+
var _t = (0, react_1.useState)(true), referenceIdentifierIsMandatory = _t[0], setReferenceIdentifierIsMandatory = _t[1];
|
|
189
|
+
var _u = (0, react_1.useState)(false), outsideVatScope = _u[0], setOutsideVatScope = _u[1];
|
|
190
|
+
var _v = (0, react_1.useState)(false), captchaVerified = _v[0], setCaptchaVerified = _v[1];
|
|
191
|
+
var _w = (0, react_1.useState)({}), removedInvoiceLine = _w[0], setRemovedInvoiceLine = _w[1];
|
|
192
|
+
var _x = (0, react_1.useState)(undefined), missingRequiredDataTooltip = _x[0], setMissingRequiredDataTooltip = _x[1];
|
|
193
|
+
var _y = (0, react_1.useState)(false), newLineSaved = _y[0], setNewLineSaved = _y[1];
|
|
194
|
+
var _z = (0, react_1.useState)(0), numberOfAttemptedCalls = _z[0], setNumberOfAttemptedCalls = _z[1];
|
|
195
|
+
var _0 = (0, react_1.useState)(''), messageIdForRetryAttachments = _0[0], setMessageIdForRetryAttachments = _0[1];
|
|
196
|
+
var _1 = (0, react_1.useState)(''), tokenForRetryAttachments = _1[0], setTokenForRetryAttachments = _1[1];
|
|
197
|
+
var _2 = (0, react_1.useState)([]), allAttachments = _2[0], setAllAttachments = _2[1];
|
|
198
|
+
var _3 = (0, react_1.useState)(false), alreadyRetried = _3[0], setAlreadyRetried = _3[1];
|
|
199
|
+
var _4 = (0, react_1.useState)(AttachmentUploadStatus_1.SubmittingStatus.Pending), invoiceSubmittingStatus = _4[0], setInvoiceSubmittingStatus = _4[1];
|
|
200
|
+
var _5 = (0, react_1.useState)([]), allAttachmentsWithStatuses = _5[0], setAllAttachmentsWithStatuses = _5[1];
|
|
201
|
+
var _6 = (0, react_1.useState)(true), showWelcomeModal = _6[0], setShowWelcomeModal = _6[1];
|
|
204
202
|
var url = new URL(window.location.href);
|
|
205
203
|
var skipWelcomeModal = url.searchParams.has("skipintro");
|
|
206
204
|
if (skipWelcomeModal) {
|
|
@@ -211,7 +209,7 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
211
209
|
var getDefaultPaymentType = function (defaultPaymentType) {
|
|
212
210
|
return defaultPaymentType || mapi_1.PaymentMeansType.DomesticClaim;
|
|
213
211
|
};
|
|
214
|
-
var
|
|
212
|
+
var _7 = (0, react_1.useState)({
|
|
215
213
|
invoice: {
|
|
216
214
|
supplier: {
|
|
217
215
|
address: {
|
|
@@ -237,22 +235,79 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
237
235
|
},
|
|
238
236
|
issueDate: (0, dayjs_1.default)(),
|
|
239
237
|
},
|
|
240
|
-
}), formData =
|
|
241
|
-
var values = antd_1.Form.useWatch([], form);
|
|
242
|
-
var validateBillingLinesAndRefIdentifierField = function (isMultipleReferenceIdentifier, isSingleReferenceIdentifier, someRequiredFieldsEmpty) {
|
|
243
|
-
var validationErrors = (0, ValidationUtility_1.validateInvoiceFieldsWithoutRules)(form, isMultipleReferenceIdentifier, isSingleReferenceIdentifier, someRequiredFieldsEmpty, setIsNextStepDisabled, referenceIdentifierIsMandatory, referenceIdentifierValidateStatus, intl);
|
|
244
|
-
var billingLineValidationMessage = (0, ValidationUtility_1.validateBillingLines)(form, setIsNextStepDisabled, intl);
|
|
245
|
-
return [validationErrors, billingLineValidationMessage];
|
|
246
|
-
};
|
|
238
|
+
}), formData = _7[0], setFormData = _7[1];
|
|
247
239
|
(0, react_1.useEffect)(function () {
|
|
248
|
-
var
|
|
249
|
-
var
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
240
|
+
var _a, _b, _c;
|
|
241
|
+
var savedValuesObject = (0, LocalStorageUtility_1.getFormFromLocalStorage)(props.localStorageFormDataVersion);
|
|
242
|
+
if (savedValuesObject) {
|
|
243
|
+
if ((chosenCustomer === null || chosenCustomer === void 0 ? void 0 : chosenCustomer.identifier) !== ((_b = (_a = savedValuesObject === null || savedValuesObject === void 0 ? void 0 : savedValuesObject.invoice) === null || _a === void 0 ? void 0 : _a.customer) === null || _b === void 0 ? void 0 : _b.locationIdentifier)) {
|
|
244
|
+
var customerFromLocalStorage = (_c = savedValuesObject.invoice) === null || _c === void 0 ? void 0 : _c.customer;
|
|
245
|
+
setChosenCustomer(customerFromLocalStorage);
|
|
246
|
+
}
|
|
247
|
+
var invoice = savedValuesObject.invoice, rest = __rest(savedValuesObject, ["invoice"]);
|
|
248
|
+
var issueDate = invoice.issueDate, restOfInvoice = __rest(invoice, ["issueDate"]);
|
|
249
|
+
form.setFieldsValue(__assign({ invoice: restOfInvoice }, rest));
|
|
250
|
+
}
|
|
251
|
+
}, []);
|
|
252
|
+
(0, react_1.useEffect)(function () {
|
|
253
|
+
validateFields();
|
|
254
|
+
}, [form, activeStep, newLineSaved, referenceIdentifierValidateStatus]);
|
|
255
|
+
(0, react_1.useEffect)(function () {
|
|
256
|
+
setSupplierEmail(form.getFieldValue(["invoice", "supplier", "contact", "electronicMail"]));
|
|
257
|
+
}, [form.getFieldValue(["invoice", "supplier", "contact", "electronicMail"])]);
|
|
258
|
+
(0, react_1.useEffect)(function () {
|
|
259
|
+
setOutsideVatScope(!!form.getFieldValue(["outsideVatScope"]));
|
|
260
|
+
}, [form.getFieldValue(["outsideVatScope"])]);
|
|
261
|
+
(0, react_1.useEffect)(function () {
|
|
262
|
+
setIsSubmitDisabled(!captchaVerified);
|
|
263
|
+
}, [captchaVerified]);
|
|
264
|
+
(0, react_1.useEffect)(function () {
|
|
265
|
+
setIsBackButtonVisible(activeStep > 0 && activeStep <= items.length);
|
|
266
|
+
setIsNextStepVisible(activeStep < items.length);
|
|
267
|
+
}, [activeStep]);
|
|
268
|
+
(0, react_1.useEffect)(function () {
|
|
269
|
+
if (outsideVatScope) {
|
|
270
|
+
form.resetFields([["invoice", "supplier", "vatNumber"]]);
|
|
271
|
+
}
|
|
272
|
+
var invoiceLines = form.getFieldValue(["invoice", "invoiceLines"]);
|
|
273
|
+
if (outsideVatScope) {
|
|
274
|
+
invoiceLines = invoiceLines.map(function (invoiceLine) {
|
|
275
|
+
invoiceLine.taxCategoryType = mapi_1.TaxCategoryTypeEnum.OutsideTaxScope;
|
|
276
|
+
return invoiceLine;
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
invoiceLines = invoiceLines.map(function (invoiceLine) {
|
|
281
|
+
invoiceLine.taxCategoryType = mapi_1.TaxCategoryTypeEnum.StandardRated;
|
|
282
|
+
return invoiceLine;
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
form.setFieldsValue({
|
|
286
|
+
invoice: {
|
|
287
|
+
invoiceLines: invoiceLines,
|
|
288
|
+
},
|
|
289
|
+
});
|
|
290
|
+
}, [outsideVatScope]);
|
|
291
|
+
(0, react_1.useEffect)(function () {
|
|
292
|
+
getReceiverRequirements();
|
|
293
|
+
}, [chosenCustomer]);
|
|
294
|
+
// useEffect(() => {
|
|
295
|
+
// if (supplierEmail) {
|
|
296
|
+
// form.validateFields([["invoice", "supplier", "contact", "electronicMail"]])
|
|
297
|
+
// .then(() => {
|
|
298
|
+
// setSendCopyDisabled(!supplierEmail);
|
|
299
|
+
// setSendCopy(true);
|
|
300
|
+
// })
|
|
301
|
+
// .catch(() => {
|
|
302
|
+
// setSendCopyDisabled(true);
|
|
303
|
+
// setSendCopy(false);
|
|
304
|
+
// });
|
|
305
|
+
// } else {
|
|
306
|
+
// setSendCopy(false);
|
|
307
|
+
// setSendCopyDisabled(true);
|
|
308
|
+
// }
|
|
309
|
+
// }, [supplierEmail]);
|
|
310
|
+
var validateFields = function () {
|
|
256
311
|
switch (activeStep) {
|
|
257
312
|
case 0: {
|
|
258
313
|
form.validateFields(formPaths_1.customerFieldPaths, { validateOnly: true })
|
|
@@ -277,13 +332,21 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
277
332
|
break;
|
|
278
333
|
}
|
|
279
334
|
case 2: {
|
|
335
|
+
var referenceIdentifiersDefinitions = (0, ReferenceIdentifierUtility_1.getReferenceIdentifierFieldDefinitions)(props.receiverRequirements);
|
|
336
|
+
var isSingleReferenceIdentifier_1 = (referenceIdentifiersDefinitions === null || referenceIdentifiersDefinitions === void 0 ? void 0 : referenceIdentifiersDefinitions.length) === 1;
|
|
337
|
+
var isMultipleReferenceIdentifier_1 = (referenceIdentifiersDefinitions === null || referenceIdentifiersDefinitions === void 0 ? void 0 : referenceIdentifiersDefinitions.length) > 1;
|
|
338
|
+
var someRequiredFieldsEmpty_1 = function () {
|
|
339
|
+
var _a, _b, _c;
|
|
340
|
+
var referenceIdentifierType = form.getFieldValue(["invoice", "referenceIdentifiers"]);
|
|
341
|
+
return ((_a = referenceIdentifierType[0]) === null || _a === void 0 ? void 0 : _a.code) ? !((_c = (_b = referenceIdentifierType[0]) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.trim()) : false;
|
|
342
|
+
};
|
|
280
343
|
form.validateFields(formPaths_1.invoiceFieldPaths, { validateOnly: true })
|
|
281
344
|
.then(function () {
|
|
282
|
-
var additionalValidationMessages = validateBillingLinesAndRefIdentifierField(
|
|
345
|
+
var additionalValidationMessages = validateBillingLinesAndRefIdentifierField(isMultipleReferenceIdentifier_1, isSingleReferenceIdentifier_1, someRequiredFieldsEmpty_1);
|
|
283
346
|
additionalValidationMessages.filter(function (messageEntry) { return messageEntry !== undefined; }).length > 0 ? setMissingRequiredDataTooltip((0, RequirementsUtility_1.getRequiredTooltipMessage)(intl.formatMessage(CommonTranslations_1.commonTranslationMessages.missingRequiredData), additionalValidationMessages)) : setMissingRequiredDataTooltip(undefined);
|
|
284
347
|
})
|
|
285
348
|
.catch(function (error) {
|
|
286
|
-
var additionalValidationMessages = validateBillingLinesAndRefIdentifierField(
|
|
349
|
+
var additionalValidationMessages = validateBillingLinesAndRefIdentifierField(isMultipleReferenceIdentifier_1, isSingleReferenceIdentifier_1, someRequiredFieldsEmpty_1);
|
|
287
350
|
(0, ValidationUtility_1.handleValidationErrors)(error, setMissingRequiredDataTooltip, setIsNextStepDisabled, props.receiverRequirements, intl, additionalValidationMessages);
|
|
288
351
|
});
|
|
289
352
|
break;
|
|
@@ -304,7 +367,12 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
304
367
|
return;
|
|
305
368
|
}
|
|
306
369
|
}
|
|
307
|
-
}
|
|
370
|
+
};
|
|
371
|
+
var validateBillingLinesAndRefIdentifierField = function (isMultipleReferenceIdentifier, isSingleReferenceIdentifier, someRequiredFieldsEmpty) {
|
|
372
|
+
var validationErrors = (0, ValidationUtility_1.validateInvoiceFieldsWithoutRules)(form, isMultipleReferenceIdentifier, isSingleReferenceIdentifier, someRequiredFieldsEmpty, setIsNextStepDisabled, referenceIdentifierIsMandatory, referenceIdentifierValidateStatus, intl);
|
|
373
|
+
var billingLineValidationMessage = (0, ValidationUtility_1.validateBillingLines)(form, setIsNextStepDisabled, intl);
|
|
374
|
+
return [validationErrors, billingLineValidationMessage];
|
|
375
|
+
};
|
|
308
376
|
var saveFieldValuesToLocalStorage = function () {
|
|
309
377
|
var _a, _b, _c, _d;
|
|
310
378
|
var flatFields = form.getFieldsValue();
|
|
@@ -356,71 +424,6 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
356
424
|
saveFieldValuesToLocalStorage();
|
|
357
425
|
}
|
|
358
426
|
};
|
|
359
|
-
(0, react_1.useEffect)(function () {
|
|
360
|
-
var _a, _b, _c;
|
|
361
|
-
var savedValuesObject = (0, LocalStorageUtility_1.getFormFromLocalStorage)(props.localStorageFormDataVersion);
|
|
362
|
-
if (savedValuesObject) {
|
|
363
|
-
if ((chosenCustomer === null || chosenCustomer === void 0 ? void 0 : chosenCustomer.identifier) !== ((_b = (_a = savedValuesObject === null || savedValuesObject === void 0 ? void 0 : savedValuesObject.invoice) === null || _a === void 0 ? void 0 : _a.customer) === null || _b === void 0 ? void 0 : _b.locationIdentifier)) {
|
|
364
|
-
var customerFromLocalStorage = (_c = savedValuesObject.invoice) === null || _c === void 0 ? void 0 : _c.customer;
|
|
365
|
-
setChosenCustomer(customerFromLocalStorage);
|
|
366
|
-
}
|
|
367
|
-
var invoice = savedValuesObject.invoice, rest = __rest(savedValuesObject, ["invoice"]);
|
|
368
|
-
var issueDate = invoice.issueDate, restOfInvoice = __rest(invoice, ["issueDate"]);
|
|
369
|
-
form.setFieldsValue(__assign({ invoice: restOfInvoice }, rest));
|
|
370
|
-
}
|
|
371
|
-
}, []);
|
|
372
|
-
(0, react_1.useEffect)(function () {
|
|
373
|
-
setSupplierEmail(form.getFieldValue(["invoice", "supplier", "contact", "electronicMail"]));
|
|
374
|
-
}, [form.getFieldValue(["invoice", "supplier", "contact", "electronicMail"])]);
|
|
375
|
-
(0, react_1.useEffect)(function () {
|
|
376
|
-
setOutsideVatScope(!!form.getFieldValue(["outsideVatScope"]));
|
|
377
|
-
}, [form.getFieldValue(["outsideVatScope"])]);
|
|
378
|
-
(0, react_1.useEffect)(function () {
|
|
379
|
-
setIsSubmitDisabled(!captchaVerified);
|
|
380
|
-
}, [captchaVerified]);
|
|
381
|
-
(0, react_1.useEffect)(function () {
|
|
382
|
-
setIsBackButtonVisible(activeStep > 0 && activeStep <= items.length);
|
|
383
|
-
setIsNextStepVisible(activeStep < items.length);
|
|
384
|
-
}, [activeStep]);
|
|
385
|
-
(0, react_1.useEffect)(function () {
|
|
386
|
-
if (outsideVatScope) {
|
|
387
|
-
form.resetFields([["invoice", "supplier", "vatNumber"]]);
|
|
388
|
-
}
|
|
389
|
-
var invoiceLines = form.getFieldValue(["invoice", "invoiceLines"]);
|
|
390
|
-
if (outsideVatScope) {
|
|
391
|
-
invoiceLines = invoiceLines.map(function (invoiceLine) {
|
|
392
|
-
invoiceLine.taxCategoryType = mapi_1.TaxCategoryTypeEnum.OutsideTaxScope;
|
|
393
|
-
return invoiceLine;
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
else {
|
|
397
|
-
invoiceLines = invoiceLines.map(function (invoiceLine) {
|
|
398
|
-
invoiceLine.taxCategoryType = mapi_1.TaxCategoryTypeEnum.StandardRated;
|
|
399
|
-
return invoiceLine;
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
form.setFieldsValue({
|
|
403
|
-
invoice: {
|
|
404
|
-
invoiceLines: invoiceLines,
|
|
405
|
-
},
|
|
406
|
-
});
|
|
407
|
-
}, [outsideVatScope]);
|
|
408
|
-
// useEffect(() => {
|
|
409
|
-
// if (supplierEmail) {
|
|
410
|
-
// form.validateFields([["invoice", "supplier", "contact", "electronicMail"]])
|
|
411
|
-
// .then(() => {
|
|
412
|
-
// setSendCopyDisabled(!supplierEmail);
|
|
413
|
-
// setSendCopy(true);
|
|
414
|
-
// })
|
|
415
|
-
// .catch(() => {
|
|
416
|
-
// setSendCopyDisabled(true);
|
|
417
|
-
// setSendCopy(false);
|
|
418
|
-
// });
|
|
419
|
-
// } else {
|
|
420
|
-
// setSendCopy(false);
|
|
421
|
-
// setSendCopyDisabled(true);
|
|
422
|
-
// }
|
|
423
|
-
// }, [supplierEmail]);
|
|
424
427
|
var retryUploadingFailedAttachments = function (_failedAttachments) {
|
|
425
428
|
var failed = (0, SubmitConfirmationUtility_1.getAllFailedUploads)(allAttachmentsWithStatuses);
|
|
426
429
|
var success = (0, SubmitConfirmationUtility_1.getAllSuccessfulUploads)(allAttachmentsWithStatuses);
|
|
@@ -434,10 +437,8 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
434
437
|
};
|
|
435
438
|
var handleSubmit = function (_values, messageId) {
|
|
436
439
|
var _a, _b, _c, _d, _e, _f;
|
|
437
|
-
setSubmitting(true);
|
|
438
440
|
if (referenceIdentifierValidateStatus !== "" && referenceIdentifierValidateStatus !== "success") {
|
|
439
441
|
form.scrollToField(["invoice", "referenceIdentifiers", 0, "value"]);
|
|
440
|
-
setSubmitting(false);
|
|
441
442
|
return;
|
|
442
443
|
}
|
|
443
444
|
var attachments = [
|
|
@@ -459,7 +460,6 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
459
460
|
if (!chosenCustomer) {
|
|
460
461
|
antd_1.message.error(intl.formatMessage(exports.translationMessages.createInvoice_selectCustomerMsg));
|
|
461
462
|
// TODO: handle this better?
|
|
462
|
-
setSubmitting(false);
|
|
463
463
|
return;
|
|
464
464
|
}
|
|
465
465
|
var services = sendCopy
|
|
@@ -492,7 +492,6 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
492
492
|
else {
|
|
493
493
|
antd_1.message.error(props.intl.formatMessage(exports.translationMessages.createInvoice_invoiceHadValidationErrors));
|
|
494
494
|
}
|
|
495
|
-
setSubmitting(false);
|
|
496
495
|
form.resetFields();
|
|
497
496
|
form.setFields([
|
|
498
497
|
{
|
|
@@ -522,7 +521,6 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
522
521
|
// location.reload();
|
|
523
522
|
})
|
|
524
523
|
.catch(function (error) {
|
|
525
|
-
setSubmitting(false);
|
|
526
524
|
setInvoiceSubmittingStatus(AttachmentUploadStatus_1.SubmittingStatus.Failed);
|
|
527
525
|
if (error.response) {
|
|
528
526
|
// The request was made and the server responded with a status code
|
|
@@ -582,9 +580,6 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
582
580
|
props.getReceiverRequirements(chosenCustomer.identifier);
|
|
583
581
|
}
|
|
584
582
|
};
|
|
585
|
-
(0, react_1.useEffect)(function () {
|
|
586
|
-
getReceiverRequirements();
|
|
587
|
-
}, [chosenCustomer]);
|
|
588
583
|
var defaultCustomer;
|
|
589
584
|
if (props.customers.length === 1 && !chosenCustomer) {
|
|
590
585
|
defaultCustomer = props.customers[0];
|
|
@@ -603,7 +598,7 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
603
598
|
name: defaultCustomer.name,
|
|
604
599
|
});
|
|
605
600
|
}
|
|
606
|
-
var
|
|
601
|
+
var _8 = (0, react_1.useState)(undefined), billingLinesMetadata = _8[0], setBillingLinesMetadata = _8[1];
|
|
607
602
|
var getBillingLines = function (changedValues, allValues) {
|
|
608
603
|
var invoiceLines = allValues.invoice.invoiceLines;
|
|
609
604
|
if (invoiceLines) {
|
|
@@ -660,6 +655,12 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
660
655
|
}
|
|
661
656
|
}, scrollToFirstError: true, onValuesChange: function (changedValues, allValues) {
|
|
662
657
|
getBillingLines(changedValues, allValues);
|
|
658
|
+
// Skip validation for description field of attachments for performance reasons
|
|
659
|
+
if (changedValues.attachments)
|
|
660
|
+
return;
|
|
661
|
+
setTimeout(function () {
|
|
662
|
+
validateFields();
|
|
663
|
+
}, 0);
|
|
663
664
|
} }, formLayout_1.formItemLayout, { form: form, onFinish: function (_values) { return handleSubmit(_values); }, onFinishFailed: function (error) {
|
|
664
665
|
// tslint:disable-next-line:no-console
|
|
665
666
|
console.log(error);
|
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
"deliveryLocation_streetNameAndNumber": "Address",
|
|
123
123
|
"deliveryLocation_title": "Delivery location",
|
|
124
124
|
"formItem_required_errorMessage": "This field is required",
|
|
125
|
+
"formItem_valueCannotBeZero_errorMessage": "Value cannot be 0",
|
|
125
126
|
"invoicePreview.headerTitle": "Invoice",
|
|
126
127
|
"invoicePreview_VAT": "VAT",
|
|
127
128
|
"invoicePreview_VATof": "VAT of",
|
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
"deliveryLocation_streetNameAndNumber": "Heimilisfang",
|
|
123
123
|
"deliveryLocation_title": "Afhendingarstaður",
|
|
124
124
|
"formItem_required_errorMessage": "Það þarf að fylla út í þennan reit",
|
|
125
|
+
"formItem_valueCannotBeZero_errorMessage": "Gildi getur ekki verið 0",
|
|
125
126
|
"invoicePreview.headerTitle": "Reikningur",
|
|
126
127
|
"invoicePreview_VAT": "VSK",
|
|
127
128
|
"invoicePreview_VATof": "VSK af",
|
|
@@ -123,6 +123,7 @@ declare const _default: {
|
|
|
123
123
|
deliveryLocation_streetNameAndNumber: string;
|
|
124
124
|
deliveryLocation_title: string;
|
|
125
125
|
formItem_required_errorMessage: string;
|
|
126
|
+
formItem_valueCannotBeZero_errorMessage: string;
|
|
126
127
|
"invoicePreview.headerTitle": string;
|
|
127
128
|
invoicePreview_VAT: string;
|
|
128
129
|
invoicePreview_VATof: string;
|
|
@@ -332,6 +333,7 @@ declare const _default: {
|
|
|
332
333
|
deliveryLocation_streetNameAndNumber: string;
|
|
333
334
|
deliveryLocation_title: string;
|
|
334
335
|
formItem_required_errorMessage: string;
|
|
336
|
+
formItem_valueCannotBeZero_errorMessage: string;
|
|
335
337
|
"invoicePreview.headerTitle": string;
|
|
336
338
|
invoicePreview_VAT: string;
|
|
337
339
|
invoicePreview_VATof: string;
|
package/lib/utils/ApiUtility.js
CHANGED
|
@@ -10,6 +10,42 @@ 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
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
13
49
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
50
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
51
|
if (ar || !(i in from)) {
|
|
@@ -31,6 +67,7 @@ var axios_1 = __importDefault(require("axios"));
|
|
|
31
67
|
var antd_1 = require("antd");
|
|
32
68
|
var create_invoice_1 = require("../create-invoice");
|
|
33
69
|
var AttachmentUploadStatus_1 = require("../common/components/submit-confirmation/AttachmentUploadStatus");
|
|
70
|
+
var chardet_1 = __importDefault(require("chardet"));
|
|
34
71
|
var initialiseTransactionApi = function (mapiBaseUrl) {
|
|
35
72
|
var apiConfig = {
|
|
36
73
|
basePath: mapiBaseUrl,
|
|
@@ -78,20 +115,55 @@ var submitDocument = function (data, attachDocument, mapiBaseUrl, apiKey) {
|
|
|
78
115
|
// )
|
|
79
116
|
};
|
|
80
117
|
exports.submitDocument = submitDocument;
|
|
81
|
-
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
118
|
+
function getEncoding(file) {
|
|
119
|
+
var _a;
|
|
120
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
121
|
+
var bytes, _b;
|
|
122
|
+
return __generator(this, function (_c) {
|
|
123
|
+
switch (_c.label) {
|
|
124
|
+
case 0:
|
|
125
|
+
_b = Uint8Array.bind;
|
|
126
|
+
return [4 /*yield*/, file.arrayBuffer()];
|
|
127
|
+
case 1:
|
|
128
|
+
bytes = new (_b.apply(Uint8Array, [void 0, _c.sent()]))();
|
|
129
|
+
return [2 /*return*/, (_a = chardet_1.default.detect(bytes)) !== null && _a !== void 0 ? _a : "utf-8"];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
92
132
|
});
|
|
93
|
-
|
|
94
|
-
|
|
133
|
+
}
|
|
134
|
+
var submitDocumentFetch = function (data, attachDocument, mapiBaseUrl, token) { return __awaiter(void 0, void 0, void 0, function () {
|
|
135
|
+
var messageId, name, contentType, more, headers, params, _a, _b, _c, responsePromise;
|
|
136
|
+
return __generator(this, function (_d) {
|
|
137
|
+
switch (_d.label) {
|
|
138
|
+
case 0:
|
|
139
|
+
messageId = attachDocument.messageId, name = attachDocument.name, contentType = attachDocument.contentType, more = attachDocument.more;
|
|
140
|
+
headers = {
|
|
141
|
+
Authorization: "Bearer ".concat(token),
|
|
142
|
+
"Content-Type": "application/octet-stream",
|
|
143
|
+
"X-test": "test",
|
|
144
|
+
};
|
|
145
|
+
params = new URLSearchParams({
|
|
146
|
+
Name: name,
|
|
147
|
+
More: String(more),
|
|
148
|
+
// ContentType does not work correctly here for "application/pdf", so we add it manually to the fetch path
|
|
149
|
+
});
|
|
150
|
+
if (!(contentType === "text/csv" || data.type === "text/csv")) return [3 /*break*/, 2];
|
|
151
|
+
_b = (_a = params).set;
|
|
152
|
+
_c = ["Encoding"];
|
|
153
|
+
return [4 /*yield*/, getEncoding(data)];
|
|
154
|
+
case 1:
|
|
155
|
+
_b.apply(_a, _c.concat([_d.sent()]));
|
|
156
|
+
_d.label = 2;
|
|
157
|
+
case 2:
|
|
158
|
+
responsePromise = fetch("".concat(mapiBaseUrl, "/api/v1/messages/").concat(messageId, "/documents?ContentType=").concat(contentType, "&").concat(params.toString()), {
|
|
159
|
+
method: "POST",
|
|
160
|
+
headers: headers,
|
|
161
|
+
body: data
|
|
162
|
+
});
|
|
163
|
+
return [2 /*return*/, responsePromise];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}); };
|
|
95
167
|
exports.submitDocumentFetch = submitDocumentFetch;
|
|
96
168
|
var submitInvoice = function (createSubmitInvoice, mapiBaseUrl, token, callName, language) {
|
|
97
169
|
var transactionApi = initialiseTransactionApi(mapiBaseUrl);
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { SubmittingStatus } from "../common/components/submit-confirmation/AttachmentUploadStatus";
|
|
2
|
-
|
|
2
|
+
import { AttachmentType } from "../common/components/attachments";
|
|
3
|
+
import { FormInstance } from "antd/es/form";
|
|
4
|
+
import { UploadFile } from "antd/es/upload/interface";
|
|
5
|
+
import { Dispatch, SetStateAction } from "react";
|
|
6
|
+
import { UploadChangeParam } from "antd/lib/upload";
|
|
7
|
+
import { IntlShape } from "react-intl";
|
|
3
8
|
declare const isRetryButtonVisible: (numberOfAttemptedCalls: number, totalNumberOfCalls: number, numberOfSuccessfulCalls: number, numberOfFailedUploads: number, alreadyRetried: boolean, invoiceSubmittingStatus: SubmittingStatus) => boolean;
|
|
4
|
-
|
|
9
|
+
declare const updateFormState: (attachmentsForForm: AttachmentType[], form: FormInstance) => void;
|
|
10
|
+
declare const hasDuplicateDescriptions: (attachments: AttachmentType[]) => boolean;
|
|
11
|
+
declare const hasEmptyDescriptions: (attachments: AttachmentType[]) => boolean;
|
|
12
|
+
declare const hasInvalidStatus: (attachments: AttachmentType[]) => boolean;
|
|
13
|
+
declare const updateFile: (file: UploadFile, updatedProps: Partial<AttachmentType>, setLocalAttachments: Dispatch<SetStateAction<AttachmentType[]>>) => void;
|
|
14
|
+
declare const verifyAttachment: (info: UploadChangeParam, sizeLimit: number, remove: (file: UploadFile) => void, intl: IntlShape, setLocalAttachments: Dispatch<SetStateAction<AttachmentType[]>>) => void;
|
|
15
|
+
export { isRetryButtonVisible, updateFormState, hasDuplicateDescriptions, hasEmptyDescriptions, hasInvalidStatus, updateFile, verifyAttachment };
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
+
};
|
|
2
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
23
|
+
exports.verifyAttachment = exports.updateFile = exports.hasInvalidStatus = exports.hasEmptyDescriptions = exports.hasDuplicateDescriptions = exports.updateFormState = exports.isRetryButtonVisible = void 0;
|
|
4
24
|
var AttachmentUploadStatus_1 = require("../common/components/submit-confirmation/AttachmentUploadStatus");
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
if (failedUploads.includes(name))
|
|
8
|
-
return AttachmentUploadStatus_1.SubmittingStatus.Failed;
|
|
9
|
-
if (index < numberOfAttemptedCalls && !failedUploads.includes(name))
|
|
10
|
-
return AttachmentUploadStatus_1.SubmittingStatus.Done;
|
|
11
|
-
if (index <= numberOfAttemptedCalls || index > numberOfAttemptedCalls)
|
|
12
|
-
return AttachmentUploadStatus_1.SubmittingStatus.Pending;
|
|
13
|
-
};
|
|
14
|
-
exports.getSubmittingStatus = getSubmittingStatus;
|
|
25
|
+
var FileUploadUtility_1 = require("./FileUploadUtility");
|
|
26
|
+
var AttachmentModal_1 = require("../common/components/attachments/AttachmentModal");
|
|
15
27
|
var isRetryButtonVisible = function (numberOfAttemptedCalls, totalNumberOfCalls, numberOfSuccessfulCalls, numberOfFailedUploads, alreadyRetried, invoiceSubmittingStatus) {
|
|
16
28
|
if (invoiceSubmittingStatus === AttachmentUploadStatus_1.SubmittingStatus.Failed)
|
|
17
29
|
return true;
|
|
@@ -20,3 +32,78 @@ var isRetryButtonVisible = function (numberOfAttemptedCalls, totalNumberOfCalls,
|
|
|
20
32
|
}
|
|
21
33
|
};
|
|
22
34
|
exports.isRetryButtonVisible = isRetryButtonVisible;
|
|
35
|
+
var updateFormState = function (attachmentsForForm, form) {
|
|
36
|
+
var fields = [];
|
|
37
|
+
// Populate existing attachments into fields
|
|
38
|
+
attachmentsForForm.forEach(function (attachment, index) {
|
|
39
|
+
fields.push({
|
|
40
|
+
name: ["attachments", "file".concat(index + 1), "file"],
|
|
41
|
+
value: attachment.file,
|
|
42
|
+
}, {
|
|
43
|
+
name: ["attachments", "file".concat(index + 1), "description"],
|
|
44
|
+
value: attachment.description,
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
// Clear any remaining attachment fields
|
|
48
|
+
for (var i = attachmentsForForm.length + 1; i <= 3; i++) {
|
|
49
|
+
fields.push({
|
|
50
|
+
name: ["attachments", "file".concat(i), "file"],
|
|
51
|
+
value: undefined,
|
|
52
|
+
}, {
|
|
53
|
+
name: ["attachments", "file".concat(i), "description"],
|
|
54
|
+
value: undefined,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
form.setFields(fields);
|
|
58
|
+
};
|
|
59
|
+
exports.updateFormState = updateFormState;
|
|
60
|
+
var hasDuplicateDescriptions = function (attachments) {
|
|
61
|
+
var descriptions = attachments
|
|
62
|
+
.map(function (attachment) { return attachment.description.trim(); })
|
|
63
|
+
.filter(Boolean);
|
|
64
|
+
return new Set(descriptions).size !== descriptions.length;
|
|
65
|
+
};
|
|
66
|
+
exports.hasDuplicateDescriptions = hasDuplicateDescriptions;
|
|
67
|
+
var hasEmptyDescriptions = function (attachments) {
|
|
68
|
+
return attachments.some(function (attachment) { return !attachment.description.trim(); });
|
|
69
|
+
};
|
|
70
|
+
exports.hasEmptyDescriptions = hasEmptyDescriptions;
|
|
71
|
+
var hasInvalidStatus = function (attachments) {
|
|
72
|
+
return attachments.some(function (attachment) { return attachment.fieldValidation !== "success"; });
|
|
73
|
+
};
|
|
74
|
+
exports.hasInvalidStatus = hasInvalidStatus;
|
|
75
|
+
var updateFile = function (file, updatedProps, setLocalAttachments) {
|
|
76
|
+
setLocalAttachments(function (prev) {
|
|
77
|
+
var fileIndex = prev.findIndex(function (attachment) { return attachment.file.uid === file.uid; });
|
|
78
|
+
if (fileIndex === -1) {
|
|
79
|
+
// If not found then add attachment
|
|
80
|
+
return __spreadArray(__spreadArray([], prev, true), [
|
|
81
|
+
__assign({ uid: file.uid, file: file, description: "", fieldValidation: "" }, updatedProps),
|
|
82
|
+
], false);
|
|
83
|
+
}
|
|
84
|
+
return prev.map(function (attachment) {
|
|
85
|
+
// Else if found - update
|
|
86
|
+
return attachment.file.uid === file.uid
|
|
87
|
+
? __assign(__assign({}, attachment), updatedProps) : attachment;
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
exports.updateFile = updateFile;
|
|
92
|
+
var verifyAttachment = function (info, sizeLimit, remove, intl, setLocalAttachments) {
|
|
93
|
+
if (info.file.status === "removed")
|
|
94
|
+
return;
|
|
95
|
+
var isValid = (0, FileUploadUtility_1.reportIfFileIsValid)(info.file, sizeLimit, {
|
|
96
|
+
uploadErrorToLarge: intl.formatMessage(AttachmentModal_1.translationMessages.attachment_error_fileTooLarge, {
|
|
97
|
+
uploadSizeLimit: sizeLimit / 1024,
|
|
98
|
+
}),
|
|
99
|
+
uploadErrorWrongType: intl.formatMessage(AttachmentModal_1.translationMessages.attachment_error_fileWrongType),
|
|
100
|
+
uploadFailed: intl.formatMessage(AttachmentModal_1.translationMessages.attachment_error_fileFailedToUpload),
|
|
101
|
+
});
|
|
102
|
+
if (isValid) {
|
|
103
|
+
updateFile(info.file, { file: __assign({}, info.file), fieldValidation: "success" }, setLocalAttachments);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
remove(info.file);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
exports.verifyAttachment = verifyAttachment;
|
|
@@ -18,7 +18,7 @@ export declare const calculateTaxableAmount: (discountValue: string | null | und
|
|
|
18
18
|
export declare const calculateTaxAmount: (taxableAmount: number, taxPercentage: number) => number;
|
|
19
19
|
export declare const calculateTaxPercentage: (taxCategoryType: TaxCategoryTypeEnum | undefined) => number;
|
|
20
20
|
export declare const generateTaxCategoryLabel: (taxCategoryType: TaxCategoryTypeEnum | undefined, taxCategoryTypeTranslated: string) => string;
|
|
21
|
-
export declare const getCorrectInputNode: (dataIdx: keyof BillingLineMetadataOverride, intl: IntlShape, placeholder: string, required: boolean, addonAfter?: React.ReactNode, mobile?: boolean, value?: any) => React.ReactChild;
|
|
21
|
+
export declare const getCorrectInputNode: (dataIdx: keyof BillingLineMetadataOverride, intl: IntlShape, placeholder: string, required: boolean, addonAfter?: React.ReactNode, mobile?: boolean, value?: any, min?: number) => React.ReactChild;
|
|
22
22
|
export declare const getTotals: (invoiceLines: BillingLineMetadataOverride[]) => Totals;
|
|
23
23
|
export declare const getTaxCategoryDisabled: (taxCategoryType: AvailableTaxCategoryTypeEnum, outsideVatScope: boolean) => boolean;
|
|
24
24
|
export declare const getFieldNames: (keys: string[], intl: IntlShape) => string[];
|