@unimaze/billing 0.1.2-rc.10 → 0.1.2-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +3 -11
  2. package/lib/common/components/attachments/Attachment.d.ts +2 -8
  3. package/lib/common/components/attachments/Attachment.js +8 -33
  4. package/lib/common/components/attachments/index.d.ts +2 -9
  5. package/lib/common/components/attachments/index.js +6 -15
  6. package/lib/common/components/base-information/index.d.ts +3 -6
  7. package/lib/common/components/base-information/index.js +81 -100
  8. package/lib/common/components/billing-lines/index.d.ts +23 -9
  9. package/lib/common/components/billing-lines/index.js +38 -116
  10. package/lib/common/components/delivery-location/index.d.ts +2 -5
  11. package/lib/common/components/delivery-location/index.js +11 -43
  12. package/lib/common/components/editable-cell/index.d.ts +1 -1
  13. package/lib/common/components/editable-cell/index.js +10 -76
  14. package/lib/common/components/editable-row/index.d.ts +5 -5
  15. package/lib/common/components/editable-row/index.js +6 -8
  16. package/lib/common/components/index.d.ts +5 -10
  17. package/lib/common/components/index.js +8 -20
  18. package/lib/common/components/issuer/index.d.ts +7 -0
  19. package/lib/common/components/{customer/hardCoddedCustomer.js → issuer/index.js} +8 -5
  20. package/lib/common/components/payer/index.d.ts +3 -0
  21. package/lib/common/components/payer/index.js +50 -0
  22. package/lib/common/components/payment-method/index.d.ts +3 -6
  23. package/lib/common/components/payment-method/index.js +17 -57
  24. package/lib/common/consts/validationRules.d.ts +3 -2
  25. package/lib/common/consts/validationRules.js +7 -0
  26. package/lib/common/enums/index.d.ts +1 -1
  27. package/lib/common/enums/index.js +4 -2
  28. package/lib/common/types/BillingLineMetadataOverride.d.ts +0 -1
  29. package/lib/create-credit-note/index.d.ts +2 -1
  30. package/lib/create-credit-note/index.js +14 -6
  31. package/lib/create-invoice/index.d.ts +2 -1
  32. package/lib/create-invoice/index.js +21 -79
  33. package/lib/example/src/index.d.ts +1 -1
  34. package/lib/index.js +0 -5
  35. package/lib/src/common/components/attachments/Attachment.d.ts +2 -8
  36. package/lib/src/common/components/attachments/index.d.ts +2 -9
  37. package/lib/src/common/components/base-information/index.d.ts +3 -6
  38. package/lib/src/common/components/billing-lines/index.d.ts +23 -9
  39. package/lib/src/common/components/delivery-location/index.d.ts +2 -5
  40. package/lib/src/common/components/editable-cell/index.d.ts +1 -1
  41. package/lib/src/common/components/editable-row/index.d.ts +5 -5
  42. package/lib/src/common/components/issuer/index.d.ts +7 -0
  43. package/lib/src/common/components/payer/index.d.ts +3 -0
  44. package/lib/src/common/components/payment-method/index.d.ts +3 -6
  45. package/lib/src/common/consts/validationRules.d.ts +3 -2
  46. package/lib/src/create-credit-note/index.d.ts +9 -0
  47. package/lib/src/create-invoice/index.d.ts +2 -1
  48. package/lib/src/index.d.ts +4 -0
  49. package/lib/style/index.css +1222 -0
  50. package/lib/utils/ApiUtility.d.ts +1 -8
  51. package/lib/utils/ApiUtility.js +1 -17
  52. package/lib/utils/ConversionUtility.d.ts +4 -5
  53. package/lib/utils/ConversionUtility.js +133 -121
  54. package/lib/utils/index.d.ts +2 -2
  55. package/lib/utils/index.js +2 -2
  56. package/package.json +7 -12
  57. package/lib/common/components/base-information/ReferenceIdentifiers.d.ts +0 -6
  58. package/lib/common/components/base-information/ReferenceIdentifiers.js +0 -40
  59. package/lib/common/components/billing-lines/BillingCalculations.d.ts +0 -11
  60. package/lib/common/components/billing-lines/BillingCalculations.js +0 -61
  61. package/lib/common/components/billing-lines/BillingTaxSummary.d.ts +0 -10
  62. package/lib/common/components/billing-lines/BillingTaxSummary.js +0 -51
  63. package/lib/common/components/billing-lines/billingLIneFormData.d.ts +0 -7
  64. package/lib/common/components/billing-lines/billingLIneFormData.js +0 -63
  65. package/lib/common/components/customer/hardCoddedCustomer.d.ts +0 -7
  66. package/lib/common/components/customer/index.d.ts +0 -6
  67. package/lib/common/components/customer/index.js +0 -93
  68. package/lib/common/components/form-item/index.d.ts +0 -21
  69. package/lib/common/components/form-item/index.js +0 -27
  70. package/lib/common/components/locale-intl/index.d.ts +0 -10
  71. package/lib/common/components/locale-intl/index.js +0 -45
  72. package/lib/common/components/supplier/index.d.ts +0 -6
  73. package/lib/common/components/supplier/index.js +0 -93
  74. package/lib/common/types/ReceiverRequirements.d.ts +0 -81
  75. package/lib/common/types/ReceiverRequirements.js +0 -379
  76. package/lib/src/common/components/base-information/ReferenceIdentifiers.d.ts +0 -6
  77. package/lib/src/common/components/billing-lines/BillingCalculations.d.ts +0 -11
  78. package/lib/src/common/components/billing-lines/BillingTaxSummary.d.ts +0 -10
  79. package/lib/src/common/components/billing-lines/billingLIneFormData.d.ts +0 -7
  80. package/lib/src/common/components/customer/index.d.ts +0 -6
  81. package/lib/src/common/components/form-item/index.d.ts +0 -21
  82. package/lib/src/common/components/index.d.ts +0 -10
  83. package/lib/src/common/components/locale-intl/index.d.ts +0 -10
  84. package/lib/src/common/components/supplier/index.d.ts +0 -6
  85. package/lib/src/common/types/ReceiverRequirements.d.ts +0 -81
  86. package/lib/src/translations/locales.d.ts +0 -74
  87. package/lib/src/utils/ApiUtility.d.ts +0 -21
  88. package/lib/src/utils/BillingLineUtility.d.ts +0 -8
  89. package/lib/src/utils/ConversionUtility.d.ts +0 -5
  90. package/lib/src/utils/RequirementsUtility.d.ts +0 -5
  91. package/lib/src/utils/billingLineFormData.d.ts +0 -7
  92. package/lib/src/utils/index.d.ts +0 -2
  93. package/lib/translations/locales/is.json +0 -70
  94. package/lib/translations/locales.d.ts +0 -74
  95. package/lib/translations/locales.js +0 -10
  96. package/lib/utils/BillingLineUtility.d.ts +0 -8
  97. package/lib/utils/BillingLineUtility.js +0 -66
  98. package/lib/utils/RequirementsUtility.d.ts +0 -5
  99. package/lib/utils/RequirementsUtility.js +0 -23
  100. package/lib/utils/billingLineFormData.d.ts +0 -7
  101. package/lib/utils/billingLineFormData.js +0 -63
