@unimaze/billing 0.1.0
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/LICENSE.txt +1 -0
- package/README.md +14 -0
- package/lib/common/components/attachments/Attachment.d.ts +15 -0
- package/lib/common/components/attachments/Attachment.js +78 -0
- package/lib/common/components/attachments/index.d.ts +3 -0
- package/lib/common/components/attachments/index.js +22 -0
- package/lib/common/components/base-information/index.d.ts +9 -0
- package/lib/common/components/base-information/index.js +112 -0
- package/lib/common/components/billing-lines/index.d.ts +27 -0
- package/lib/common/components/billing-lines/index.js +186 -0
- package/lib/common/components/component-container/Content.d.ts +7 -0
- package/lib/common/components/component-container/Content.js +13 -0
- package/lib/common/components/component-container/Header.d.ts +9 -0
- package/lib/common/components/component-container/Header.js +28 -0
- package/lib/common/components/component-container/index.d.ts +10 -0
- package/lib/common/components/component-container/index.js +20 -0
- package/lib/common/components/delivery-location/index.d.ts +3 -0
- package/lib/common/components/delivery-location/index.js +28 -0
- package/lib/common/components/editable-cell/index.d.ts +11 -0
- package/lib/common/components/editable-cell/index.js +76 -0
- package/lib/common/components/editable-row/index.d.ts +6 -0
- package/lib/common/components/editable-row/index.js +41 -0
- package/lib/common/components/index.d.ts +5 -0
- package/lib/common/components/index.js +10 -0
- package/lib/common/components/issuer/index.d.ts +7 -0
- package/lib/common/components/issuer/index.js +28 -0
- 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 -0
- package/lib/common/components/payment-method/index.js +73 -0
- package/lib/common/consts/validationRules.d.ts +7 -0
- package/lib/common/consts/validationRules.js +67 -0
- package/lib/common/enums/DocumentTypeEnum.d.ts +5 -0
- package/lib/common/enums/DocumentTypeEnum.js +8 -0
- package/lib/common/enums/index.d.ts +1 -0
- package/lib/common/enums/index.js +6 -0
- package/lib/common/types/BillingLineMetadataOverride.d.ts +4 -0
- package/lib/common/types/BillingLineMetadataOverride.js +2 -0
- package/lib/common/types/CommonProps.d.ts +7 -0
- package/lib/common/types/CommonProps.js +2 -0
- package/lib/common/types/InvoiceFormFields.d.ts +1 -0
- package/lib/common/types/InvoiceFormFields.js +2 -0
- package/lib/common/types/index.d.ts +1 -0
- package/lib/common/types/index.js +2 -0
- package/lib/create-credit-note/index.d.ts +9 -0
- package/lib/create-credit-note/index.js +75 -0
- package/lib/create-invoice/index.d.ts +15 -0
- package/lib/create-invoice/index.js +89 -0
- package/lib/example/src/index.d.ts +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +9 -0
- package/lib/style/index.css +1269 -0
- package/lib/utils/index.d.ts +5 -0
- package/lib/utils/index.js +164 -0
- package/package.json +82 -0
|
@@ -0,0 +1,76 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
28
|
+
result["default"] = mod;
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
var react_1 = __importStar(require("react"));
|
|
33
|
+
var antd_1 = require("antd");
|
|
34
|
+
var models_1 = require("../../../../../npm-unimaze-api-clients/lib/mapi/models");
|
|
35
|
+
var validationRules_1 = require("../../consts/validationRules");
|
|
36
|
+
var editable_row_1 = require("../editable-row");
|
|
37
|
+
var EditableCell = function (props) {
|
|
38
|
+
var editable = props.editable, dataIndex = props.dataIndex,
|
|
39
|
+
// title,
|
|
40
|
+
record = props.record, index = props.index, handleSave = props.handleSave, children = props.children, restProps = __rest(props, ["editable", "dataIndex", "record", "index", "handleSave", "children"]);
|
|
41
|
+
var _a = react_1.useState(false), editing = _a[0], setEditing = _a[1];
|
|
42
|
+
var input = null;
|
|
43
|
+
var toggleEdit = function () {
|
|
44
|
+
setEditing(!editing);
|
|
45
|
+
if (!editing && input)
|
|
46
|
+
input.focus();
|
|
47
|
+
};
|
|
48
|
+
var getCorrectInputNode = function (dataIdx) {
|
|
49
|
+
switch (dataIdx) {
|
|
50
|
+
case "quantity":
|
|
51
|
+
case "unitPriceAmount":
|
|
52
|
+
case "taxableAmount":
|
|
53
|
+
case "taxAmount":
|
|
54
|
+
case "taxPercentage":
|
|
55
|
+
case "discountValue":
|
|
56
|
+
case "accountingCost":
|
|
57
|
+
return react_1.default.createElement(antd_1.InputNumber, { step: 0.01 });
|
|
58
|
+
case "unitOfMeasure":
|
|
59
|
+
return (react_1.default.createElement(antd_1.Select, { ref: function (node) { return (input = node); }, defaultActiveFirstOption: true }, Object.keys(models_1.UnitOfMeasureMetadataUnitEnum).map(function (unitOfMeasure) {
|
|
60
|
+
return (react_1.default.createElement(antd_1.Select.Option, { value: unitOfMeasure, title: unitOfMeasure, key: unitOfMeasure }, unitOfMeasure));
|
|
61
|
+
})));
|
|
62
|
+
case "taxCategoryType":
|
|
63
|
+
return (react_1.default.createElement(antd_1.Select, { ref: function (node) { return (input = node); }, defaultActiveFirstOption: true }, Object.keys(models_1.BillingLineMetadataTaxCategoryTypeEnum).map(function (taxCategoryType) {
|
|
64
|
+
return (react_1.default.createElement(antd_1.Select.Option, { value: taxCategoryType, title: taxCategoryType, key: taxCategoryType }, taxCategoryType));
|
|
65
|
+
})));
|
|
66
|
+
default:
|
|
67
|
+
return react_1.default.createElement(antd_1.Input, { ref: function (node) { return (input = node); } });
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var renderCell = function () {
|
|
71
|
+
var inputNode = getCorrectInputNode(dataIndex);
|
|
72
|
+
return editing ? (react_1.default.createElement(antd_1.Form.Item, { style: { margin: 0 }, rules: validationRules_1.validationRules[dataIndex], name: dataIndex, initialValue: record[dataIndex] }, inputNode)) : (react_1.default.createElement("div", { className: "editable-cell-value-wrap", style: { paddingRight: 24 }, onClick: toggleEdit }, children));
|
|
73
|
+
};
|
|
74
|
+
return (react_1.default.createElement("td", __assign({}, restProps), editable ? (react_1.default.createElement(editable_row_1.EditableContext.Consumer, null, renderCell)) : (children)));
|
|
75
|
+
};
|
|
76
|
+
exports.default = EditableCell;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
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;
|
|
@@ -0,0 +1,41 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
28
|
+
result["default"] = mod;
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
var React = __importStar(require("react"));
|
|
33
|
+
var compatible_1 = require("@ant-design/compatible");
|
|
34
|
+
require("@ant-design/compatible/assets/index.css");
|
|
35
|
+
exports.EditableContext = React.createContext({});
|
|
36
|
+
var EditableRow = function (_a) {
|
|
37
|
+
var form = _a.form, index = _a.index, props = __rest(_a, ["form", "index"]);
|
|
38
|
+
return (React.createElement(exports.EditableContext.Provider, { value: form },
|
|
39
|
+
React.createElement("tr", __assign({}, props))));
|
|
40
|
+
};
|
|
41
|
+
exports.default = compatible_1.Form.create()(EditableRow);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function __export(m) {
|
|
3
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
4
|
+
}
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
__export(require("./component-container"));
|
|
7
|
+
__export(require("./payer"));
|
|
8
|
+
__export(require("./issuer"));
|
|
9
|
+
__export(require("./base-information"));
|
|
10
|
+
__export(require("./delivery-location"));
|
|
@@ -0,0 +1,28 @@
|
|
|
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 Issuer = function (props) {
|
|
16
|
+
var _a = props.issuer, participantLegalIsoIdentifier = _a.participantLegalIsoIdentifier, participantLegalAddressPostalCode = _a.participantLegalAddressPostalCode, participantLegalAddressCity = _a.participantLegalAddressCity, participantLegalAddressStreet = _a.participantLegalAddressStreet, email = _a.email, name = _a.name, country = _a.country;
|
|
17
|
+
return (React.createElement(component_container_1.default, { title: "Issuer" },
|
|
18
|
+
React.createElement("div", null,
|
|
19
|
+
React.createElement("strong", null, name),
|
|
20
|
+
" (",
|
|
21
|
+
participantLegalIsoIdentifier,
|
|
22
|
+
")"),
|
|
23
|
+
React.createElement("div", null, participantLegalAddressPostalCode + " " + participantLegalAddressCity),
|
|
24
|
+
React.createElement("div", null, participantLegalAddressStreet),
|
|
25
|
+
React.createElement("div", null, country),
|
|
26
|
+
React.createElement("div", null, email)));
|
|
27
|
+
};
|
|
28
|
+
exports.default = Issuer;
|
|
@@ -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;
|
|
@@ -0,0 +1,73 @@
|
|
|
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_1 = __importStar(require("react"));
|
|
14
|
+
var component_container_1 = __importDefault(require("../component-container"));
|
|
15
|
+
var antd_1 = require("antd");
|
|
16
|
+
var mapi_1 = require("@unimaze/api-clients/lib/mapi/");
|
|
17
|
+
var PaymentMethod = function () {
|
|
18
|
+
var _a = react_1.useState(mapi_1.PaymentMeansMetadataTypeEnum.NotSpecified), paymentMethod = _a[0], setPaymentMethod = _a[1];
|
|
19
|
+
var domesticTransferFormFields = react_1.default.createElement(react_1.default.Fragment, null,
|
|
20
|
+
react_1.default.createElement(antd_1.Form.Item, { label: "Bank no.", name: "paymentMethod:bankNo" },
|
|
21
|
+
react_1.default.createElement(antd_1.Input, null)),
|
|
22
|
+
react_1.default.createElement(antd_1.Form.Item, { label: "Type no.", name: "paymentMethod:typeNo" },
|
|
23
|
+
react_1.default.createElement(antd_1.Select, null,
|
|
24
|
+
react_1.default.createElement(antd_1.Select.Option, { value: "05" }, "05"),
|
|
25
|
+
react_1.default.createElement(antd_1.Select.Option, { value: "15" }, "15"),
|
|
26
|
+
react_1.default.createElement(antd_1.Select.Option, { value: "26" }, "26"))),
|
|
27
|
+
react_1.default.createElement(antd_1.Form.Item, { label: "Account no.", name: "paymentMethod:accountNo" },
|
|
28
|
+
react_1.default.createElement(antd_1.Input, null)),
|
|
29
|
+
react_1.default.createElement(antd_1.Form.Item, { label: "Payment reference", name: "paymentMethod:paymentReference" },
|
|
30
|
+
react_1.default.createElement(antd_1.Input, null)));
|
|
31
|
+
var icelandicClaimFormFields = react_1.default.createElement(react_1.default.Fragment, null,
|
|
32
|
+
react_1.default.createElement(antd_1.Form.Item, { label: "Bank no.", name: "paymentMethod:bankNo" },
|
|
33
|
+
react_1.default.createElement(antd_1.Input, null)),
|
|
34
|
+
react_1.default.createElement(antd_1.Form.Item, { label: "Claim no.", name: "paymentMethod:claimNo" },
|
|
35
|
+
react_1.default.createElement(antd_1.Input, null)));
|
|
36
|
+
var renderFormFields = function (payMthd) {
|
|
37
|
+
switch (payMthd) {
|
|
38
|
+
case mapi_1.PaymentMeansMetadataTypeEnum.NotSpecified:
|
|
39
|
+
case mapi_1.PaymentMeansMetadataTypeEnum.MutuallyAgreed:
|
|
40
|
+
return null;
|
|
41
|
+
case mapi_1.PaymentMeansMetadataTypeEnum.DomesticTransfer:
|
|
42
|
+
return (domesticTransferFormFields);
|
|
43
|
+
case mapi_1.PaymentMeansMetadataTypeEnum.DomesticClaim:
|
|
44
|
+
return (icelandicClaimFormFields);
|
|
45
|
+
default:
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var paymentMethods = [
|
|
50
|
+
{
|
|
51
|
+
value: mapi_1.PaymentMeansMetadataTypeEnum.NotSpecified,
|
|
52
|
+
display: "Undefined"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
value: mapi_1.PaymentMeansMetadataTypeEnum.MutuallyAgreed,
|
|
56
|
+
display: "Mutually agreed"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
value: mapi_1.PaymentMeansMetadataTypeEnum.DomesticTransfer,
|
|
60
|
+
display: "Domestic transfer"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
value: mapi_1.PaymentMeansMetadataTypeEnum.DomesticClaim,
|
|
64
|
+
display: "Claim (Icelandic)"
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
return (react_1.default.createElement(component_container_1.default, { title: "Payment method" },
|
|
68
|
+
react_1.default.createElement(antd_1.Select, { value: paymentMethod, onSelect: setPaymentMethod }, paymentMethods.map(function (payMthd) {
|
|
69
|
+
return react_1.default.createElement(antd_1.Select.Option, { value: payMthd.value, title: payMthd.display, key: payMthd.value }, payMthd.display);
|
|
70
|
+
})),
|
|
71
|
+
renderFormFields(paymentMethod)));
|
|
72
|
+
};
|
|
73
|
+
exports.default = PaymentMethod;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BillingLineMetadataOverride } from "../types/BillingLineMetadataOverride";
|
|
2
|
+
import { Rule } from "rc-field-form/lib/interface";
|
|
3
|
+
declare type ValidationRulesObject = {
|
|
4
|
+
[key in keyof BillingLineMetadataOverride]: Rule[];
|
|
5
|
+
};
|
|
6
|
+
export declare const validationRules: ValidationRulesObject;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var models_1 = require("../../../../npm-unimaze-api-clients/lib/mapi/models");
|
|
4
|
+
exports.validationRules = {
|
|
5
|
+
itemNo: [
|
|
6
|
+
{
|
|
7
|
+
required: true,
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
name: [
|
|
11
|
+
{
|
|
12
|
+
required: true,
|
|
13
|
+
message: "Please insert item name",
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
unitOfMeasure: [
|
|
17
|
+
{
|
|
18
|
+
required: true,
|
|
19
|
+
message: "Please choose unit of measure",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
enum: Object.keys(models_1.UnitOfMeasureMetadataUnitEnum),
|
|
23
|
+
message: "Unit of measure must be one of the accepted values",
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
unitPriceAmount: [
|
|
27
|
+
{
|
|
28
|
+
required: true,
|
|
29
|
+
message: "Please fill in unit price amount",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
type: "number",
|
|
33
|
+
message: "Unit price amount mu st be a number",
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
taxCategoryType: [
|
|
37
|
+
{
|
|
38
|
+
required: true,
|
|
39
|
+
message: "Please choose tax category type",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
enum: Object.keys(models_1.BillingLineMetadataTaxCategoryTypeEnum),
|
|
43
|
+
message: "Tax category must be one of the accepted values",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
discountValue: [],
|
|
47
|
+
taxableAmount: [
|
|
48
|
+
{
|
|
49
|
+
required: true,
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
taxPercentage: [
|
|
53
|
+
{
|
|
54
|
+
required: true,
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
quantity: [
|
|
58
|
+
{
|
|
59
|
+
required: true,
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
taxAmount: [
|
|
63
|
+
{
|
|
64
|
+
required: true,
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var DocumentTypeEnum;
|
|
4
|
+
(function (DocumentTypeEnum) {
|
|
5
|
+
DocumentTypeEnum["Invoice"] = "invoice";
|
|
6
|
+
DocumentTypeEnum["CreditNote"] = "creditNote";
|
|
7
|
+
})(DocumentTypeEnum || (DocumentTypeEnum = {}));
|
|
8
|
+
exports.default = DocumentTypeEnum;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DocumentTypeEnum";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CreateCorrectWithCreditRequest } from "@unimaze/api-clients/lib/mapi";
|
|
3
|
+
import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
|
|
4
|
+
interface Props {
|
|
5
|
+
handleCorrectWithCredit: (createCorrectWithCreditRequest: CreateCorrectWithCreditRequest) => void;
|
|
6
|
+
issuer: ProfileOutput;
|
|
7
|
+
}
|
|
8
|
+
declare const CreateInvoice: React.FC<Props>;
|
|
9
|
+
export default CreateInvoice;
|
|
@@ -0,0 +1,75 @@
|
|
|
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 __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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
var react_1 = __importStar(require("react"));
|
|
25
|
+
var antd_1 = require("antd");
|
|
26
|
+
var payer_1 = __importDefault(require("../common/components/payer"));
|
|
27
|
+
var issuer_1 = __importDefault(require("../common/components/issuer"));
|
|
28
|
+
var base_information_1 = __importDefault(require("../common/components/base-information"));
|
|
29
|
+
var billing_lines_1 = __importDefault(require("../common/components/billing-lines"));
|
|
30
|
+
var attachments_1 = __importDefault(require("../common/components/attachments"));
|
|
31
|
+
var _a = react_1.useState({
|
|
32
|
+
conversationIdentifier: "test",
|
|
33
|
+
creditNoteMetadataInput: {},
|
|
34
|
+
messageId: "test_mid",
|
|
35
|
+
more: false,
|
|
36
|
+
services: [],
|
|
37
|
+
}), createCorrectWithCreditRequest = _a[0], setCreateCorrectWithCreditRequest = _a[1];
|
|
38
|
+
var form = antd_1.Form.useForm()[0];
|
|
39
|
+
var handleSetBillingLineMetadata = function (formInstance, billingLineMetadata) {
|
|
40
|
+
formInstance.setFieldsValue({
|
|
41
|
+
"billingLineMetadata": billingLineMetadata,
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var handleSubmit = function (values) {
|
|
45
|
+
// console.log('Received values of form: ', values);
|
|
46
|
+
};
|
|
47
|
+
var CreateInvoice = function (props) {
|
|
48
|
+
// props.form.getFieldDecorator('billingLineMetadata', {initialValue: []});
|
|
49
|
+
var formItemLayout = {
|
|
50
|
+
labelCol: {
|
|
51
|
+
xs: { span: 24 },
|
|
52
|
+
sm: { span: 8 },
|
|
53
|
+
},
|
|
54
|
+
wrapperCol: {
|
|
55
|
+
xs: { span: 24 },
|
|
56
|
+
sm: { span: 16 },
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
return (react_1.default.createElement(antd_1.Form, __assign({}, formItemLayout, { onFinish: handleSubmit }),
|
|
60
|
+
react_1.default.createElement("h1", null, "Credit note"),
|
|
61
|
+
react_1.default.createElement(antd_1.Row, { gutter: [16, 16] },
|
|
62
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 12 } },
|
|
63
|
+
react_1.default.createElement(payer_1.default, null)),
|
|
64
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 12 } },
|
|
65
|
+
react_1.default.createElement(issuer_1.default, { issuer: props.issuer })),
|
|
66
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
|
|
67
|
+
react_1.default.createElement(base_information_1.default, { form: form, documentType: "creditNote" })),
|
|
68
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 }, xl: { span: 16 } },
|
|
69
|
+
react_1.default.createElement(billing_lines_1.default, { setBillingLineMetadata: handleSetBillingLineMetadata, form: form })),
|
|
70
|
+
react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 }, xl: { span: 24 } },
|
|
71
|
+
react_1.default.createElement(attachments_1.default, null)),
|
|
72
|
+
react_1.default.createElement(antd_1.Col, { span: 24 },
|
|
73
|
+
react_1.default.createElement(antd_1.Button, { type: "primary", htmlType: "submit" }, "Submit")))));
|
|
74
|
+
};
|
|
75
|
+
exports.default = CreateInvoice;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "antd/dist/antd.compact.css";
|
|
2
|
+
import "../style/index.css";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
|
|
5
|
+
import { CommonProps } from "../common/types/CommonProps";
|
|
6
|
+
interface Props extends CommonProps {
|
|
7
|
+
issuer: ProfileOutput;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
|
|
11
|
+
*
|
|
12
|
+
* @component
|
|
13
|
+
*/
|
|
14
|
+
declare const CreateInvoice: React.FC<Props>;
|
|
15
|
+
export default CreateInvoice;
|