@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
package/README.md
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
## Peer dependencies ##
|
|
4
|
-
- "antd": "4.3.3",
|
|
5
|
-
- "axios": "^0.19.2",
|
|
6
|
-
- "react": "16.13.1",
|
|
7
|
-
- "react-dom": "16.13.1",
|
|
8
|
-
- "react-intl": "^2.9.0",
|
|
9
|
-
- "react-intl.macro": "^0.3.7"
|
|
1
|
+
# README #
|
|
10
2
|
|
|
11
3
|
## Components ##
|
|
12
|
-
### `<CreateInvoice
|
|
4
|
+
### `<CreateInvoice>` ###
|
|
13
5
|
|
|
14
6
|
Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
|
|
15
7
|
|
|
16
8
|
|Property |Description |Type |Default |
|
|
17
9
|
|:----------------------|:------------------------------------------------------|:------------------------------------------------------|:----------|
|
|
18
|
-
|
|
|
10
|
+
|issuer |Sets the Invoice issuer |Object `ProfileOutput` | |
|
|
19
11
|
|language |Sets the language of the component |`en` `is` `pl` `undefined` |`en` |
|
|
20
12
|
|mapiBaseUrl |Url of the MAPI |string | |
|
|
21
13
|
|rapiBaseUrl |Url of the RAPI |string | |
|
|
@@ -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;
|
|
@@ -34,29 +34,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
34
34
|
var React = __importStar(require("react"));
|
|
35
35
|
require("@ant-design/compatible/assets/index.css");
|
|
36
36
|
var antd_1 = require("antd");
|
|
37
|
-
var react_intl_1 = require("react-intl");
|
|
38
|
-
var translationMessages = react_intl_1.defineMessages({
|
|
39
|
-
attachment_labels_Reference: {
|
|
40
|
-
id: "attachment_labels_Reference",
|
|
41
|
-
defaultMessage: "Reference",
|
|
42
|
-
},
|
|
43
|
-
attachment_labels_Reference_requiredMessage: {
|
|
44
|
-
id: "attachment_labels_Reference_requiredMessage",
|
|
45
|
-
defaultMessage: "Please input the reference",
|
|
46
|
-
},
|
|
47
|
-
attachment_labels_Description: {
|
|
48
|
-
id: "attachment_labels_Description",
|
|
49
|
-
defaultMessage: "Description",
|
|
50
|
-
},
|
|
51
|
-
attachment_labels_Description_requiredMessage: {
|
|
52
|
-
id: "attachment_labels_Description_requiredMessage",
|
|
53
|
-
defaultMessage: "Please input the description",
|
|
54
|
-
},
|
|
55
|
-
attachment_labels_File: {
|
|
56
|
-
id: "attachment_labels_File",
|
|
57
|
-
defaultMessage: "File",
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
37
|
var Attachment = /** @class */ (function (_super) {
|
|
61
38
|
__extends(Attachment, _super);
|
|
62
39
|
function Attachment(props) {
|
|
@@ -77,27 +54,25 @@ var Attachment = /** @class */ (function (_super) {
|
|
|
77
54
|
return _this;
|
|
78
55
|
}
|
|
79
56
|
Attachment.prototype.render = function () {
|
|
80
|
-
var _this = this;
|
|
81
57
|
return (React.createElement(React.Fragment, null,
|
|
82
|
-
React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, label:
|
|
58
|
+
React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, label: "Reference", name: "attachment:" + this.props.fieldName + ":reference", rules: [
|
|
83
59
|
{
|
|
84
60
|
required: this.state.file.length > 0,
|
|
85
|
-
message:
|
|
61
|
+
message: 'Please input the reference',
|
|
86
62
|
}
|
|
87
63
|
] },
|
|
88
64
|
React.createElement(antd_1.Input, null)),
|
|
89
|
-
React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, label:
|
|
65
|
+
React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, label: "Description", name: "attachment:" + this.props.fieldName + ":description", rules: [
|
|
90
66
|
{
|
|
91
67
|
required: this.state.file.length > 0,
|
|
92
|
-
message:
|
|
68
|
+
message: 'Please input the description',
|
|
93
69
|
}
|
|
94
70
|
] },
|
|
95
71
|
React.createElement(antd_1.Input, null)),
|
|
96
|
-
React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, label:
|
|
97
|
-
React.createElement(antd_1.Upload.Dragger, { name: "attachment:" + this.props.fieldName, multiple: false, onRemove: this.handleRemoveFile
|
|
98
|
-
|
|
99
|
-
} }))));
|
|
72
|
+
React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, label: "File", name: "attachment:" + this.props.fieldName, valuePropName: "fileList", getValueFromEvent: this.normFile },
|
|
73
|
+
React.createElement(antd_1.Upload.Dragger, { name: "attachment:" + this.props.fieldName, multiple: false, onRemove: this.handleRemoveFile }),
|
|
74
|
+
",")));
|
|
100
75
|
};
|
|
101
76
|
return Attachment;
|
|
102
77
|
}(React.Component));
|
|
103
|
-
exports.default =
|
|
78
|
+
exports.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;
|
|
@@ -11,21 +11,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
var React = __importStar(require("react"));
|
|
14
|
-
var
|
|
14
|
+
var component_container_1 = __importDefault(require("../component-container"));
|
|
15
15
|
var Attachment_1 = __importDefault(require("./Attachment"));
|
|
16
|
-
var react_intl_1 = require("react-intl");
|
|
17
|
-
var translationMessages = react_intl_1.defineMessages({
|
|
18
|
-
attachment_title: {
|
|
19
|
-
id: "attachment.title",
|
|
20
|
-
defaultMessage: "Attachments",
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
16
|
var AttachmentsGroup = function (props) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
React.createElement(Attachment_1.default, {
|
|
27
|
-
React.createElement(Attachment_1.default, {
|
|
28
|
-
React.createElement(Attachment_1.default, { handleAddFile: handleAddFile, fieldName: "file3" })));
|
|
17
|
+
return (React.createElement(component_container_1.default, { title: "Attachments" },
|
|
18
|
+
React.createElement(Attachment_1.default, { fieldName: "file1" }),
|
|
19
|
+
React.createElement(Attachment_1.default, { fieldName: "file2" }),
|
|
20
|
+
React.createElement(Attachment_1.default, { fieldName: "file3" })));
|
|
29
21
|
};
|
|
30
|
-
|
|
31
|
-
exports.default = AttachmentGroupIntl;
|
|
22
|
+
exports.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;
|
|
@@ -11,121 +11,102 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
var React = __importStar(require("react"));
|
|
14
|
-
var
|
|
14
|
+
var component_container_1 = __importDefault(require("../component-container"));
|
|
15
15
|
require("@ant-design/compatible/assets/index.css");
|
|
16
16
|
var antd_1 = require("antd");
|
|
17
|
-
var form_item_1 = __importDefault(require("../form-item"));
|
|
18
|
-
var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
|
|
19
|
-
var react_intl_1 = require("react-intl");
|
|
20
|
-
var translationMessages = react_intl_1.defineMessages({
|
|
21
|
-
baseInformation_title: {
|
|
22
|
-
id: "baseInformation_title",
|
|
23
|
-
defaultMessage: "Base Information",
|
|
24
|
-
},
|
|
25
|
-
baseInformation_invoiceNo: {
|
|
26
|
-
id: "baseInformation_invoiceNo",
|
|
27
|
-
defaultMessage: "Invoice No",
|
|
28
|
-
},
|
|
29
|
-
baseInformation_issueDate: {
|
|
30
|
-
id: "baseInformation_issueDate",
|
|
31
|
-
defaultMessage: "Issue date"
|
|
32
|
-
},
|
|
33
|
-
baseInformation_dueDate: {
|
|
34
|
-
id: "baseInformation_dueDate",
|
|
35
|
-
defaultMessage: "Due date"
|
|
36
|
-
},
|
|
37
|
-
baseInformation_orderReference_documentNo: {
|
|
38
|
-
id: "baseInformation_orderReference_documentNo",
|
|
39
|
-
defaultMessage: "Order no"
|
|
40
|
-
},
|
|
41
|
-
baseInformation_notes: {
|
|
42
|
-
id: "baseInformation_notes",
|
|
43
|
-
defaultMessage: "Notes"
|
|
44
|
-
},
|
|
45
|
-
baseInformation_currencyCode: {
|
|
46
|
-
id: "baseInformation_currencyCode",
|
|
47
|
-
defaultMessage: "Currency"
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
17
|
var BaseInformation = function (props) {
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
];
|
|
82
|
-
if (recRequirements.currencyCode && recRequirements.currencyCode.values && recRequirements.currencyCode.values.length > 0) {
|
|
83
|
-
return recRequirements.currencyCode.values.map(function (currency) {
|
|
84
|
-
return React.createElement(antd_1.Select.Option, { value: currency.key, title: currency.label, key: currency.key }, currency.label);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
return currencies.map(function (currency) {
|
|
89
|
-
return React.createElement(antd_1.Select.Option, { value: currency.key, title: currency.label, key: currency.key }, currency.label);
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
};
|
|
18
|
+
var currencies = [
|
|
19
|
+
{
|
|
20
|
+
value: "ISK",
|
|
21
|
+
display: "Icelandic krona (ISK)"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
value: "DKK",
|
|
25
|
+
display: "Danish krona (DKK)"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: "NOK",
|
|
29
|
+
display: "Norwegian krona (NOK)"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: "SEK",
|
|
33
|
+
display: "Swedish krona (SEK)"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
value: "EUR",
|
|
37
|
+
display: "Euro (EUR)"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: "USD",
|
|
41
|
+
display: "US dollar (USD)"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
value: "GBP",
|
|
45
|
+
display: "British pound (GBP)"
|
|
46
|
+
},
|
|
47
|
+
];
|
|
93
48
|
var disabledDate = function (dueDate, issueDate) {
|
|
94
49
|
return dueDate < issueDate;
|
|
95
50
|
};
|
|
96
51
|
var checkIfEmpty = function (date) {
|
|
97
52
|
if (!date) {
|
|
98
|
-
props.form.resetFields(["
|
|
99
|
-
props.form.validateFields(["
|
|
53
|
+
props.form.resetFields(["baseInformation:dueDate"]);
|
|
54
|
+
props.form.validateFields(["baseInformation:dueDate"]).then(function (values) {
|
|
100
55
|
// console.log(values);
|
|
101
56
|
});
|
|
102
57
|
}
|
|
103
58
|
};
|
|
104
|
-
|
|
105
|
-
|
|
59
|
+
var getDocumentNoLabel = function (documentType) {
|
|
60
|
+
switch (documentType) {
|
|
61
|
+
case "creditNote":
|
|
62
|
+
return "Credit note no.";
|
|
63
|
+
case "invoice":
|
|
64
|
+
return "Invoice no.";
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return (React.createElement(component_container_1.default, { title: "Base information" },
|
|
68
|
+
React.createElement(antd_1.Form.Item, { label: getDocumentNoLabel(props.documentType), name: "baseInformation:invoiceNo" },
|
|
106
69
|
React.createElement(antd_1.Input, null)),
|
|
107
|
-
React.createElement(
|
|
108
|
-
React.createElement(antd_1.DatePicker, null)),
|
|
109
|
-
React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.dueDate, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_dueDate), defaultIsRequired: false, fieldName: ["invoice", "dueDate"], additionalRules: [
|
|
70
|
+
React.createElement(antd_1.Form.Item, { label: "Issue date", rules: [
|
|
110
71
|
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
callback();
|
|
114
|
-
}
|
|
115
|
-
var issueDate = props.form.getFieldValue(["invoice", "issueDate"]);
|
|
116
|
-
value < issueDate
|
|
117
|
-
? callback("Due date must be after the issue date")
|
|
118
|
-
: callback();
|
|
119
|
-
}),
|
|
72
|
+
required: true,
|
|
73
|
+
message: 'Please input the issue date',
|
|
120
74
|
},
|
|
121
|
-
] },
|
|
122
|
-
React.createElement(antd_1.DatePicker,
|
|
123
|
-
|
|
75
|
+
], name: "baseInformation:issueDate" },
|
|
76
|
+
React.createElement(antd_1.DatePicker, null)),
|
|
77
|
+
props.documentType === "invoice" &&
|
|
78
|
+
React.createElement(React.Fragment, null,
|
|
79
|
+
React.createElement(antd_1.Form.Item, { label: "Due date", name: "baseInformation:dueDate", rules: [
|
|
80
|
+
{
|
|
81
|
+
validator: (function (rule, value, callback) {
|
|
82
|
+
if (!value) {
|
|
83
|
+
callback();
|
|
84
|
+
}
|
|
85
|
+
var issueDate = props.form.getFieldValue("baseInformation:issueDate");
|
|
86
|
+
value < issueDate
|
|
87
|
+
? callback("Due date must be after the issue date")
|
|
88
|
+
: callback();
|
|
89
|
+
}),
|
|
90
|
+
},
|
|
91
|
+
] },
|
|
92
|
+
React.createElement(antd_1.DatePicker, { onChange: checkIfEmpty, disabledDate: (function (current) { return disabledDate(current, props.form.getFieldValue("baseInformation:issueDate")); }) })),
|
|
93
|
+
React.createElement(antd_1.Form.Item, { label: "Last payment date", name: "baseInformation:lastPaymentDate" },
|
|
94
|
+
React.createElement(antd_1.DatePicker, null))),
|
|
95
|
+
props.documentType === "creditNote" &&
|
|
96
|
+
React.createElement(antd_1.Form.Item, { label: "Invoice no", name: "baseInformation:invoiceReferenceNo", rules: [
|
|
97
|
+
{
|
|
98
|
+
required: true,
|
|
99
|
+
message: "Please input the invoice no."
|
|
100
|
+
}
|
|
101
|
+
] },
|
|
102
|
+
React.createElement(antd_1.Input, null)),
|
|
103
|
+
React.createElement(antd_1.Form.Item, { label: "Order no", name: "baseInformation:orderNo" },
|
|
124
104
|
React.createElement(antd_1.Input, null)),
|
|
125
|
-
React.createElement(
|
|
105
|
+
React.createElement(antd_1.Form.Item, { label: "Notes", name: "baseInformation:notes" },
|
|
126
106
|
React.createElement(antd_1.Input.TextArea, null)),
|
|
127
|
-
React.createElement(
|
|
128
|
-
React.createElement(antd_1.Select, { defaultActiveFirstOption: true },
|
|
107
|
+
React.createElement(antd_1.Form.Item, { label: "Currency", name: "baseInformation:currency" },
|
|
108
|
+
React.createElement(antd_1.Select, { defaultActiveFirstOption: true }, currencies.map(function (currency) {
|
|
109
|
+
return React.createElement(antd_1.Select.Option, { value: currency.value, title: currency.display, key: currency.value }, currency.display);
|
|
110
|
+
})))));
|
|
129
111
|
};
|
|
130
|
-
|
|
131
|
-
exports.default = BaseInformationIntl;
|
|
112
|
+
exports.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;
|