package/README.md CHANGED
@@ -1,21 +1,13 @@
1
- - # README #
2
-
3
- ## Peer dependencies ##
4
- - "antd": "4.3.3",
5
- - "axios": "^0.19.2",
6
- - "react": "16.13.1",
7
- - "react-dom": "16.13.1",
8
- - "react-intl": "^2.9.0",
9
- - "react-intl.macro": "^0.3.7"
1
+ # README #
10
2
 
11
3
  ## Components ##
12
- ### `<CreateInvoice />` ###
4
+ ### `<CreateInvoice>` ###
13
5
 
14
6
  Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
15
7
 
16
8
  |Property |Description |Type |Default |
17
9
  |:----------------------|:------------------------------------------------------|:------------------------------------------------------|:----------|
18
- |customer |Sets the Invoice customer |Object `ProfileOutput` | |
10
+ |issuer |Sets the Invoice issuer |Object `ProfileOutput` | |
19
11
  |language |Sets the language of the component |`en` `is` `pl` `undefined` |`en` |
20
12
  |mapiBaseUrl |Url of the MAPI |string | |
21
13
  |rapiBaseUrl |Url of the RAPI |string | |
@@ -1,10 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import '@ant-design/compatible/assets/index.css';
3
- import { UploadFile } from "antd/lib/upload/interface";
4
- import { InjectedIntlProps } from "react-intl";
5
- interface Props extends InjectedIntlProps {
3
+ interface Props {
6
4
  fieldName: string;
7
- handleAddFile: (file: UploadFile) => void;
8
5
  }
9
6
  interface States {
10
7
  file: any[];
@@ -15,7 +12,4 @@ declare class Attachment extends React.Component<Props, States> {
15
12
  normFile: (e: any) => any;
16
13
  render(): JSX.Element;
17
14
  }
18
- declare const _default: React.ComponentClass<Pick<Props & React.RefAttributes<Attachment>, "key" | "ref" | "fieldName" | "handleAddFile">, any> & {
19
- WrappedComponent: React.ComponentType<Props & React.RefAttributes<Attachment> & InjectedIntlProps>;
20
- };
21
- export default _default;
15
+ export default Attachment;
@@ -34,29 +34,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
34
34
  var React = __importStar(require("react"));
35
35
  require("@ant-design/compatible/assets/index.css");
36
36
  var antd_1 = require("antd");
37
- var react_intl_1 = require("react-intl");
38
- var translationMessages = react_intl_1.defineMessages({
39
- attachment_labels_Reference: {
40
- id: "attachment_labels_Reference",
41
- defaultMessage: "Reference",
42
- },
43
- attachment_labels_Reference_requiredMessage: {
44
- id: "attachment_labels_Reference_requiredMessage",
45
- defaultMessage: "Please input the reference",
46
- },
47
- attachment_labels_Description: {
48
- id: "attachment_labels_Description",
49
- defaultMessage: "Description",
50
- },
51
- attachment_labels_Description_requiredMessage: {
52
- id: "attachment_labels_Description_requiredMessage",
53
- defaultMessage: "Please input the description",
54
- },
55
- attachment_labels_File: {
56
- id: "attachment_labels_File",
57
- defaultMessage: "File",
58
- },
59
- });
60
37
  var Attachment = /** @class */ (function (_super) {
61
38
  __extends(Attachment, _super);
62
39
  function Attachment(props) {
@@ -77,27 +54,25 @@ var Attachment = /** @class */ (function (_super) {
77
54
  return _this;
78
55
  }
79
56
  Attachment.prototype.render = function () {
80
- var _this = this;
81
57
  return (React.createElement(React.Fragment, null,
82
- React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, label: this.props.intl.formatMessage(translationMessages.attachment_labels_Reference), name: "attachment:" + this.props.fieldName + ":reference", rules: [
58
+ React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, label: "Reference", name: "attachment:" + this.props.fieldName + ":reference", rules: [
83
59
  {
84
60
  required: this.state.file.length > 0,
85
- message: this.props.intl.formatMessage(translationMessages.attachment_labels_Reference_requiredMessage),
61
+ message: 'Please input the reference',
86
62
  }
87
63
  ] },
88
64
  React.createElement(antd_1.Input, null)),
89
- React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, label: this.props.intl.formatMessage(translationMessages.attachment_labels_Description), name: "attachment:" + this.props.fieldName + ":description", rules: [
65
+ React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, label: "Description", name: "attachment:" + this.props.fieldName + ":description", rules: [
90
66
  {
91
67
  required: this.state.file.length > 0,
92
- message: this.props.intl.formatMessage(translationMessages.attachment_labels_Description_requiredMessage),
68
+ message: 'Please input the description',
93
69
  }
94
70
  ] },
95
71
  React.createElement(antd_1.Input, null)),
96
- React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, label: this.props.intl.formatMessage(translationMessages.attachment_labels_File), name: "attachment:" + this.props.fieldName, valuePropName: "fileList", getValueFromEvent: this.normFile },
97
- React.createElement(antd_1.Upload.Dragger, { name: "attachment:" + this.props.fieldName, multiple: false, onRemove: this.handleRemoveFile, beforeUpload: function () { return false; }, onChange: function (info) {
98
- _this.props.handleAddFile(info.file);
99
- } }))));
72
+ React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, label: "File", name: "attachment:" + this.props.fieldName, valuePropName: "fileList", getValueFromEvent: this.normFile },
73
+ React.createElement(antd_1.Upload.Dragger, { name: "attachment:" + this.props.fieldName, multiple: false, onRemove: this.handleRemoveFile }),
74
+ ",")));
100
75
  };
