@unimaze/billing 0.21.8 → 0.21.10
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/invoice-preview/InvoicePreviewCustomerSupplierInfo.d.ts +0 -0
- package/lib/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfo.js +109 -0
- package/lib/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfoBox.d.ts +14 -0
- package/lib/common/components/invoice-preview/InvoicePreviewCustomerSupplierInfoBox.js +73 -0
- package/lib/common/components/invoice-preview/InvoicePreviewInvoiceLines.d.ts +12 -0
- package/lib/common/components/invoice-preview/InvoicePreviewInvoiceLines.js +93 -0
- package/lib/common/components/invoice-preview/InvoicePreviewPaymentInfo.d.ts +0 -0
- package/lib/common/components/invoice-preview/InvoicePreviewPaymentInfo.js +110 -0
- package/lib/common/components/invoice-preview/InvoicePreviewPaymentInfoBox.d.ts +14 -0
- package/lib/common/components/invoice-preview/InvoicePreviewPaymentInfoBox.js +77 -0
- package/lib/common/components/invoice-preview/InvoicePreviewTotalAmountPreview.d.ts +14 -0
- package/lib/common/components/invoice-preview/InvoicePreviewTotalAmountPreview.js +52 -0
- package/lib/common/components/payment-method/index.js +5 -0
- package/lib/unimaze-billing/src/common/components/CommonTranslations.d.ts +1 -29
- package/lib/unimaze-billing/src/common/components/CommonTranslations.js +4 -32
- package/lib/unimaze-billing/src/common/components/attachments/Attachment.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/attachments/AttachmentModal.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/attachments/AttachmentModal.js +5 -2
- package/lib/unimaze-billing/src/common/components/attachments/index.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/base-information/AccountingCost.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/base-information/OrderReference.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/base-information/ProjectReference.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/base-information/ReferenceIdentifiers.d.ts +6 -1
- package/lib/unimaze-billing/src/common/components/base-information/ReferenceIdentifiers.js +34 -12
- package/lib/unimaze-billing/src/common/components/base-information/index.d.ts +10 -1
- package/lib/unimaze-billing/src/common/components/base-information/index.js +10 -2
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingCalculations.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingCalculations.js +3 -5
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingLinePreview.d.ts +4 -1
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingLinePreview.js +45 -25
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingTaxSummary.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/billing-lines/BillingTaxSummary.js +0 -1
- package/lib/unimaze-billing/src/common/components/billing-lines/NewBillingLines.d.ts +6 -1
- package/lib/unimaze-billing/src/common/components/billing-lines/NewBillingLines.js +41 -327
- package/lib/unimaze-billing/src/common/components/billing-lines/SingleBillingLine.d.ts +10 -5
- package/lib/unimaze-billing/src/common/components/billing-lines/SingleBillingLine.js +137 -61
- package/lib/unimaze-billing/src/common/components/billing-lines/index.d.ts +3 -6
- package/lib/unimaze-billing/src/common/components/billing-lines/index.js +1 -1
- package/lib/unimaze-billing/src/common/components/customer/CostCenter.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/customer/CustomerContactName.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/customer/index.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/customer/index.js +7 -9
- package/lib/unimaze-billing/src/common/components/delivery-location/index.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/form-item/index.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/input/index.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/invoice/index.d.ts +3 -1
- package/lib/unimaze-billing/src/common/components/invoice/index.js +21 -14
- 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 +1 -1
- package/lib/unimaze-billing/src/common/components/invoice-preview/InvoicePreviewHeader.js +7 -8
- 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 +87 -1
- package/lib/unimaze-billing/src/common/components/invoice-preview/index.js +27 -236
- package/lib/unimaze-billing/src/common/components/payment-method/index.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/supplier/CityAutofill.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/supplier/index.d.ts +1 -1
- package/lib/unimaze-billing/src/common/components/supplier/index.js +1 -1
- package/lib/unimaze-billing/src/common/components/welcome-modal/index.d.ts +1 -1
- package/lib/unimaze-billing/src/common/types/AppConfiguration.d.ts +7 -4
- package/lib/unimaze-billing/src/common/types/ReceiverRequirements.d.ts +2 -0
- package/lib/unimaze-billing/src/common/types/ReceiverRequirements.js +2 -0
- package/lib/unimaze-billing/src/create-invoice/index.d.ts +11 -3
- package/lib/unimaze-billing/src/create-invoice/index.js +91 -64
- package/lib/unimaze-billing/src/enums.d.ts +3 -0
- package/lib/unimaze-billing/src/translations/locales/en.json +13 -13
- package/lib/unimaze-billing/src/translations/locales/is.json +8 -8
- package/lib/unimaze-billing/src/translations/locales.d.ts +16 -16
- package/lib/unimaze-billing/src/utils/ApiUtility.d.ts +9 -3
- package/lib/unimaze-billing/src/utils/ApiUtility.js +31 -13
- package/lib/unimaze-billing/src/utils/BillingLineUtility.d.ts +4 -1
- package/lib/unimaze-billing/src/utils/BillingLineUtility.js +36 -4
- package/lib/unimaze-billing/src/utils/ConversionUtility.d.ts +2 -2
- package/lib/unimaze-billing/src/utils/ConversionUtility.js +10 -11
- package/lib/unimaze-billing/src/utils/IntlUtility.d.ts +1 -0
- package/lib/unimaze-billing/src/utils/IntlUtility.js +33 -10
- package/lib/unimaze-billing/src/utils/RequirementsUtility.d.ts +3 -1
- package/lib/unimaze-billing/src/utils/RequirementsUtility.js +49 -1
- package/lib/utils/BillingLineUtility.js +3 -2
- package/package.json +1 -1
|
File without changes
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import {Card, Col, Flex, FormInstance, Row, theme, Typography} from "antd";
|
|
3
|
+
// import React from "react";
|
|
4
|
+
// import { injectIntl, WrappedComponentProps} from "react-intl";
|
|
5
|
+
// import {translationMessages} from "./index";
|
|
6
|
+
// import {grey} from "@ant-design/colors";
|
|
7
|
+
// import {PartyMetadata} from "../../../../../unimaze-api-clients/src/mapi";
|
|
8
|
+
//
|
|
9
|
+
// interface Props extends WrappedComponentProps {
|
|
10
|
+
// form: FormInstance;
|
|
11
|
+
// chosenCustomer: PartyMetadata;
|
|
12
|
+
// }
|
|
13
|
+
//
|
|
14
|
+
// const InvoicePreviewCustomerSupplierInfo: React.FC<Props> = (props) => {
|
|
15
|
+
// const {token} = theme.useToken();
|
|
16
|
+
//
|
|
17
|
+
// return (
|
|
18
|
+
// <Card
|
|
19
|
+
// bordered={false}
|
|
20
|
+
// style={{backgroundColor: "#F5F5F5"}}
|
|
21
|
+
// title={"LL"
|
|
22
|
+
// // <Row gutter={20}>
|
|
23
|
+
// // <Col span={12}>
|
|
24
|
+
// // <Flex justify="space-between" align="flex-end" style={{fontWeight: 400}}>
|
|
25
|
+
// // <Typography.Text>
|
|
26
|
+
// // {"DSAAA"}
|
|
27
|
+
// // {/*{props.intl.formatMessage(translationMessages.baseInformation_issueDate)}*/}
|
|
28
|
+
// // </Typography.Text>
|
|
29
|
+
// // <Typography.Text type="secondary" style={{fontSize: token.fontSizeSM}}>
|
|
30
|
+
// // {props.form.getFieldValue(["invoice", "issueDate"])?.format("DD.MM.YYYY")}
|
|
31
|
+
// // </Typography.Text>
|
|
32
|
+
// // </Flex>
|
|
33
|
+
// // </Col>
|
|
34
|
+
// // <Col span={12} style={{borderLeft: `1px solid ${grey[0]}`}}>
|
|
35
|
+
// // <Flex justify="space-between" align="flex-end" style={{fontWeight: 400}}>
|
|
36
|
+
// // <Typography.Text>
|
|
37
|
+
// // {props.intl.formatMessage(translationMessages.baseInformation_dueDate)}
|
|
38
|
+
// // </Typography.Text>
|
|
39
|
+
// // <Typography.Text type="secondary" style={{fontSize: token.fontSizeSM}}>
|
|
40
|
+
// // {props.form.getFieldValue(["invoice", "dueDate"])?.format("DD.MM.YYYY")}
|
|
41
|
+
// // </Typography.Text>
|
|
42
|
+
// // </Flex>
|
|
43
|
+
// // </Col>
|
|
44
|
+
// // </Row>
|
|
45
|
+
// }
|
|
46
|
+
// >
|
|
47
|
+
// <Flex vertical gap={"small"}>
|
|
48
|
+
// {/*<Typography.Text style={{fontSize: token.fontSizeHeading4, fontWeight: 500}}>*/}
|
|
49
|
+
// {/* {props.intl.formatMessage(translationMessages.customer_title)}:*/}
|
|
50
|
+
// {/*</Typography.Text>*/}
|
|
51
|
+
// {/*<Typography.Text type="secondary">{props.chosenCustomer.name}</Typography.Text>*/}
|
|
52
|
+
// {/*<Typography.Text type="secondary">*/}
|
|
53
|
+
// {/* {props.intl.formatMessage(translationMessages.customer_identifier)}:{" "}*/}
|
|
54
|
+
// {/* {props.chosenCustomer.identifier}*/}
|
|
55
|
+
// {/*</Typography.Text>*/}
|
|
56
|
+
// {/*{props.chosenCustomer.address?.streetNameAndNumber &&*/}
|
|
57
|
+
// {/* props.chosenCustomer.address?.postalZone &&*/}
|
|
58
|
+
// {/* props.chosenCustomer.address?.city && (*/}
|
|
59
|
+
// {/* <Typography.Text type="secondary">*/}
|
|
60
|
+
// {/* {props.intl.formatMessage(translationMessages.customer_address_streetNameAndNumber)}*/}
|
|
61
|
+
// {/* : {props.chosenCustomer.address.streetNameAndNumber},{" "}*/}
|
|
62
|
+
// {/* {props.chosenCustomer.address.postalZone}{" "}*/}
|
|
63
|
+
// {/* {props.chosenCustomer.address.city}*/}
|
|
64
|
+
// {/* </Typography.Text>*/}
|
|
65
|
+
// {/* )}*/}
|
|
66
|
+
// {/*{props.form.getFieldValue(["invoice", "customer", "locationIdentifier"]) && (*/}
|
|
67
|
+
// {/* <Typography.Text type="secondary">*/}
|
|
68
|
+
// {/* {props.intl.formatMessage(translationMessages.baseInformation_costCenter)}:{" "}*/}
|
|
69
|
+
// {/* {props.form.getFieldValue(["invoice", "customer", "locationIdentifier"])}*/}
|
|
70
|
+
// {/* </Typography.Text>*/}
|
|
71
|
+
// {/*)}*/}
|
|
72
|
+
// {/*<Col span={8} style={{padding: 0}}>*/}
|
|
73
|
+
// {/* <hr/>*/}
|
|
74
|
+
// {/*</Col>*/}
|
|
75
|
+
// {/*<Typography.Text style={{fontSize: token.fontSizeHeading4, fontWeight: 500}}>*/}
|
|
76
|
+
// {/* {props.intl.formatMessage(translationMessages.supplier_title)}:*/}
|
|
77
|
+
// {/*</Typography.Text>*/}
|
|
78
|
+
// {/*<Typography.Text type="secondary">*/}
|
|
79
|
+
// {/* {props.form.getFieldValue(["invoice", "supplier", "name"])}*/}
|
|
80
|
+
// {/*</Typography.Text>*/}
|
|
81
|
+
// {/*<Typography.Text type="secondary">*/}
|
|
82
|
+
// {/* {props.intl.formatMessage(translationMessages.supplier_identifier)}:{" "}*/}
|
|
83
|
+
// {/* {props.form.getFieldValue(["invoice", "supplier", "identifier"])}*/}
|
|
84
|
+
// {/*</Typography.Text>*/}
|
|
85
|
+
// {/*<Typography.Text type="secondary">*/}
|
|
86
|
+
// {/* {props.intl.formatMessage(translationMessages.supplier_address_streetNameAndNumber)}*/}
|
|
87
|
+
// {/* :{" "}*/}
|
|
88
|
+
// {/* {props.form.getFieldValue(["invoice", "supplier", "address", "streetNameAndNumber",])}*/}
|
|
89
|
+
// {/* , {props.form.getFieldValue(["invoice", "supplier", "address", "postalZone"])}{" "}*/}
|
|
90
|
+
// {/* {props.form.getFieldValue(["invoice", "supplier", "address", "city"])}*/}
|
|
91
|
+
// {/*</Typography.Text>*/}
|
|
92
|
+
// {/*{props.form.getFieldValue(["invoice", "supplier", "contact", "telephone"]) && (*/}
|
|
93
|
+
// {/* <Typography.Text type="secondary">*/}
|
|
94
|
+
// {/* {props.intl.formatMessage(translationMessages.supplier_contact_phoneNumber)}:*/}
|
|
95
|
+
// {/* {props.form.getFieldValue(["invoice", "supplier", "contact", "telephone"])}*/}
|
|
96
|
+
// {/* </Typography.Text>*/}
|
|
97
|
+
// {/*)}*/}
|
|
98
|
+
// {/*{props.form.getFieldValue(["invoice", "supplier", "contact", "electronicMail"]) && (*/}
|
|
99
|
+
// {/* <Typography.Text type="secondary">*/}
|
|
100
|
+
// {/* {props.form.getFieldValue(["invoice", "supplier", "contact", "electronicMail"])}*/}
|
|
101
|
+
// {/* </Typography.Text>*/}
|
|
102
|
+
// {/*)}*/}
|
|
103
|
+
// </Flex>
|
|
104
|
+
// </Card>
|
|
105
|
+
// );
|
|
106
|
+
// };
|
|
107
|
+
//
|
|
108
|
+
// export default injectIntl(InvoicePreviewCustomerSupplierInfo);
|
|
109
|
+
//
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormInstance } from "antd";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { WrappedComponentProps } from "react-intl";
|
|
4
|
+
import { PartyMetadata } from "../../../../../unimaze-api-clients/lib/mapi";
|
|
5
|
+
interface Props extends WrappedComponentProps {
|
|
6
|
+
form: FormInstance;
|
|
7
|
+
chosenCustomer: PartyMetadata;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
|
|
10
|
+
forwardedRef?: React.Ref<any>;
|
|
11
|
+
} & React.RefAttributes<any>> & {
|
|
12
|
+
WrappedComponent: React.ComponentType<Props>;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
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 react_intl_1 = require("react-intl");
|
|
9
|
+
var index_1 = require("./index");
|
|
10
|
+
var colors_1 = require("@ant-design/colors");
|
|
11
|
+
var InvoicePreviewCustomerSupplierInfoBox = function (props) {
|
|
12
|
+
var _a, _b, _c, _d, _e;
|
|
13
|
+
var token = antd_1.theme.useToken().token;
|
|
14
|
+
return (react_1.default.createElement(antd_1.Card, { bordered: false, style: { backgroundColor: "#F5F5F5" }, title: react_1.default.createElement(antd_1.Row, null,
|
|
15
|
+
react_1.default.createElement(antd_1.Flex, { justify: "space-between", align: "flex-end", style: { fontWeight: 400, borderRight: "1px solid ".concat(colors_1.grey[0]), paddingRight: 10 } },
|
|
16
|
+
react_1.default.createElement(antd_1.Typography.Text, null, props.intl.formatMessage(index_1.translationMessages.baseInformation_issueDate)),
|
|
17
|
+
react_1.default.createElement(antd_1.Typography.Text, { type: "secondary", style: { fontSize: token.fontSizeSM, padding: "0px 5px 0px 5px" } }, (_a = props.form.getFieldValue(["invoice", "issueDate"])) === null || _a === void 0 ? void 0 : _a.format("DD.MM.YYYY"))),
|
|
18
|
+
react_1.default.createElement(antd_1.Flex, { justify: "space-between", align: "flex-end", style: { fontWeight: 400, padding: "0px 10px 0px 10px" } },
|
|
19
|
+
react_1.default.createElement(antd_1.Typography.Text, null, props.intl.formatMessage(index_1.translationMessages.baseInformation_dueDate)),
|
|
20
|
+
react_1.default.createElement(antd_1.Typography.Text, { type: "secondary", style: { fontSize: token.fontSizeSM, padding: "0px 5px 0px 5px" } }, (_b = props.form.getFieldValue(["invoice", "dueDate"])) === null || _b === void 0 ? void 0 : _b.format("DD.MM.YYYY")))) },
|
|
21
|
+
react_1.default.createElement(antd_1.Flex, { gap: "middle", justify: "space-between" },
|
|
22
|
+
react_1.default.createElement(antd_1.Flex, { vertical: true },
|
|
23
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeHeading4, fontWeight: 500 } },
|
|
24
|
+
props.intl.formatMessage(index_1.translationMessages.customer_title),
|
|
25
|
+
":"),
|
|
26
|
+
react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" }, props.chosenCustomer.name),
|
|
27
|
+
react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
|
|
28
|
+
props.intl.formatMessage(index_1.translationMessages.customer_identifier),
|
|
29
|
+
":",
|
|
30
|
+
" ",
|
|
31
|
+
props.chosenCustomer.identifier),
|
|
32
|
+
((_c = props.chosenCustomer.address) === null || _c === void 0 ? void 0 : _c.streetNameAndNumber) &&
|
|
33
|
+
((_d = props.chosenCustomer.address) === null || _d === void 0 ? void 0 : _d.postalZone) &&
|
|
34
|
+
((_e = props.chosenCustomer.address) === null || _e === void 0 ? void 0 : _e.city) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
|
|
35
|
+
props.intl.formatMessage(index_1.translationMessages.customer_address_streetNameAndNumber),
|
|
36
|
+
": ",
|
|
37
|
+
props.chosenCustomer.address.streetNameAndNumber,
|
|
38
|
+
",",
|
|
39
|
+
" ",
|
|
40
|
+
props.chosenCustomer.address.postalZone,
|
|
41
|
+
" ",
|
|
42
|
+
props.chosenCustomer.address.city)),
|
|
43
|
+
props.form.getFieldValue(["invoice", "customer", "locationIdentifier"]) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
|
|
44
|
+
props.intl.formatMessage(index_1.translationMessages.baseInformation_costCenter),
|
|
45
|
+
":",
|
|
46
|
+
" ",
|
|
47
|
+
props.form.getFieldValue(["invoice", "customer", "locationIdentifier"])))),
|
|
48
|
+
react_1.default.createElement(antd_1.Flex, { vertical: true },
|
|
49
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeHeading4, fontWeight: 500 } },
|
|
50
|
+
props.intl.formatMessage(index_1.translationMessages.supplier_title),
|
|
51
|
+
":"),
|
|
52
|
+
react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" }, props.form.getFieldValue(["invoice", "supplier", "name"])),
|
|
53
|
+
react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
|
|
54
|
+
props.intl.formatMessage(index_1.translationMessages.supplier_identifier),
|
|
55
|
+
":",
|
|
56
|
+
" ",
|
|
57
|
+
props.form.getFieldValue(["invoice", "supplier", "identifier"])),
|
|
58
|
+
react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
|
|
59
|
+
props.intl.formatMessage(index_1.translationMessages.supplier_address_streetNameAndNumber),
|
|
60
|
+
":",
|
|
61
|
+
" ",
|
|
62
|
+
props.form.getFieldValue(["invoice", "supplier", "address", "streetNameAndNumber",]),
|
|
63
|
+
", ",
|
|
64
|
+
props.form.getFieldValue(["invoice", "supplier", "address", "postalZone"]),
|
|
65
|
+
" ",
|
|
66
|
+
props.form.getFieldValue(["invoice", "supplier", "address", "city"])),
|
|
67
|
+
props.form.getFieldValue(["invoice", "supplier", "contact", "telephone"]) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
|
|
68
|
+
props.intl.formatMessage(index_1.translationMessages.supplier_contact_phoneNumber),
|
|
69
|
+
":",
|
|
70
|
+
props.form.getFieldValue(["invoice", "supplier", "contact", "telephone"]))),
|
|
71
|
+
props.form.getFieldValue(["invoice", "supplier", "contact", "electronicMail"]) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" }, props.form.getFieldValue(["invoice", "supplier", "contact", "electronicMail"])))))));
|
|
72
|
+
};
|
|
73
|
+
exports.default = (0, react_intl_1.injectIntl)(InvoicePreviewCustomerSupplierInfoBox);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FormInstance } from "antd";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { WrappedComponentProps } from "react-intl";
|
|
4
|
+
interface Props extends WrappedComponentProps {
|
|
5
|
+
form: FormInstance;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: 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 _default;
|
|
@@ -0,0 +1,93 @@
|
|
|
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 react_intl_1 = require("react-intl");
|
|
9
|
+
var BillingLineUtility_1 = require("../../../utils/BillingLineUtility");
|
|
10
|
+
var index_1 = require("./index");
|
|
11
|
+
var IntlUtility_1 = require("../../../utils/IntlUtility");
|
|
12
|
+
var enums_1 = require("../../../enums");
|
|
13
|
+
var InvoicePreviewInvoiceLines = function (props) {
|
|
14
|
+
var _a;
|
|
15
|
+
var token = antd_1.theme.useToken().token;
|
|
16
|
+
var billingLineContent = function (line) {
|
|
17
|
+
var quantity = line.quantity, unitOfMeasure = line.unitOfMeasure, unitPriceAmount = line.unitPriceAmount, currencyCode = line.currencyCode;
|
|
18
|
+
var unitOfMeasureUnit = (unitOfMeasure === null || unitOfMeasure === void 0 ? void 0 : unitOfMeasure.unit) === "One" ? undefined : (unitOfMeasure === null || unitOfMeasure === void 0 ? void 0 : unitOfMeasure.unit) + ("(s)");
|
|
19
|
+
return react_1.default.createElement(antd_1.Typography.Text, { style: { fontStyle: "italic", color: 'grey' } },
|
|
20
|
+
quantity,
|
|
21
|
+
" ",
|
|
22
|
+
unitOfMeasureUnit,
|
|
23
|
+
" ",
|
|
24
|
+
"@",
|
|
25
|
+
" ",
|
|
26
|
+
unitPriceAmount,
|
|
27
|
+
" ",
|
|
28
|
+
currencyCode,
|
|
29
|
+
" ",
|
|
30
|
+
"each");
|
|
31
|
+
};
|
|
32
|
+
var getInvoiceLineHeader = function (line, taxPercentage, calculatedDiscountValue) {
|
|
33
|
+
return react_1.default.createElement("div", { style: {
|
|
34
|
+
display: "flex",
|
|
35
|
+
flexDirection: 'row',
|
|
36
|
+
backgroundColor: "#F5F5F5",
|
|
37
|
+
margin: "0 -24px",
|
|
38
|
+
padding: "0 24px",
|
|
39
|
+
justifyContent: "space-between",
|
|
40
|
+
} },
|
|
41
|
+
react_1.default.createElement("div", { style: { width: "80%", justifyContent: "space-between", display: "flex", flexDirection: 'row' } },
|
|
42
|
+
react_1.default.createElement("div", null,
|
|
43
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } },
|
|
44
|
+
line.itemNo,
|
|
45
|
+
" ",
|
|
46
|
+
react_1.default.createElement("span", { style: { fontWeight: 'bold' } }, line.name))),
|
|
47
|
+
react_1.default.createElement("div", { style: { display: "flex", flexDirection: "row" } },
|
|
48
|
+
billingLineContent(line),
|
|
49
|
+
react_1.default.createElement("div", { style: { marginLeft: '10px' } },
|
|
50
|
+
line.taxableAmount,
|
|
51
|
+
" ",
|
|
52
|
+
line.currencyCode))),
|
|
53
|
+
react_1.default.createElement("div", null,
|
|
54
|
+
react_1.default.createElement(antd_1.Typography.Text, null,
|
|
55
|
+
(0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)((line.quantity * line.unitPriceAmount) + (0, BillingLineUtility_1.calculateTaxAmount)(line.taxableAmount, taxPercentage) - calculatedDiscountValue, props.intl),
|
|
56
|
+
" ",
|
|
57
|
+
line.currencyCode)));
|
|
58
|
+
};
|
|
59
|
+
return (react_1.default.createElement(antd_1.Flex, { vertical: true, style: { padding: "0 24px" }, gap: "middle" },
|
|
60
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeHeading4 } },
|
|
61
|
+
props.intl.formatMessage(index_1.translationMessages.invoicePreview_billingLinesTitle),
|
|
62
|
+
":"),
|
|
63
|
+
((_a = props.form.getFieldValue(["invoice", "invoiceLines"])) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
64
|
+
props.form
|
|
65
|
+
.getFieldValue(["invoice", "invoiceLines"])
|
|
66
|
+
.map(function (line, index) {
|
|
67
|
+
var taxPercentage = (0, BillingLineUtility_1.calculateTaxPercentage)(enums_1.AvailableTaxCategoryTypeEnum[line.taxCategoryType]);
|
|
68
|
+
var calculatedDiscountValue = line.discountType === "PERCENTAGE"
|
|
69
|
+
? (0, BillingLineUtility_1.calculateDiscountAmount)(line.discountValue, line.quantity, line.unitPriceAmount)
|
|
70
|
+
: line.discountValue;
|
|
71
|
+
return (react_1.default.createElement(antd_1.Flex, { key: index, vertical: true, gap: "small" },
|
|
72
|
+
react_1.default.createElement(antd_1.Flex, { vertical: true }, getInvoiceLineHeader(line, taxPercentage, calculatedDiscountValue)),
|
|
73
|
+
line.discountValue && (react_1.default.createElement(antd_1.Flex, { justify: "space-between", style: { width: "80%" }, align: "center" },
|
|
74
|
+
react_1.default.createElement(antd_1.Typography.Text, null, "".concat(line.discountValue).concat(line.discountType === "PERCENTAGE" ? "%" : " ".concat(line.currencyCode)),
|
|
75
|
+
" ",
|
|
76
|
+
props.intl.formatMessage(index_1.translationMessages.billingLines_discount)),
|
|
77
|
+
react_1.default.createElement(antd_1.Typography.Text, null,
|
|
78
|
+
"-",
|
|
79
|
+
(0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(calculatedDiscountValue, props.intl),
|
|
80
|
+
" ",
|
|
81
|
+
line.currencyCode))),
|
|
82
|
+
react_1.default.createElement(antd_1.Flex, { justify: "space-between", style: { width: "80%" }, align: "center" },
|
|
83
|
+
react_1.default.createElement(antd_1.Typography.Text, null,
|
|
84
|
+
taxPercentage,
|
|
85
|
+
"% VAT of ",
|
|
86
|
+
line.taxableAmount),
|
|
87
|
+
react_1.default.createElement(antd_1.Typography.Text, null,
|
|
88
|
+
(0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)((0, BillingLineUtility_1.calculateTaxAmount)(line.taxableAmount, taxPercentage), props.intl),
|
|
89
|
+
" ",
|
|
90
|
+
line.currencyCode))));
|
|
91
|
+
})));
|
|
92
|
+
};
|
|
93
|
+
exports.default = (0, react_intl_1.injectIntl)(InvoicePreviewInvoiceLines);
|
|
File without changes
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import {Card, Flex, FormInstance, Typography} from "antd";
|
|
3
|
+
// import React from "react";
|
|
4
|
+
// import { injectIntl, WrappedComponentProps} from "react-intl";
|
|
5
|
+
// import {translationMessages as invoicePreviewTranslations} from "./index";
|
|
6
|
+
// import {translationMessages as paymentMethod_translationMessages} from "../payment-method";
|
|
7
|
+
// import {PaymentMeansType} from "../../../../../unimaze-api-clients/src/mapi";
|
|
8
|
+
// import {getFieldRequirements} from "../../../utils/RequirementsUtility";
|
|
9
|
+
// import {AvailableFields} from "../../types/ReceiverRequirements";
|
|
10
|
+
// import {NewReceiverRequirements} from "../../types/NewReceiverRequirements";
|
|
11
|
+
//
|
|
12
|
+
// interface Props extends WrappedComponentProps {
|
|
13
|
+
// form: FormInstance;
|
|
14
|
+
// receiverRequirements: NewReceiverRequirements;
|
|
15
|
+
// }
|
|
16
|
+
//
|
|
17
|
+
// const InvoicePreviewPaymentInfo: React.FC<Props> = (props) => {
|
|
18
|
+
//
|
|
19
|
+
// const defaultPaymentMethods = [
|
|
20
|
+
// {
|
|
21
|
+
// key: PaymentMeansType.NotSpecified,
|
|
22
|
+
// name: props.intl.formatMessage(paymentMethod_translationMessages.paymentMethod_labels_methods_undefined),
|
|
23
|
+
// },
|
|
24
|
+
// {
|
|
25
|
+
// key: PaymentMeansType.MutuallyAgreed,
|
|
26
|
+
// name: props.intl.formatMessage(
|
|
27
|
+
// paymentMethod_translationMessages.paymentMethod_labels_methods_mutuallyAgreed
|
|
28
|
+
// ),
|
|
29
|
+
// },
|
|
30
|
+
// {
|
|
31
|
+
// key: PaymentMeansType.DomesticTransfer,
|
|
32
|
+
// name: props.intl.formatMessage(
|
|
33
|
+
// paymentMethod_translationMessages.paymentMethod_labels_methods_domesticTransfer
|
|
34
|
+
// ),
|
|
35
|
+
// },
|
|
36
|
+
// {
|
|
37
|
+
// key: PaymentMeansType.DomesticClaim,
|
|
38
|
+
// name: props.intl.formatMessage(
|
|
39
|
+
// paymentMethod_translationMessages.paymentMethod_labels_methods_domesticClaim
|
|
40
|
+
// ),
|
|
41
|
+
// },
|
|
42
|
+
// ];
|
|
43
|
+
//
|
|
44
|
+
// const getPaymentMeansValue = (paymentMeansType: PaymentMeansType) => {
|
|
45
|
+
// const paymentMeansTypes = getFieldRequirements(props.receiverRequirements, AvailableFields["paymentMeans.type"]);
|
|
46
|
+
//
|
|
47
|
+
// if (
|
|
48
|
+
// paymentMeansTypes &&
|
|
49
|
+
// paymentMeansTypes.hasOwnProperty("properties") &&
|
|
50
|
+
// paymentMeansTypes.properties.hasOwnProperty("values") &&
|
|
51
|
+
// paymentMeansTypes.properties.values
|
|
52
|
+
// ) {
|
|
53
|
+
// const paymentMeansValue = paymentMeansTypes.properties.values.find(
|
|
54
|
+
// (value: any) => value.key === paymentMeansType
|
|
55
|
+
// );
|
|
56
|
+
// return paymentMeansValue?.name;
|
|
57
|
+
// } else {
|
|
58
|
+
// const paymentMeansValue = defaultPaymentMethods.find((value: any) => value.key === paymentMeansType);
|
|
59
|
+
// return paymentMeansValue?.name;
|
|
60
|
+
// }
|
|
61
|
+
// };
|
|
62
|
+
//
|
|
63
|
+
// return (
|
|
64
|
+
// <Card bordered={false} style={{backgroundColor: "#F5F5F5"}} size="small">
|
|
65
|
+
// <Flex vertical style={{padding: "0 12px"}} gap={"small"}>
|
|
66
|
+
// <Typography.Text style={{fontWeight: 700}}>
|
|
67
|
+
// {props.intl.formatMessage(invoicePreviewTranslations.invoicePreview_paymentInfoTitle)}
|
|
68
|
+
// </Typography.Text>
|
|
69
|
+
// <Flex vertical>
|
|
70
|
+
// <Typography.Text type="secondary">
|
|
71
|
+
// {props.form.getFieldValue(["invoice", "supplier", "name"])} Kt:{" "}
|
|
72
|
+
// {props.form.getFieldValue(["invoice", "supplier", "identifier"])}
|
|
73
|
+
// </Typography.Text>
|
|
74
|
+
// <Typography.Text type="secondary">
|
|
75
|
+
// {getPaymentMeansValue(props.form.getFieldValue(["invoice", "paymentMeans", "type"]))}
|
|
76
|
+
// </Typography.Text>
|
|
77
|
+
// {props.form.getFieldValue(["invoice", "paymentMeans", "domesticTransfer"]) && (
|
|
78
|
+
// <>
|
|
79
|
+
// <Typography.Text type="secondary">
|
|
80
|
+
// {props.intl.formatMessage(paymentMethod_translationMessages.paymentMethod_labels_domesticTransfer_accountNo)}:{" "}
|
|
81
|
+
// {props.form.getFieldValue(["invoice", "paymentMeans", "domesticTransfer", "bankNumber",])}
|
|
82
|
+
// -
|
|
83
|
+
// {props.form.getFieldValue(["invoice", "paymentMeans", "domesticTransfer", "accountTypeNumber",])}
|
|
84
|
+
// -
|
|
85
|
+
// {props.form.getFieldValue(["invoice", "paymentMeans", "domesticTransfer", "accountNumber",])}
|
|
86
|
+
// </Typography.Text>
|
|
87
|
+
// {props.form.getFieldValue(["invoice", "paymentMeans", "domesticTransfer", "paymentIdentifier",]) && (
|
|
88
|
+
// <Typography.Text type="secondary">
|
|
89
|
+
// {props.intl.formatMessage(paymentMethod_translationMessages.paymentMethod_labels_domesticTransfer_paymentReference)}
|
|
90
|
+
// :{" "}
|
|
91
|
+
// {props.form.getFieldValue(["invoice", "paymentMeans", "domesticTransfer", "paymentIdentifier",])}
|
|
92
|
+
// </Typography.Text>
|
|
93
|
+
// )}
|
|
94
|
+
// </>
|
|
95
|
+
// )}
|
|
96
|
+
// {props.form.getFieldValue(["invoice", "paymentMeans", "domesticClaim"]) && (
|
|
97
|
+
// <Typography.Text type="secondary">
|
|
98
|
+
// {props.form.getFieldValue(["invoice", "paymentMeans", "domesticClaim", "bankNumber",])}
|
|
99
|
+
// -66-
|
|
100
|
+
// {props.form.getFieldValue(["invoice", "paymentMeans", "domesticClaim", "accountNumber",])}
|
|
101
|
+
// </Typography.Text>
|
|
102
|
+
// )}
|
|
103
|
+
// </Flex>
|
|
104
|
+
// </Flex>
|
|
105
|
+
// </Card>
|
|
106
|
+
// );
|
|
107
|
+
// };
|
|
108
|
+
//
|
|
109
|
+
// export default injectIntl(InvoicePreviewPaymentInfo);
|
|
110
|
+
//
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormInstance } from "antd";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { WrappedComponentProps } from "react-intl";
|
|
4
|
+
import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
|
|
5
|
+
interface Props extends WrappedComponentProps {
|
|
6
|
+
form: FormInstance;
|
|
7
|
+
receiverRequirements: NewReceiverRequirements;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
|
|
10
|
+
forwardedRef?: React.Ref<any>;
|
|
11
|
+
} & React.RefAttributes<any>> & {
|
|
12
|
+
WrappedComponent: React.ComponentType<Props>;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,77 @@
|
|
|
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 react_intl_1 = require("react-intl");
|
|
9
|
+
var index_1 = require("./index");
|
|
10
|
+
var mapi_1 = require("@unimaze/api-clients/lib/mapi");
|
|
11
|
+
var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
|
|
12
|
+
var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
|
|
13
|
+
var index_2 = require("../payment-method/index");
|
|
14
|
+
var InvoicePreviewPaymentInfoBox = function (props) {
|
|
15
|
+
var defaultPaymentMethods = [
|
|
16
|
+
{
|
|
17
|
+
key: mapi_1.PaymentMeansType.NotSpecified,
|
|
18
|
+
name: props.intl.formatMessage(index_2.translationMessages.paymentMethod_labels_methods_undefined),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: mapi_1.PaymentMeansType.MutuallyAgreed,
|
|
22
|
+
name: props.intl.formatMessage(index_2.translationMessages.paymentMethod_labels_methods_mutuallyAgreed),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: mapi_1.PaymentMeansType.DomesticTransfer,
|
|
26
|
+
name: props.intl.formatMessage(index_2.translationMessages.paymentMethod_labels_methods_domesticTransfer),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: mapi_1.PaymentMeansType.DomesticClaim,
|
|
30
|
+
name: props.intl.formatMessage(index_2.translationMessages.paymentMethod_labels_methods_domesticClaim),
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
var getPaymentMeansValue = function (paymentMeansType) {
|
|
34
|
+
var paymentMeansTypes = (0, RequirementsUtility_1.getFieldRequirements)(props.receiverRequirements, ReceiverRequirements_1.AvailableFields["paymentMeans.type"]);
|
|
35
|
+
if (paymentMeansTypes &&
|
|
36
|
+
paymentMeansTypes.hasOwnProperty("properties") &&
|
|
37
|
+
paymentMeansTypes.properties.hasOwnProperty("values") &&
|
|
38
|
+
paymentMeansTypes.properties.values) {
|
|
39
|
+
var paymentMeansValue = paymentMeansTypes.properties.values.find(function (value) { return value.key === paymentMeansType; });
|
|
40
|
+
return paymentMeansValue === null || paymentMeansValue === void 0 ? void 0 : paymentMeansValue.name;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
var paymentMeansValue = defaultPaymentMethods.find(function (value) { return value.key === paymentMeansType; });
|
|
44
|
+
return paymentMeansValue === null || paymentMeansValue === void 0 ? void 0 : paymentMeansValue.name;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return (react_1.default.createElement(antd_1.Card, { bordered: false, style: { backgroundColor: "#F5F5F5" }, size: "small" },
|
|
48
|
+
react_1.default.createElement(antd_1.Flex, { vertical: true, style: { padding: "0 12px" }, gap: "small" },
|
|
49
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontWeight: 700 } }, props.intl.formatMessage(index_1.translationMessages.invoicePreview_paymentInfoTitle)),
|
|
50
|
+
react_1.default.createElement(antd_1.Flex, { vertical: true },
|
|
51
|
+
react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
|
|
52
|
+
props.form.getFieldValue(["invoice", "supplier", "name"]),
|
|
53
|
+
" Kt:",
|
|
54
|
+
" ",
|
|
55
|
+
props.form.getFieldValue(["invoice", "supplier", "identifier"])),
|
|
56
|
+
react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" }, getPaymentMeansValue(props.form.getFieldValue(["invoice", "paymentMeans", "type"]))),
|
|
57
|
+
props.form.getFieldValue(["invoice", "paymentMeans", "domesticTransfer"]) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
58
|
+
react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
|
|
59
|
+
props.intl.formatMessage(index_2.translationMessages.paymentMethod_labels_domesticTransfer_accountNo),
|
|
60
|
+
":",
|
|
61
|
+
" ",
|
|
62
|
+
props.form.getFieldValue(["invoice", "paymentMeans", "domesticTransfer", "bankNumber",]),
|
|
63
|
+
"-",
|
|
64
|
+
props.form.getFieldValue(["invoice", "paymentMeans", "domesticTransfer", "accountTypeNumber",]),
|
|
65
|
+
"-",
|
|
66
|
+
props.form.getFieldValue(["invoice", "paymentMeans", "domesticTransfer", "accountNumber",])),
|
|
67
|
+
props.form.getFieldValue(["invoice", "paymentMeans", "domesticTransfer", "paymentIdentifier",]) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
|
|
68
|
+
props.intl.formatMessage(index_2.translationMessages.paymentMethod_labels_domesticTransfer_paymentReference),
|
|
69
|
+
":",
|
|
70
|
+
" ",
|
|
71
|
+
props.form.getFieldValue(["invoice", "paymentMeans", "domesticTransfer", "paymentIdentifier",]))),
|
|
72
|
+
props.form.getFieldValue(["invoice", "paymentMeans", "domesticClaim"]) && (react_1.default.createElement(antd_1.Typography.Text, { type: "secondary" },
|
|
73
|
+
props.form.getFieldValue(["invoice", "paymentMeans", "domesticClaim", "bankNumber",]),
|
|
74
|
+
"-66-",
|
|
75
|
+
props.form.getFieldValue(["invoice", "paymentMeans", "domesticClaim", "accountNumber",])))))))));
|
|
76
|
+
};
|
|
77
|
+
exports.default = (0, react_intl_1.injectIntl)(InvoicePreviewPaymentInfoBox);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormInstance } from "antd";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { WrappedComponentProps } from "react-intl";
|
|
4
|
+
import { Totals } from "../../../utils/BillingLineUtility";
|
|
5
|
+
interface Props extends WrappedComponentProps {
|
|
6
|
+
form: FormInstance;
|
|
7
|
+
totals: Totals;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
|
|
10
|
+
forwardedRef?: React.Ref<any>;
|
|
11
|
+
} & React.RefAttributes<any>> & {
|
|
12
|
+
WrappedComponent: React.ComponentType<Props>;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
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 react_intl_1 = require("react-intl");
|
|
9
|
+
var BillingLineUtility_1 = require("../../../utils/BillingLineUtility");
|
|
10
|
+
var index_1 = require("./index");
|
|
11
|
+
var IntlUtility_1 = require("../../../utils/IntlUtility");
|
|
12
|
+
var enums_1 = require("../../../enums");
|
|
13
|
+
var InvoicePreviewTotalAmountPreview = function (props) {
|
|
14
|
+
var token = antd_1.theme.useToken().token;
|
|
15
|
+
var getLinesTax = function () {
|
|
16
|
+
var _a;
|
|
17
|
+
return ((_a = props.form.getFieldValue(["invoice", "invoiceLines"])) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
18
|
+
props.form.getFieldValue(["invoice", "invoiceLines"]).map(function (line, index) {
|
|
19
|
+
var taxPercentage = (0, BillingLineUtility_1.calculateTaxPercentage)(enums_1.AvailableTaxCategoryTypeEnum[line.taxCategoryType]);
|
|
20
|
+
return (react_1.default.createElement(antd_1.Flex, { justify: "space-between", key: index },
|
|
21
|
+
react_1.default.createElement(antd_1.Typography.Text, null,
|
|
22
|
+
taxPercentage,
|
|
23
|
+
"% VAT"),
|
|
24
|
+
react_1.default.createElement(antd_1.Typography.Text, null, (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)((0, BillingLineUtility_1.calculateTaxAmount)(line.taxableAmount, taxPercentage), props.intl))));
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
return (react_1.default.createElement(antd_1.Flex, { vertical: true, gap: "small" },
|
|
28
|
+
react_1.default.createElement(antd_1.Card, { bordered: false, style: { backgroundColor: "#F5F5F5" }, size: "small" },
|
|
29
|
+
react_1.default.createElement(antd_1.Flex, { vertical: true, style: { padding: "0 12px" } },
|
|
30
|
+
react_1.default.createElement(antd_1.Flex, { justify: "space-between" },
|
|
31
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } }, props.intl.formatMessage(index_1.translationMessages.billingCalculations_labels_TaxAmountWithoutVat)),
|
|
32
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeSM } },
|
|
33
|
+
props.form.getFieldValue(["invoice", "currencyCode"]),
|
|
34
|
+
" ",
|
|
35
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } }, (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(props.totals.totalTaxableAmount, props.intl)))),
|
|
36
|
+
getLinesTax(),
|
|
37
|
+
react_1.default.createElement(antd_1.Flex, { justify: "space-between" },
|
|
38
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } }, props.intl.formatMessage(index_1.translationMessages.billingCalculations_labels_TotalRoundingAmount)),
|
|
39
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeSM } },
|
|
40
|
+
props.form.getFieldValue(["invoice", "currencyCode"]),
|
|
41
|
+
" ",
|
|
42
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } }, (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(props.totals.discountAmount, props.intl)))))),
|
|
43
|
+
react_1.default.createElement(antd_1.Flex, { justify: "space-between", align: "center", style: { padding: "0 24px" } },
|
|
44
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: "16px" } },
|
|
45
|
+
props.intl.formatMessage(index_1.translationMessages.billingCalculations_labels_AmountPayable),
|
|
46
|
+
":"),
|
|
47
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeHeading4 } },
|
|
48
|
+
props.form.getFieldValue(["invoice", "currencyCode"]),
|
|
49
|
+
" ",
|
|
50
|
+
react_1.default.createElement(antd_1.Typography.Text, { style: { fontSize: token.fontSizeXL } }, (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(Math.round(props.totals.totalTaxInclusiveAmount), props.intl))))));
|
|
51
|
+
};
|
|
52
|
+
exports.default = (0, react_intl_1.injectIntl)(InvoicePreviewTotalAmountPreview);
|
|
@@ -130,6 +130,11 @@ var PaymentMethod = function (props) {
|
|
|
130
130
|
return;
|
|
131
131
|
debouncedValidateFields(fieldPaths, true);
|
|
132
132
|
}, [props.isActiveStep, JSON.stringify(props.formInstance.getFieldsValue(fieldPaths))]);
|
|
133
|
+
(0, react_1.useEffect)(function () {
|
|
134
|
+
if (!props.formInstance.getFieldValue(["invoice", "paymentMeans", "domesticTransfer", "accountTypeNumber"])) {
|
|
135
|
+
props.formInstance.setFieldValue(["invoice", "paymentMeans", "domesticTransfer", "accountTypeNumber"], "04");
|
|
136
|
+
}
|
|
137
|
+
}, [props.formInstance.getFieldValue(["invoice", "paymentMeans", "type"])]);
|
|
133
138
|
var domesticTransferFormFields = (react_1.default.createElement(react_1.default.Fragment, null,
|
|
134
139
|
react_1.default.createElement(antd_1.Form.Item, null,
|
|
135
140
|
react_1.default.createElement(antd_1.Row, { gutter: [8, 0] },
|