@unimaze/billing 0.1.2-rc.9 → 0.2.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.
Files changed (73) hide show
  1. package/lib/common/components/attachments/Attachment.d.ts +6 -5
  2. package/lib/common/components/attachments/Attachment.js +75 -18
  3. package/lib/common/components/attachments/index.d.ts +5 -6
  4. package/lib/common/components/attachments/index.js +20 -6
  5. package/lib/common/components/base-information/ReferenceIdentifiers.d.ts +17 -0
  6. package/lib/common/components/base-information/ReferenceIdentifiers.js +58 -0
  7. package/lib/common/components/base-information/index.d.ts +6 -3
  8. package/lib/common/components/base-information/index.js +86 -10
  9. package/lib/common/components/billing-lines/BillingCalculations.d.ts +11 -0
  10. package/lib/common/components/billing-lines/BillingCalculations.js +63 -0
  11. package/lib/common/components/billing-lines/BillingTaxSummary.d.ts +10 -0
  12. package/lib/common/components/billing-lines/BillingTaxSummary.js +53 -0
  13. package/lib/common/components/billing-lines/NewBillingLines.d.ts +10 -0
  14. package/lib/common/components/billing-lines/NewBillingLines.js +77 -0
  15. package/lib/common/components/billing-lines/index.d.ts +7 -15
  16. package/lib/common/components/billing-lines/index.js +177 -62
  17. package/lib/common/components/customer/hardCoddedCustomer.d.ts +7 -0
  18. package/lib/common/components/customer/hardCoddedCustomer.js +25 -0
  19. package/lib/common/components/customer/index.d.ts +5 -6
  20. package/lib/common/components/customer/index.js +125 -12
  21. package/lib/common/components/delivery-location/index.d.ts +5 -2
  22. package/lib/common/components/delivery-location/index.js +69 -8
  23. package/lib/common/components/editable-cell/index.js +7 -9
  24. package/lib/common/components/form-item/index.d.ts +12 -7
  25. package/lib/common/components/form-item/index.js +31 -7
  26. package/lib/common/components/locale-intl/index.d.ts +10 -0
  27. package/lib/common/components/locale-intl/index.js +45 -0
  28. package/lib/common/components/payment-method/index.d.ts +6 -3
  29. package/lib/common/components/payment-method/index.js +136 -16
  30. package/lib/common/components/payment-method/paymentMethodForConversion.d.ts +9 -0
  31. package/lib/common/components/payment-method/paymentMethodForConversion.js +44 -0
  32. package/lib/common/components/supplier/index.d.ts +9 -2
  33. package/lib/common/components/supplier/index.js +125 -24
  34. package/lib/common/consts/formLayout.d.ts +44 -0
  35. package/lib/common/consts/formLayout.js +35 -0
  36. package/lib/common/consts/validationRules.js +0 -7
  37. package/lib/common/types/ReceiverRequirements.d.ts +1 -1
  38. package/lib/common/types/ReceiverRequirements.js +8 -69
  39. package/lib/create-credit-note/index.js +3 -5
  40. package/lib/create-invoice/index.js +107 -43
  41. package/lib/src/common/components/attachments/Attachment.d.ts +6 -5
  42. package/lib/src/common/components/attachments/index.d.ts +5 -6
  43. package/lib/src/common/components/base-information/ReferenceIdentifiers.d.ts +17 -0
  44. package/lib/src/common/components/base-information/index.d.ts +6 -3
  45. package/lib/src/common/components/billing-lines/BillingCalculations.d.ts +11 -0
  46. package/lib/src/common/components/billing-lines/BillingTaxSummary.d.ts +10 -0
  47. package/lib/src/common/components/billing-lines/NewBillingLines.d.ts +10 -0
  48. package/lib/src/common/components/billing-lines/index.d.ts +7 -15
  49. package/lib/src/common/components/customer/index.d.ts +5 -6
  50. package/lib/src/common/components/delivery-location/index.d.ts +5 -2
  51. package/lib/src/common/components/form-item/index.d.ts +12 -7
  52. package/lib/src/common/components/locale-intl/index.d.ts +10 -0
  53. package/lib/src/common/components/payment-method/index.d.ts +6 -3
  54. package/lib/src/common/components/payment-method/paymentMethodForConversion.d.ts +9 -0
  55. package/lib/src/common/components/supplier/index.d.ts +9 -2
  56. package/lib/src/common/consts/formLayout.d.ts +44 -0
  57. package/lib/src/common/types/ReceiverRequirements.d.ts +1 -1
  58. package/lib/src/translations/locales.d.ts +77 -0
  59. package/lib/src/utils/BillingLineUtility.d.ts +10 -0
  60. package/lib/src/utils/ConversionUtility.d.ts +4 -4
  61. package/lib/translations/locales/is.json +73 -0
  62. package/lib/translations/locales.d.ts +77 -0
  63. package/lib/translations/locales.js +10 -0
  64. package/lib/utils/ApiUtility.js +1 -1
  65. package/lib/utils/BillingLineUtility.d.ts +10 -0
  66. package/lib/utils/BillingLineUtility.js +90 -0
  67. package/lib/utils/ConversionUtility.d.ts +4 -4
  68. package/lib/utils/ConversionUtility.js +39 -55
  69. package/lib/utils/RequirementsUtility.js +1 -1
  70. package/package.json +9 -6
  71. package/lib/common/components/billing-lines/BillingLIneFormData.d.ts +0 -6
  72. package/lib/common/components/billing-lines/BillingLIneFormData.js +0 -6
  73. package/lib/src/common/components/billing-lines/BillingLIneFormData.d.ts +0 -6