101
76
  return Attachment;
102
77
  }(React.Component));
103
- exports.default = react_intl_1.injectIntl(React.memo(Attachment));
78
+ exports.default = Attachment;
@@ -1,10 +1,3 @@
1
1
  import * as React from 'react';
2
- import { UploadFile } from "antd/lib/upload/interface";
3
- import { InjectedIntlProps } from "react-intl";
4
- interface Props extends InjectedIntlProps {
5
- handleAddFile: (file: UploadFile) => void;
6
- }
7
- declare const AttachmentGroupIntl: React.ComponentClass<Pick<Props, "handleAddFile">, any> & {
8
- WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
9
- };
10
- export default AttachmentGroupIntl;
2
+ declare const AttachmentsGroup: React.FC;
3
+ export default AttachmentsGroup;
@@ -11,21 +11,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  var React = __importStar(require("react"));
14
- var components_1 = require("../../components");
14
+ var component_container_1 = __importDefault(require("../component-container"));
15
15
  var Attachment_1 = __importDefault(require("./Attachment"));
16
- var react_intl_1 = require("react-intl");
17
- var translationMessages = react_intl_1.defineMessages({
18
- attachment_title: {
19
- id: "attachment.title",
20
- defaultMessage: "Attachments",
21
- },
22
- });
23
16
  var AttachmentsGroup = function (props) {
24
- var handleAddFile = props.handleAddFile;
25
- return (React.createElement(components_1.ComponentContainer, { title: props.intl.formatMessage(translationMessages.attachment_title) },
26
- React.createElement(Attachment_1.default, { handleAddFile: handleAddFile, fieldName: "file1" }),
27
- React.createElement(Attachment_1.default, { handleAddFile: handleAddFile, fieldName: "file2" }),
28
- React.createElement(Attachment_1.default, { handleAddFile: handleAddFile, fieldName: "file3" })));
17
+ return (React.createElement(component_container_1.default, { title: "Attachments" },
18
+ React.createElement(Attachment_1.default, { fieldName: "file1" }),
19
+ React.createElement(Attachment_1.default, { fieldName: "file2" }),
20
+ React.createElement(Attachment_1.default, { fieldName: "file3" })));
29
21
  };
