@unimaze/billing 0.1.2-rc.10 → 0.1.2-rc.2
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/README.md +3 -11
- package/lib/common/components/attachments/Attachment.d.ts +2 -8
- package/lib/common/components/attachments/Attachment.js +8 -33
- package/lib/common/components/attachments/index.d.ts +2 -9
- package/lib/common/components/attachments/index.js +6 -15
- package/lib/common/components/base-information/index.d.ts +3 -6
- package/lib/common/components/base-information/index.js +81 -100
- package/lib/common/components/billing-lines/index.d.ts +23 -9
- package/lib/common/components/billing-lines/index.js +38 -116
- package/lib/common/components/delivery-location/index.d.ts +2 -5
- package/lib/common/components/delivery-location/index.js +11 -43
- package/lib/common/components/editable-cell/index.d.ts +1 -1
- package/lib/common/components/editable-cell/index.js +10 -76
- package/lib/common/components/editable-row/index.d.ts +5 -5
- package/lib/common/components/editable-row/index.js +6 -8
- package/lib/common/components/index.d.ts +5 -10
- package/lib/common/components/index.js +8 -20
- package/lib/common/components/issuer/index.d.ts +7 -0
- package/lib/common/components/{customer/hardCoddedCustomer.js → issuer/index.js} +8 -5
- package/lib/common/components/payer/index.d.ts +3 -0
- package/lib/common/components/payer/index.js +50 -0
- package/lib/common/components/payment-method/index.d.ts +3 -6
- package/lib/common/components/payment-method/index.js +17 -57
- package/lib/common/consts/validationRules.d.ts +3 -2
- package/lib/common/consts/validationRules.js +7 -0
- package/lib/common/enums/index.d.ts +1 -1
- package/lib/common/enums/index.js +4 -2
- package/lib/common/types/BillingLineMetadataOverride.d.ts +0 -1
- package/lib/create-credit-note/index.d.ts +2 -1
- package/lib/create-credit-note/index.js +14 -6
- package/lib/create-invoice/index.d.ts +2 -1
- package/lib/create-invoice/index.js +21 -79
- package/lib/example/src/index.d.ts +1 -1
- package/lib/index.js +0 -5
- package/lib/src/common/components/attachments/Attachment.d.ts +2 -8
- package/lib/src/common/components/attachments/index.d.ts +2 -9
- package/lib/src/common/components/base-information/index.d.ts +3 -6
- package/lib/src/common/components/billing-lines/index.d.ts +23 -9
- package/lib/src/common/components/delivery-location/index.d.ts +2 -5
- package/lib/src/common/components/editable-cell/index.d.ts +1 -1
- package/lib/src/common/components/editable-row/index.d.ts +5 -5
- package/lib/src/common/components/issuer/index.d.ts +7 -0
- package/lib/src/common/components/payer/index.d.ts +3 -0
- package/lib/src/common/components/payment-method/index.d.ts +3 -6
- package/lib/src/common/consts/validationRules.d.ts +3 -2
- package/lib/src/create-credit-note/index.d.ts +9 -0
- package/lib/src/create-invoice/index.d.ts +2 -1
- package/lib/src/index.d.ts +4 -0
- package/lib/style/index.css +1222 -0
- package/lib/utils/ApiUtility.d.ts +1 -8
- package/lib/utils/ApiUtility.js +1 -17
- package/lib/utils/ConversionUtility.d.ts +4 -5
- package/lib/utils/ConversionUtility.js +133 -121
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +2 -2
- package/package.json +7 -12
- package/lib/common/components/base-information/ReferenceIdentifiers.d.ts +0 -6
- package/lib/common/components/base-information/ReferenceIdentifiers.js +0 -40
- package/lib/common/components/billing-lines/BillingCalculations.d.ts +0 -11
- package/lib/common/components/billing-lines/BillingCalculations.js +0 -61
- package/lib/common/components/billing-lines/BillingTaxSummary.d.ts +0 -10
- package/lib/common/components/billing-lines/BillingTaxSummary.js +0 -51
- package/lib/common/components/billing-lines/billingLIneFormData.d.ts +0 -7
- package/lib/common/components/billing-lines/billingLIneFormData.js +0 -63
- package/lib/common/components/customer/hardCoddedCustomer.d.ts +0 -7
- package/lib/common/components/customer/index.d.ts +0 -6
- package/lib/common/components/customer/index.js +0 -93
- package/lib/common/components/form-item/index.d.ts +0 -21
- package/lib/common/components/form-item/index.js +0 -27
- package/lib/common/components/locale-intl/index.d.ts +0 -10
- package/lib/common/components/locale-intl/index.js +0 -45
- package/lib/common/components/supplier/index.d.ts +0 -6
- package/lib/common/components/supplier/index.js +0 -93
- package/lib/common/types/ReceiverRequirements.d.ts +0 -81
- package/lib/common/types/ReceiverRequirements.js +0 -379
- package/lib/src/common/components/base-information/ReferenceIdentifiers.d.ts +0 -6
- package/lib/src/common/components/billing-lines/BillingCalculations.d.ts +0 -11
- package/lib/src/common/components/billing-lines/BillingTaxSummary.d.ts +0 -10
- package/lib/src/common/components/billing-lines/billingLIneFormData.d.ts +0 -7
- package/lib/src/common/components/customer/index.d.ts +0 -6
- package/lib/src/common/components/form-item/index.d.ts +0 -21
- package/lib/src/common/components/index.d.ts +0 -10
- package/lib/src/common/components/locale-intl/index.d.ts +0 -10
- package/lib/src/common/components/supplier/index.d.ts +0 -6
- package/lib/src/common/types/ReceiverRequirements.d.ts +0 -81
- package/lib/src/translations/locales.d.ts +0 -74
- package/lib/src/utils/ApiUtility.d.ts +0 -21
- package/lib/src/utils/BillingLineUtility.d.ts +0 -8
- package/lib/src/utils/ConversionUtility.d.ts +0 -5
- package/lib/src/utils/RequirementsUtility.d.ts +0 -5
- package/lib/src/utils/billingLineFormData.d.ts +0 -7
- package/lib/src/utils/index.d.ts +0 -2
- package/lib/translations/locales/is.json +0 -70
- package/lib/translations/locales.d.ts +0 -74
- package/lib/translations/locales.js +0 -10
- package/lib/utils/BillingLineUtility.d.ts +0 -8
- package/lib/utils/BillingLineUtility.js +0 -66
- package/lib/utils/RequirementsUtility.d.ts +0 -5
- package/lib/utils/RequirementsUtility.js +0 -23
- package/lib/utils/billingLineFormData.d.ts +0 -7
- package/lib/utils/billingLineFormData.js +0 -63
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
+
if (mod && mod.__esModule) return mod;
|
|
4
|
+
var result = {};
|
|
5
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
+
result["default"] = mod;
|
|
7
|
+
return result;
|
|
8
|
+
};
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
var React = __importStar(require("react"));
|
|
14
|
+
var component_container_1 = __importDefault(require("../component-container"));
|
|
15
|
+
var antd_1 = require("antd");
|
|
16
|
+
var Payer = function () {
|
|
17
|
+
return (React.createElement(component_container_1.default, { title: "Payer" },
|
|
18
|
+
React.createElement(antd_1.Form.Item, { label: "Name/Identifier", style: { marginBottom: 0 } },
|
|
19
|
+
React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "50%" }, name: "payer:name", rules: [
|
|
20
|
+
{
|
|
21
|
+
required: true,
|
|
22
|
+
message: 'Please input payer name',
|
|
23
|
+
},
|
|
24
|
+
] },
|
|
25
|
+
React.createElement(antd_1.Input, null)),
|
|
26
|
+
React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "50%", paddingLeft: "3px" }, name: "payer:isoIdentifier", rules: [
|
|
27
|
+
{
|
|
28
|
+
required: true,
|
|
29
|
+
message: 'Please input payer identifier',
|
|
30
|
+
},
|
|
31
|
+
] },
|
|
32
|
+
React.createElement(antd_1.Input, null))),
|
|
33
|
+
React.createElement(antd_1.Form.Item, { label: "Address", name: "payer:address" },
|
|
34
|
+
React.createElement(antd_1.Input, null)),
|
|
35
|
+
React.createElement(antd_1.Form.Item, { label: "Zip/City" },
|
|
36
|
+
React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, name: "payer:zip" },
|
|
37
|
+
React.createElement(antd_1.Input, null)),
|
|
38
|
+
React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "70%", paddingLeft: "3px" }, name: "payer:city" },
|
|
39
|
+
React.createElement(antd_1.Input, null))),
|
|
40
|
+
React.createElement(antd_1.Form.Item, { label: "Country", name: "payer:country" },
|
|
41
|
+
React.createElement(antd_1.Input, null)),
|
|
42
|
+
React.createElement(antd_1.Form.Item, { label: "E-mail", name: "payer:email", rules: [
|
|
43
|
+
{
|
|
44
|
+
type: 'email',
|
|
45
|
+
message: 'The input is not valid E-mail!',
|
|
46
|
+
}
|
|
47
|
+
] },
|
|
48
|
+
React.createElement(antd_1.Input, null))));
|
|
49
|
+
};
|
|
50
|
+
exports.default = Payer;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
WrappedComponent: React.ComponentType<InjectedIntlProps>;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const PaymentMethod: () => JSX.Element;
|
|
3
|
+
export default PaymentMethod;
|
|
@@ -6,72 +6,32 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
6
6
|
result["default"] = mod;
|
|
7
7
|
return result;
|
|
8
8
|
};
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
9
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
13
|
var react_1 = __importStar(require("react"));
|
|
11
|
-
var
|
|
14
|
+
var component_container_1 = __importDefault(require("../component-container"));
|
|
12
15
|
var antd_1 = require("antd");
|
|
13
16
|
var models_1 = require("@unimaze/api-clients/lib/mapi/models");
|
|
14
|
-
var
|
|
15
|
-
var translationMessages = react_intl_1.defineMessages({
|
|
16
|
-
paymentMethod_labels_domesticTransfer_bankNo: {
|
|
17
|
-
id: "paymentMethod_labels_domesticTransfer_bankNo",
|
|
18
|
-
defaultMessage: "Bank no",
|
|
19
|
-
},
|
|
20
|
-
paymentMethod_labels_domesticTransfer_typeNo: {
|
|
21
|
-
id: "paymentMethod_labels_domesticTransfer_typeNo",
|
|
22
|
-
defaultMessage: "Type no",
|
|
23
|
-
},
|
|
24
|
-
paymentMethod_labels_domesticTransfer_accountNo: {
|
|
25
|
-
id: "paymentMethod_labels_domesticTransfer_accountNo",
|
|
26
|
-
defaultMessage: "Account no",
|
|
27
|
-
},
|
|
28
|
-
paymentMethod_labels_domesticTransfer_paymentReference: {
|
|
29
|
-
id: "paymentMethod_labels_domesticTransfer_paymentReference",
|
|
30
|
-
defaultMessage: "Payment reference",
|
|
31
|
-
},
|
|
32
|
-
paymentMethod_labels_icelandicClaim_bankNo: {
|
|
33
|
-
id: "paymentMethod_labels_icelandicClaim_bankNo",
|
|
34
|
-
defaultMessage: "Bank no",
|
|
35
|
-
},
|
|
36
|
-
paymentMethod_labels_icelandicClaim_claimNo: {
|
|
37
|
-
id: "paymentMethod_labels_icelandicClaim_claimNo",
|
|
38
|
-
defaultMessage: "Claim no",
|
|
39
|
-
},
|
|
40
|
-
paymentMethod_labels_methods_undefined: {
|
|
41
|
-
id: "paymentMethod_labels_methods_undefined",
|
|
42
|
-
defaultMessage: "Undefined",
|
|
43
|
-
},
|
|
44
|
-
paymentMethod_labels_methods_mutuallyAgreed: {
|
|
45
|
-
id: "paymentMethod_labels_methods_mutuallyAgreed",
|
|
46
|
-
defaultMessage: "Mutually agreed",
|
|
47
|
-
},
|
|
48
|
-
paymentMethod_labels_methods_domesticTransfer: {
|
|
49
|
-
id: "paymentMethod_labels_methods_domesticTransfer",
|
|
50
|
-
defaultMessage: "Domestic transfer",
|
|
51
|
-
},
|
|
52
|
-
paymentMethod_labels_methods_domesticClaim: {
|
|
53
|
-
id: "paymentMethod_labels_methods_domesticClaim",
|
|
54
|
-
defaultMessage: "Claim (Icelandic)",
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
var PaymentMethod = function (props) {
|
|
17
|
+
var PaymentMethod = function () {
|
|
58
18
|
var _a = react_1.useState(models_1.PaymentMeansMetadataTypeEnum.NotSpecified), paymentMethod = _a[0], setPaymentMethod = _a[1];
|
|
59
19
|
var domesticTransferFormFields = react_1.default.createElement(react_1.default.Fragment, null,
|
|
60
|
-
react_1.default.createElement(antd_1.Form.Item, { label:
|
|
20
|
+
react_1.default.createElement(antd_1.Form.Item, { label: "Bank no.", name: "paymentMethod:bankNo" },
|
|
61
21
|
react_1.default.createElement(antd_1.Input, null)),
|
|
62
|
-
react_1.default.createElement(antd_1.Form.Item, { label:
|
|
22
|
+
react_1.default.createElement(antd_1.Form.Item, { label: "Type no.", name: "paymentMethod:typeNo" },
|
|
63
23
|
react_1.default.createElement(antd_1.Select, null,
|
|
64
24
|
react_1.default.createElement(antd_1.Select.Option, { value: "05" }, "05"),
|
|
65
25
|
react_1.default.createElement(antd_1.Select.Option, { value: "15" }, "15"),
|
|
66
26
|
react_1.default.createElement(antd_1.Select.Option, { value: "26" }, "26"))),
|
|
67
|
-
react_1.default.createElement(antd_1.Form.Item, { label:
|
|
27
|
+
react_1.default.createElement(antd_1.Form.Item, { label: "Account no.", name: "paymentMethod:accountNo" },
|
|
68
28
|
react_1.default.createElement(antd_1.Input, null)),
|
|
69
|
-
react_1.default.createElement(antd_1.Form.Item, { label:
|
|
29
|
+
react_1.default.createElement(antd_1.Form.Item, { label: "Payment reference", name: "paymentMethod:paymentReference" },
|
|
70
30
|
react_1.default.createElement(antd_1.Input, null)));
|
|
71
31
|
var icelandicClaimFormFields = react_1.default.createElement(react_1.default.Fragment, null,
|
|
72
|
-
react_1.default.createElement(antd_1.Form.Item, { label:
|
|
32
|
+
react_1.default.createElement(antd_1.Form.Item, { label: "Bank no.", name: "paymentMethod:bankNo" },
|
|
73
33
|
react_1.default.createElement(antd_1.Input, null)),
|
|
74
|
-
react_1.default.createElement(antd_1.Form.Item, { label:
|
|
34
|
+
react_1.default.createElement(antd_1.Form.Item, { label: "Claim no.", name: "paymentMethod:claimNo" },
|
|
75
35
|
react_1.default.createElement(antd_1.Input, null)));
|
|
76
36
|
var renderFormFields = function (payMthd) {
|
|
77
37
|
switch (payMthd) {
|
|
@@ -89,25 +49,25 @@ var PaymentMethod = function (props) {
|
|
|
89
49
|
var paymentMethods = [
|
|
90
50
|
{
|
|
91
51
|
value: models_1.PaymentMeansMetadataTypeEnum.NotSpecified,
|
|
92
|
-
display:
|
|
52
|
+
display: "Undefined"
|
|
93
53
|
},
|
|
94
54
|
{
|
|
95
55
|
value: models_1.PaymentMeansMetadataTypeEnum.MutuallyAgreed,
|
|
96
|
-
display:
|
|
56
|
+
display: "Mutually agreed"
|
|
97
57
|
},
|
|
98
58
|
{
|
|
99
59
|
value: models_1.PaymentMeansMetadataTypeEnum.DomesticTransfer,
|
|
100
|
-
display:
|
|
60
|
+
display: "Domestic transfer"
|
|
101
61
|
},
|
|
102
62
|
{
|
|
103
63
|
value: models_1.PaymentMeansMetadataTypeEnum.DomesticClaim,
|
|
104
|
-
display:
|
|
64
|
+
display: "Claim (Icelandic)"
|
|
105
65
|
}
|
|
106
66
|
];
|
|
107
|
-
return (react_1.default.createElement(
|
|
67
|
+
return (react_1.default.createElement(component_container_1.default, { title: "Payment method" },
|
|
108
68
|
react_1.default.createElement(antd_1.Select, { value: paymentMethod, onSelect: setPaymentMethod }, paymentMethods.map(function (payMthd) {
|
|
109
69
|
return react_1.default.createElement(antd_1.Select.Option, { value: payMthd.value, title: payMthd.display, key: payMthd.value }, payMthd.display);
|
|
110
70
|
})),
|
|
111
71
|
renderFormFields(paymentMethod)));
|
|
112
72
|
};
|
|
113
|
-
exports.default =
|
|
73
|
+
exports.default = PaymentMethod;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BillingLineMetadataOverride } from "../types/BillingLineMetadataOverride";
|
|
2
2
|
import { Rule } from "rc-field-form/lib/interface";
|
|
3
|
-
|
|
4
|
-
[key in keyof
|
|
3
|
+
declare type ValidationRulesObject = {
|
|
4
|
+
[key in keyof BillingLineMetadataOverride]: Rule[];
|
|
5
5
|
};
|
|
6
6
|
export declare const validationRules: ValidationRulesObject;
|
|
7
|
+
export {};
|
|
@@ -10,30 +10,37 @@ exports.validationRules = {
|
|
|
10
10
|
name: [
|
|
11
11
|
{
|
|
12
12
|
required: true,
|
|
13
|
+
message: "Please insert item name",
|
|
13
14
|
}
|
|
14
15
|
],
|
|
15
16
|
unitOfMeasure: [
|
|
16
17
|
{
|
|
17
18
|
required: true,
|
|
19
|
+
message: "Please choose unit of measure",
|
|
18
20
|
},
|
|
19
21
|
{
|
|
20
22
|
enum: Object.keys(models_1.UnitOfMeasureMetadataUnitEnum),
|
|
23
|
+
message: "Unit of measure must be one of the accepted values",
|
|
21
24
|
},
|
|
22
25
|
],
|
|
23
26
|
unitPriceAmount: [
|
|
24
27
|
{
|
|
25
28
|
required: true,
|
|
29
|
+
message: "Please fill in unit price amount",
|
|
26
30
|
},
|
|
27
31
|
{
|
|
28
32
|
type: "number",
|
|
33
|
+
message: "Unit price amount mu st be a number",
|
|
29
34
|
}
|
|
30
35
|
],
|
|
31
36
|
taxCategoryType: [
|
|
32
37
|
{
|
|
33
38
|
required: true,
|
|
39
|
+
message: "Please choose tax category type",
|
|
34
40
|
},
|
|
35
41
|
{
|
|
36
42
|
enum: Object.keys(models_1.BillingLineMetadataTaxCategoryTypeEnum),
|
|
43
|
+
message: "Tax category must be one of the accepted values",
|
|
37
44
|
},
|
|
38
45
|
],
|
|
39
46
|
discountValue: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./DocumentTypeEnum";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
function __export(m) {
|
|
3
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
4
|
+
}
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
exports.DocumentTypeEnum = DocumentTypeEnum_1.default;
|
|
6
|
+
__export(require("./DocumentTypeEnum"));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BillingLineMetadata, UnitOfMeasureMetadataUnitEnum } from "@unimaze/api-clients/lib/mapi/models";
|
|
2
2
|
export interface BillingLineMetadataOverride extends Omit<BillingLineMetadata, 'unitOfMeasure'> {
|
|
3
|
-
key: number;
|
|
4
3
|
unitOfMeasure: UnitOfMeasureMetadataUnitEnum;
|
|
5
4
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import "antd/dist/antd.compact.css";
|
|
1
2
|
import "../style/index.css";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
|
|
4
5
|
interface Props {
|
|
5
|
-
|
|
6
|
+
issuer: ProfileOutput;
|
|
6
7
|
}
|
|
7
8
|
declare const CreateInvoice: React.FC<Props>;
|
|
8
9
|
export default CreateInvoice;
|
|
@@ -14,10 +14,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
require("antd/dist/antd.compact.css");
|
|
17
18
|
require("../style/index.css");
|
|
18
19
|
var react_1 = __importDefault(require("react"));
|
|
19
20
|
var antd_1 = require("antd");
|
|
20
|
-
var
|
|
21
|
+
var payer_1 = __importDefault(require("../common/components/payer"));
|
|
22
|
+
var issuer_1 = __importDefault(require("../common/components/issuer"));
|
|
23
|
+
var base_information_1 = __importDefault(require("../common/components/base-information"));
|
|
24
|
+
var billing_lines_1 = __importDefault(require("../common/components/billing-lines"));
|
|
25
|
+
var attachments_1 = __importDefault(require("../common/components/attachments"));
|
|
21
26
|
// const [createCorrectWithCreditRequest, setCreateCorrectWithCreditRequest] = useState<CreateCorrectWithCreditRequest>(
|
|
22
27
|
// {
|
|
23
28
|
// conversationIdentifier: "test",
|
|
@@ -52,12 +57,15 @@ var CreateInvoice = function (props) {
|
|
|
52
57
|
react_1.default.createElement("h1", null, "Credit note"),
|
|
53
58
|
react_1.default.createElement(antd_1.Row, { gutter: [16, 16] },
|
|
54
59
|
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 12 } },
|
|
55
|
-
react_1.default.createElement(
|
|
56
|
-
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 12 } }
|
|
60
|
+
react_1.default.createElement(payer_1.default, null)),
|
|
61
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 12 } },
|
|
62
|
+
react_1.default.createElement(issuer_1.default, { issuer: props.issuer })),
|
|
57
63
|
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
|
|
58
|
-
react_1.default.createElement(
|
|
59
|
-
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 }, xl: { span: 16 } }
|
|
60
|
-
|
|
64
|
+
react_1.default.createElement(base_information_1.default, { form: form, documentType: "creditNote" })),
|
|
65
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 }, xl: { span: 16 } },
|
|
66
|
+
react_1.default.createElement(billing_lines_1.default, { setBillingLineMetadata: handleSetBillingLineMetadata, form: form })),
|
|
67
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 }, xl: { span: 24 } },
|
|
68
|
+
react_1.default.createElement(attachments_1.default, null)),
|
|
61
69
|
react_1.default.createElement(antd_1.Col, { span: 24 },
|
|
62
70
|
react_1.default.createElement(antd_1.Button, { type: "primary", htmlType: "submit" }, "Submit")))));
|
|
63
71
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import "antd/dist/antd.compact.css";
|
|
1
2
|
import "../style/index.css";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
|
|
4
5
|
import { CommonProps } from "../common/types/CommonProps";
|
|
5
6
|
interface Props extends CommonProps {
|
|
6
|
-
|
|
7
|
+
issuer: ProfileOutput;
|
|
7
8
|
}
|
|
8
9
|
/**
|
|
9
10
|
* Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
|
|
@@ -10,36 +10,31 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
14
|
-
if (mod && mod.__esModule) return mod;
|
|
15
|
-
var result = {};
|
|
16
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
17
|
-
result["default"] = mod;
|
|
18
|
-
return result;
|
|
19
|
-
};
|
|
20
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
15
|
};
|
|
23
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
require("antd/dist/antd.compact.css");
|
|
24
18
|
require("../style/index.css");
|
|
25
|
-
var react_1 =
|
|
19
|
+
var react_1 = __importDefault(require("react"));
|
|
26
20
|
var antd_1 = require("antd");
|
|
27
21
|
var is_IS_1 = __importDefault(require("antd/es/locale-provider/is_IS"));
|
|
28
22
|
var en_US_1 = __importDefault(require("antd/es/locale-provider/en_US"));
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
23
|
+
var payer_1 = __importDefault(require("../common/components/payer"));
|
|
24
|
+
var issuer_1 = __importDefault(require("../common/components/issuer"));
|
|
25
|
+
var delivery_location_1 = __importDefault(require("../common/components/delivery-location"));
|
|
26
|
+
var payment_method_1 = __importDefault(require("../common/components/payment-method"));
|
|
27
|
+
var attachments_1 = __importDefault(require("../common/components/attachments"));
|
|
28
|
+
var base_information_1 = __importDefault(require("../common/components/base-information"));
|
|
29
|
+
var billing_lines_1 = __importDefault(require("../common/components/billing-lines"));
|
|
34
30
|
/**
|
|
35
31
|
* Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
|
|
36
32
|
*
|
|
37
33
|
* @component
|
|
38
34
|
*/
|
|
39
35
|
var CreateInvoice = function (props) {
|
|
40
|
-
// const [submitInvoiceRequest, setSubmitInvoiceRequest] =
|
|
36
|
+
// const [submitInvoiceRequest, setSubmitInvoiceRequest] = useState<CreateSubmitInvoiceRequest>();
|
|
41
37
|
var form = antd_1.Form.useForm()[0];
|
|
42
|
-
var _a = react_1.useState([]), files = _a[0], setFiles = _a[1];
|
|
43
38
|
var formItemLayout = {
|
|
44
39
|
labelCol: {
|
|
45
40
|
xs: { span: 24 },
|
|
@@ -50,53 +45,14 @@ var CreateInvoice = function (props) {
|
|
|
50
45
|
sm: { span: 16 },
|
|
51
46
|
},
|
|
52
47
|
};
|
|
53
|
-
var handleAddFile = function (file) {
|
|
54
|
-
if (file.status === "removed") {
|
|
55
|
-
var remainingFiles = files.filter(function (existingFile) { return existingFile.uid !== file.uid; });
|
|
56
|
-
setFiles(remainingFiles);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
setFiles(files.concat([file]));
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
48
|
var handleSetBillingLineMetadata = function (formInstance, billingLineMetadata) {
|
|
63
49
|
formInstance.setFieldsValue({
|
|
64
|
-
"
|
|
50
|
+
"billingLineMetadata": billingLineMetadata,
|
|
65
51
|
});
|
|
66
52
|
};
|
|
67
53
|
var handleSubmit = function (values) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
invoiceMetadataInput: invoiceMetadataInput,
|
|
71
|
-
more: files.length > 0,
|
|
72
|
-
messageId: uuid_1.v4(),
|
|
73
|
-
processingMode: mapi_1.TransactionProcessingMode.Device
|
|
74
|
-
};
|
|
75
|
-
utils_1.submitInvoice(createSubmitInvoice, props.mapiBaseUrl, props.apiKey, "submitInvoice", props.language)
|
|
76
|
-
.then(function (resp) {
|
|
77
|
-
antd_1.message.success("successfully submitted the invoice");
|
|
78
|
-
var messageId = resp.data.uniqueId;
|
|
79
|
-
var _loop_1 = function () {
|
|
80
|
-
var nextFileArray = files.splice(0, 1);
|
|
81
|
-
var nextFile = nextFileArray[0];
|
|
82
|
-
var createAttachDocument = {
|
|
83
|
-
messageId: messageId,
|
|
84
|
-
contentType: nextFile.type,
|
|
85
|
-
more: files.length > 0,
|
|
86
|
-
name: nextFile.name,
|
|
87
|
-
};
|
|
88
|
-
utils_1.submitDocument(nextFile, createAttachDocument, props.mapiBaseUrl, props.apiKey)
|
|
89
|
-
.then(function (submitDocumentResponse) {
|
|
90
|
-
antd_1.message.success("successfully uploaded attachment " + nextFile.name);
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
while (files.length > 0) {
|
|
94
|
-
_loop_1();
|
|
95
|
-
}
|
|
96
|
-
})
|
|
97
|
-
.catch(function (error) {
|
|
98
|
-
antd_1.message.error(error.message);
|
|
99
|
-
});
|
|
54
|
+
// props.handleSubmitInvoice(values);
|
|
55
|
+
// console.log('Received values of form: ', values);
|
|
100
56
|
};
|
|
101
57
|
var setLocale = function (language) {
|
|
102
58
|
switch (language) {
|
|
@@ -109,37 +65,23 @@ var CreateInvoice = function (props) {
|
|
|
109
65
|
}
|
|
110
66
|
};
|
|
111
67
|
return (react_1.default.createElement(antd_1.ConfigProvider, { locale: setLocale(props.language), componentSize: "small" },
|
|
112
|
-
react_1.default.createElement(antd_1.Form, __assign({}, formItemLayout, {
|
|
113
|
-
invoice: {
|
|
114
|
-
currencyCode: "ISK",
|
|
115
|
-
supplier: {
|
|
116
|
-
address: {
|
|
117
|
-
countryCode: "IS"
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
customer: {
|
|
121
|
-
address: {
|
|
122
|
-
countryCode: "IS"
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
} }),
|
|
68
|
+
react_1.default.createElement(antd_1.Form, __assign({}, formItemLayout, { onFinish: handleSubmit }),
|
|
127
69
|
react_1.default.createElement("h1", null, "Invoice"),
|
|
128
70
|
react_1.default.createElement(antd_1.Row, { gutter: [16, 16] },
|
|
129
71
|
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
|
|
130
|
-
react_1.default.createElement(
|
|
72
|
+
react_1.default.createElement(payer_1.default, null)),
|
|
131
73
|
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
|
|
132
|
-
react_1.default.createElement(
|
|
74
|
+
react_1.default.createElement(delivery_location_1.default, null)),
|
|
133
75
|
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
|
|
134
|
-
react_1.default.createElement(
|
|
76
|
+
react_1.default.createElement(issuer_1.default, { issuer: props.issuer })),
|
|
135
77
|
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
|
|
136
|
-
react_1.default.createElement(
|
|
78
|
+
react_1.default.createElement(base_information_1.default, { form: form, documentType: "invoice" })),
|
|
137
79
|
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 }, xl: { span: 16 } },
|
|
138
|
-
react_1.default.createElement(
|
|
80
|
+
react_1.default.createElement(billing_lines_1.default, { setBillingLineMetadata: handleSetBillingLineMetadata, form: form })),
|
|
139
81
|
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 8 }, xl: { span: 8 } },
|
|
140
|
-
react_1.default.createElement(
|
|
82
|
+
react_1.default.createElement(payment_method_1.default, null)),
|
|
141
83
|
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 16 }, xl: { span: 16 } },
|
|
142
|
-
react_1.default.createElement(
|
|
84
|
+
react_1.default.createElement(attachments_1.default, null)),
|
|
143
85
|
react_1.default.createElement(antd_1.Col, { span: 24 },
|
|
144
86
|
react_1.default.createElement(antd_1.Form.Item, null,
|
|
145
87
|
react_1.default.createElement(antd_1.Button, { type: "primary", htmlType: "submit" }, "Submit")))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
package/lib/index.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
function __export(m) {
|
|
3
|
-
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
4
|
-
}
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
// Enums, Types
|
|
7
|
-
__export(require("./common/enums"));
|
|
8
3
|
// Components
|
|
9
4
|
var create_invoice_1 = require("./create-invoice");
|
|
10
5
|
exports.CreateInvoice = create_invoice_1.default;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import '@ant-design/compatible/assets/index.css';
|
|
3
|
-
|
|
4
|
-
import { InjectedIntlProps } from "react-intl";
|
|
5
|
-
interface Props extends InjectedIntlProps {
|
|
3
|
+
interface Props {
|
|
6
4
|
fieldName: string;
|
|
7
|
-
handleAddFile: (file: UploadFile) => void;
|
|
8
5
|
}
|
|
9
6
|
interface States {
|
|
10
7
|
file: any[];
|
|
@@ -15,7 +12,4 @@ declare class Attachment extends React.Component<Props, States> {
|
|
|
15
12
|
normFile: (e: any) => any;
|
|
16
13
|
render(): JSX.Element;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
|
-
WrappedComponent: React.ComponentType<Props & React.RefAttributes<Attachment> & InjectedIntlProps>;
|
|
20
|
-
};
|
|
21
|
-
export default _default;
|
|
15
|
+
export default Attachment;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
interface Props extends InjectedIntlProps {
|
|
5
|
-
handleAddFile: (file: UploadFile) => void;
|
|
6
|
-
}
|
|
7
|
-
declare const AttachmentGroupIntl: React.ComponentClass<Pick<Props, "handleAddFile">, any> & {
|
|
8
|
-
WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
|
|
9
|
-
};
|
|
10
|
-
export default AttachmentGroupIntl;
|
|
2
|
+
declare const AttachmentsGroup: React.FC;
|
|
3
|
+
export default AttachmentsGroup;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import '@ant-design/compatible/assets/index.css';
|
|
3
3
|
import { FormInstance } from "antd/es/form";
|
|
4
|
-
|
|
5
|
-
interface Props extends InjectedIntlProps {
|
|
4
|
+
interface Props {
|
|
6
5
|
form: FormInstance;
|
|
7
6
|
documentType: "creditNote" | "invoice";
|
|
8
7
|
}
|
|
9
|
-
declare const
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
export default BaseInformationIntl;
|
|
8
|
+
declare const BaseInformation: React.FC<Props>;
|
|
9
|
+
export default BaseInformation;
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import '@ant-design/compatible/assets/index.css';
|
|
3
3
|
import { BillingLineMetadata } from "@unimaze/api-clients/lib/mapi/models";
|
|
4
|
-
import {
|
|
4
|
+
import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOverride";
|
|
5
5
|
import { FormInstance } from "antd/es/form";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import { ColumnType } from 'antd/es/table';
|
|
7
|
+
interface EditableColumnProps<T> extends ColumnType<T> {
|
|
8
|
+
editable?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface Props {
|
|
11
|
+
form: FormInstance;
|
|
12
|
+
setBillingLineMetadata: (form: FormInstance, billingLineMetadata: BillingLineMetadata[]) => void;
|
|
13
|
+
}
|
|
14
|
+
interface States {
|
|
15
|
+
dataSource: BillingLineMetadataOverride[];
|
|
16
|
+
editableIndex: number | null;
|
|
17
|
+
}
|
|
18
|
+
declare class BillingLines extends React.Component<Props, States> {
|
|
19
|
+
columns: EditableColumnProps<BillingLineMetadataOverride>[];
|
|
20
|
+
constructor(props: Props);
|
|
21
|
+
renderCurrencyColumn: (text: string) => string;
|
|
22
|
+
handleDelete: (index: number) => void;
|
|
23
|
+
handleAdd: () => void;
|
|
24
|
+
handleSave: (row: BillingLineMetadataOverride, form: FormInstance) => void;
|
|
25
|
+
render(): JSX.Element;
|
|
26
|
+
}
|
|
27
|
+
export default BillingLines;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
WrappedComponent: React.ComponentType<InjectedIntlProps>;
|
|
5
|
-
};
|
|
6
|
-
export default DeliveryLocationIntl;
|
|
2
|
+
declare const DeliveryLocation: React.FC;
|
|
3
|
+
export default DeliveryLocation;
|
|
@@ -3,7 +3,7 @@ import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOver
|
|
|
3
3
|
interface EditableCellProps {
|
|
4
4
|
record: BillingLineMetadataOverride;
|
|
5
5
|
handleSave: (billingLineMetadata: BillingLineMetadataOverride) => void;
|
|
6
|
-
dataIndex: keyof
|
|
6
|
+
dataIndex: keyof BillingLineMetadataOverride;
|
|
7
7
|
editable: boolean;
|
|
8
8
|
index: number;
|
|
9
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import '
|
|
3
|
-
import
|
|
4
|
-
export declare const EditableContext: React.Context<
|
|
5
|
-
declare const
|
|
6
|
-
export default
|
|
2
|
+
import { WrappedFormUtils } from '@ant-design/compatible/es/form/Form';
|
|
3
|
+
import '@ant-design/compatible/assets/index.css';
|
|
4
|
+
export declare const EditableContext: React.Context<WrappedFormUtils<any>>;
|
|
5
|
+
declare const _default: import("@ant-design/compatible/lib/form/interface").ConnectedComponentClass<({ form, index, ...props }: any) => JSX.Element, Pick<import("@ant-design/compatible/lib/form").FormComponentProps<any>, "wrappedComponentRef">>;
|
|
6
|
+
export default _default;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
WrappedComponent: React.ComponentType<InjectedIntlProps>;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const PaymentMethod: () => JSX.Element;
|
|
3
|
+
export default PaymentMethod;
|