@unimaze/billing 0.21.3 → 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/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 +87 -60
- 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 +32 -1
- package/lib/utils/RequirementsUtility.d.ts +4 -1
- package/lib/utils/RequirementsUtility.js +56 -1
- package/package.json +2 -2
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var react_1 = __importStar(require("react"));
|
|
30
|
+
var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
|
|
31
|
+
var form_item_1 = __importDefault(require("../form-item"));
|
|
32
|
+
var react_intl_1 = require("react-intl");
|
|
33
|
+
var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
|
|
34
|
+
// import {FormInstance} from "antd/es/form";
|
|
35
|
+
var translationMessages = {
|
|
36
|
+
baseInformation_costCenter: {
|
|
37
|
+
id: "baseInformation_costCenter",
|
|
38
|
+
defaultMessage: "Cost center",
|
|
39
|
+
},
|
|
40
|
+
baseInformation_costCenter_placeholder_input: {
|
|
41
|
+
id: "baseInformation_costCenter_placeholder_input",
|
|
42
|
+
defaultMessage: "Input you cost center",
|
|
43
|
+
},
|
|
44
|
+
baseInformation_costCenter_placeholder_search: {
|
|
45
|
+
id: "baseInformation_costCenter_placeholder_search",
|
|
46
|
+
defaultMessage: "Search cost centers",
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
//
|
|
50
|
+
// const handleReferenceIdentifierValueSearch = (
|
|
51
|
+
// searchValue: string,
|
|
52
|
+
// costCenterFieldDefinition: FieldDefinition,
|
|
53
|
+
// receiverRequirements: NewReceiverRequirements,
|
|
54
|
+
// rapiBaseUrl: string,
|
|
55
|
+
// setLoadingCostCenterValues: (loadingCostCenterValues: boolean) => void,
|
|
56
|
+
// updateReceiverRequirementsProp: (receiverRequirements: NewReceiverRequirements) => void
|
|
57
|
+
// ) => {
|
|
58
|
+
// if (costCenterFieldDefinition && costCenterFieldDefinition.properties && costCenterFieldDefinition.properties.href) {
|
|
59
|
+
// const searchUrl = rapiBaseUrl + costCenterFieldDefinition.properties.href.replace("%7BtextFilter%7D", searchValue).replace("%7Boffset%7D", "0").replace("%7Blimit%7D", "15");
|
|
60
|
+
// setLoadingCostCenterValues(true)
|
|
61
|
+
// axios.get(searchUrl)
|
|
62
|
+
// .then(response => {
|
|
63
|
+
// setLoadingCostCenterValues(false)
|
|
64
|
+
// const updatedFieldDefinitions: FieldDefinition[] = [...receiverRequirements.fieldDefinitions];
|
|
65
|
+
// const index = updatedFieldDefinitions.findIndex(x => x.key === costCenterFieldDefinition.key)
|
|
66
|
+
//
|
|
67
|
+
// const updatedReferenceIdentifier: FieldDefinition = {
|
|
68
|
+
// ...updatedFieldDefinitions[index],
|
|
69
|
+
// properties: {
|
|
70
|
+
// label: updatedFieldDefinitions[index].properties.label,
|
|
71
|
+
// href: updatedFieldDefinitions[index].properties.href,
|
|
72
|
+
// cardinality: updatedFieldDefinitions[index].properties.cardinality,
|
|
73
|
+
// values: response.data.value
|
|
74
|
+
// }
|
|
75
|
+
// };
|
|
76
|
+
// updatedFieldDefinitions.splice(index, 1, updatedReferenceIdentifier)
|
|
77
|
+
//
|
|
78
|
+
// const newReceiverRequirements: NewReceiverRequirements = {
|
|
79
|
+
// ...receiverRequirements,
|
|
80
|
+
// fieldDefinitions: updatedFieldDefinitions
|
|
81
|
+
// }
|
|
82
|
+
//
|
|
83
|
+
// updateReceiverRequirementsProp(newReceiverRequirements);
|
|
84
|
+
// }
|
|
85
|
+
// )
|
|
86
|
+
// .catch(error => {
|
|
87
|
+
// setLoadingCostCenterValues(false)
|
|
88
|
+
// })
|
|
89
|
+
//
|
|
90
|
+
// }
|
|
91
|
+
// }
|
|
92
|
+
//
|
|
93
|
+
// const getCostCenterInput = (
|
|
94
|
+
// fieldDefinition: FieldDefinition,
|
|
95
|
+
// receiverRequirements: NewReceiverRequirements,
|
|
96
|
+
// rapiBaseUrl: string,
|
|
97
|
+
// setLoadingCostCenterValues: (loadingCostCenterValues: boolean) => void,
|
|
98
|
+
// loadingCostCenterValues: boolean,
|
|
99
|
+
// updateReceiverRequirementsProp: (receiverRequirements: NewReceiverRequirements) => void,
|
|
100
|
+
// constCenterPlaceholderInput: string,
|
|
101
|
+
// constCenterPlaceholderSearch: string,
|
|
102
|
+
// ): React.ReactElement => {
|
|
103
|
+
// let handling = null;
|
|
104
|
+
// if (fieldDefinition.properties.handling) {
|
|
105
|
+
// handling = JSON.parse(fieldDefinition.properties.handling)
|
|
106
|
+
// }
|
|
107
|
+
//
|
|
108
|
+
// if (fieldDefinition) {
|
|
109
|
+
// if (fieldDefinition.properties.values) {
|
|
110
|
+
// const selectProps: SelectProps<any> = fieldDefinition.properties.hasOwnProperty("href")
|
|
111
|
+
// ? {
|
|
112
|
+
// showSearch: true,
|
|
113
|
+
// filterOption: false,
|
|
114
|
+
// onSearch: (searchValue: string) => {
|
|
115
|
+
// handleReferenceIdentifierValueSearch(searchValue, fieldDefinition, receiverRequirements, rapiBaseUrl, setLoadingCostCenterValues, updateReceiverRequirementsProp);
|
|
116
|
+
// },
|
|
117
|
+
// onChange: (searchValue: string) => {
|
|
118
|
+
// if (!searchValue) {
|
|
119
|
+
// handleReferenceIdentifierValueSearch("", fieldDefinition, receiverRequirements, rapiBaseUrl, setLoadingCostCenterValues, updateReceiverRequirementsProp);
|
|
120
|
+
// }
|
|
121
|
+
// },
|
|
122
|
+
// loading: loadingCostCenterValues,
|
|
123
|
+
// }
|
|
124
|
+
// : {}
|
|
125
|
+
//
|
|
126
|
+
// return <Select
|
|
127
|
+
// popupMatchSelectWidth={false}
|
|
128
|
+
// allowClear
|
|
129
|
+
// {...selectProps}
|
|
130
|
+
// placeholder={getFieldPlaceholderOverride(receiverRequirements,AvailableFields["customer.locationIdentifier"], constCenterPlaceholderSearch)}
|
|
131
|
+
// >
|
|
132
|
+
// {fieldDefinition.properties.values.map(op => {
|
|
133
|
+
// return <Select.Option
|
|
134
|
+
// key={op.key}
|
|
135
|
+
// value={op.key}
|
|
136
|
+
// >
|
|
137
|
+
// {op.name}
|
|
138
|
+
// </Select.Option>;
|
|
139
|
+
// }
|
|
140
|
+
// )}
|
|
141
|
+
// </Select>;
|
|
142
|
+
// } else {
|
|
143
|
+
// return <Input
|
|
144
|
+
// placeholder={getFieldPlaceholderOverride(receiverRequirements,AvailableFields["customer.locationIdentifier"], constCenterPlaceholderInput)}/>
|
|
145
|
+
// }
|
|
146
|
+
// } else {
|
|
147
|
+
// return <Input
|
|
148
|
+
// placeholder={getFieldPlaceholderOverride(receiverRequirements,AvailableFields["customer.locationIdentifier"], constCenterPlaceholderInput)}/>
|
|
149
|
+
// }
|
|
150
|
+
// }
|
|
151
|
+
var CostCenter = function (props) {
|
|
152
|
+
var _a = (0, react_1.useState)(""), costCenterHandlingValidationStatus = _a[0], setCostCenterHandlingValidationStatus = _a[1];
|
|
153
|
+
var _b = (0, react_1.useState)({}), costCenterFieldProps = _b[0], setCostCenterFieldProps = _b[1];
|
|
154
|
+
var _c = (0, react_1.useState)(false), loadingCostCenterValues = _c[0], setLoadingCostCenterValues = _c[1];
|
|
155
|
+
var costCenterFieldDefinition = (0, RequirementsUtility_1.getFieldRequirements)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["customer.locationIdentifier"]);
|
|
156
|
+
if (costCenterFieldDefinition) {
|
|
157
|
+
return (react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.locationIdentifier"], defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_costCenter), defaultIsRequired: false, fieldName: ["invoice", "customer", "locationIdentifier"], validateStatus: costCenterHandlingValidationStatus }, (0, RequirementsUtility_1.getInput)(costCenterFieldDefinition, ["invoice", "customer", "locationIdentifier"], "handleCostCenterValidation", props.legalIdentifier, props.formInstance, props.rapiBaseUrl, props.receiverRequirements, props.updateReceiverRequirementsProp, setCostCenterFieldProps, costCenterFieldProps, setLoadingCostCenterValues, loadingCostCenterValues, setCostCenterHandlingValidationStatus, props.intl.formatMessage(translationMessages.baseInformation_costCenter), true)));
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
exports.default = (0, react_intl_1.injectIntl)(CostCenter);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { WrappedComponentProps } from "react-intl";
|
|
3
|
+
import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
|
|
4
|
+
import { FormInstance } from "antd/es/form";
|
|
5
|
+
interface CustomerContactNameProps extends WrappedComponentProps {
|
|
6
|
+
receiverRequirements: NewReceiverRequirements;
|
|
7
|
+
updateReceiverRequirementsProp: (receiverRequirements: NewReceiverRequirements) => void;
|
|
8
|
+
rapiBaseUrl: string;
|
|
9
|
+
formInstance: FormInstance;
|
|
10
|
+
legalIdentifier: string;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<CustomerContactNameProps, "intl"> & {
|
|
13
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
14
|
+
} & React.RefAttributes<any>> & {
|
|
15
|
+
WrappedComponent: React.ComponentType<CustomerContactNameProps>;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var React = __importStar(require("react"));
|
|
30
|
+
var react_intl_1 = require("react-intl");
|
|
31
|
+
var react_1 = require("react");
|
|
32
|
+
var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
|
|
33
|
+
var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
|
|
34
|
+
var form_item_1 = __importDefault(require("../form-item"));
|
|
35
|
+
var translationMessages = {
|
|
36
|
+
baseInformation_customerContactName: {
|
|
37
|
+
id: "baseInformation_customerContactName",
|
|
38
|
+
defaultMessage: "Contact name",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
var CustomerContactName = function (props) {
|
|
42
|
+
var _a = (0, react_1.useState)(""), customerContactNameHandlingValidationStatus = _a[0], setCustomerContactNameHandlingValidationStatus = _a[1];
|
|
43
|
+
var _b = (0, react_1.useState)({}), customerContactNameFieldProps = _b[0], setCustomerContactNameFieldProps = _b[1];
|
|
44
|
+
var _c = (0, react_1.useState)(false), loadingCustomerContactNameValues = _c[0], setLoadingCustomerContactNameValues = _c[1];
|
|
45
|
+
var customerContactNameFieldDefinition = (0, RequirementsUtility_1.getFieldRequirements)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["customer.contact.name"]);
|
|
46
|
+
if (customerContactNameFieldDefinition) {
|
|
47
|
+
return (React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.contact.name"], defaultIsRequired: false, fieldName: ["invoice", "customer", "contact", "name"], validateStatus: customerContactNameHandlingValidationStatus }, (0, RequirementsUtility_1.getInput)(customerContactNameFieldDefinition, ["invoice", "customer", "contact", "name"], "handleCostCenterValidation", props.legalIdentifier, props.formInstance, props.rapiBaseUrl, props.receiverRequirements, props.updateReceiverRequirementsProp, setCustomerContactNameFieldProps, customerContactNameFieldProps, setLoadingCustomerContactNameValues, loadingCustomerContactNameValues, setCustomerContactNameHandlingValidationStatus, props.intl.formatMessage(translationMessages.baseInformation_customerContactName), true)));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.default = (0, react_intl_1.injectIntl)(CustomerContactName);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
var React = __importStar(require("react"));
|
|
27
|
+
var components_1 = require("../../components");
|
|
28
|
+
var Customer = function (props) {
|
|
29
|
+
var _a = props.customer, participantLegalIsoIdentifier = _a.participantLegalIsoIdentifier, participantLegalAddressPostalCode = _a.participantLegalAddressPostalCode, participantLegalAddressCity = _a.participantLegalAddressCity, participantLegalAddressStreet = _a.participantLegalAddressStreet, email = _a.email, name = _a.name, country = _a.country;
|
|
30
|
+
return (React.createElement(components_1.ComponentContainer, { title: "Invoice payer" },
|
|
31
|
+
React.createElement("div", null,
|
|
32
|
+
React.createElement("strong", null, name),
|
|
33
|
+
" (",
|
|
34
|
+
participantLegalIsoIdentifier,
|
|
35
|
+
")"),
|
|
36
|
+
React.createElement("div", null, "".concat(participantLegalAddressPostalCode, " ").concat(participantLegalAddressCity)),
|
|
37
|
+
React.createElement("div", null, participantLegalAddressStreet),
|
|
38
|
+
React.createElement("div", null, country),
|
|
39
|
+
React.createElement("div", null, email)));
|
|
40
|
+
};
|
|
41
|
+
exports.default = Customer;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { WrappedComponentProps } from "react-intl";
|
|
3
|
+
import { FormInstance } from "antd/es/form";
|
|
4
|
+
import { PartyMetadata } from "@unimaze/api-clients/lib/mapi";
|
|
5
|
+
import { ProfileOutputWithApiKey } from "../../types/AppConfiguration";
|
|
6
|
+
import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
|
|
7
|
+
interface Props extends WrappedComponentProps {
|
|
8
|
+
receiverRequirements: NewReceiverRequirements;
|
|
9
|
+
customers: ProfileOutputWithApiKey[];
|
|
10
|
+
formInstance: FormInstance;
|
|
11
|
+
chosenCustomer: PartyMetadata | undefined;
|
|
12
|
+
setChosenCustomer: (chosenCustomer: PartyMetadata) => void;
|
|
13
|
+
setChosenCustomerApiKey: (chosenCustomerApiKey: string) => void;
|
|
14
|
+
rapiBaseUrl: string;
|
|
15
|
+
updateReceiverRequirementsProp: (newReceiverRequirements: NewReceiverRequirements) => void;
|
|
16
|
+
validateFields: (fieldNames: string[][], validateOnly?: boolean | undefined) => void;
|
|
17
|
+
isSaveFieldValuesSelected: boolean;
|
|
18
|
+
onSaveFieldValuesChange: () => void;
|
|
19
|
+
isActiveStep: boolean;
|
|
20
|
+
}
|
|
21
|
+
declare const CustomerIntl: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
|
|
22
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
23
|
+
} & React.RefAttributes<any>> & {
|
|
24
|
+
WrappedComponent: React.ComponentType<Props>;
|
|
25
|
+
};
|
|
26
|
+
export default CustomerIntl;
|
|
@@ -0,0 +1,168 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
var react_1 = __importStar(require("react"));
|
|
41
|
+
var antd_1 = require("antd");
|
|
42
|
+
var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
|
|
43
|
+
var form_item_1 = __importDefault(require("../form-item"));
|
|
44
|
+
var react_intl_1 = require("react-intl");
|
|
45
|
+
var ConversionUtility_1 = require("../../../utils/ConversionUtility");
|
|
46
|
+
var formLayout_1 = require("../../consts/formLayout");
|
|
47
|
+
var CostCenter_1 = __importDefault(require("./CostCenter"));
|
|
48
|
+
var CustomerContactName_1 = __importDefault(require("./CustomerContactName"));
|
|
49
|
+
var Title_1 = __importDefault(require("antd/es/typography/Title"));
|
|
50
|
+
var react_use_1 = require("react-use");
|
|
51
|
+
var CommonTranslations_1 = require("../CommonTranslations");
|
|
52
|
+
var lodash_1 = require("lodash");
|
|
53
|
+
var translationMessages = (0, react_intl_1.defineMessages)({
|
|
54
|
+
customer_title: {
|
|
55
|
+
id: "customer_title",
|
|
56
|
+
defaultMessage: "Customer",
|
|
57
|
+
},
|
|
58
|
+
customer_selectTheCustomer: {
|
|
59
|
+
id: "customer_selectTheCustomer",
|
|
60
|
+
defaultMessage: "Select the customer",
|
|
61
|
+
},
|
|
62
|
+
customer_name: {
|
|
63
|
+
id: "customer_name",
|
|
64
|
+
defaultMessage: "Name",
|
|
65
|
+
},
|
|
66
|
+
customer_identifier: {
|
|
67
|
+
id: "customer_identifier",
|
|
68
|
+
defaultMessage: "Identifier",
|
|
69
|
+
},
|
|
70
|
+
customer_address_streetNameAndNumber: {
|
|
71
|
+
id: "customer_address_streetNameAndNumber",
|
|
72
|
+
defaultMessage: "Address",
|
|
73
|
+
},
|
|
74
|
+
customer_address_zip_postalCode: {
|
|
75
|
+
id: "customer_address_zipPostalCode",
|
|
76
|
+
defaultMessage: "Zip/Postal code",
|
|
77
|
+
},
|
|
78
|
+
customer_address_city: {
|
|
79
|
+
id: "customer_address_city",
|
|
80
|
+
defaultMessage: "City",
|
|
81
|
+
},
|
|
82
|
+
customer_address_countryCode: {
|
|
83
|
+
id: "customer_address_countryCode",
|
|
84
|
+
defaultMessage: "Country code",
|
|
85
|
+
},
|
|
86
|
+
customer_contact_email: {
|
|
87
|
+
id: "customer_contact_email",
|
|
88
|
+
defaultMessage: "E-Mail",
|
|
89
|
+
},
|
|
90
|
+
customer_contact_name: {
|
|
91
|
+
id: "customer_contact_name",
|
|
92
|
+
defaultMessage: "Contact name",
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
var Customer = function (props) {
|
|
96
|
+
var width = (0, react_use_1.useWindowSize)().width;
|
|
97
|
+
var _a = react_1.default.useState(false), isMobile = _a[0], setIsMobile = _a[1];
|
|
98
|
+
var colorInfoBg = antd_1.theme.useToken().token.colorInfoBg;
|
|
99
|
+
react_1.default.useEffect(function () {
|
|
100
|
+
if (width < 768) {
|
|
101
|
+
setIsMobile(true);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
setIsMobile(false);
|
|
105
|
+
}
|
|
106
|
+
}, [width]);
|
|
107
|
+
var chosenCustomer = props.chosenCustomer, setChosenCustomer = props.setChosenCustomer;
|
|
108
|
+
var onCustomerChange = function (customerIndex) {
|
|
109
|
+
var customerPartyMetadata = (0, ConversionUtility_1.profileOutputToPartyMetadata)(props.customers[customerIndex]);
|
|
110
|
+
var prevValues = props.formInstance.getFieldsValue();
|
|
111
|
+
var newFormValues = __assign(__assign({}, prevValues), { invoice: __assign(__assign({}, prevValues.invoice), { customer: __assign(__assign({}, prevValues.invoice.customer), customerPartyMetadata) }) });
|
|
112
|
+
setChosenCustomer(__assign(__assign({}, prevValues.invoice.customer), customerPartyMetadata));
|
|
113
|
+
props.setChosenCustomerApiKey(props.customers[customerIndex].apiKey);
|
|
114
|
+
props.formInstance.setFieldsValue(newFormValues);
|
|
115
|
+
};
|
|
116
|
+
var fieldPaths = [
|
|
117
|
+
["invoice", "customer", "name"],
|
|
118
|
+
["invoice", "customer", "locationIdentifier"],
|
|
119
|
+
["invoice", "customer", "contact", "name"],
|
|
120
|
+
];
|
|
121
|
+
var debouncedValidateFields = (0, lodash_1.debounce)(props.validateFields, 500);
|
|
122
|
+
(0, react_1.useEffect)(function () {
|
|
123
|
+
if (!props.isActiveStep)
|
|
124
|
+
return;
|
|
125
|
+
debouncedValidateFields(fieldPaths, true);
|
|
126
|
+
}, [props.isActiveStep, props.formInstance.getFieldsValue(fieldPaths)]);
|
|
127
|
+
var onlyOneCustomer = props.customers.length === 1;
|
|
128
|
+
return (react_1.default.createElement(antd_1.Flex, { style: {
|
|
129
|
+
backgroundColor: isMobile ? undefined : colorInfoBg,
|
|
130
|
+
padding: isMobile ? 0 : "35px",
|
|
131
|
+
}, justify: "center" },
|
|
132
|
+
react_1.default.createElement(antd_1.Flex, { vertical: true, style: { width: "100%", maxWidth: "900px" }, gap: isMobile || onlyOneCustomer ? "small" : "middle" },
|
|
133
|
+
react_1.default.createElement(Title_1.default, { level: 5 }, props.intl.formatMessage(translationMessages.customer_title)),
|
|
134
|
+
onlyOneCustomer ?
|
|
135
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: 20, paddingBottom: 5 }, className: "ant-form-text" }, props.customers[0].name)
|
|
136
|
+
:
|
|
137
|
+
react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, defaultLabel: props.customers.length > 1
|
|
138
|
+
? props.intl.formatMessage(translationMessages.customer_selectTheCustomer)
|
|
139
|
+
: props.intl.formatMessage(translationMessages.customer_title), defaultIsRequired: true, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["customer.identifier"], fieldName: ["invoice", "customer", "name"], style: { marginBottom: 0 } }, props.customers.length > 0 ? (react_1.default.createElement(antd_1.Select, __assign({ onChange: function (value) {
|
|
140
|
+
onCustomerChange(value);
|
|
141
|
+
}, disabled: props.customers.length === 1 }, formLayout_1.formItemLayout), props.customers.map(function (customer, index) { return (react_1.default.createElement(antd_1.Select.Option, { key: index, value: index }, customer.name)); }))) : ("Error - no customer configured")),
|
|
142
|
+
react_1.default.createElement(antd_1.Flex, { vertical: true, gap: 5 },
|
|
143
|
+
react_1.default.createElement(antd_1.Typography.Text, { className: "ant-form-text", style: { fontSize: 18 }, type: "secondary" },
|
|
144
|
+
props.intl.formatMessage(translationMessages.customer_identifier),
|
|
145
|
+
":",
|
|
146
|
+
" ",
|
|
147
|
+
chosenCustomer && (0, ConversionUtility_1.convertToReadableKennitala)(chosenCustomer.identifier)),
|
|
148
|
+
react_1.default.createElement(antd_1.Typography.Text, { className: "ant-form-text", style: { fontSize: 18 }, type: "secondary" },
|
|
149
|
+
props.intl.formatMessage(translationMessages.customer_address_streetNameAndNumber),
|
|
150
|
+
":",
|
|
151
|
+
" ",
|
|
152
|
+
chosenCustomer && chosenCustomer.address ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
153
|
+
chosenCustomer.address.streetNameAndNumber,
|
|
154
|
+
", ",
|
|
155
|
+
chosenCustomer.address.postalZone,
|
|
156
|
+
",",
|
|
157
|
+
" ",
|
|
158
|
+
chosenCustomer.address.city,
|
|
159
|
+
", ",
|
|
160
|
+
chosenCustomer.address.countryCode)) : null,
|
|
161
|
+
" "),
|
|
162
|
+
chosenCustomer && chosenCustomer.identifier && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
163
|
+
react_1.default.createElement(CostCenter_1.default, { receiverRequirements: props.receiverRequirements, updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, rapiBaseUrl: props.rapiBaseUrl, legalIdentifier: chosenCustomer.identifier, formInstance: props.formInstance }),
|
|
164
|
+
react_1.default.createElement(CustomerContactName_1.default, { receiverRequirements: props.receiverRequirements, updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, rapiBaseUrl: props.rapiBaseUrl, legalIdentifier: chosenCustomer.identifier, formInstance: props.formInstance }))),
|
|
165
|
+
react_1.default.createElement(antd_1.Checkbox, { checked: props.isSaveFieldValuesSelected, onChange: props.onSaveFieldValuesChange }, props.intl.formatMessage(CommonTranslations_1.commonTranslationMessages.saveInformation_label))))));
|
|
166
|
+
};
|
|
167
|
+
var CustomerIntl = (0, react_intl_1.injectIntl)(Customer);
|
|
168
|
+
exports.default = CustomerIntl;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
|
|
3
|
+
import { AvailableFields } from "../../types/ReceiverRequirements";
|
|
4
|
+
import { Dayjs } from "dayjs";
|
|
5
|
+
interface Props {
|
|
6
|
+
receiverRequirements?: NewReceiverRequirements;
|
|
7
|
+
receiverRequirementsKey?: AvailableFields;
|
|
8
|
+
defaultPickerValue?: Dayjs;
|
|
9
|
+
defaultPlaceholder?: string;
|
|
10
|
+
defaultIsRequired?: boolean;
|
|
11
|
+
defaultValue?: Dayjs;
|
|
12
|
+
defaultTooltip?: React.ReactNode;
|
|
13
|
+
format: string;
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
disabledDate?: (current: Dayjs) => boolean;
|
|
17
|
+
onChange?: (date: Dayjs | null, dateString: string | string[]) => void;
|
|
18
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
19
|
+
}
|
|
20
|
+
declare const UmzDatePicker: React.FC<Props>;
|
|
21
|
+
export default UmzDatePicker;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var antd_1 = require("antd");
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
|
|
9
|
+
var tooltip_1 = __importDefault(require("../tooltip"));
|
|
10
|
+
var UmzDatePicker = function (_a) {
|
|
11
|
+
var receiverRequirements = _a.receiverRequirements, receiverRequirementsKey = _a.receiverRequirementsKey, defaultPlaceholder = _a.defaultPlaceholder, _b = _a.defaultIsRequired, defaultIsRequired = _b === void 0 ? false : _b, defaultPickerValue = _a.defaultPickerValue, defaultValue = _a.defaultValue, defaultTooltip = _a.defaultTooltip, format = _a.format, style = _a.style, _c = _a.disabled, disabled = _c === void 0 ? false : _c, disabledDate = _a.disabledDate, onChange = _a.onChange, getPopupContainer = _a.getPopupContainer;
|
|
12
|
+
var isRequired = receiverRequirements && receiverRequirementsKey
|
|
13
|
+
? (0, RequirementsUtility_1.getFieldIsRequired)(receiverRequirements, receiverRequirementsKey, defaultIsRequired)
|
|
14
|
+
: defaultIsRequired;
|
|
15
|
+
var tooltipTitle = receiverRequirements && receiverRequirementsKey
|
|
16
|
+
? (0, RequirementsUtility_1.getFieldLabelTooltipOverride)(receiverRequirements, receiverRequirementsKey, defaultTooltip)
|
|
17
|
+
: defaultTooltip;
|
|
18
|
+
return (react_1.default.createElement(antd_1.Flex, { gap: "middle" },
|
|
19
|
+
react_1.default.createElement(antd_1.DatePicker, { className: isRequired ? "date-picker-asterisk-wrapper" : undefined, required: isRequired, placeholder: defaultPlaceholder, defaultValue: defaultValue, defaultPickerValue: defaultPickerValue, format: format, style: style, disabled: disabled, disabledDate: disabledDate, onChange: onChange, getPopupContainer: getPopupContainer }),
|
|
20
|
+
react_1.default.createElement(antd_1.Flex, { align: "center" },
|
|
21
|
+
react_1.default.createElement(tooltip_1.default, { title: tooltipTitle }))));
|
|
22
|
+
};
|
|
23
|
+
exports.default = UmzDatePicker;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { WrappedComponentProps } from "react-intl";
|
|
3
|
+
import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
|
|
4
|
+
interface Props extends WrappedComponentProps {
|
|
5
|
+
receiverRequirements: NewReceiverRequirements;
|
|
6
|
+
}
|
|
7
|
+
declare const DeliveryLocationIntl: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
|
|
8
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
9
|
+
} & React.RefAttributes<any>> & {
|
|
10
|
+
WrappedComponent: React.ComponentType<Props>;
|
|
11
|
+
};
|
|
12
|
+
export default DeliveryLocationIntl;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var React = __importStar(require("react"));
|
|
30
|
+
var components_1 = require("../../components");
|
|
31
|
+
var antd_1 = require("antd");
|
|
32
|
+
var form_item_1 = __importDefault(require("../form-item"));
|
|
33
|
+
var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
|
|
34
|
+
var react_intl_1 = require("react-intl");
|
|
35
|
+
var translationMessages = (0, react_intl_1.defineMessages)({
|
|
36
|
+
deliveryLocation_title: {
|
|
37
|
+
id: "deliveryLocation_title",
|
|
38
|
+
defaultMessage: "Delivery location",
|
|
39
|
+
},
|
|
40
|
+
deliveryLocation_partyName: {
|
|
41
|
+
id: "deliveryLocation_partyName",
|
|
42
|
+
defaultMessage: "Party name",
|
|
43
|
+
},
|
|
44
|
+
deliveryLocation_streetNameAndNumber: {
|
|
45
|
+
id: "deliveryLocation_streetNameAndNumber",
|
|
46
|
+
defaultMessage: "Address"
|
|
47
|
+
},
|
|
48
|
+
deliveryLocation_postalZone: {
|
|
49
|
+
id: "deliveryLocation_postalZone",
|
|
50
|
+
defaultMessage: "Postal no"
|
|
51
|
+
},
|
|
52
|
+
deliveryLocation_city: {
|
|
53
|
+
id: "deliveryLocation_city",
|
|
54
|
+
defaultMessage: "Town/City"
|
|
55
|
+
},
|
|
56
|
+
deliveryLocation_countryCode: {
|
|
57
|
+
id: "deliveryLocation_countryCode",
|
|
58
|
+
defaultMessage: "Country code"
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
var DeliveryLocation = function (props) {
|
|
62
|
+
return (
|
|
63
|
+
// props.intl.formatMessage(translationMessages.deliveryLocation_title)
|
|
64
|
+
React.createElement(components_1.ComponentContainer, { title: "Afhendingarstaður" },
|
|
65
|
+
React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.partyName"],
|
|
66
|
+
// props.intl.formatMessage(translationMessages.deliveryLocation_partyName)
|
|
67
|
+
defaultLabel: "Nafn aðila", defaultIsRequired: false, fieldName: ["invoice", "delivery", "partyName"] },
|
|
68
|
+
React.createElement(antd_1.Input, null)),
|
|
69
|
+
React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.address.streetNameAndNumber"],
|
|
70
|
+
// props.intl.formatMessage(translationMessages.deliveryLocation_streetNameAndNumber)
|
|
71
|
+
defaultLabel: "Heimilisfang", defaultIsRequired: false, fieldName: ["invoice", "delivery", "address", "streetNameAndNumber"] },
|
|
72
|
+
React.createElement(antd_1.Input, null)),
|
|
73
|
+
React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.address.postalZone"],
|
|
74
|
+
// props.intl.formatMessage(translationMessages.deliveryLocation_postalZone)
|
|
75
|
+
defaultLabel: "Póstnúmer", defaultIsRequired: false, fieldName: ["invoice", "delivery", "address", "postalZone"] },
|
|
76
|
+
React.createElement(antd_1.Input, null)),
|
|
77
|
+
React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements,
|
|
78
|
+
// receiverRequirements={receiverRequirementsObject}
|
|
79
|
+
receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.address.city"],
|
|
80
|
+
// props.intl.formatMessage(translationMessages.deliveryLocation_city)
|
|
81
|
+
defaultLabel: "Bær/Borg", defaultIsRequired: false, fieldName: ["invoice", "delivery", "address", "city"] },
|
|
82
|
+
React.createElement(antd_1.Input, null)),
|
|
83
|
+
React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.address.countryCode"],
|
|
84
|
+
// props.intl.formatMessage(translationMessages.deliveryLocation_countryCode)
|
|
85
|
+
defaultLabel: "Landsnúmer", defaultIsRequired: true, fieldName: ["invoice", "delivery", "address", "countryCode"] },
|
|
86
|
+
React.createElement(antd_1.Input, null))));
|
|
87
|
+
};
|
|
88
|
+
var DeliveryLocationIntl = (0, react_intl_1.injectIntl)(DeliveryLocation);
|
|
89
|
+
exports.default = DeliveryLocationIntl;
|
|
File without changes
|