30
- var AttachmentGroupIntl = react_intl_1.injectIntl(AttachmentsGroup);
31
- exports.default = AttachmentGroupIntl;
22
+ exports.default = AttachmentsGroup;
@@ -1,12 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import '@ant-design/compatible/assets/index.css';
3
3
  import { FormInstance } from "antd/es/form";
4
- import { InjectedIntlProps } from "react-intl";
5
- interface Props extends InjectedIntlProps {
4
+ interface Props {
6
5
  form: FormInstance;
7
6
  documentType: "creditNote" | "invoice";
8
7
  }
9
- declare const BaseInformationIntl: React.ComponentClass<Pick<Props, "form" | "documentType">, any> & {
10
- WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
11
- };
12
- export default BaseInformationIntl;
8
+ declare const BaseInformation: React.FC<Props>;
9
+ export default BaseInformation;
@@ -11,121 +11,102 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  var React = __importStar(require("react"));
14
- var components_1 = require("../../components");
14
+ var component_container_1 = __importDefault(require("../component-container"));
15
15
  require("@ant-design/compatible/assets/index.css");
16
16
  var antd_1 = require("antd");
17
- var form_item_1 = __importDefault(require("../form-item"));
18
- var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
19
- var react_intl_1 = require("react-intl");
20
- var translationMessages = react_intl_1.defineMessages({
21
- baseInformation_title: {
22
- id: "baseInformation_title",
23
- defaultMessage: "Base Information",
24
- },
25
- baseInformation_invoiceNo: {
26
- id: "baseInformation_invoiceNo",
27
- defaultMessage: "Invoice No",
28
- },
29
- baseInformation_issueDate: {
30
- id: "baseInformation_issueDate",
31
- defaultMessage: "Issue date"
32
- },
33
- baseInformation_dueDate: {
34
- id: "baseInformation_dueDate",
35
- defaultMessage: "Due date"
36
- },
37
- baseInformation_orderReference_documentNo: {
38
- id: "baseInformation_orderReference_documentNo",
39
- defaultMessage: "Order no"
40
- },
41
- baseInformation_notes: {
42
- id: "baseInformation_notes",
43
- defaultMessage: "Notes"
44
- },
45
- baseInformation_currencyCode: {
46
- id: "baseInformation_currencyCode",
47
- defaultMessage: "Currency"
48
- }
49
- });
50
17
  var BaseInformation = function (props) {
51
- var getCurrencies = function (recRequirements) {
52
- var currencies = [
53
- {
54
- key: "ISK",
55
- label: "Icelandic krona (ISK)"
56
- },
57
- {
58
- key: "DKK",
59
- label: "Danish krona (DKK)"
60
- },
61
- {
62
- key: "NOK",
63
- label: "Norwegian krona (NOK)"
64
- },
65
- {
66
- key: "SEK",
67
- label: "Swedish krona (SEK)"
68
- },
69
- {
70
- key: "EUR",
71
- label: "Euro (EUR)"
72
- },
73
- {
74
- key: "USD",
75
- label: "US dollar (USD)"
76
- },
77
- {
78
- key: "GBP",
79
- label: "British pound (GBP)"
80
- },
81
- ];
82
- if (recRequirements.currencyCode && recRequirements.currencyCode.values && recRequirements.currencyCode.values.length > 0) {
83
- return recRequirements.currencyCode.values.map(function (currency) {
84
- return React.createElement(antd_1.Select.Option, { value: currency.key, title: currency.label, key: currency.key }, currency.label);
85
- });
86
- }
87
- else {
88
- return currencies.map(function (currency) {
89
- return React.createElement(antd_1.Select.Option, { value: currency.key, title: currency.label, key: currency.key }, currency.label);
90
- });
91
- }
92
- };
18
+ var currencies = [
19
+ {
20
+ value: "ISK",
21
+ display: "Icelandic krona (ISK)"
22
+ },
23
+ {
24
+ value: "DKK",
25
+ display: "Danish krona (DKK)"
26
+ },
27
+ {
28
+ value: "NOK",
29
+ display: "Norwegian krona (NOK)"
30
+ },
31
+ {
32
+ value: "SEK",
33
+ display: "Swedish krona (SEK)"
34
+ },
35
+ {
36
+ value: "EUR",
37
+ display: "Euro (EUR)"
38
+ },
39
+ {
40
+ value: "USD",
41
+ display: "US dollar (USD)"
42
+ },
43
+ {
44
+ value: "GBP",
45
+ display: "British pound (GBP)"
46
+ },
47
+ ];
93
48
  var disabledDate = function (dueDate, issueDate) {
94
49
  return dueDate < issueDate;
95
50
  };
96
51
  var checkIfEmpty = function (date) {
97
52
  if (!date) {
98
- props.form.resetFields(["invoice", "dueDate"]);
99
- props.form.validateFields(["invoice", "dueDate"]).then(function (values) {
53
+ props.form.resetFields(["baseInformation:dueDate"]);
54
+ props.form.validateFields(["baseInformation:dueDate"]).then(function (values) {
100
55
  // console.log(values);
101
56
  });
102
57
  }
103
58
  };
104
- return (React.createElement(components_1.ComponentContainer, { title: props.intl.formatMessage(translationMessages.baseInformation_title) },
105
- React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.invoiceNo, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_invoiceNo), defaultIsRequired: true, fieldName: ["invoice", "invoiceNo"] },
59
+ var getDocumentNoLabel = function (documentType) {
60
+ switch (documentType) {
61
+ case "creditNote":
62
+ return "Credit note no.";
63
+ case "invoice":
64
+ return "Invoice no.";
65
+ }
66
+ };
67
+ return (React.createElement(component_container_1.default, { title: "Base information" },
68
+ React.createElement(antd_1.Form.Item, { label: getDocumentNoLabel(props.documentType), name: "baseInformation:invoiceNo" },
106
69
  React.createElement(antd_1.Input, null)),
107
- React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.issueDate, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_issueDate), defaultIsRequired: true, fieldName: ["invoice", "issueDate"] },
108
- React.createElement(antd_1.DatePicker, null)),
109
- React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.dueDate, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_dueDate), defaultIsRequired: false, fieldName: ["invoice", "dueDate"], additionalRules: [
70
+ React.createElement(antd_1.Form.Item, { label: "Issue date", rules: [
110
71
  {
111
- validator: (function (rule, value, callback) {
112
- if (!value) {
113
- callback();
114
- }
115
- var issueDate = props.form.getFieldValue(["invoice", "issueDate"]);
116
- value < issueDate
117
- ? callback("Due date must be after the issue date")
118
- : callback();
119
- }),
72
+ required: true,
73
+ message: 'Please input the issue date',
120
74
  },
121
- ] },
122
- React.createElement(antd_1.DatePicker, { onChange: checkIfEmpty, disabledDate: (function (current) { return disabledDate(current, props.form.getFieldValue(["invoice", "issueDate"])); }) })),
123
- React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["orderReference.documentNo"], defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_orderReference_documentNo), defaultIsRequired: false, fieldName: ["invoice", "orderReference", "documentNo"] },
75
+ ], name: "baseInformation:issueDate" },
76
+ React.createElement(antd_1.DatePicker, null)),
77
+ props.documentType === "invoice" &&
78
+ React.createElement(React.Fragment, null,
79
+ React.createElement(antd_1.Form.Item, { label: "Due date", name: "baseInformation:dueDate", rules: [
80
+ {
81
+ validator: (function (rule, value, callback) {
82
+ if (!value) {
83
+ callback();
84
+ }
85
+ var issueDate = props.form.getFieldValue("baseInformation:issueDate");
86
+ value < issueDate
87
+ ? callback("Due date must be after the issue date")
88
+ : callback();
89
+ }),
90
+ },
91
+ ] },
92
+ React.createElement(antd_1.DatePicker, { onChange: checkIfEmpty, disabledDate: (function (current) { return disabledDate(current, props.form.getFieldValue("baseInformation:issueDate")); }) })),
93
+ React.createElement(antd_1.Form.Item, { label: "Last payment date", name: "baseInformation:lastPaymentDate" },
94
+ React.createElement(antd_1.DatePicker, null))),
95
+ props.documentType === "creditNote" &&
96
+ React.createElement(antd_1.Form.Item, { label: "Invoice no", name: "baseInformation:invoiceReferenceNo", rules: [
97
+ {
98
+ required: true,
99
+ message: "Please input the invoice no."
100
+ }
101
+ ] },
102
+ React.createElement(antd_1.Input, null)),
103
+ React.createElement(antd_1.Form.Item, { label: "Order no", name: "baseInformation:orderNo" },
124
104
  React.createElement(antd_1.Input, null)),
