@unimaze/billing 0.21.46 → 0.21.47
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/billing-lines/CurrencySelector.d.ts +1 -3
- package/lib/common/components/billing-lines/CurrencySelector.js +45 -8
- package/lib/common/components/billing-lines/NewBillingLines.js +0 -8
- 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.js +9 -5
- 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/invoice-preview/InvoicePreviewCustomerSupplierInfo.d.ts +0 -0
- package/lib/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfo.js +109 -0
- package/lib/common/components/invoice-preview/InvoicePreviewPaymentInfo.d.ts +0 -0
- package/lib/common/components/invoice-preview/InvoicePreviewPaymentInfo.js +110 -0
- 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 +74 -0
- package/lib/unimaze-billing/src/common/components/CommonTranslations.js +78 -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 +206 -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 +53 -0
- package/lib/unimaze-billing/src/common/components/base-information/ReferenceIdentifiers.js +328 -0
- package/lib/unimaze-billing/src/common/components/base-information/index.d.ts +77 -0
- package/lib/unimaze-billing/src/common/components/base-information/index.js +186 -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 +151 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingLinePreview.d.ts +24 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingLinePreview.js +61 -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 +133 -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 +134 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/NewBillingLines.js +209 -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 +19 -0
- package/lib/unimaze-billing/src/common/components/billing-lines/SingleBillingLine.js +275 -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 +49 -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 +166 -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 +42 -0
- package/lib/unimaze-billing/src/common/components/invoice/index.js +59 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfo.d.ts +14 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfo.js +75 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfoBox.d.ts +14 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfoBox.js +73 -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 +104 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewInvoiceLines.d.ts +12 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewInvoiceLines.js +93 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewPaymentInfo.d.ts +14 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewPaymentInfo.js +77 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewPaymentInfoBox.d.ts +14 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewPaymentInfoBox.js +58 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewTotalAmountPreview.d.ts +14 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewTotalAmountPreview.js +52 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/index.d.ts +102 -0
- package/lib/unimaze-billing/src/common/components/invoice-preview/index.js +196 -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 +26 -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 +83 -0
- package/lib/unimaze-billing/src/common/types/ReceiverRequirements.js +393 -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 +82 -0
- package/lib/unimaze-billing/src/create-invoice/index.js +710 -0
- package/lib/unimaze-billing/src/enums.d.ts +14 -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 +29 -0
- package/lib/unimaze-billing/src/utils/ApiUtility.js +133 -0
- package/lib/unimaze-billing/src/utils/BillingLineUtility.d.ts +25 -0
- package/lib/unimaze-billing/src/utils/BillingLineUtility.js +190 -0
- package/lib/unimaze-billing/src/utils/ConversionUtility.d.ts +9 -0
- package/lib/unimaze-billing/src/utils/ConversionUtility.js +222 -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 +6 -0
- package/lib/unimaze-billing/src/utils/IntlUtility.js +78 -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 +21 -0
- package/lib/unimaze-billing/src/utils/RequirementsUtility.js +237 -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/RequirementsUtility.d.ts +3 -2
- package/lib/utils/RequirementsUtility.js +12 -2
- package/package.json +1 -1
- package/lib/style/index.css +0 -51
|
@@ -0,0 +1,166 @@
|
|
|
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
|
+
react_1.default.createElement(antd_1.Flex, { vertical: true, gap: "middle" },
|
|
135
|
+
onlyOneCustomer && (react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: 20, paddingBottom: 5 }, className: "ant-form-text" }, props.customers[0].name)),
|
|
136
|
+
react_1.default.createElement(form_item_1.default, { hidden: onlyOneCustomer, receiverRequirements: props.receiverRequirements, defaultLabel: props.customers.length > 1
|
|
137
|
+
? props.intl.formatMessage(translationMessages.customer_selectTheCustomer)
|
|
138
|
+
: 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) {
|
|
139
|
+
onCustomerChange(value);
|
|
140
|
+
}, 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")),
|
|
141
|
+
react_1.default.createElement(antd_1.Typography.Text, { className: "ant-form-text", style: { fontSize: 18 }, type: "secondary" },
|
|
142
|
+
props.intl.formatMessage(translationMessages.customer_identifier),
|
|
143
|
+
":",
|
|
144
|
+
" ",
|
|
145
|
+
chosenCustomer && (0, ConversionUtility_1.convertToReadableKennitala)(chosenCustomer.identifier)),
|
|
146
|
+
react_1.default.createElement(antd_1.Typography.Text, { className: "ant-form-text", style: { fontSize: 18 }, type: "secondary" },
|
|
147
|
+
props.intl.formatMessage(translationMessages.customer_address_streetNameAndNumber),
|
|
148
|
+
":",
|
|
149
|
+
" ",
|
|
150
|
+
chosenCustomer && chosenCustomer.address ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
151
|
+
chosenCustomer.address.streetNameAndNumber,
|
|
152
|
+
", ",
|
|
153
|
+
chosenCustomer.address.postalZone,
|
|
154
|
+
",",
|
|
155
|
+
" ",
|
|
156
|
+
chosenCustomer.address.city,
|
|
157
|
+
", ",
|
|
158
|
+
chosenCustomer.address.countryCode)) : null,
|
|
159
|
+
" "),
|
|
160
|
+
chosenCustomer && chosenCustomer.identifier && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
161
|
+
react_1.default.createElement(CostCenter_1.default, { receiverRequirements: props.receiverRequirements, updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, rapiBaseUrl: props.rapiBaseUrl, legalIdentifier: chosenCustomer.identifier, formInstance: props.formInstance }),
|
|
162
|
+
react_1.default.createElement(CustomerContactName_1.default, { receiverRequirements: props.receiverRequirements, updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, rapiBaseUrl: props.rapiBaseUrl, legalIdentifier: chosenCustomer.identifier, formInstance: props.formInstance }))),
|
|
163
|
+
react_1.default.createElement(antd_1.Checkbox, { checked: props.isSaveFieldValuesSelected, onChange: props.onSaveFieldValuesChange }, props.intl.formatMessage(CommonTranslations_1.commonTranslationMessages.saveInformation_label))))));
|
|
164
|
+
};
|
|
165
|
+
var CustomerIntl = (0, react_intl_1.injectIntl)(Customer);
|
|
166
|
+
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>;
|
|
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
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import React, {useState, useContext, MutableRefObject} from "react";
|
|
3
|
+
// import {Form, Input, InputNumber, Select, message} from "antd";
|
|
4
|
+
//
|
|
5
|
+
// import {
|
|
6
|
+
// BillingLineMetadataTaxCategoryTypeEnum,
|
|
7
|
+
// UnitOfMeasureMetadataUnitEnum
|
|
8
|
+
// } from "@unimaze/api-clients/lib/mapi/models";
|
|
9
|
+
//
|
|
10
|
+
// import {validationRules, ValidationRulesObject} from "../../consts/validationRules";
|
|
11
|
+
// import {BillingLineMetadataOverride} from "../../types/BillingLineMetadataOverride";
|
|
12
|
+
// import {EditableContext} from "../editable-row";
|
|
13
|
+
// import {FormInstance} from "antd/lib/form";
|
|
14
|
+
// import {calculateTaxPercentage} from "../../../utils/BillingLineUtility";
|
|
15
|
+
// import {TaxCategoryTypeEnum} from "@unimaze/api-clients/lib/mapi/api";
|
|
16
|
+
// import {defineMessages, injectIntl, WrappedComponentProps} from "react-intl";
|
|
17
|
+
// import {returnDecimalSeparatorForLocale} from "../../../utils/IntlUtility";
|
|
18
|
+
//
|
|
19
|
+
// export const commonTranslationMessages = defineMessages({
|
|
20
|
+
// taxCategoryType_labels_StandardRated: {
|
|
21
|
+
// id: "taxCategoryType_labels_StandardRated",
|
|
22
|
+
// defaultMessage: "Standard rated",
|
|
23
|
+
// },
|
|
24
|
+
// taxCategoryType_labels_ReducedRated: {
|
|
25
|
+
// id: "taxCategoryType_labels_ReducedRated",
|
|
26
|
+
// defaultMessage: "Reduced rated",
|
|
27
|
+
// },
|
|
28
|
+
// taxCategoryType_labels_ZeroRated: {
|
|
29
|
+
// id: "taxCategoryType_labels_ZeroRated",
|
|
30
|
+
// defaultMessage: "Zero rated",
|
|
31
|
+
// },
|
|
32
|
+
// taxCategoryType_labels_Exempt: {
|
|
33
|
+
// id: "taxCategoryType_labels_Exempt",
|
|
34
|
+
// defaultMessage: "Exempt",
|
|
35
|
+
// },
|
|
36
|
+
// taxCategoryType_labels_OutsideTaxScope: {
|
|
37
|
+
// id: "taxCategoryType_labels_OutsideTaxScope",
|
|
38
|
+
// defaultMessage: "Outside tax scope",
|
|
39
|
+
// },
|
|
40
|
+
// unitOfMeasure_labels_Piece: {
|
|
41
|
+
// id: "unitOfMeasure_labels_Piece",
|
|
42
|
+
// defaultMessage: "Piece",
|
|
43
|
+
// },
|
|
44
|
+
// unitOfMeasure_labels_Kilogram: {
|
|
45
|
+
// id: "unitOfMeasure_labels_Kilogram",
|
|
46
|
+
// defaultMessage: "Kilogram",
|
|
47
|
+
// },
|
|
48
|
+
// unitOfMeasure_labels_Month: {
|
|
49
|
+
// id: "unitOfMeasure_labels_Month",
|
|
50
|
+
// defaultMessage: "Month",
|
|
51
|
+
// },
|
|
52
|
+
// unitOfMeasure_labels_Package: {
|
|
53
|
+
// id: "unitOfMeasure_labels_Package",
|
|
54
|
+
// defaultMessage: "Package",
|
|
55
|
+
// },
|
|
56
|
+
// unitOfMeasure_labels_Year: {
|
|
57
|
+
// id: "unitOfMeasure_labels_Year",
|
|
58
|
+
// defaultMessage: "Year",
|
|
59
|
+
// },
|
|
60
|
+
// unitOfMeasure_labels_Day: {
|
|
61
|
+
// id: "unitOfMeasure_labels_Day",
|
|
62
|
+
// defaultMessage: "Day",
|
|
63
|
+
// },
|
|
64
|
+
// unitOfMeasure_labels_Hour: {
|
|
65
|
+
// id: "unitOfMeasure_labels_Hour",
|
|
66
|
+
// defaultMessage: "Hour",
|
|
67
|
+
// },
|
|
68
|
+
// unitOfMeasure_labels_Kilometre: {
|
|
69
|
+
// id: "unitOfMeasure_labels_Kilometre",
|
|
70
|
+
// defaultMessage: "Kilometre",
|
|
71
|
+
// },
|
|
72
|
+
// unitOfMeasure_labels_Metre: {
|
|
73
|
+
// id: "unitOfMeasure_labels_Metre",
|
|
74
|
+
// defaultMessage: "Metre",
|
|
75
|
+
// },
|
|
76
|
+
// unitOfMeasure_labels_Litre: {
|
|
77
|
+
// id: "unitOfMeasure_labels_Litre",
|
|
78
|
+
// defaultMessage: "Litre",
|
|
79
|
+
// },
|
|
80
|
+
// unitOfMeasure_labels_SquareMetre: {
|
|
81
|
+
// id: "unitOfMeasure_labels_SquareMetre",
|
|
82
|
+
// defaultMessage: "Square metre",
|
|
83
|
+
// },
|
|
84
|
+
// unitOfMeasure_labels_CubicMetre: {
|
|
85
|
+
// id: "unitOfMeasure_labels_CubicMetre",
|
|
86
|
+
// defaultMessage: "Cubic metre",
|
|
87
|
+
// },
|
|
88
|
+
// unitOfMeasure_labels_Tonne: {
|
|
89
|
+
// id: "unitOfMeasure_labels_Tonne",
|
|
90
|
+
// defaultMessage: "Tonne",
|
|
91
|
+
// },
|
|
92
|
+
// unitOfMeasure_labels_KiloWattHour: {
|
|
93
|
+
// id: "unitOfMeasure_labels_KiloWattHour",
|
|
94
|
+
// defaultMessage: "KiloWatt hour",
|
|
95
|
+
// },
|
|
96
|
+
// unitOfMeasure_labels_One: {
|
|
97
|
+
// id: "unitOfMeasure_labels_One",
|
|
98
|
+
// defaultMessage: "One",
|
|
99
|
+
// },
|
|
100
|
+
// });
|
|
101
|
+
//
|
|
102
|
+
// const validationTranslationMessages = defineMessages({
|
|
103
|
+
// rulesMessages_name_required: {
|
|
104
|
+
// id: "rulesMessages_name_required",
|
|
105
|
+
// defaultMessage: "Please insert item name",
|
|
106
|
+
// },
|
|
107
|
+
// rulesMessages_unitOfMeasure_required: {
|
|
108
|
+
// id: "rulesMessages_unitOfMeasure_required",
|
|
109
|
+
// defaultMessage: "Please choose unit of measure",
|
|
110
|
+
// },
|
|
111
|
+
// rulesMessages_unitPriceAmount_required: {
|
|
112
|
+
// id: "rulesMessages_unitPriceAmount_required",
|
|
113
|
+
// defaultMessage: "Please fill in unit price amount",
|
|
114
|
+
// },
|
|
115
|
+
// rulesMessages_unitPriceAmount_type: {
|
|
116
|
+
// id: "rulesMessages_unitPriceAmount_type",
|
|
117
|
+
// defaultMessage: "Unit price amount must be a number",
|
|
118
|
+
// },
|
|
119
|
+
// rulesMessages_taxCategoryType_required: {
|
|
120
|
+
// id: "rulesMessages_taxCategoryType_required",
|
|
121
|
+
// defaultMessage: "Please choose tax category type",
|
|
122
|
+
// },
|
|
123
|
+
// rulesMessages_discountValue_pattern: {
|
|
124
|
+
// id: "rulesMessages_discountValue_pattern",
|
|
125
|
+
// defaultMessage: "Please use only numbers characters and percentage character at the end",
|
|
126
|
+
// },
|
|
127
|
+
// });
|
|
128
|
+
//
|
|
129
|
+
// interface EditableCellProps extends WrappedComponentProps {
|
|
130
|
+
// record: BillingLineMetadataOverride;
|
|
131
|
+
// handleSave: (billingLineMetadata: BillingLineMetadataOverride) => void;
|
|
132
|
+
// // title: string;
|
|
133
|
+
// dataIndex: keyof Omit<BillingLineMetadataOverride, 'key'>;
|
|
134
|
+
// editable: boolean;
|
|
135
|
+
// index: number;
|
|
136
|
+
// }
|
|
137
|
+
//
|
|
138
|
+
// const EditableCell: React.FC<EditableCellProps> = (props) => {
|
|
139
|
+
// const {
|
|
140
|
+
// editable,
|
|
141
|
+
// dataIndex,
|
|
142
|
+
// // title,
|
|
143
|
+
// record,
|
|
144
|
+
// index,
|
|
145
|
+
// handleSave,
|
|
146
|
+
// children,
|
|
147
|
+
// ...restProps
|
|
148
|
+
// } = props;
|
|
149
|
+
//
|
|
150
|
+
// const [editing, setEditing] = useState<boolean>(true);
|
|
151
|
+
// let input: Select<any> | Input | null = null;
|
|
152
|
+
// const form = useContext<FormInstance>(EditableContext);
|
|
153
|
+
//
|
|
154
|
+
// const toggleEdit = (): void => {
|
|
155
|
+
// setEditing(!editing);
|
|
156
|
+
// if (!editing && input) input.focus();
|
|
157
|
+
// };
|
|
158
|
+
//
|
|
159
|
+
// const save = async () => {
|
|
160
|
+
// try {
|
|
161
|
+
// const values = await form.validateFields();
|
|
162
|
+
// toggleEdit();
|
|
163
|
+
// handleSave({...record, ...values});
|
|
164
|
+
// } catch (errInfo) {
|
|
165
|
+
// message.error(errInfo)
|
|
166
|
+
// }
|
|
167
|
+
// };
|
|
168
|
+
//
|
|
169
|
+
// const getCorrectInputNode = (dataIdx: keyof BillingLineMetadataOverride): React.ReactChild => {
|
|
170
|
+
// switch (dataIdx) {
|
|
171
|
+
// case "quantity":
|
|
172
|
+
// case "unitPriceAmount":
|
|
173
|
+
// return <InputNumber step={1}
|
|
174
|
+
// decimalSeparator={returnDecimalSeparatorForLocale(localStorage.getItem("languageString"))}
|
|
175
|
+
// // ref={node => (input = node)}
|
|
176
|
+
// // onPressEnter={save}
|
|
177
|
+
// onBlur={save}
|
|
178
|
+
// />;
|
|
179
|
+
//
|
|
180
|
+
// case "discountValue":
|
|
181
|
+
// return <Input onBlur={save}/>
|
|
182
|
+
// case "unitOfMeasure":
|
|
183
|
+
// return (
|
|
184
|
+
// <Select
|
|
185
|
+
// dropdownMatchSelectWidth={false}
|
|
186
|
+
// ref={node => (input = node)}
|
|
187
|
+
// // defaultActiveFirstOption
|
|
188
|
+
// // onSelect={save}
|
|
189
|
+
// labelInValue
|
|
190
|
+
// onChange={save}
|
|
191
|
+
// >
|
|
192
|
+
// {Object.keys(UnitOfMeasureMetadataUnitEnum).map(unitOfMeasure => {
|
|
193
|
+
// if (unitOfMeasure !== "Rec20" && unitOfMeasure !== "Rec21")
|
|
194
|
+
// return (
|
|
195
|
+
// <Select.Option
|
|
196
|
+
// value={unitOfMeasure}
|
|
197
|
+
// // title={unitOfMeasure}
|
|
198
|
+
// key={unitOfMeasure}
|
|
199
|
+
// >
|
|
200
|
+
// {/*{unitOfMeasure}*/}
|
|
201
|
+
// {props.intl.formatMessage(commonTranslationMessages[`unitOfMeasure_labels_${unitOfMeasure}` as keyof typeof commonTranslationMessages])}
|
|
202
|
+
// </Select.Option>
|
|
203
|
+
// )
|
|
204
|
+
// })}
|
|
205
|
+
// </Select>
|
|
206
|
+
// );
|
|
207
|
+
// case "taxCategoryType":
|
|
208
|
+
// return (
|
|
209
|
+
// <Select
|
|
210
|
+
// dropdownMatchSelectWidth={false}
|
|
211
|
+
// ref={node => (input = node)}
|
|
212
|
+
// // defaultActiveFirstOption
|
|
213
|
+
// labelInValue
|
|
214
|
+
// // onSelect={save}
|
|
215
|
+
// onChange={save}
|
|
216
|
+
// >
|
|
217
|
+
// {Object.keys(TaxCategoryTypeEnum).map(taxCategoryType => {
|
|
218
|
+
// const taxPercentage = calculateTaxPercentage(TaxCategoryTypeEnum[taxCategoryType as TaxCategoryTypeEnum]);
|
|
219
|
+
//
|
|
220
|
+
// return (
|
|
221
|
+
// <Select.Option
|
|
222
|
+
// value={taxCategoryType}
|
|
223
|
+
// key={taxCategoryType}
|
|
224
|
+
// >
|
|
225
|
+
// {/*{`${taxCategoryType} (${taxPercentage}%)`}*/}
|
|
226
|
+
// {`${props.intl.formatMessage(commonTranslationMessages[`taxCategoryType_labels_${taxCategoryType}` as keyof typeof commonTranslationMessages])} (${taxPercentage}%)`}
|
|
227
|
+
// </Select.Option>
|
|
228
|
+
// )
|
|
229
|
+
// })}
|
|
230
|
+
// </Select>
|
|
231
|
+
// );
|
|
232
|
+
// default:
|
|
233
|
+
// return <Input
|
|
234
|
+
// ref={node => (input = node)}
|
|
235
|
+
// // onPressEnter={save}
|
|
236
|
+
// onBlur={save}
|
|
237
|
+
// />;
|
|
238
|
+
//
|
|
239
|
+
// }
|
|
240
|
+
// };
|
|
241
|
+
//
|
|
242
|
+
// const renderCell = () => {
|
|
243
|
+
// const inputNode: React.ReactChild = getCorrectInputNode(dataIndex);
|
|
244
|
+
//
|
|
245
|
+
// const rules = (validationRules as ValidationRulesObject)[dataIndex];
|
|
246
|
+
//
|
|
247
|
+
// const translatableRules = rules && rules.map(singleRule => {
|
|
248
|
+
// return {
|
|
249
|
+
// ...singleRule,
|
|
250
|
+
// message: singleRule.message && props.intl.formatMessage(validationTranslationMessages[`rulesMessages_${singleRule.message}` as keyof typeof validationTranslationMessages])
|
|
251
|
+
// }
|
|
252
|
+
// })
|
|
253
|
+
//
|
|
254
|
+
// return editing ? (
|
|
255
|
+
// <Form.Item
|
|
256
|
+
// style={{margin: 0}}
|
|
257
|
+
// rules={translatableRules}
|
|
258
|
+
// name={dataIndex}
|
|
259
|
+
// initialValue={record[dataIndex]}
|
|
260
|
+
// >
|
|
261
|
+
// {inputNode}
|
|
262
|
+
// </Form.Item>
|
|
263
|
+
// ) : (
|
|
264
|
+
// <div
|
|
265
|
+
// className="editable-cell-value-wrap"
|
|
266
|
+
// // style={{paddingRight: 24}}
|
|
267
|
+
// onClick={toggleEdit}
|
|
268
|
+
// >
|
|
269
|
+
// {children}
|
|
270
|
+
// </div>
|
|
271
|
+
// );
|
|
272
|
+
// // return (
|
|
273
|
+
// // <Form.Item
|
|
274
|
+
// // style={{margin: 0}}
|
|
275
|
+
// // rules={rules}
|
|
276
|
+
// // name={dataIndex}
|
|
277
|
+
// // initialValue={record[dataIndex]}
|
|
278
|
+
// // >
|
|
279
|
+
// // {inputNode}
|
|
280
|
+
// // </Form.Item>
|
|
281
|
+
// // )
|
|
282
|
+
// };
|
|
283
|
+
//
|
|
284
|
+
// return (
|
|
285
|
+
// <td {...restProps}>
|
|
286
|
+
// {editable ? (
|
|
287
|
+
// <EditableContext.Consumer>{renderCell}</EditableContext.Consumer>
|
|
288
|
+
// ) : (
|
|
289
|
+
// children
|
|
290
|
+
// )}
|
|
291
|
+
// </td>
|
|
292
|
+
// );
|
|
293
|
+
// };
|
|
294
|
+
// const EditableCellIntl = injectIntl(EditableCell);
|
|
295
|
+
// export default EditableCellIntl;
|