@@ -26,11 +26,14 @@ var react_1 = __importStar(require("react"));
26
26
  var antd_1 = require("antd");
27
27
  var is_IS_1 = __importDefault(require("antd/es/locale-provider/is_IS"));
28
28
  var en_US_1 = __importDefault(require("antd/es/locale-provider/en_US"));
29
+ var models_1 = require("@unimaze/api-clients/lib/mapi/models");
29
30
  var components_1 = require("../common/components");
30
31
  var utils_1 = require("../utils");
31
32
  var uuid_1 = require("uuid");
32
- var BillingLIneFormData_1 = require("../common/components/billing-lines/BillingLIneFormData");
33
+ var BillingLineUtility_1 = require("../utils/BillingLineUtility");
33
34
  var mapi_1 = require("@unimaze/api-clients/lib/mapi");
35
+ var formLayout_1 = require("../common/consts/formLayout");
36
+ var paymentMethodForConversion_1 = require("../common/components/payment-method/paymentMethodForConversion");
34
37
  /**
35
38
  * Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
36
39
  *
@@ -39,60 +42,108 @@ var mapi_1 = require("@unimaze/api-clients/lib/mapi");
39
42
  var CreateInvoice = function (props) {
40
43
  // const [submitInvoiceRequest, setSubmitInvoiceRequest] = React.useState<CreateSubmitInvoiceRequest>();
41
44
  var form = antd_1.Form.useForm()[0];
42
- var _a = react_1.useState([]), files = _a[0], setFiles = _a[1];
43
- var formItemLayout = {
44
- labelCol: {
45
- xs: { span: 24 },
46
- sm: { span: 8 },
47
- },
48
- wrapperCol: {
49
- xs: { span: 24 },
50
- sm: { span: 16 },
51
- },
45
+ var _a = react_1.useState([]), billingLinesDataSource = _a[0], setBillingLinesDataSource = _a[1];
46
+ var _b = react_1.useState(0), billingLinesEditableIndex = _b[0], setBillingLinesEditableIndex = _b[1];
47
+ // const [files, setFiles] = useState<UploadFile[]>([]);
48
+ //
49
+ // const handleAddFile = (file: UploadFile) => {
50
+ // if (file.status === "removed") {
51
+ // const remainingFiles = files.filter(existingFile => existingFile.uid !== file.uid);
52
+ // setFiles(remainingFiles);
53
+ // } else {
54
+ // setFiles([...files, file])
55
+ // }
56
+ // };
57
+ // BILLING LINES
58
+ var handleBillingLinesDelete = function (index) {
59
+ var newDataSource = billingLinesDataSource.slice();
60
+ newDataSource.splice(index, 1);
61
+ setBillingLinesDataSource(newDataSource);
52
62
  };
53
- var handleAddFile = function (file) {
54
- if (file.status === "removed") {
55
- var remainingFiles = files.filter(function (existingFile) { return existingFile.uid !== file.uid; });
56
- setFiles(remainingFiles);
57
- }
58
- else {
59
- setFiles(files.concat([file]));
60
- }
63
+ var handleBillingLinesAdd = function () {
64
+ var newData = {
65
+ key: billingLinesEditableIndex,
66
+ itemNo: "Item No.",
67
+ quantity: 0,
68
+ taxAmount: 0,
69
+ name: "New Item",
70
+ unitOfMeasure: models_1.UnitOfMeasureMetadataUnitEnum.Piece,
71
+ unitPriceAmount: 0,
72
+ taxCategoryType: models_1.BillingLineMetadataTaxCategoryTypeEnum.StandardRated,
73
+ discountValue: "0",
74
+ taxableAmount: 0,
75
+ taxPercentage: null
76
+ };
77
+ setBillingLinesDataSource(billingLinesDataSource.concat([newData]));
78
+ setBillingLinesEditableIndex(billingLinesEditableIndex + 1);
61
79
  };
80
+ var handleBillingLinesSave = function (row, formInstance) {
81
+ var newData = billingLinesDataSource.slice();
82
+ var index = newData.findIndex(function (i) {
83
+ return row.key === i.key;
84
+ });
85
+ var item = newData[index];
86
+ newData.splice(index, 1, __assign({}, item, row));
87
+ var billingLineMetadata = newData.map(function (current) {
88
+ return __assign({}, current, { unitOfMeasure: {
89
+ unit: current.unitOfMeasure,
90
+ } });
91
+ });
92
+ setBillingLinesDataSource(newData);
93
+ handleSetBillingLineMetadata(formInstance, billingLineMetadata);
94
+ };
95
+ // END BILLING LINES
62
96
  var handleSetBillingLineMetadata = function (formInstance, billingLineMetadata) {
63
97
  formInstance.setFieldsValue({
64
98
  "billingLinesMetadata": billingLineMetadata
65
99
  });
66
100
  };
67
101
  var handleSubmit = function (values) {
68
- var invoiceMetadataInput = utils_1.convertToInvoiceMetadataInput(values, BillingLIneFormData_1.BillingLinesFieldsMetadata(form), props.customer);
102
+ var attachments = [
103
+ values.attachments.file1 && values.attachments.file1,
104
+ values.attachments.file2 && values.attachments.file2,
105
+ values.attachments.file3 && values.attachments.file3,
106
+ ];
107
+ // Clear the array of undefined
108
+ attachments = attachments.filter(function (attachment) { return attachment.file !== undefined; });
109
+ var billingLinesArray = form.getFieldValue("billingLinesMetadata");
110
+ if (!billingLinesArray || billingLinesArray.length <= 0) {
111
+ antd_1.message.error("Add at least one document line");
112
+ return;
113
+ }
114
+ var invoiceMetadataInput = utils_1.convertToInvoiceMetadataInput(values, BillingLineUtility_1.billingLinesFieldsMetadata(form), paymentMethodForConversion_1.PaymentMethodFormData(values), props.customer);
69
115
  var createSubmitInvoice = {
70
116
  invoiceMetadataInput: invoiceMetadataInput,
71
- more: files.length > 0,
117
+ more: attachments.length > 0,
72
118
  messageId: uuid_1.v4(),
73
- processingMode: mapi_1.TransactionProcessingMode.Device
119
+ processingMode: mapi_1.TransactionProcessingMode.DeviceRouted
74
120
  };
75
121
  utils_1.submitInvoice(createSubmitInvoice, props.mapiBaseUrl, props.apiKey, "submitInvoice", props.language)
76
122
  .then(function (resp) {
77
123
  antd_1.message.success("successfully submitted the invoice");
78
124
  var messageId = resp.data.uniqueId;
79
125
  var _loop_1 = function () {
80
- var nextFileArray = files.splice(0, 1);
81
- var nextFile = nextFileArray[0];
126
+ var nextFileArray = attachments.splice(0, 1);
127
+ var nextFile = nextFileArray[0].file[0].originFileObj;
128
+ var nextFileDescription = nextFileArray[0].description;
82
129
  var createAttachDocument = {
83
130
  messageId: messageId,
84
131
  contentType: nextFile.type,
85
- more: files.length > 0,
86
- name: nextFile.name,
132
+ more: attachments.length > 0,
133
+ name: nextFileDescription // nextFile.name,
87
134
  };
88
135
  utils_1.submitDocument(nextFile, createAttachDocument, props.mapiBaseUrl, props.apiKey)
89
136
  .then(function (submitDocumentResponse) {
90
- antd_1.message.success("successfully uploaded attachment " + nextFile.name);
137
+ antd_1.message.success("successfully uploaded attachment " + nextFileDescription);
91
138
  });
92
139
  };
93
- while (files.length > 0) {
140
+ while (attachments.length > 0) {
94
141
  _loop_1();
95
142
  }
143
+ form.resetFields();
144
+ // Clear the billing line dataSource
145
+ setBillingLinesDataSource([]);
146
+ setBillingLinesEditableIndex(0);
96
147
  })
97
148
  .catch(function (error) {
98
149
  antd_1.message.error(error.message);
@@ -109,25 +160,38 @@ var CreateInvoice = function (props) {
109
160
  }
110
161
  };
111
162
  return (react_1.default.createElement(antd_1.ConfigProvider, { locale: setLocale(props.language), componentSize: "small" },
112
- react_1.default.createElement(antd_1.Form, __assign({}, formItemLayout, { form: form, onFinish: handleSubmit, initialValues: { abc: "abc" } }),
113
- react_1.default.createElement("h1", null, "Invoice"),
163
+ react_1.default.createElement(antd_1.Form, __assign({}, formLayout_1.formItemLayout, { form: form, onFinish: handleSubmit, initialValues: {
164
+ invoice: {
165
+ currencyCode: "ISK",
166
+ supplier: {
167
+ address: {
168
+ countryCode: "IS"
169
+ }
170
+ },
171
+ customer: {
172
+ address: {
173
+ countryCode: "IS"
174
+ }
175
+ }
176
+ }
177
+ } }),
114
178
  react_1.default.createElement(antd_1.Row, { gutter: [16, 16] },
115
- react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
116
- react_1.default.createElement(components_1.Supplier, null)),
117
- react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
118
- react_1.default.createElement(components_1.DeliveryLocation, null)),
119
- react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
120
- react_1.default.createElement(components_1.Customer, { customer: props.customer })),
121
- react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
179
+ react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 } },
180
+ react_1.default.createElement(components_1.Supplier, { billingLinesDataSource: billingLinesDataSource })),
181
+ react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 } },
182
+ react_1.default.createElement(components_1.Customer, null)),
183
+ react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 } },
122
184
  react_1.default.createElement(components_1.BaseInformation, { form: form, documentType: "invoice" })),
123
- react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 }, xl: { span: 16 } },
124
- react_1.default.createElement(components_1.BillingLines, { setBillingLineMetadata: handleSetBillingLineMetadata, formInstance: form })),
125
- react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 8 }, xl: { span: 8 } },
185
+ react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 } },
186
+ react_1.default.createElement(components_1.DeliveryLocation, null)),
187
+ react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 } },
188
+ react_1.default.createElement(components_1.BillingLines, { setBillingLineMetadata: handleSetBillingLineMetadata, formInstance: form, dataSource: billingLinesDataSource, editableIndex: billingLinesEditableIndex, handleAdd: handleBillingLinesAdd, handleDelete: handleBillingLinesDelete, handleSave: handleBillingLinesSave })),
189
+ react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 8 } },
126
190
  react_1.default.createElement(components_1.PaymentMethod, null)),
127
- react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 16 }, xl: { span: 16 } },
128
- react_1.default.createElement(components_1.Attachments, { handleAddFile: handleAddFile })),
191
+ react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 16 } },
192
+ react_1.default.createElement(components_1.Attachments /*handleAddFile={handleAddFile}*/, null)),
129
193
  react_1.default.createElement(antd_1.Col, { span: 24 },
130
194
  react_1.default.createElement(antd_1.Form.Item, null,
131
- react_1.default.createElement(antd_1.Button, { type: "primary", htmlType: "submit" }, "Submit")))))));
195
+ react_1.default.createElement(antd_1.Button, { type: "primary", htmlType: "submit" }, "Senda")))))));
132
196
  };
