@unimaze/billing 0.21.2 → 0.21.4
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 +1 -29
- package/lib/common/components/CommonTranslations.js +4 -32
- package/lib/common/components/attachments/Attachment.d.ts +1 -1
- package/lib/common/components/attachments/AttachmentModal.d.ts +1 -1
- package/lib/common/components/attachments/index.d.ts +1 -1
- package/lib/common/components/base-information/AccountingCost.d.ts +1 -1
- package/lib/common/components/base-information/OrderReference.d.ts +1 -1
- package/lib/common/components/base-information/ProjectReference.d.ts +1 -1
- package/lib/common/components/base-information/ReferenceIdentifiers.d.ts +2 -1
- package/lib/common/components/base-information/ReferenceIdentifiers.js +29 -11
- package/lib/common/components/base-information/index.d.ts +10 -1
- package/lib/common/components/base-information/index.js +9 -1
- package/lib/common/components/billing-lines/BillingCalculations.d.ts +1 -1
- package/lib/common/components/billing-lines/BillingCalculations.js +5 -1
- package/lib/common/components/billing-lines/BillingLinePreview.d.ts +2 -1
- package/lib/common/components/billing-lines/BillingLinePreview.js +4 -2
- package/lib/common/components/billing-lines/BillingTaxSummary.d.ts +1 -1
- package/lib/common/components/billing-lines/BillingTaxSummary.js +0 -1
- package/lib/common/components/billing-lines/CurrencySelector.d.ts +20 -0
- package/lib/common/components/billing-lines/CurrencySelector.js +17 -0
- package/lib/common/components/billing-lines/DiscountTypeSelector.d.ts +10 -0
- package/lib/common/components/billing-lines/DiscountTypeSelector.js +16 -0
- package/lib/common/components/billing-lines/NewBillingLines.d.ts +2 -1
- package/lib/common/components/billing-lines/NewBillingLines.js +37 -327
- package/lib/common/components/billing-lines/NewNewBillingLines.d.ts +15 -0
- package/lib/common/components/billing-lines/NewNewBillingLines.js +36 -0
- package/lib/common/components/billing-lines/SingleBillingLine.d.ts +19 -0
- package/lib/common/components/billing-lines/SingleBillingLine.js +262 -0
- package/lib/common/components/billing-lines/UnitOfMeasureSelector.d.ts +14 -0
- package/lib/common/components/billing-lines/UnitOfMeasureSelector.js +15 -0
- package/lib/common/components/billing-lines/cwdwdw.d.ts +1 -0
- package/lib/common/components/billing-lines/cwdwdw.js +14 -0
- package/lib/common/components/billing-lines/index.d.ts +3 -6
- package/lib/common/components/billing-lines/index.js +1 -1
- package/lib/common/components/customer/CostCenter.d.ts +1 -1
- package/lib/common/components/customer/CustomerContactName.d.ts +1 -1
- package/lib/common/components/customer/index.d.ts +1 -1
- package/lib/common/components/customer/index.js +6 -4
- package/lib/common/components/delivery-location/index.d.ts +1 -1
- package/lib/common/components/form-item/index.d.ts +1 -1
- package/lib/common/components/input/index.d.ts +1 -1
- package/lib/common/components/invoice/index.d.ts +3 -1
- package/lib/common/components/invoice/index.js +21 -14
- package/lib/common/components/invoice-preview/InvoicePreviewHeader.d.ts +1 -1
- package/lib/common/components/invoice-preview/InvoicePreviewHeader.js +7 -8
- package/lib/common/components/invoice-preview/index.d.ts +1 -1
- package/lib/common/components/invoice-preview/index.js +8 -2
- package/lib/common/components/payment-method/index.d.ts +1 -1
- package/lib/common/components/payment-method/index.js +22 -7
- package/lib/common/components/supplier/CityAutofill.d.ts +1 -1
- package/lib/common/components/supplier/index.d.ts +1 -1
- package/lib/common/components/welcome-modal/index.d.ts +1 -1
- package/lib/common/types/ReceiverRequirements.d.ts +2 -0
- package/lib/common/types/ReceiverRequirements.js +2 -0
- package/lib/create-invoice/index.d.ts +9 -1
- package/lib/create-invoice/index.js +88 -61
- package/lib/enums.d.ts +3 -0
- package/lib/translations/locales/en.json +7 -10
- package/lib/translations/locales/is.json +5 -8
- package/lib/translations/locales.d.ts +10 -16
- package/lib/unimaze-api-clients/src/mapi/api.d.ts +6664 -0
- package/lib/unimaze-api-clients/src/mapi/api.js +4743 -0
- package/lib/unimaze-api-clients/src/mapi/base.d.ts +55 -0
- package/lib/unimaze-api-clients/src/mapi/base.js +84 -0
- package/lib/unimaze-api-clients/src/mapi/configuration.d.ts +63 -0
- package/lib/unimaze-api-clients/src/mapi/configuration.js +28 -0
- package/lib/unimaze-api-clients/src/mapi/index.d.ts +13 -0
- package/lib/unimaze-api-clients/src/mapi/index.js +30 -0
- package/lib/unimaze-api-clients/src/rapi/api.d.ts +5015 -0
- package/lib/unimaze-api-clients/src/rapi/api.js +5582 -0
- package/lib/unimaze-api-clients/src/rapi/base.d.ts +55 -0
- package/lib/unimaze-api-clients/src/rapi/base.js +84 -0
- package/lib/unimaze-api-clients/src/rapi/configuration.d.ts +63 -0
- package/lib/unimaze-api-clients/src/rapi/configuration.js +28 -0
- package/lib/unimaze-api-clients/src/rapi/index.d.ts +13 -0
- package/lib/unimaze-api-clients/src/rapi/index.js +30 -0
- package/lib/unimaze-billing/src/common/components/CommonTranslations.d.ts +102 -0
- package/lib/unimaze-billing/src/common/components/CommonTranslations.js +106 -0
- package/lib/unimaze-billing/src/common/components/attachments/Attachment.d.ts +20 -0
- package/lib/unimaze-billing/src/common/components/attachments/Attachment.js +164 -0
- package/lib/unimaze-billing/src/common/components/attachments/AttachmentModal.d.ts +21 -0
- package/lib/unimaze-billing/src/common/components/attachments/AttachmentModal.js +203 -0
- package/lib/unimaze-billing/src/common/components/attachments/index.d.ts +27 -0
- package/lib/unimaze-billing/src/common/components/attachments/index.js +214 -0
- package/lib/unimaze-billing/src/common/components/base-information/AccountingCost.d.ts +17 -0
- package/lib/unimaze-billing/src/common/components/base-information/AccountingCost.js +61 -0
- package/lib/unimaze-billing/src/common/components/base-information/OrderReference.d.ts +16 -0
- package/lib/unimaze-billing/src/common/components/base-information/OrderReference.js +58 -0
- package/lib/unimaze-billing/src/common/components/base-information/ProjectReference.d.ts +14 -0
- package/lib/unimaze-billing/src/common/components/base-information/ProjectReference.js +30 -0
- package/lib/unimaze-billing/src/common/components/base-information/ReferenceIdentifiers.d.ts +48 -0
- package/lib/unimaze-billing/src/common/components/base-information/ReferenceIdentifiers.js +306 -0
- package/lib/unimaze-billing/src/common/components/base-information/index.d.ts +68 -0
- package/lib/unimaze-billing/src/common/components/base-information/index.js +178 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingCalculations.d.ts +14 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingCalculations.js +153 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingLinePreview.d.ts +21 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingLinePreview.js +41 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingTaxSummary.d.ts +13 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingTaxSummary.js +134 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/CurrencySelector.d.ts +20 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/CurrencySelector.js +17 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/DiscountTypeSelector.d.ts +10 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/DiscountTypeSelector.js +16 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/NewBillingLines.d.ts +129 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/NewBillingLines.js +495 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/NewNewBillingLines.d.ts +15 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/NewNewBillingLines.js +36 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/SingleBillingLine.d.ts +14 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/SingleBillingLine.js +199 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/UnitOfMeasureSelector.d.ts +14 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/UnitOfMeasureSelector.js +15 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/index.d.ts +52 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/index.js +104 -0
- package/lib/unimaze-billing/src/common/components/component-container/Content.d.ts +7 -0
- package/lib/unimaze-billing/src/common/components/component-container/Content.js +13 -0
- package/lib/unimaze-billing/src/common/components/component-container/Header.d.ts +9 -0
- package/lib/unimaze-billing/src/common/components/component-container/Header.js +28 -0
- package/lib/unimaze-billing/src/common/components/component-container/index.d.ts +12 -0
- package/lib/unimaze-billing/src/common/components/component-container/index.js +22 -0
- package/lib/unimaze-billing/src/common/components/customer/CostCenter.d.ts +17 -0
- package/lib/unimaze-billing/src/common/components/customer/CostCenter.js +163 -0
- package/lib/unimaze-billing/src/common/components/customer/CustomerContactName.d.ts +17 -0
- package/lib/unimaze-billing/src/common/components/customer/CustomerContactName.js +53 -0
- package/lib/unimaze-billing/src/common/components/customer/hardCoddedCustomer.d.ts +7 -0
- package/lib/unimaze-billing/src/common/components/customer/hardCoddedCustomer.js +41 -0
- package/lib/unimaze-billing/src/common/components/customer/index.d.ts +26 -0
- package/lib/unimaze-billing/src/common/components/customer/index.js +168 -0
- package/lib/unimaze-billing/src/common/components/date-picker/index.d.ts +21 -0
- package/lib/unimaze-billing/src/common/components/date-picker/index.js +23 -0
- package/lib/unimaze-billing/src/common/components/delivery-location/index.d.ts +12 -0
- package/lib/unimaze-billing/src/common/components/delivery-location/index.js +89 -0
- package/lib/unimaze-billing/src/common/components/editable-cell/index.d.ts +0 -0
- package/lib/unimaze-billing/src/common/components/editable-cell/index.js +295 -0
- package/lib/unimaze-billing/src/common/components/editable-row/index.d.ts +5 -0
- package/lib/unimaze-billing/src/common/components/editable-row/index.js +59 -0
- package/lib/unimaze-billing/src/common/components/form-item/index.d.ts +35 -0
- package/lib/unimaze-billing/src/common/components/form-item/index.js +60 -0
- package/lib/unimaze-billing/src/common/components/index.d.ts +18 -0
- package/lib/unimaze-billing/src/common/components/index.js +42 -0
- package/lib/unimaze-billing/src/common/components/input/index.d.ts +23 -0
- package/lib/unimaze-billing/src/common/components/input/index.js +37 -0
- package/lib/unimaze-billing/src/common/components/invoice/index.d.ts +40 -0
- package/lib/unimaze-billing/src/common/components/invoice/index.js +52 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewHeader.d.ts +12 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewHeader.js +105 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/index.d.ts +16 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/index.js +405 -0
- package/lib/unimaze-billing/src/common/components/locale-intl/index.d.ts +0 -0
- package/lib/unimaze-billing/src/common/components/locale-intl/index.js +51 -0
- package/lib/unimaze-billing/src/common/components/payment-method/index.d.ts +76 -0
- package/lib/unimaze-billing/src/common/components/payment-method/index.js +356 -0
- package/lib/unimaze-billing/src/common/components/payment-method/paymentMethodForConversion.d.ts +8 -0
- package/lib/unimaze-billing/src/common/components/payment-method/paymentMethodForConversion.js +37 -0
- package/lib/unimaze-billing/src/common/components/submit-confirmation/SubmitConfirmationSVG.d.ts +3 -0
- package/lib/unimaze-billing/src/common/components/submit-confirmation/SubmitConfirmationSVG.js +17 -0
- package/lib/unimaze-billing/src/common/components/submit-confirmation/index.d.ts +8 -0
- package/lib/unimaze-billing/src/common/components/submit-confirmation/index.js +34 -0
- package/lib/unimaze-billing/src/common/components/supplier/CityAutofill.d.ts +18 -0
- package/lib/unimaze-billing/src/common/components/supplier/CityAutofill.js +159 -0
- package/lib/unimaze-billing/src/common/components/supplier/index.d.ts +94 -0
- package/lib/unimaze-billing/src/common/components/supplier/index.js +334 -0
- package/lib/unimaze-billing/src/common/components/tooltip/index.d.ts +7 -0
- package/lib/unimaze-billing/src/common/components/tooltip/index.js +15 -0
- package/lib/unimaze-billing/src/common/components/welcome-modal/index.d.ts +15 -0
- package/lib/unimaze-billing/src/common/components/welcome-modal/index.js +26 -0
- package/lib/unimaze-billing/src/common/consts/formLayout.d.ts +74 -0
- package/lib/unimaze-billing/src/common/consts/formLayout.js +45 -0
- package/lib/unimaze-billing/src/common/consts/validationRules.d.ts +6 -0
- package/lib/unimaze-billing/src/common/consts/validationRules.js +69 -0
- package/lib/unimaze-billing/src/common/enums/DocumentTypeEnum.d.ts +5 -0
- package/lib/unimaze-billing/src/common/enums/DocumentTypeEnum.js +8 -0
- package/lib/unimaze-billing/src/common/enums/index.d.ts +1 -0
- package/lib/unimaze-billing/src/common/enums/index.js +8 -0
- package/lib/unimaze-billing/src/common/types/AppConfiguration.d.ts +23 -0
- package/lib/unimaze-billing/src/common/types/AppConfiguration.js +2 -0
- package/lib/unimaze-billing/src/common/types/BillingLineMetadataOverride.d.ts +10 -0
- package/lib/unimaze-billing/src/common/types/BillingLineMetadataOverride.js +2 -0
- package/lib/unimaze-billing/src/common/types/CommonProps.d.ts +33 -0
- package/lib/unimaze-billing/src/common/types/CommonProps.js +2 -0
- package/lib/unimaze-billing/src/common/types/DiscountType.d.ts +1 -0
- package/lib/unimaze-billing/src/common/types/DiscountType.js +2 -0
- package/lib/unimaze-billing/src/common/types/InvoiceFormFields.d.ts +1 -0
- package/lib/unimaze-billing/src/common/types/InvoiceFormFields.js +2 -0
- package/lib/unimaze-billing/src/common/types/NewReceiverRequirements.d.ts +27 -0
- package/lib/unimaze-billing/src/common/types/NewReceiverRequirements.js +2 -0
- package/lib/unimaze-billing/src/common/types/ReceiverRequirements.d.ts +81 -0
- package/lib/unimaze-billing/src/common/types/ReceiverRequirements.js +391 -0
- package/lib/unimaze-billing/src/common/types/SupplierInfo.d.ts +11 -0
- package/lib/unimaze-billing/src/common/types/SupplierInfo.js +2 -0
- package/lib/unimaze-billing/src/common/types/index.d.ts +1 -0
- package/lib/unimaze-billing/src/common/types/index.js +17 -0
- package/lib/unimaze-billing/src/create-credit-note/index.d.ts +9 -0
- package/lib/unimaze-billing/src/create-credit-note/index.js +62 -0
- package/lib/unimaze-billing/src/create-invoice/IntlLoader.d.ts +11 -0
- package/lib/unimaze-billing/src/create-invoice/IntlLoader.js +116 -0
- package/lib/unimaze-billing/src/create-invoice/index.d.ts +74 -0
- package/lib/unimaze-billing/src/create-invoice/index.js +680 -0
- package/lib/unimaze-billing/src/enums.d.ts +11 -0
- package/lib/unimaze-billing/src/enums.js +18 -0
- package/lib/unimaze-billing/src/index.d.ts +4 -0
- package/lib/unimaze-billing/src/index.js +28 -0
- package/lib/unimaze-billing/src/translations/locales/en.json +183 -0
- package/lib/unimaze-billing/src/translations/locales/is.json +183 -0
- package/lib/unimaze-billing/src/translations/locales.d.ts +369 -0
- package/lib/unimaze-billing/src/translations/locales.js +11 -0
- package/lib/unimaze-billing/src/utils/ApiUtility.d.ts +23 -0
- package/lib/unimaze-billing/src/utils/ApiUtility.js +115 -0
- package/lib/unimaze-billing/src/utils/BillingLineUtility.d.ts +22 -0
- package/lib/unimaze-billing/src/utils/BillingLineUtility.js +158 -0
- package/lib/unimaze-billing/src/utils/ConversionUtility.d.ts +9 -0
- package/lib/unimaze-billing/src/utils/ConversionUtility.js +223 -0
- package/lib/unimaze-billing/src/utils/FileUploadUtility.d.ts +9 -0
- package/lib/unimaze-billing/src/utils/FileUploadUtility.js +45 -0
- package/lib/unimaze-billing/src/utils/IntlUtility.d.ts +5 -0
- package/lib/unimaze-billing/src/utils/IntlUtility.js +55 -0
- package/lib/unimaze-billing/src/utils/LocationUtility.d.ts +1 -0
- package/lib/unimaze-billing/src/utils/LocationUtility.js +81 -0
- package/lib/unimaze-billing/src/utils/ReferenceIdentifierUtility.d.ts +7 -0
- package/lib/unimaze-billing/src/utils/ReferenceIdentifierUtility.js +26 -0
- package/lib/unimaze-billing/src/utils/RequirementsUtility.d.ts +19 -0
- package/lib/unimaze-billing/src/utils/RequirementsUtility.js +189 -0
- package/lib/unimaze-billing/src/utils/index.d.ts +2 -0
- package/lib/unimaze-billing/src/utils/index.js +8 -0
- package/lib/utils/ApiUtility.d.ts +9 -3
- package/lib/utils/ApiUtility.js +30 -2
- package/lib/utils/BillingLineUtility.d.ts +3 -0
- package/lib/utils/BillingLineUtility.js +45 -2
- package/lib/utils/RequirementsUtility.d.ts +4 -1
- package/lib/utils/RequirementsUtility.js +56 -1
- package/package.json +2 -2
|
@@ -227,6 +227,7 @@ var InvoicePreview = function (props) {
|
|
|
227
227
|
backgroundColor: "#F5F5F5",
|
|
228
228
|
margin: "0 -24px",
|
|
229
229
|
padding: "0 24px",
|
|
230
|
+
justifyContent: "space-between",
|
|
230
231
|
} },
|
|
231
232
|
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeSM } },
|
|
232
233
|
line.quantity,
|
|
@@ -238,7 +239,11 @@ var InvoicePreview = function (props) {
|
|
|
238
239
|
" ",
|
|
239
240
|
line.currencyCode,
|
|
240
241
|
" / ", (_b = line.unitOfMeasure) === null || _b === void 0 ? void 0 :
|
|
241
|
-
_b.unit)
|
|
242
|
+
_b.unit),
|
|
243
|
+
react_1.default.createElement(antd_1.Typography.Text, null,
|
|
244
|
+
(0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(line.quantity * line.unitPriceAmount, props.intl),
|
|
245
|
+
" ",
|
|
246
|
+
line.currencyCode))),
|
|
242
247
|
react_1.default.createElement(antd_1.Flex, { justify: "space-between", align: "center" },
|
|
243
248
|
react_1.default.createElement(antd_1.Typography.Text, null,
|
|
244
249
|
taxPercentage,
|
|
@@ -252,6 +257,7 @@ var InvoicePreview = function (props) {
|
|
|
252
257
|
" ",
|
|
253
258
|
props.intl.formatMessage(translationMessages.billingLines_discount)),
|
|
254
259
|
react_1.default.createElement(antd_1.Typography.Text, null,
|
|
260
|
+
"-",
|
|
255
261
|
(0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(calculatedDiscountValue, props.intl),
|
|
256
262
|
" ",
|
|
257
263
|
line.currencyCode))),
|
|
@@ -261,7 +267,7 @@ var InvoicePreview = function (props) {
|
|
|
261
267
|
react_1.default.createElement(antd_1.Flex, { justify: "space-between", align: "center" },
|
|
262
268
|
react_1.default.createElement(antd_1.Typography.Text, null, props.intl.formatMessage(translationMessages.billingLines_total)),
|
|
263
269
|
react_1.default.createElement(antd_1.Typography.Text, null,
|
|
264
|
-
(0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(line.taxableAmount, props.intl),
|
|
270
|
+
(0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)((line.quantity * line.unitPriceAmount) + (0, BillingLineUtility_1.calculateTaxAmount)(line.taxableAmount, taxPercentage) - calculatedDiscountValue, props.intl),
|
|
265
271
|
" ",
|
|
266
272
|
line.currencyCode)))));
|
|
267
273
|
}))),
|
|
@@ -69,7 +69,7 @@ interface Props extends WrappedComponentProps {
|
|
|
69
69
|
isActiveStep: boolean;
|
|
70
70
|
}
|
|
71
71
|
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
|
|
72
|
-
forwardedRef?: React.Ref<any
|
|
72
|
+
forwardedRef?: React.Ref<any>;
|
|
73
73
|
} & React.RefAttributes<any>> & {
|
|
74
74
|
WrappedComponent: React.ComponentType<Props>;
|
|
75
75
|
};
|
|
@@ -310,13 +310,26 @@ var PaymentMethod = function (props) {
|
|
|
310
310
|
name: props.intl.formatMessage(exports.translationMessages.paymentMethod_labels_methods_domesticClaim), // "Claim"
|
|
311
311
|
},
|
|
312
312
|
];
|
|
313
|
+
var onlyOnePaymentMeansTypeName = function (receiverRequirements) {
|
|
314
|
+
var _a, _b;
|
|
315
|
+
var paymentMeansTypeFieldDefinition = (0, RequirementsUtility_1.getFieldRequirements)(receiverRequirements, ReceiverRequirements_1.AvailableFields["paymentMeans.type"]);
|
|
316
|
+
if ((0, RequirementsUtility_1.paymentMeansTypeFieldHasValues)(paymentMeansTypeFieldDefinition) && ((_b = (_a = paymentMeansTypeFieldDefinition === null || paymentMeansTypeFieldDefinition === void 0 ? void 0 : paymentMeansTypeFieldDefinition.properties) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b.length) === 1) {
|
|
317
|
+
var paymentFromReceiverRequirements = paymentMeansTypeFieldDefinition.properties.values[0].key;
|
|
318
|
+
if (paymentMethod !== paymentFromReceiverRequirements) {
|
|
319
|
+
setPaymentMethod(paymentFromReceiverRequirements);
|
|
320
|
+
}
|
|
321
|
+
return paymentMeansTypeFieldDefinition.properties.values[0].name;
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
return undefined;
|
|
325
|
+
}
|
|
326
|
+
};
|
|
313
327
|
var getPaymentMeansTypeOptions = function (receiverRequirements) {
|
|
328
|
+
var _a, _b, _c, _d, _e, _f;
|
|
314
329
|
var paymentMeansTypeFieldDefinition = (0, RequirementsUtility_1.getFieldRequirements)(receiverRequirements, ReceiverRequirements_1.AvailableFields["paymentMeans.type"]);
|
|
315
|
-
if (paymentMeansTypeFieldDefinition
|
|
316
|
-
paymentMeansTypeFieldDefinition.
|
|
317
|
-
paymentMeansTypeFieldDefinition.properties.
|
|
318
|
-
paymentMeansTypeFieldDefinition.properties.values) {
|
|
319
|
-
return paymentMeansTypeFieldDefinition.properties.values.map(function (op) {
|
|
330
|
+
if ((0, RequirementsUtility_1.paymentMeansTypeFieldHasValues)(paymentMeansTypeFieldDefinition)
|
|
331
|
+
&& (((_b = (_a = paymentMeansTypeFieldDefinition === null || paymentMeansTypeFieldDefinition === void 0 ? void 0 : paymentMeansTypeFieldDefinition.properties) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b.length) !== undefined && ((_d = (_c = paymentMeansTypeFieldDefinition === null || paymentMeansTypeFieldDefinition === void 0 ? void 0 : paymentMeansTypeFieldDefinition.properties) === null || _c === void 0 ? void 0 : _c.values) === null || _d === void 0 ? void 0 : _d.length) > 0)) {
|
|
332
|
+
return (_f = (_e = paymentMeansTypeFieldDefinition === null || paymentMeansTypeFieldDefinition === void 0 ? void 0 : paymentMeansTypeFieldDefinition.properties) === null || _e === void 0 ? void 0 : _e.values) === null || _f === void 0 ? void 0 : _f.map(function (op) {
|
|
320
333
|
return (react_1.default.createElement(antd_1.Select.Option, { key: op.key, value: mapi_1.PaymentMeansType[op.key], title: op.name }, op.name));
|
|
321
334
|
});
|
|
322
335
|
}
|
|
@@ -333,8 +346,10 @@ var PaymentMethod = function (props) {
|
|
|
333
346
|
react_1.default.createElement(antd_1.Flex, { vertical: true, style: { width: "100%", maxWidth: "900px" }, gap: isMobile ? "small" : "middle" },
|
|
334
347
|
react_1.default.createElement(antd_1.Typography.Title, { level: 5 }, props.intl.formatMessage(exports.translationMessages.paymentMethod_title)),
|
|
335
348
|
react_1.default.createElement(antd_1.Flex, { vertical: true },
|
|
336
|
-
|
|
337
|
-
react_1.default.createElement(antd_1.
|
|
349
|
+
onlyOnePaymentMeansTypeName(props.receiverRequirements) ?
|
|
350
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: 20 }, className: "ant-form-text", type: "secondary" }, onlyOnePaymentMeansTypeName(props.receiverRequirements))
|
|
351
|
+
: react_1.default.createElement(antd_1.Form.Item, { name: ["invoice", "paymentMeans", "type"] },
|
|
352
|
+
react_1.default.createElement(antd_1.Select, { popupMatchSelectWidth: false, value: paymentMethod, onSelect: setPaymentMethod, defaultValue: props.formInstance.getFieldValue(["invoice", "paymentMeans", "type"]) }, getPaymentMeansTypeOptions(props.receiverRequirements))),
|
|
338
353
|
renderFormFields(paymentMethod),
|
|
339
354
|
react_1.default.createElement(antd_1.Checkbox, { checked: props.isSaveFieldValuesSelected, onChange: props.onSaveFieldValuesChange }, props.intl.formatMessage(CommonTranslations_1.commonTranslationMessages.saveInformation_label))))));
|
|
340
355
|
};
|
|
@@ -11,7 +11,7 @@ interface Props extends WrappedComponentProps {
|
|
|
11
11
|
defaultValue?: string;
|
|
12
12
|
}
|
|
13
13
|
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
|
|
14
|
-
forwardedRef?: React.Ref<any
|
|
14
|
+
forwardedRef?: React.Ref<any>;
|
|
15
15
|
} & React.RefAttributes<any>> & {
|
|
16
16
|
WrappedComponent: React.ComponentType<Props>;
|
|
17
17
|
};
|
|
@@ -87,7 +87,7 @@ interface Props extends WrappedComponentProps {
|
|
|
87
87
|
isActiveStep: boolean;
|
|
88
88
|
}
|
|
89
89
|
declare const SupplierIntl: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
|
|
90
|
-
forwardedRef?: React.Ref<any
|
|
90
|
+
forwardedRef?: React.Ref<any>;
|
|
91
91
|
} & React.RefAttributes<any>> & {
|
|
92
92
|
WrappedComponent: React.ComponentType<Props>;
|
|
93
93
|
};
|
|
@@ -8,7 +8,7 @@ interface Props extends WrappedComponentProps {
|
|
|
8
8
|
imageUrl?: string;
|
|
9
9
|
}
|
|
10
10
|
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
|
|
11
|
-
forwardedRef?: React.Ref<any
|
|
11
|
+
forwardedRef?: React.Ref<any>;
|
|
12
12
|
} & React.RefAttributes<any>> & {
|
|
13
13
|
WrappedComponent: React.ComponentType<Props>;
|
|
14
14
|
};
|
|
@@ -27,6 +27,8 @@ export declare enum AvailableFields {
|
|
|
27
27
|
"referenceIdentifiers.type" = "referenceIdentifiers.type",
|
|
28
28
|
"referenceIdentifiers.code" = "referenceIdentifiers.code",
|
|
29
29
|
"referenceIdentifiers.value" = "referenceIdentifiers.value",
|
|
30
|
+
"referenceIdentifier.*" = "referenceIdentifier.*",
|
|
31
|
+
"singleReferenceIdentifier" = "singleReferenceIdentifier",
|
|
30
32
|
"referenceIdentifiers" = "referenceIdentifiers",
|
|
31
33
|
"supplier.vatNumber" = "supplier.vatNumber",
|
|
32
34
|
"supplier.address.streetNameAndNumber" = "supplier.address.streetNameAndNumber",
|
|
@@ -20,6 +20,8 @@ var AvailableFields;
|
|
|
20
20
|
AvailableFields["referenceIdentifiers.type"] = "referenceIdentifiers.type";
|
|
21
21
|
AvailableFields["referenceIdentifiers.code"] = "referenceIdentifiers.code";
|
|
22
22
|
AvailableFields["referenceIdentifiers.value"] = "referenceIdentifiers.value";
|
|
23
|
+
AvailableFields["referenceIdentifier.*"] = "referenceIdentifier.*";
|
|
24
|
+
AvailableFields["singleReferenceIdentifier"] = "singleReferenceIdentifier";
|
|
23
25
|
AvailableFields["referenceIdentifiers"] = "referenceIdentifiers";
|
|
24
26
|
AvailableFields["supplier.vatNumber"] = "supplier.vatNumber";
|
|
25
27
|
AvailableFields["supplier.address.streetNameAndNumber"] = "supplier.address.streetNameAndNumber";
|
|
@@ -60,6 +60,14 @@ export declare const translationMessages: {
|
|
|
60
60
|
id: string;
|
|
61
61
|
defaultMessage: string;
|
|
62
62
|
};
|
|
63
|
+
createInvoice_validationErrorObjectIdentifierRequired: {
|
|
64
|
+
id: string;
|
|
65
|
+
defaultMessage: string;
|
|
66
|
+
};
|
|
67
|
+
createInvoice_validationErrorObjectIdentifierNotValid: {
|
|
68
|
+
id: string;
|
|
69
|
+
defaultMessage: string;
|
|
70
|
+
};
|
|
63
71
|
};
|
|
64
72
|
interface Props extends CommonProps, WrappedComponentProps {
|
|
65
73
|
customers: ProfileOutputWithApiKey[];
|
|
@@ -67,7 +75,7 @@ interface Props extends CommonProps, WrappedComponentProps {
|
|
|
67
75
|
referenceIdentifiersLabelText?: string;
|
|
68
76
|
}
|
|
69
77
|
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
|
|
70
|
-
forwardedRef?: React.Ref<any
|
|
78
|
+
forwardedRef?: React.Ref<any>;
|
|
71
79
|
} & React.RefAttributes<any>> & {
|
|
72
80
|
WrappedComponent: React.ComponentType<Props>;
|
|
73
81
|
};
|
|
@@ -106,6 +106,7 @@ var CommonTranslations_1 = require("../common/components/CommonTranslations");
|
|
|
106
106
|
var supplier_1 = require("../common/components/supplier");
|
|
107
107
|
var base_information_1 = require("../common/components/base-information");
|
|
108
108
|
var payment_method_1 = require("../common/components/payment-method");
|
|
109
|
+
var ReferenceIdentifierUtility_1 = require("../utils/ReferenceIdentifierUtility");
|
|
109
110
|
exports.translationMessages = (0, react_intl_1.defineMessages)({
|
|
110
111
|
createInvoice_addDocumentLineMsg: {
|
|
111
112
|
id: "createInvoice_addDocumentLineMsg",
|
|
@@ -163,6 +164,14 @@ exports.translationMessages = (0, react_intl_1.defineMessages)({
|
|
|
163
164
|
id: "createInvoice_nextStep",
|
|
164
165
|
defaultMessage: "Next step",
|
|
165
166
|
},
|
|
167
|
+
createInvoice_validationErrorObjectIdentifierRequired: {
|
|
168
|
+
id: "createInvoice_validationErrorObjectIdentifierRequired",
|
|
169
|
+
defaultMessage: "Object identifier is required",
|
|
170
|
+
},
|
|
171
|
+
createInvoice_validationErrorObjectIdentifierNotValid: {
|
|
172
|
+
id: "createInvoice_validationErrorObjectIdentifierNotValid",
|
|
173
|
+
defaultMessage: "Object identifier is not valid",
|
|
174
|
+
},
|
|
166
175
|
});
|
|
167
176
|
/**
|
|
168
177
|
* Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
|
|
@@ -198,14 +207,15 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
198
207
|
var _p = (0, react_1.useState)(true), sendCopyDisabled = _p[0], setSendCopyDisabled = _p[1];
|
|
199
208
|
var _q = (0, react_1.useState)(false), sendCopy = _q[0], setSendCopy = _q[1];
|
|
200
209
|
var _r = react_1.default.useState(""), referenceIdentifierValidateStatus = _r[0], setReferenceIdentifierValidateStatus = _r[1];
|
|
201
|
-
var _s = (0, react_1.useState)(
|
|
202
|
-
var _t = (0, react_1.useState)(false),
|
|
203
|
-
var _u = (0, react_1.useState)(
|
|
204
|
-
var _v = (0, react_1.useState)(
|
|
210
|
+
var _s = (0, react_1.useState)(true), referenceIdentifierIsMandatory = _s[0], setReferenceIdentifierIsMandatory = _s[1];
|
|
211
|
+
var _t = (0, react_1.useState)(false), outsideVatScope = _t[0], setOutsideVatScope = _t[1];
|
|
212
|
+
var _u = (0, react_1.useState)(false), captchaVerified = _u[0], setCaptchaVerified = _u[1];
|
|
213
|
+
var _v = (0, react_1.useState)({}), removedInvoiceLine = _v[0], setRemovedInvoiceLine = _v[1];
|
|
214
|
+
var _w = (0, react_1.useState)(undefined), missingRequiredDataTooltip = _w[0], setMissingRequiredDataTooltip = _w[1];
|
|
205
215
|
var getDefaultPaymentType = function (defaultPaymentType) {
|
|
206
216
|
return defaultPaymentType || mapi_1.PaymentMeansType.DomesticClaim;
|
|
207
217
|
};
|
|
208
|
-
var
|
|
218
|
+
var _x = (0, react_1.useState)({
|
|
209
219
|
invoice: {
|
|
210
220
|
supplier: {
|
|
211
221
|
address: {
|
|
@@ -218,9 +228,10 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
218
228
|
paymentMeans: {
|
|
219
229
|
type: getDefaultPaymentType(props.defaultPaymentType),
|
|
220
230
|
},
|
|
221
|
-
referenceIdentifiers: [{}],
|
|
231
|
+
referenceIdentifiers: [{ code: undefined }],
|
|
222
232
|
singleReferenceIdentifier: {
|
|
223
233
|
code: undefined,
|
|
234
|
+
value: undefined,
|
|
224
235
|
},
|
|
225
236
|
invoiceLines: [{}],
|
|
226
237
|
attachments: {
|
|
@@ -230,34 +241,59 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
230
241
|
},
|
|
231
242
|
issueDate: (0, dayjs_1.default)(),
|
|
232
243
|
},
|
|
233
|
-
}), formData =
|
|
244
|
+
}), formData = _x[0], setFormData = _x[1];
|
|
234
245
|
var validateFieldsForNextStep = function (fieldPaths, validateOnly) { return __awaiter(void 0, void 0, void 0, function () {
|
|
246
|
+
var referenceIdentifiersDefinitions, isSingleReferenceIdentifier, isMultipleReferenceIdentifier, someRequiredFieldsEmpty;
|
|
235
247
|
return __generator(this, function (_a) {
|
|
236
248
|
switch (_a.label) {
|
|
237
|
-
case 0:
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
.catch(function (error) {
|
|
249
|
-
var _a;
|
|
250
|
-
var requiredFields = [];
|
|
251
|
-
(_a = error === null || error === void 0 ? void 0 : error.errorFields) === null || _a === void 0 ? void 0 : _a.map(function (errorField) {
|
|
249
|
+
case 0:
|
|
250
|
+
referenceIdentifiersDefinitions = (0, ReferenceIdentifierUtility_1.getReferenceIdentifierFieldDefinitions)(props.receiverRequirements);
|
|
251
|
+
isSingleReferenceIdentifier = referenceIdentifiersDefinitions.length === 1;
|
|
252
|
+
isMultipleReferenceIdentifier = referenceIdentifiersDefinitions.length > 1;
|
|
253
|
+
someRequiredFieldsEmpty = function () {
|
|
254
|
+
var _a, _b;
|
|
255
|
+
var referenceIdentifierType = form.getFieldValue(["invoice", "referenceIdentifiers"]);
|
|
256
|
+
return ((_a = referenceIdentifierType[0]) === null || _a === void 0 ? void 0 : _a.code) ? !((_b = referenceIdentifierType[0]) === null || _b === void 0 ? void 0 : _b.value) : false;
|
|
257
|
+
};
|
|
258
|
+
return [4 /*yield*/, form.validateFields(fieldPaths, { validateOnly: validateOnly || true })
|
|
259
|
+
.then(function () {
|
|
252
260
|
var _a;
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
+
var invoiceLines = form.getFieldValue(["invoice", "invoiceLines"]);
|
|
262
|
+
var noInvoiceLines = invoiceLines.length <= 1 && ((_a = invoiceLines[0]) === null || _a === void 0 ? void 0 : _a.editing) === true;
|
|
263
|
+
if (activeStep === 2 && noInvoiceLines) {
|
|
264
|
+
setIsNextStepDisabled(true);
|
|
265
|
+
setMissingRequiredDataTooltip(react_1.default.createElement(react_1.default.Fragment, null, props.intl.formatMessage(exports.translationMessages.createInvoice_addDocumentLineMsg)));
|
|
266
|
+
}
|
|
267
|
+
else if (activeStep === 2 && isMultipleReferenceIdentifier && someRequiredFieldsEmpty()) {
|
|
268
|
+
setIsNextStepDisabled(true);
|
|
269
|
+
setMissingRequiredDataTooltip(intl.formatMessage(exports.translationMessages.createInvoice_validationErrorObjectIdentifierRequired));
|
|
270
|
+
}
|
|
271
|
+
else if (activeStep === 2 && isSingleReferenceIdentifier && referenceIdentifierIsMandatory && !form.getFieldValue(["invoice", "singleReferenceIdentifier", "value"])) {
|
|
272
|
+
setIsNextStepDisabled(true);
|
|
273
|
+
setMissingRequiredDataTooltip(intl.formatMessage(exports.translationMessages.createInvoice_validationErrorObjectIdentifierRequired));
|
|
274
|
+
}
|
|
275
|
+
else if (activeStep === 2 && referenceIdentifierValidateStatus === "error") {
|
|
276
|
+
setIsNextStepDisabled(true);
|
|
277
|
+
setMissingRequiredDataTooltip(intl.formatMessage(exports.translationMessages.createInvoice_validationErrorObjectIdentifierNotValid));
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
setIsNextStepDisabled(false);
|
|
281
|
+
setMissingRequiredDataTooltip(undefined);
|
|
282
|
+
}
|
|
283
|
+
})
|
|
284
|
+
.catch(function (error) {
|
|
285
|
+
var _a;
|
|
286
|
+
var requiredFields = [];
|
|
287
|
+
(_a = error === null || error === void 0 ? void 0 : error.errorFields) === null || _a === void 0 ? void 0 : _a.map(function (errorField) {
|
|
288
|
+
var _a;
|
|
289
|
+
requiredFields.push(errorField.name[((_a = errorField === null || errorField === void 0 ? void 0 : errorField.name) === null || _a === void 0 ? void 0 : _a.length) - 1]);
|
|
290
|
+
});
|
|
291
|
+
if ((requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.length) > 0) {
|
|
292
|
+
var names = getFieldNames(requiredFields);
|
|
293
|
+
setMissingRequiredDataTooltip((0, RequirementsUtility_1.getRequiredTooltipMessage)(props.intl.formatMessage(CommonTranslations_1.commonTranslationMessages.missingRequiredData), names));
|
|
294
|
+
}
|
|
295
|
+
setIsNextStepDisabled(true);
|
|
296
|
+
})];
|
|
261
297
|
case 1:
|
|
262
298
|
_a.sent();
|
|
263
299
|
return [2 /*return*/];
|
|
@@ -291,6 +327,10 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
291
327
|
return props.intl.formatMessage(payment_method_1.translationMessages.paymentMethod_labels_domesticTransfer_accountNo);
|
|
292
328
|
case "bankNumber":
|
|
293
329
|
return props.intl.formatMessage(payment_method_1.translationMessages.paymentMethod_labels_icelandicClaim_bankNo);
|
|
330
|
+
case "value": // singleReferenceIdentifier
|
|
331
|
+
return intl.formatMessage(base_information_1.translationMessages.baseInformation_objectIdentifier);
|
|
332
|
+
case "documentNo":
|
|
333
|
+
return intl.formatMessage(base_information_1.translationMessages.baseInformation_projectReference);
|
|
294
334
|
default:
|
|
295
335
|
return "";
|
|
296
336
|
}
|
|
@@ -299,9 +339,13 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
299
339
|
var saveFieldValuesToLocalStorage = function () {
|
|
300
340
|
var flatFields = form.getFieldsValue();
|
|
301
341
|
delete flatFields.attachments;
|
|
342
|
+
delete flatFields.invoice.invoiceNo;
|
|
302
343
|
delete flatFields.invoice.invoiceLines;
|
|
303
344
|
delete flatFields.invoice.dueDate;
|
|
304
345
|
delete flatFields.invoice.issueDate;
|
|
346
|
+
delete flatFields.invoice.buyerReference;
|
|
347
|
+
delete flatFields.invoice.referenceIdentifiers;
|
|
348
|
+
delete flatFields.invoice.notes;
|
|
305
349
|
localStorage.setItem("formData", JSON.stringify(flatFields));
|
|
306
350
|
};
|
|
307
351
|
var handlePrevStep = function () {
|
|
@@ -352,7 +396,9 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
352
396
|
setIsNextStepVisible(activeStep < items.length);
|
|
353
397
|
}, [activeStep]);
|
|
354
398
|
(0, react_1.useEffect)(function () {
|
|
355
|
-
|
|
399
|
+
if (outsideVatScope) {
|
|
400
|
+
form.resetFields([["invoice", "supplier", "vatNumber"]]);
|
|
401
|
+
}
|
|
356
402
|
var invoiceLines = form.getFieldValue(["invoice", "invoiceLines"]);
|
|
357
403
|
if (outsideVatScope) {
|
|
358
404
|
invoiceLines = invoiceLines.map(function (invoiceLine) {
|
|
@@ -411,7 +457,7 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
411
457
|
return;
|
|
412
458
|
}
|
|
413
459
|
var services = sendCopy
|
|
414
|
-
? ["urn:services:dispatcher:mail.pdf?email=".concat(supplierEmail)]
|
|
460
|
+
? ["urn:services:dispatcher:mail.pdf?email=".concat(supplierEmail, "#$#lang=").concat(props.language)]
|
|
415
461
|
: undefined;
|
|
416
462
|
var invoiceMetadataInput = (0, utils_1.convertToInvoiceMetadataInput)(values, (0, BillingLineUtility_1.billingLinesFieldsMetadata)(form), (0, paymentMethodForConversion_1.PaymentMethodFormData)(values), chosenCustomer);
|
|
417
463
|
var createSubmitInvoice = {
|
|
@@ -423,34 +469,15 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
423
469
|
};
|
|
424
470
|
(0, utils_1.submitInvoice)(createSubmitInvoice, props.mapiBaseUrl, chosenCustomerApiKey, "submitInvoice", props.language)
|
|
425
471
|
.then(function (resp) {
|
|
472
|
+
var _a;
|
|
426
473
|
antd_1.message.success(intl.formatMessage(exports.translationMessages.createInvoice_successfullySubmittedInvoiceMsg));
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
throw new Error("NextFile is empty");
|
|
435
|
-
var createAttachDocument = {
|
|
436
|
-
messageId: _messageId,
|
|
437
|
-
contentType: nextFile.type,
|
|
438
|
-
more: _attachments.length > 0,
|
|
439
|
-
name: nextFileDescription_1, // nextFile.name,
|
|
440
|
-
};
|
|
441
|
-
(0, ApiUtility_1.submitDocumentFetch)(nextFile, createAttachDocument, _mapiBaseUrl, _chosenCustomerApiKey)
|
|
442
|
-
.then(function (submitDocumentResponse) {
|
|
443
|
-
antd_1.message.success(intl.formatMessage(exports.translationMessages.createInvoice_successfullyUploadedAttachmentMsg, { attachment: nextFileDescription_1 }));
|
|
444
|
-
submitAttachmentIfAnyLeft(_messageId, _attachments, _mapiBaseUrl, _chosenCustomerApiKey);
|
|
445
|
-
})
|
|
446
|
-
.catch(function (documentSendingErrorMessage) {
|
|
447
|
-
antd_1.message.error("".concat(intl.formatMessage(exports.translationMessages.createInvoice_ErrorUploadedAttachmentMsg, {
|
|
448
|
-
attachment: nextFileDescription_1,
|
|
449
|
-
}), " - ").concat(documentSendingErrorMessage.message));
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
};
|
|
453
|
-
submitAttachmentIfAnyLeft(messageId, attachments, props.mapiBaseUrl, chosenCustomerApiKey);
|
|
474
|
+
if (resp.status === 200) {
|
|
475
|
+
var response = resp.data;
|
|
476
|
+
(0, ApiUtility_1.submitAttachmentIfAnyLeft)((_a = response === null || response === void 0 ? void 0 : response.uniqueId) !== null && _a !== void 0 ? _a : "", attachments, props.mapiBaseUrl, chosenCustomerApiKey, intl);
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
antd_1.message.error("Created invoice had validation errors");
|
|
480
|
+
}
|
|
454
481
|
setActiveStep(activeStep + 1);
|
|
455
482
|
setSubmitting(false);
|
|
456
483
|
form.resetFields();
|
|
@@ -576,7 +603,7 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
576
603
|
});
|
|
577
604
|
setChosenCustomerApiKey(props.customers[0].apiKey);
|
|
578
605
|
}
|
|
579
|
-
var
|
|
606
|
+
var _y = (0, react_1.useState)(undefined), billingLinesMetadata = _y[0], setBillingLinesMetadata = _y[1];
|
|
580
607
|
var getBillingLines = function (changedValues, allValues) {
|
|
581
608
|
var invoiceLines = allValues.invoice.invoiceLines;
|
|
582
609
|
if (invoiceLines) {
|
|
@@ -651,7 +678,7 @@ var CreateInvoiceConstructor = function (props) {
|
|
|
651
678
|
react_1.default.createElement(antd_1.Flex, { vertical: true, style: activeStep !== 2 ? { display: "none" } : {} },
|
|
652
679
|
react_1.default.createElement(components_1.Invoice, { receiverRequirements: props.receiverRequirements, form: form, documentType: "invoice", updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, rapiBaseUrl: props.rapiBaseUrl, legalIdentifier: chosenCustomer.identifier, referenceIdentifiersLabelText: props.referenceIdentifiersLabelText, referenceIdentifiersHelpText: props.referenceIdentifiersHelpText, referenceIdentifierValidateStatus: referenceIdentifierValidateStatus, chosenCustomer: chosenCustomer, setReferenceIdentifierValidateStatus: setReferenceIdentifierValidateStatus, dueDateMinimumOffset: props.dueDateMinimumOffset, billingLinesMetadata: billingLinesMetadata, outsideVatScope: outsideVatScope, uploadSizeLimit: props.uploadSizeLimit, attachmentTooltipText: props.attachmentTooltipText, languageString: props.language, validateFields: validateFieldsForNextStep, isSaveFieldValuesSelected: isSaveFieldValuesSelected, onSaveFieldValuesChange: function () {
|
|
653
680
|
return setIsSaveFieldValuesSelected(!isSaveFieldValuesSelected);
|
|
654
|
-
}, isActiveStep: activeStep === 2 })),
|
|
681
|
+
}, isActiveStep: activeStep === 2, setReferenceIdentifierIsMandatory: setReferenceIdentifierIsMandatory })),
|
|
655
682
|
react_1.default.createElement(antd_1.Flex, { vertical: true, style: activeStep !== 3 ? { display: "none" } : {} },
|
|
656
683
|
react_1.default.createElement(components_1.PaymentMethod, { receiverRequirements: props.receiverRequirements, formInstance: form, validateFields: validateFieldsForNextStep, isSaveFieldValuesSelected: isSaveFieldValuesSelected, onSaveFieldValuesChange: function () {
|
|
657
684
|
return setIsSaveFieldValuesSelected(!isSaveFieldValuesSelected);
|
package/lib/enums.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ declare const AvailableTaxCategoryTypeEnum: {
|
|
|
5
5
|
ZeroRated: TaxCategoryTypeEnum.ZeroRated;
|
|
6
6
|
Exempt: TaxCategoryTypeEnum.Exempt;
|
|
7
7
|
OutsideTaxScope: TaxCategoryTypeEnum.OutsideTaxScope;
|
|
8
|
+
ExemptionForResale: TaxCategoryTypeEnum.ExemptionForResale;
|
|
9
|
+
SpecialTaxationProcedure: TaxCategoryTypeEnum.SpecialTaxationProcedure;
|
|
10
|
+
Annulled: TaxCategoryTypeEnum.Annulled;
|
|
8
11
|
};
|
|
9
12
|
type excludedOptions = typeof TaxCategoryTypeEnum.ExemptEuropeanEconomicArea | typeof TaxCategoryTypeEnum.FreeExportTaxNotCharged | typeof TaxCategoryTypeEnum.ReverseCharged;
|
|
10
13
|
type AvailableTaxCategoryTypeEnum = Exclude<TaxCategoryTypeEnum, excludedOptions>;
|
|
@@ -26,8 +26,10 @@
|
|
|
26
26
|
"baseInformation_issueDate": "Issue date",
|
|
27
27
|
"baseInformation_issueDate_title": "The issue date controls on which settlement period the transfer is registered",
|
|
28
28
|
"baseInformation_notes": "Notes",
|
|
29
|
+
"baseInformation_objectIdentifier": "Object identifier",
|
|
29
30
|
"baseInformation_orderReferenceLabel": "Order number",
|
|
30
31
|
"baseInformation_orderReferenceLabel_helpText": "Only use a reference to an actual order here. If no order exists, the buyer reference must be specified.",
|
|
32
|
+
"baseInformation_projectReference": "Project reference is required",
|
|
31
33
|
"baseInformation_projectReferenceLabel": "Project reference",
|
|
32
34
|
"baseInformation_title": "Base Information",
|
|
33
35
|
"billingCalculations_labels_AmountPayable": "Amount payable",
|
|
@@ -55,7 +57,7 @@
|
|
|
55
57
|
"billingLines_discount": "Discount",
|
|
56
58
|
"billingLines_discount_helpText": "Discount can be represented as an amount or a percentage indicated with a percentage sign (%)",
|
|
57
59
|
"billingLines_itemNo": "Item no",
|
|
58
|
-
"billingLines_labels_addButton": "
|
|
60
|
+
"billingLines_labels_addButton": "Save line",
|
|
59
61
|
"billingLines_lineAmount": "Amount",
|
|
60
62
|
"billingLines_name": "Name",
|
|
61
63
|
"billingLines_placeholders_itemNo": "Item No",
|
|
@@ -92,6 +94,8 @@
|
|
|
92
94
|
"createInvoice_successfullySubmittedInvoiceMsg": "Successfully submitted the invoice",
|
|
93
95
|
"createInvoice_successfullyUploadedAttachmentMsg": "Successfully uploaded attachment {attachment}",
|
|
94
96
|
"createInvoice_supplierStepTitle": "Supplier",
|
|
97
|
+
"createInvoice_validationErrorObjectIdentifierNotValid": "Object identifier is not valid",
|
|
98
|
+
"createInvoice_validationErrorObjectIdentifierRequired": "Object identifier is required",
|
|
95
99
|
"customer_address_city": "City",
|
|
96
100
|
"customer_address_countryCode": "Country code",
|
|
97
101
|
"customer_address_streetNameAndNumber": "Address",
|
|
@@ -155,14 +159,7 @@
|
|
|
155
159
|
"supplier_title": "Supplier",
|
|
156
160
|
"supplier_vatNumber": "VAT no",
|
|
157
161
|
"supplier_vatNumber_mandatory": "VAT number is required if some document lines are using any tax category type other than 'Outside tax scope'",
|
|
158
|
-
"
|
|
159
|
-
"taxCategoryType_labels_ExemptEuropeanEconomicArea": "Exempt European economic area",
|
|
160
|
-
"taxCategoryType_labels_FreeExportTaxNotCharged": "Free export tax not charged",
|
|
161
|
-
"taxCategoryType_labels_OutsideTaxScope": "Outside tax scope",
|
|
162
|
-
"taxCategoryType_labels_ReducedRated": "Reduced rated",
|
|
163
|
-
"taxCategoryType_labels_ReverseCharged": "Reverse charged",
|
|
164
|
-
"taxCategoryType_labels_StandardRated": "Standard rated",
|
|
165
|
-
"taxCategoryType_labels_ZeroRated": "Zero rated",
|
|
162
|
+
"taxCategoryType_label": "{taxCategoryType, select , StandardRated {Standard rated} ReducedRated {Reduced rated} ZeroRated {Zero rated} Exempt {Exempt} OutsideTaxScope {Outside tax scope} ReverseCharged {Reverse charged} FreeExportTaxNotCharged {Free export tax not charged} ExemptEuropeanEconomicArea {Exempt European economic area} ExemptionForResale {Exemption for resale} other {taxCategoryType}}",
|
|
166
163
|
"unitOfMeasure_labels_CubicMetre": "Cubic metre",
|
|
167
164
|
"unitOfMeasure_labels_Day": "Day",
|
|
168
165
|
"unitOfMeasure_labels_Hour": "Hour",
|
|
@@ -172,7 +169,7 @@
|
|
|
172
169
|
"unitOfMeasure_labels_Litre": "Litre",
|
|
173
170
|
"unitOfMeasure_labels_Metre": "Metre",
|
|
174
171
|
"unitOfMeasure_labels_Month": "Month",
|
|
175
|
-
"unitOfMeasure_labels_One": "
|
|
172
|
+
"unitOfMeasure_labels_One": "Unit",
|
|
176
173
|
"unitOfMeasure_labels_Package": "Package",
|
|
177
174
|
"unitOfMeasure_labels_Piece": "Piece",
|
|
178
175
|
"unitOfMeasure_labels_SquareMetre": "Square metre",
|
|
@@ -26,8 +26,10 @@
|
|
|
26
26
|
"baseInformation_issueDate": "Útgáfudags.",
|
|
27
27
|
"baseInformation_issueDate_title": "Útgáfudagsetning stjórnar á hvaða uppgjörstímabili færslan skráist",
|
|
28
28
|
"baseInformation_notes": "Athugasemdir",
|
|
29
|
+
"baseInformation_objectIdentifier": "Tilvísun",
|
|
29
30
|
"baseInformation_orderReferenceLabel": "Pöntun nr.",
|
|
30
31
|
"baseInformation_orderReferenceLabel_helpText": "Aðeins má nota númer raunverulegrar pöntunar. Ef engin pöntun er til, verður að nota tilvísun kaupanda.",
|
|
32
|
+
"baseInformation_projectReference": "Verknúmer er skilyrt svæði",
|
|
31
33
|
"baseInformation_projectReferenceLabel": "Verknúmer",
|
|
32
34
|
"baseInformation_title": "Grunnupplýsingar",
|
|
33
35
|
"billingCalculations_labels_AmountPayable": "Til greiðslu",
|
|
@@ -92,6 +94,8 @@
|
|
|
92
94
|
"createInvoice_successfullySubmittedInvoiceMsg": "Sending reiknings tókst",
|
|
93
95
|
"createInvoice_successfullyUploadedAttachmentMsg": "Það tókst að hlaða upp viðhenginu {attachment}",
|
|
94
96
|
"createInvoice_supplierStepTitle": "Þínar upplýsingar",
|
|
97
|
+
"createInvoice_validationErrorObjectIdentifierNotValid": "Tilvísun er ekki gild",
|
|
98
|
+
"createInvoice_validationErrorObjectIdentifierRequired": "Tilvísun þarf að fylla út",
|
|
95
99
|
"customer_address_city": "Borg",
|
|
96
100
|
"customer_address_countryCode": "Landsnúmer",
|
|
97
101
|
"customer_address_streetNameAndNumber": "Heimilisfang",
|
|
@@ -155,14 +159,7 @@
|
|
|
155
159
|
"supplier_title": "Birgi",
|
|
156
160
|
"supplier_vatNumber": "VSK nr.",
|
|
157
161
|
"supplier_vatNumber_mandatory": "Gerð er krafa um VSK númer ef línur í skjali nota aðra skattflokka heldur en 'Utan skattumfangs'",
|
|
158
|
-
"
|
|
159
|
-
"taxCategoryType_labels_ExemptEuropeanEconomicArea": "Exempt European economic area",
|
|
160
|
-
"taxCategoryType_labels_FreeExportTaxNotCharged": "Free export tax not charged",
|
|
161
|
-
"taxCategoryType_labels_OutsideTaxScope": "Utan skattumfangs",
|
|
162
|
-
"taxCategoryType_labels_ReducedRated": "Lækkaður skattur",
|
|
163
|
-
"taxCategoryType_labels_ReverseCharged": "Reverse charged",
|
|
164
|
-
"taxCategoryType_labels_StandardRated": "Hefðbundinn skattur",
|
|
165
|
-
"taxCategoryType_labels_ZeroRated": "Enginn skattur",
|
|
162
|
+
"taxCategoryType_label": "{taxCategoryType, select , StandardRated {Hefðbundinn skattur} ReducedRated {Lækkaður skattur} ZeroRated {Enginn skattur} Exempt {Undaþeginn skatti} OutsideTaxScope {Utan skattumfangs} ReverseCharged {Reverse charged} FreeExportTaxNotCharged {Free export tax not charged} ExemptEuropeanEconomicArea {Exempt European economic area} ExemptionForResale {Undanþága vegna endursölu} other {taxCategoryType}}",
|
|
166
163
|
"unitOfMeasure_labels_CubicMetre": "Rúmmetri",
|
|
167
164
|
"unitOfMeasure_labels_Day": "Dagur",
|
|
168
165
|
"unitOfMeasure_labels_Hour": "Klukkustund",
|
|
@@ -27,8 +27,10 @@ declare const _default: {
|
|
|
27
27
|
baseInformation_issueDate: string;
|
|
28
28
|
baseInformation_issueDate_title: string;
|
|
29
29
|
baseInformation_notes: string;
|
|
30
|
+
baseInformation_objectIdentifier: string;
|
|
30
31
|
baseInformation_orderReferenceLabel: string;
|
|
31
32
|
baseInformation_orderReferenceLabel_helpText: string;
|
|
33
|
+
baseInformation_projectReference: string;
|
|
32
34
|
baseInformation_projectReferenceLabel: string;
|
|
33
35
|
baseInformation_title: string;
|
|
34
36
|
billingCalculations_labels_AmountPayable: string;
|
|
@@ -93,6 +95,8 @@ declare const _default: {
|
|
|
93
95
|
createInvoice_successfullySubmittedInvoiceMsg: string;
|
|
94
96
|
createInvoice_successfullyUploadedAttachmentMsg: string;
|
|
95
97
|
createInvoice_supplierStepTitle: string;
|
|
98
|
+
createInvoice_validationErrorObjectIdentifierNotValid: string;
|
|
99
|
+
createInvoice_validationErrorObjectIdentifierRequired: string;
|
|
96
100
|
customer_address_city: string;
|
|
97
101
|
customer_address_countryCode: string;
|
|
98
102
|
customer_address_streetNameAndNumber: string;
|
|
@@ -156,14 +160,7 @@ declare const _default: {
|
|
|
156
160
|
supplier_title: string;
|
|
157
161
|
supplier_vatNumber: string;
|
|
158
162
|
supplier_vatNumber_mandatory: string;
|
|
159
|
-
|
|
160
|
-
taxCategoryType_labels_ExemptEuropeanEconomicArea: string;
|
|
161
|
-
taxCategoryType_labels_FreeExportTaxNotCharged: string;
|
|
162
|
-
taxCategoryType_labels_OutsideTaxScope: string;
|
|
163
|
-
taxCategoryType_labels_ReducedRated: string;
|
|
164
|
-
taxCategoryType_labels_ReverseCharged: string;
|
|
165
|
-
taxCategoryType_labels_StandardRated: string;
|
|
166
|
-
taxCategoryType_labels_ZeroRated: string;
|
|
163
|
+
taxCategoryType_label: string;
|
|
167
164
|
unitOfMeasure_labels_CubicMetre: string;
|
|
168
165
|
unitOfMeasure_labels_Day: string;
|
|
169
166
|
unitOfMeasure_labels_Hour: string;
|
|
@@ -210,8 +207,10 @@ declare const _default: {
|
|
|
210
207
|
baseInformation_issueDate: string;
|
|
211
208
|
baseInformation_issueDate_title: string;
|
|
212
209
|
baseInformation_notes: string;
|
|
210
|
+
baseInformation_objectIdentifier: string;
|
|
213
211
|
baseInformation_orderReferenceLabel: string;
|
|
214
212
|
baseInformation_orderReferenceLabel_helpText: string;
|
|
213
|
+
baseInformation_projectReference: string;
|
|
215
214
|
baseInformation_projectReferenceLabel: string;
|
|
216
215
|
baseInformation_title: string;
|
|
217
216
|
billingCalculations_labels_AmountPayable: string;
|
|
@@ -276,6 +275,8 @@ declare const _default: {
|
|
|
276
275
|
createInvoice_successfullySubmittedInvoiceMsg: string;
|
|
277
276
|
createInvoice_successfullyUploadedAttachmentMsg: string;
|
|
278
277
|
createInvoice_supplierStepTitle: string;
|
|
278
|
+
createInvoice_validationErrorObjectIdentifierNotValid: string;
|
|
279
|
+
createInvoice_validationErrorObjectIdentifierRequired: string;
|
|
279
280
|
customer_address_city: string;
|
|
280
281
|
customer_address_countryCode: string;
|
|
281
282
|
customer_address_streetNameAndNumber: string;
|
|
@@ -339,14 +340,7 @@ declare const _default: {
|
|
|
339
340
|
supplier_title: string;
|
|
340
341
|
supplier_vatNumber: string;
|
|
341
342
|
supplier_vatNumber_mandatory: string;
|
|
342
|
-
|
|
343
|
-
taxCategoryType_labels_ExemptEuropeanEconomicArea: string;
|
|
344
|
-
taxCategoryType_labels_FreeExportTaxNotCharged: string;
|
|
345
|
-
taxCategoryType_labels_OutsideTaxScope: string;
|
|
346
|
-
taxCategoryType_labels_ReducedRated: string;
|
|
347
|
-
taxCategoryType_labels_ReverseCharged: string;
|
|
348
|
-
taxCategoryType_labels_StandardRated: string;
|
|
349
|
-
taxCategoryType_labels_ZeroRated: string;
|
|
343
|
+
taxCategoryType_label: string;
|
|
350
344
|
unitOfMeasure_labels_CubicMetre: string;
|
|
351
345
|
unitOfMeasure_labels_Day: string;
|
|
352
346
|
unitOfMeasure_labels_Hour: string;
|