125
- React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.notes, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_notes), defaultIsRequired: false, fieldName: ["invoice", "notes"] },
105
+ React.createElement(antd_1.Form.Item, { label: "Notes", name: "baseInformation:notes" },
126
106
  React.createElement(antd_1.Input.TextArea, null)),
127
- React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.currencyCode, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_currencyCode), defaultIsRequired: true, fieldName: ["invoice", "currencyCode"] },
128
- React.createElement(antd_1.Select, { defaultActiveFirstOption: true }, getCurrencies(ReceiverRequirements_1.receiverRequirementsObject)))));
107
+ React.createElement(antd_1.Form.Item, { label: "Currency", name: "baseInformation:currency" },
108
+ React.createElement(antd_1.Select, { defaultActiveFirstOption: true }, currencies.map(function (currency) {
109
+ return React.createElement(antd_1.Select.Option, { value: currency.value, title: currency.display, key: currency.value }, currency.display);
110
+ })))));
129
111
  };
130
- var BaseInformationIntl = react_intl_1.injectIntl(BaseInformation);
131
- exports.default = BaseInformationIntl;
112
+ exports.default = BaseInformation;
@@ -1,13 +1,27 @@
1
1
  import * as React from 'react';
2
2
  import '@ant-design/compatible/assets/index.css';