133
197
  exports.default = CreateInvoice;
@@ -1,9 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import '@ant-design/compatible/assets/index.css';
3
- import { UploadFile } from "antd/lib/upload/interface";
4
- interface Props {
5
- fieldName: string;
6
- handleAddFile: (file: UploadFile) => void;
3
+ import { InjectedIntlProps } from "react-intl";
4
+ interface Props extends InjectedIntlProps {
5
+ fieldName: "file1" | "file2" | "file3";
7
6
  }
8
7
  interface States {
9
8
  file: any[];
@@ -14,5 +13,7 @@ declare class Attachment extends React.Component<Props, States> {
14
13
  normFile: (e: any) => any;
15
14
  render(): JSX.Element;
16
15
  }
17
- declare const _default: React.MemoExoticComponent<typeof Attachment>;
16
+ declare const _default: React.ComponentClass<Pick<Props & React.RefAttributes<Attachment>, "ref" | "key" | "fieldName">, any> & {
17
+ WrappedComponent: React.ComponentType<Props & React.RefAttributes<Attachment> & InjectedIntlProps>;
18
+ };
18
19
  export default _default;
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
- import { UploadFile } from "antd/lib/upload/interface";
3
- interface Props {
4
- handleAddFile: (file: UploadFile) => void;
5
- }
6
- declare const AttachmentsGroup: React.FC<Props>;
7
- export default AttachmentsGroup;
2
+ import { InjectedIntlProps } from "react-intl";
3
+ declare const AttachmentGroupIntl: React.ComponentClass<Pick<InjectedIntlProps, never>, any> & {
4
+ WrappedComponent: React.ComponentType<InjectedIntlProps>;
5
+ };
6
+ export default AttachmentGroupIntl;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { InjectedIntlProps } from "react-intl";
3
+ import { StoreValue } from "rc-field-form/lib/interface";
4
+ interface FieldData {
5
+ name: number;
6
+ key: number;
7
+ fieldKey: number;
8
+ }
9
+ interface Props extends InjectedIntlProps {
10
+ fields: FieldData[];
11
+ add: (defaultValue?: StoreValue) => void;
12
+ remove: (index: number) => void;
13
+ }
14
+ declare const _default: React.ComponentClass<Pick<Props, "remove" | "fields" | "add">, any> & {
15
+ WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
16
+ };
17
+ export default _default;
@@ -1,9 +1,12 @@
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
- interface Props {
4
+ import { InjectedIntlProps } from "react-intl";
5
+ interface Props extends InjectedIntlProps {
5
6
  form: FormInstance;
6
7
  documentType: "creditNote" | "invoice";
7
8
  }
8
- declare const BaseInformation: React.FC<Props>;
9
- export default BaseInformation;
9
+ declare const BaseInformationIntl: React.ComponentClass<Pick<Props, "form" | "documentType">, any> & {
10
+ WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
11
+ };
12
+ export default BaseInformationIntl;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOverride";
3
+ import { InjectedIntlProps } from "react-intl";
4
+ interface Props extends InjectedIntlProps {
5
+ billingLinesMetadata: BillingLineMetadataOverride[] | undefined;
6
+ renderCurrencyColumn: (text: string | number) => string;
7
+ }
8
+ declare const _default: React.ComponentClass<Pick<Props, "billingLinesMetadata" | "renderCurrencyColumn">, any> & {
9
+ WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
10
+ };
11
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOverride";
3
+ import { InjectedIntlProps } from "react-intl";
4
+ interface Props extends InjectedIntlProps {
5
+ billingLines: BillingLineMetadataOverride[] | undefined;
6
+ }
7
+ declare const _default: React.ComponentClass<Pick<Props, "billingLines">, any> & {
8
+ WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
9
+ };
10
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { InjectedIntlProps } from "react-intl";
3
+ import { FormInstance } from "antd/es/form";
4
+ interface Props extends InjectedIntlProps {
5
+ formInstance: FormInstance;
6
+ }
7
+ declare const _default: React.ComponentClass<Pick<Props, "formInstance">, any> & {
8
+ WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
9
+ };
10
+ export default _default;
@@ -1,27 +1,19 @@
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 { InjectedIntlProps } from "react-intl";
4
5
  import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOverride";
5
6
  import { FormInstance } from "antd/es/form";
6
- import { ColumnType } from 'antd/es/table';
7
- interface EditableColumnProps<T> extends ColumnType<T> {
8
- editable?: boolean;
9
- }
10
- interface Props {
7
+ interface Props extends InjectedIntlProps {
11
8
  formInstance: FormInstance;
12
9
  setBillingLineMetadata: (formInstance: FormInstance, billingLineMetadata: BillingLineMetadata[]) => void;
13
- }
14
- interface States {
15
10
  dataSource: BillingLineMetadataOverride[];
16
- editableIndex: number;
17
- }
18
- declare class BillingLines extends React.Component<Props, States> {
19
- columns: EditableColumnProps<BillingLineMetadataOverride>[];
20
- constructor(props: Props);
21
- renderCurrencyColumn: (text: string) => string;
22
11
  handleDelete: (index: number) => void;
23
12
  handleAdd: () => void;
24
13
  handleSave: (row: BillingLineMetadataOverride, formInstance: FormInstance) => void;
25
- render(): JSX.Element;
14
+ editableIndex: number;
26
15
  }
27
- export default BillingLines;
16
+ declare const BillingLinesIntl: React.ComponentClass<Pick<Props, "formInstance" | "setBillingLineMetadata" | "dataSource" | "handleDelete" | "handleAdd" | "handleSave" | "editableIndex">, any> & {
17
+ WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
18
+ };
19
+ export default BillingLinesIntl;
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
- import { wapi2 } from "@unimaze/api-clients";
3
- interface Props {
4
- customer: wapi2.ProfileOutput;
5
- }
6
- declare const Customer: React.FC<Props>;
7
- export default Customer;
2
+ import { InjectedIntlProps } from "react-intl";
3
+ declare const CustomerIntl: React.ComponentClass<Pick<InjectedIntlProps, never>, any> & {
4
+ WrappedComponent: React.ComponentType<InjectedIntlProps>;
5
+ };
6
+ export default CustomerIntl;
@@ -1,3 +1,6 @@
1
1
  import * as React from 'react';
2
- declare const DeliveryLocation: React.FC;
3
- export default DeliveryLocation;
2
+ import { InjectedIntlProps } from "react-intl";
3
+ declare const DeliveryLocationIntl: React.ComponentClass<Pick<InjectedIntlProps, never>, any> & {
4
+ WrappedComponent: React.ComponentType<InjectedIntlProps>;
5
+ };
6
+ export default DeliveryLocationIntl;
@@ -1,18 +1,23 @@
1
1
  import React from 'react';
2
- import { AvailableFields, ReceiverRequirements } from "../../types/ReceiverRequirements";
3
- import { Rule } from "rc-field-form/lib/interface";
2
+ import { AvailableFields } from "../../types/ReceiverRequirements";
3
+ import { NamePath, Rule } from "rc-field-form/lib/interface";
4
+ import { InjectedIntlProps } from "react-intl";
4
5
  interface StringMap {
5
6
  [key: string]: string;
6
7
  }
7
- interface Props {
8
- receiverRequirements: ReceiverRequirements;
8
+ interface Props extends InjectedIntlProps {
9
9
  receiverRequirementsKey: AvailableFields;
10
10
  defaultLabel: React.ReactNode;
11
11
  defaultIsRequired: boolean;
12
- fieldName: string | string[];
12
+ fieldName: NamePath;
13
13
  additionalRules?: Rule[];
14
14
  style?: React.CSSProperties;
15
15
  initialValue?: StringMap;
16
+ verticalLabels?: boolean;
17
+ onlyLabelOnFirstInList?: boolean;
18
+ index?: number;
16
19
  }
17
- declare const FormItem: React.FC<Props>;
18
- export default FormItem;
20
+ declare const _default: React.ComponentClass<Pick<Props, "style" | "initialValue" | "fieldName" | "receiverRequirementsKey" | "defaultLabel" | "defaultIsRequired" | "additionalRules" | "verticalLabels" | "onlyLabelOnFirstInList" | "index">, any> & {
21
+ WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
22
+ };
23
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import "moment/locale/is";
3
+ import "moment/locale/sr";
4
+ interface IHotSwappingIntlProviderOwnProps {
5
+ initialLocale: string;
6
+ initialMessages: any;
7
+ languageString?: string;
8
+ }
9
+ declare const HotIntlProvider: React.FC<IHotSwappingIntlProviderOwnProps>;
10
+ export default HotIntlProvider;
@@ -1,3 +1,6 @@
1
- /// <reference types="react" />
2
- declare const PaymentMethod: () => JSX.Element;
3
- export default PaymentMethod;
1
+ import React from 'react';
2
+ import { InjectedIntlProps } from "react-intl";
3
+ declare const _default: React.ComponentClass<Pick<InjectedIntlProps, never>, any> & {
4
+ WrappedComponent: React.ComponentType<InjectedIntlProps>;
5
+ };
6
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { PaymentMeansType } from "@unimaze/api-clients/lib/mapi";
2
+ import { TransferMetadata, ClaimMetadata } from '@unimaze/api-clients/lib/mapi/models';
3
+ import { Store } from 'antd/es/form/interface';
4
+ export interface IPaymentMeans {
5
+ type: PaymentMeansType;
6
+ domesticTransfer?: TransferMetadata | undefined;
7
+ domesticClaim?: ClaimMetadata | undefined;
8
+ }
9
+ export declare const PaymentMethodFormData: (formData: Store) => IPaymentMeans;
@@ -1,3 +1,10 @@
1
1
  import * as React from 'react';
2
- declare const Supplier: React.FC;
3
- export default Supplier;
2
+ import { InjectedIntlProps } from "react-intl";
3
+ import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOverride";
4
+ interface Props extends InjectedIntlProps {
5
+ billingLinesDataSource: BillingLineMetadataOverride[];
6
+ }
7
+ declare const SupplierIntl: React.ComponentClass<Pick<Props, "billingLinesDataSource">, any> & {
8
+ WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
9
+ };
10
+ export default SupplierIntl;
@@ -0,0 +1,44 @@
1
+ declare const formItemLayout: {
2
+ labelCol: {
3
+ xs: {
4
+ span: number;
5
+ };
6
+ sm: {
7
+ span: number;
8
+ };
9
+ };
10
+ wrapperCol: {
11
+ xs: {
12
+ span: number;
13
+ };
14
+ sm: {
15
+ span: number;
16
+ };
17
+ };
18
+ };
19
+ declare const formItemVerticalLayout: {
20
+ labelCol: {
21
+ span: number;
22
+ };
23
+ wrapperCol: {
24
+ span: number;
25
+ };
26
+ };
27
+ declare const fullWidthInput: {
28
+ wrapperCol: {
29
+ span: number;
30
+ };
31
+ };
32
+ declare const formItemLayoutWithOutLabel: {
33
+ wrapperCol: {
34
+ xs: {
35
+ span: number;
36
+ offset: number;
37
+ };
38
+ sm: {
39
+ span: number;
40
+ offset: number;
41
+ };
42
+ };
43
+ };
44
+ export { formItemLayout, formItemVerticalLayout, fullWidthInput, formItemLayoutWithOutLabel };
@@ -55,7 +55,7 @@ export declare enum AvailableFields {
55
55
  "invoiceLines.quantity" = "invoiceLines.quantity",
56
56
  "invoiceLines.uniteOfMeasure.unit" = "invoiceLines.unitOfMeasure.unit",
57
57
  "invoiceLines.uniteOfMeasure.code" = "invoiceLines.unitOfMeasure.code",
58
- "invoiceLines.priceAmount" = "invoiceLines.priceAmount",
58
+ "invoiceLines.unitPriceAmount" = "invoiceLines.unitPriceAmount",
59
59
  "invoiceLines.taxCategoryType" = "invoiceLines.taxCategoryType",
60
60
  "invoiceLines.taxableAmount" = "invoiceLines.taxableAmount",
61
61
  "invoiceLines.taxAmount" = "invoiceLines.taxAmount",
@@ -0,0 +1,77 @@
1
+ declare const _default: {
2
+ en: {};
3
+ is: {
4
+ "attachment_labels_Reference": string;
5
+ "attachment_labels_Reference_requiredMessage": string;
6
+ "attachment_labels_Description": string;
7
+ "attachment_labels_Description_requiredMessage": string;
8
+ "attachment_labels_File": string;
9
+ "attachment_title": string;
10
+ "baseInformation_title": string;
11
+ "baseInformation_invoiceNo": string;
12
+ "baseInformation_issueDate": string;
13
+ "baseInformation_dueDate": string;
14
+ "baseInformation_orderReference_documentNo": string;
15
+ "baseInformation_notes": string;
16
+ "baseInformation_currencyCode": string;
17
+ "billingCalculations_labels_TaxAmountWithoutVat": string;
18
+ "billingCalculations_labels_TotalVatAmount": string;
19
+ "billingCalculations_labels_TotalAmountWithVat": string;
20
+ "billingTaxSummary_taxOverview": string;
21
+ "billingTaxSummary_taxableAmount": string;
22
+ "billingTaxSummary_taxAmount": string;
23
+ "billingLines_title": string;
24
+ "billingLines_itemNo": string;
25
+ "billingLines_name": string;
26
+ "billingLines_quantity": string;
27
+ "billingLines_unitOfMeasure": string;
28
+ "billingLines_unitPriceAmount": string;
29
+ "billingLines_taxCategoryType": string;
30
+ "billingLines_taxCategoryPercentage": string;
31
+ "billingLines_discount": string;
32
+ "billingLines_lineAmount": string;
33
+ "billingLines_taxAmount": string;
34
+ "billingLines_button_addRow": string;
35
+ "deliveryLocation_title": string;
36
+ "deliveryLocation_partyName": string;
37
+ "deliveryLocation_streetNameAndNumber": string;
38
+ "deliveryLocation_postalZone": string;
39
+ "deliveryLocation_city": string;
40
+ "deliveryLocation_countryCode": string;
41
+ "formItem_required_errorMessage": string;
42
+ "paymentMethod_labels_domesticTransfer_bankNo": string;
43
+ "paymentMethod_labels_domesticTransfer_typeNo": string;
44
+ "paymentMethod_labels_domesticTransfer_accountNo": string;
45
+ "paymentMethod_labels_domesticTransfer_paymentReference": string;
46
+ "paymentMethod_labels_icelandicClaim_bankNo": string;
47
+ "paymentMethod_labels_icelandicClaim_claimNo": string;
48
+ "paymentMethod_labels_methods_undefined": string;
49
+ "paymentMethod_labels_methods_mutuallyAgreed": string;
50
+ "paymentMethod_labels_methods_domesticTransfer": string;
51
+ "paymentMethod_labels_methods_domesticClaim": string;
52
+ "paymentMethod_rulles_number": string;
53
+ "supplier_title": string;
54
+ "supplier_name": string;
55
+ "supplier_identifier": string;
56
+ "supplier_vatNumber": string;
57
+ "supplier_address_streetNameAndNumber": string;
58
+ "supplier_address_zip_postalCode": string;
59
+ "supplier_address_city": string;
60
+ "supplier_address_countryCode": string;
61
+ "supplier_contact_email": string;
62
+ "supplier_contact_name": string;
63
+ "supplier_notValidEmail": string;
64
+ "customer_title": string;
65
+ "customer_name": string;
66
+ "customer_identifier": string;
67
+ "customer_address_streetNameAndNumber": string;
68
+ "customer_address_zip_postalCode": string;
69
+ "customer_address_city": string;
70
+ "customer_address_countryCode": string;
71
+ "customer_contact_email": string;
72
+ "customer_contact_name": string;
73
+ "referenceIdentifiers_labels_addButton": string;
74
+ "referenceIdentifiers_labels_referenceIdentifier": string;
75
+ };
76
+ };
77
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { BillingLineMetadata } from '@unimaze/api-clients/lib/mapi';
2
+ import { FormInstance } from "antd/es/form";
3
+ import { TaxCategoryTypeEnum } from "@unimaze/api-clients/lib/mapi/api";
4
+ import React from "react";
5
+ export declare const billingLinesFieldsMetadata: (formInstance: FormInstance) => BillingLineMetadata[];
6
+ export declare const calculateTaxableAmount: (discountValue: string | null | undefined, quantity: number | null, unitPriceAmount: number | null) => number;
7
+ export declare const calculateTaxAmount: (taxableAmount: number, taxPercentage: number) => number;
8
+ export declare const calculateTaxPercentage: (taxCategoryType: TaxCategoryTypeEnum) => number;
9
+ export declare const generateTaxCategoryLabel: (taxCategoryType: TaxCategoryTypeEnum) => string;
10
+ export declare const getCorrectInputNode: (dataIdx: "unitOfMeasure" | "itemNo" | "name" | "description" | "quantity" | "unitPriceAmount" | "taxCategoryType" | "taxableAmount" | "taxAmount" | "taxPercentage" | "discountValue" | "discountReason" | "notes" | "accountingCost" | "billingPeriod" | "buyersItemNo" | "standardItemNo" | "originCountryCode" | "commodityClassification" | "additionalItemProperties" | "referenceIdentifiers" | "orderLineReference" | "key") => React.ReactChild;
@@ -1,6 +1,6 @@
1
- import { InvoiceMetadataInput } from "@unimaze/api-clients/lib/mapi";
1
+ import { BillingLineMetadata, InvoiceMetadataInput } from "@unimaze/api-clients/lib/mapi";
2
2
  import { Store } from "antd/es/form/interface";
3
3
  import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
4
- import { IBillingLinesMetadata } from "../common/components/billing-lines/BillingLIneFormData";
5
- declare const convertToInvoiceMetadataInput: (formValues: Store, billingLines: IBillingLinesMetadata, customer: ProfileOutput) => InvoiceMetadataInput;
6
- export { /*convertToCreditNoteMetadataInput,*/ convertToInvoiceMetadataInput };
4
+ import { PaymentMeansMetadata } from "@unimaze/api-clients/lib/mapi/api";
5
+ declare const convertToInvoiceMetadataInput: (formValues: Store, billingLines: BillingLineMetadata[], paymentMethod: PaymentMeansMetadata, customer?: ProfileOutput | undefined) => InvoiceMetadataInput;
6
+ export { convertToInvoiceMetadataInput };