3
3
  import { BillingLineMetadata } from "@unimaze/api-clients/lib/mapi/models";
4
- import { InjectedIntlProps } from "react-intl";
4
+ import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOverride";
5
5
  import { FormInstance } from "antd/es/form";
6
- interface Props extends InjectedIntlProps {
7
- formInstance: FormInstance;
8
- setBillingLineMetadata: (formInstance: FormInstance, billingLineMetadata: BillingLineMetadata[]) => void;
9
- }
10
- declare const BillingLinesIntl: React.ComponentClass<Pick<Props, "formInstance" | "setBillingLineMetadata">, any> & {
11
- WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
12
- };
13
- export default BillingLinesIntl;
6
+ import { ColumnType } from 'antd/es/table';
7
+ interface EditableColumnProps<T> extends ColumnType<T> {
8
+ editable?: boolean;
9
+ }
10
+ interface Props {
11
+ form: FormInstance;
12
+ setBillingLineMetadata: (form: FormInstance, billingLineMetadata: BillingLineMetadata[]) => void;
13
+ }
14
+ interface States {
15
+ dataSource: BillingLineMetadataOverride[];
16
+ editableIndex: number | null;
17
+ }
18
+ declare class BillingLines extends React.Component<Props, States> {
19
+ columns: EditableColumnProps<BillingLineMetadataOverride>[];
20
+ constructor(props: Props);
21
+ renderCurrencyColumn: (text: string) => string;
22
+ handleDelete: (index: number) => void;
23
+ handleAdd: () => void;
24
+ handleSave: (row: BillingLineMetadataOverride, form: FormInstance) => void;
25
+ render(): JSX.Element;
26
+ }
27
+ export default BillingLines;