@unimaze/billing 0.1.2-rc.4 → 0.1.2-rc.5

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 (39) hide show
  1. package/README.md +11 -3
  2. package/lib/common/components/attachments/index.js +2 -2
  3. package/lib/common/components/base-information/index.js +2 -5
  4. package/lib/common/components/billing-lines/index.js +4 -9
  5. package/lib/common/components/customer/index.d.ts +7 -0
  6. package/lib/common/components/customer/index.js +25 -0
  7. package/lib/common/components/delivery-location/index.js +2 -5
  8. package/lib/common/components/index.d.ts +10 -5
  9. package/lib/common/components/index.js +20 -8
  10. package/lib/common/components/payer/index.js +1 -1
  11. package/lib/common/components/payment-method/index.js +2 -5
  12. package/lib/common/components/supplier/index.d.ts +3 -0
  13. package/lib/common/components/supplier/index.js +49 -0
  14. package/lib/common/enums/index.d.ts +1 -1
  15. package/lib/common/enums/index.js +2 -4
  16. package/lib/common/types/ReceiverRequirements.d.ts +1 -3
  17. package/lib/common/types/ReceiverRequirements.js +0 -11
  18. package/lib/create-credit-note/index.d.ts +1 -2
  19. package/lib/create-credit-note/index.js +5 -9
  20. package/lib/create-invoice/index.d.ts +1 -2
  21. package/lib/create-invoice/index.js +8 -14
  22. package/lib/example/src/index.d.ts +1 -1
  23. package/lib/index.js +5 -0
  24. package/lib/src/common/components/attachments/Attachment.d.ts +15 -0
  25. package/lib/src/common/components/attachments/index.d.ts +3 -0
  26. package/lib/src/common/components/customer/index.d.ts +7 -0
  27. package/lib/src/common/components/index.d.ts +10 -0
  28. package/lib/src/common/components/issuer/index.d.ts +1 -1
  29. package/lib/src/common/components/supplier/index.d.ts +3 -0
  30. package/lib/src/common/types/ReceiverRequirements.d.ts +1 -3
  31. package/lib/src/create-invoice/index.d.ts +1 -2
  32. package/lib/src/utils/ConversionUtility.d.ts +1 -1
  33. package/lib/src/utils/RequirementsUtility.d.ts +3 -0
  34. package/lib/style/index.css +1268 -1268
  35. package/lib/utils/ConversionUtility.d.ts +1 -1
  36. package/lib/utils/ConversionUtility.js +23 -24
  37. package/lib/utils/RequirementsUtility.d.ts +3 -0
  38. package/lib/utils/RequirementsUtility.js +13 -0
  39. package/package.json +1 -1
package/README.md CHANGED
@@ -1,13 +1,21 @@
1
- # README #
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"
2
10
 
3
11
  ## Components ##
4
- ### `<CreateInvoice>` ###
12
+ ### `<CreateInvoice />` ###
5
13
 
6
14
  Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
7
15
 
8
16
  |Property |Description |Type |Default |
9
17
  |:----------------------|:------------------------------------------------------|:------------------------------------------------------|:----------|
10
- |issuer |Sets the Invoice issuer |Object `ProfileOutput` | |
18
+ |customer |Sets the Invoice customer |Object `ProfileOutput` | |
11
19
  |language |Sets the language of the component |`en` `is` `pl` `undefined` |`en` |
12
20
  |mapiBaseUrl |Url of the MAPI |string | |
13
21
  |rapiBaseUrl |Url of the RAPI |string | |
@@ -11,10 +11,10 @@ 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 component_container_1 = __importDefault(require("../component-container"));
14
+ var components_1 = require("../../components");
15
15
  var Attachment_1 = __importDefault(require("./Attachment"));
16
16
  var AttachmentsGroup = function (props) {
17
- return (React.createElement(component_container_1.default, { title: "Attachments" },
17
+ return (React.createElement(components_1.ComponentContainer, { title: "Attachments" },
18
18
  React.createElement(Attachment_1.default, { fieldName: "file1" }),
19
19
  React.createElement(Attachment_1.default, { fieldName: "file2" }),
20
20
  React.createElement(Attachment_1.default, { fieldName: "file3" })));
@@ -6,12 +6,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
6
6
  result["default"] = mod;
7
7
  return result;
8
8
  };
9
- var __importDefault = (this && this.__importDefault) || function (mod) {
10
- return (mod && mod.__esModule) ? mod : { "default": mod };
11
- };
12
9
  Object.defineProperty(exports, "__esModule", { value: true });
13
10
  var React = __importStar(require("react"));
14
- var component_container_1 = __importDefault(require("../component-container"));
11
+ var components_1 = require("../../components");
15
12
  require("@ant-design/compatible/assets/index.css");
16
13
  var antd_1 = require("antd");
17
14
  var BaseInformation = function (props) {
@@ -64,7 +61,7 @@ var BaseInformation = function (props) {
64
61
  return "Invoice no.";
65
62
  }
66
63
  };
67
- return (React.createElement(component_container_1.default, { title: "Base information" },
64
+ return (React.createElement(components_1.ComponentContainer, { title: "Base information" },
68
65
  React.createElement(antd_1.Form.Item, { label: getDocumentNoLabel(props.documentType), name: props.documentType === "invoice" ? ["invoice", "invoiceNo"] : ["creditNote", "invoiceNo"] },
69
66
  React.createElement(antd_1.Input, null)),
70
67
  React.createElement(antd_1.Form.Item, { label: "Issue date", rules: [
@@ -30,18 +30,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
30
30
  result["default"] = mod;
31
31
  return result;
32
32
  };
33
- var __importDefault = (this && this.__importDefault) || function (mod) {
34
- return (mod && mod.__esModule) ? mod : { "default": mod };
35
- };
36
33
  Object.defineProperty(exports, "__esModule", { value: true });
37
34
  var React = __importStar(require("react"));
38
- var component_container_1 = __importDefault(require("../component-container"));
35
+ var components_1 = require("../../components");
39
36
  var icons_1 = require("@ant-design/icons");
40
37
  require("@ant-design/compatible/assets/index.css");
41
38
  var antd_1 = require("antd");
42
39
  var models_1 = require("@unimaze/api-clients/lib/mapi/models");
43
- var editable_cell_1 = __importDefault(require("../editable-cell"));
44
- var editable_row_1 = __importDefault(require("../editable-row"));
45
40
  var BillingLines = /** @class */ (function (_super) {
46
41
  __extends(BillingLines, _super);
47
42
  function BillingLines(props) {
@@ -156,8 +151,8 @@ var BillingLines = /** @class */ (function (_super) {
156
151
  // console.log(dataSource);
157
152
  var components = {
158
153
  body: {
159
- row: editable_row_1.default,
160
- cell: editable_cell_1.default,
154
+ row: components_1.EditableRow,
155
+ cell: components_1.EditableCell,
161
156
  },
162
157
  };
163
158
  var columns = this.columns.map(function (col) {
@@ -172,7 +167,7 @@ var BillingLines = /** @class */ (function (_super) {
172
167
  handleSave: function (billingLineMetadataOverrideRecord, rowIndex) { return _this.handleSave(billingLineMetadataOverrideRecord, _this.props.formInstance); },
173
168
  }); } });
174
169
  });
175
- return (React.createElement(component_container_1.default, { title: "Document Lines", action: React.createElement(antd_1.Button, { onClick: this.handleAdd, type: "primary", style: { marginBottom: 16 } }, "Add a row") },
170
+ return (React.createElement(components_1.ComponentContainer, { title: "Document Lines", action: React.createElement(antd_1.Button, { onClick: this.handleAdd, type: "primary", style: { marginBottom: 16 } }, "Add a row") },
176
171
  React.createElement(antd_1.Table, { components: components, dataSource: dataSource, columns: columns, pagination: false, rowKey: (function (record, index) { return index.toString(); }) })));
177
172
  };
178
173
  return BillingLines;
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __importStar = (this && this.__importStar) || function (mod) {
3
+ if (mod && mod.__esModule) return mod;
4
+ var result = {};
5
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
+ result["default"] = mod;
7
+ return result;
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ var React = __importStar(require("react"));
11
+ var components_1 = require("../../components");
12
+ var Customer = function (props) {
13
+ var _a = props.customer, participantLegalIsoIdentifier = _a.participantLegalIsoIdentifier, participantLegalAddressPostalCode = _a.participantLegalAddressPostalCode, participantLegalAddressCity = _a.participantLegalAddressCity, participantLegalAddressStreet = _a.participantLegalAddressStreet, email = _a.email, name = _a.name, country = _a.country;
14
+ return (React.createElement(components_1.ComponentContainer, { title: "Invoice payer" },
15
+ React.createElement("div", null,
16
+ React.createElement("strong", null, name),
17
+ " (",
18
+ participantLegalIsoIdentifier,
19
+ ")"),
20
+ React.createElement("div", null, participantLegalAddressPostalCode + " " + participantLegalAddressCity),
21
+ React.createElement("div", null, participantLegalAddressStreet),
22
+ React.createElement("div", null, country),
23
+ React.createElement("div", null, email)));
24
+ };
25
+ exports.default = Customer;
@@ -6,15 +6,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
6
6
  result["default"] = mod;
7
7
  return result;
8
8
  };
9
- var __importDefault = (this && this.__importDefault) || function (mod) {
10
- return (mod && mod.__esModule) ? mod : { "default": mod };
11
- };
12
9
  Object.defineProperty(exports, "__esModule", { value: true });
13
10
  var React = __importStar(require("react"));
14
- var component_container_1 = __importDefault(require("../component-container"));
11
+ var components_1 = require("../../components");
15
12
  var antd_1 = require("antd");
16
13
  var DeliveryLocation = function () {
17
- return (React.createElement(component_container_1.default, { title: "Delivery location" },
14
+ return (React.createElement(components_1.ComponentContainer, { title: "Delivery location" },
18
15
  React.createElement(antd_1.Form.Item, { label: "Description", name: ["invoice", "delivery", "description"] },
19
16
  React.createElement(antd_1.Input, null)),
20
17
  React.createElement(antd_1.Form.Item, { label: "Address", name: ["invoice", "delivery", "address", "address"] },
@@ -1,5 +1,10 @@
1
- export * from "./component-container";
2
- export * from "./payer";
3
- export * from "./issuer";
4
- export * from "./base-information";
5
- export * from "./delivery-location";
1
+ export { default as Attachments } from "./attachments";
2
+ export { default as BaseInformation } from "./base-information";
3
+ export { default as BillingLines } from "./billing-lines";
4
+ export { default as ComponentContainer } from "./component-container";
5
+ export { default as Customer } from "./customer";
6
+ export { default as DeliveryLocation } from "./delivery-location";
7
+ export { default as EditableCell } from "./editable-cell";
8
+ export { default as EditableRow } from "./editable-row";
9
+ export { default as PaymentMethod } from "./payment-method";
10
+ export { default as Supplier } from "./supplier";
@@ -1,10 +1,22 @@
1
1
  "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- __export(require("./component-container"));
7
- __export(require("./payer"));
8
- __export(require("./issuer"));
9
- __export(require("./base-information"));
10
- __export(require("./delivery-location"));
3
+ var attachments_1 = require("./attachments");
4
+ exports.Attachments = attachments_1.default;
5
+ var base_information_1 = require("./base-information");
6
+ exports.BaseInformation = base_information_1.default;
7
+ var billing_lines_1 = require("./billing-lines");
8
+ exports.BillingLines = billing_lines_1.default;
9
+ var component_container_1 = require("./component-container");
10
+ exports.ComponentContainer = component_container_1.default;
11
+ var customer_1 = require("./customer");
12
+ exports.Customer = customer_1.default;
13
+ var delivery_location_1 = require("./delivery-location");
14
+ exports.DeliveryLocation = delivery_location_1.default;
15
+ var editable_cell_1 = require("./editable-cell");
16
+ exports.EditableCell = editable_cell_1.default;
17
+ var editable_row_1 = require("./editable-row");
18
+ exports.EditableRow = editable_row_1.default;
19
+ var payment_method_1 = require("./payment-method");
20
+ exports.PaymentMethod = payment_method_1.default;
21
+ var supplier_1 = require("./supplier");
22
+ exports.Supplier = supplier_1.default;
@@ -15,7 +15,7 @@ var component_container_1 = __importDefault(require("../component-container"));
15
15
  var antd_1 = require("antd");
16
16
  var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
17
17
  var Payer = function () {
18
- return (React.createElement(component_container_1.default, { title: "Payer" },
18
+ return (React.createElement(component_container_1.default, { title: "Invoice issuer" },
19
19
  React.createElement(antd_1.Form.Item, { label: ReceiverRequirements_1.getReceiverRequirementsLabelWithDefault(ReceiverRequirements_1.receiverRequirementsObject, ReceiverRequirements_1.AvailableFields["payer.name"], "Name/identifier"), style: { marginBottom: 0 } },
20
20
  React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "50%" }, name: ["invoice", "customer", "name"], rules: [
21
21
  {
@@ -6,12 +6,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
6
6
  result["default"] = mod;
7
7
  return result;
8
8
  };
9
- var __importDefault = (this && this.__importDefault) || function (mod) {
10
- return (mod && mod.__esModule) ? mod : { "default": mod };
11
- };
12
9
  Object.defineProperty(exports, "__esModule", { value: true });
13
10
  var react_1 = __importStar(require("react"));
14
- var component_container_1 = __importDefault(require("../component-container"));
11
+ var components_1 = require("../../components");
15
12
  var antd_1 = require("antd");
16
13
  var models_1 = require("@unimaze/api-clients/lib/mapi/models");
17
14
  var PaymentMethod = function () {
@@ -64,7 +61,7 @@ var PaymentMethod = function () {
64
61
  display: "Claim (Icelandic)"
65
62
  }
66
63
  ];
67
- return (react_1.default.createElement(component_container_1.default, { title: "Payment method" },
64
+ return (react_1.default.createElement(components_1.ComponentContainer, { title: "Payment method" },
68
65
  react_1.default.createElement(antd_1.Select, { value: paymentMethod, onSelect: setPaymentMethod }, paymentMethods.map(function (payMthd) {
69
66
  return react_1.default.createElement(antd_1.Select.Option, { value: payMthd.value, title: payMthd.display, key: payMthd.value }, payMthd.display);
70
67
  })),
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const Supplier: React.FC;
3
+ export default Supplier;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __importStar = (this && this.__importStar) || function (mod) {
3
+ if (mod && mod.__esModule) return mod;
4
+ var result = {};
5
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
+ result["default"] = mod;
7
+ return result;
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ var React = __importStar(require("react"));
11
+ var components_1 = require("../../components");
12
+ var antd_1 = require("antd");
13
+ var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
14
+ var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
15
+ var Supplier = function () {
16
+ return (React.createElement(components_1.ComponentContainer, { title: "Invoice issuer" },
17
+ React.createElement(antd_1.Form.Item, { label: RequirementsUtility_1.getReceiverRequirementsLabelWithDefault(ReceiverRequirements_1.receiverRequirementsObject, ReceiverRequirements_1.AvailableFields["payer.name"], "Name/identifier"), style: { marginBottom: 0 } },
18
+ React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "50%" }, name: ["invoice", "supplier", "name"], rules: [
19
+ {
20
+ required: RequirementsUtility_1.getReceiverRequirements(ReceiverRequirements_1.receiverRequirementsObject, ReceiverRequirements_1.AvailableFields["payer.name"]).isRequired,
21
+ message: 'Please input payer name',
22
+ },
23
+ ] },
24
+ React.createElement(antd_1.Input, null)),
25
+ React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "50%", paddingLeft: "3px" }, name: ["invoice", "supplier", "identifier"], rules: [
26
+ {
27
+ required: true,
28
+ message: 'Please input payer identifier',
29
+ },
30
+ ] },
31
+ React.createElement(antd_1.Input, null))),
32
+ React.createElement(antd_1.Form.Item, { label: "Address", name: ["invoice", "supplier", "address", "streetNameAndNumber"] },
33
+ React.createElement(antd_1.Input, null)),
34
+ React.createElement(antd_1.Form.Item, { label: "Zip/City" },
35
+ React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, name: ["invoice", "supplier", "address", "postalZone"] },
36
+ React.createElement(antd_1.Input, null)),
37
+ React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "70%", paddingLeft: "3px" }, name: ["invoice", "supplier", "address", "city"] },
38
+ React.createElement(antd_1.Input, null))),
39
+ React.createElement(antd_1.Form.Item, { label: "Country", name: ["invoice", "supplier", "address", "countryCode"] },
40
+ React.createElement(antd_1.Input, null)),
41
+ React.createElement(antd_1.Form.Item, { label: "E-mail", name: ["invoice", "supplier", "contact", "electronicMail"], rules: [
42
+ {
43
+ type: 'email',
44
+ message: 'The input is not valid E-mail!',
45
+ }
46
+ ] },
47
+ React.createElement(antd_1.Input, null))));
48
+ };
49
+ exports.default = Supplier;
@@ -1 +1 @@
1
- export * from "./DocumentTypeEnum";
1
+ export { default as DocumentTypeEnum } from "./DocumentTypeEnum";
@@ -1,6 +1,4 @@
1
1
  "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- __export(require("./DocumentTypeEnum"));
3
+ var DocumentTypeEnum_1 = require("./DocumentTypeEnum");
4
+ exports.DocumentTypeEnum = DocumentTypeEnum_1.default;
@@ -21,7 +21,5 @@ export declare enum AvailableFields {
21
21
  'customer.name' = "customer.name",
22
22
  'customer.identifier' = "customer.identifier"
23
23
  }
24
- export { ReceiverRequirements };
24
+ export { ReceiverRequirements, FieldRequirement };
25
25
  export declare const receiverRequirementsObject: ReceiverRequirements;
26
- export declare const getReceiverRequirements: (recRequirements: ReceiverRequirements, key: AvailableFields) => FieldRequirement;
27
- export declare const getReceiverRequirementsLabelWithDefault: (recRequirements: ReceiverRequirements, key: AvailableFields, defaultLabel: string) => string;
@@ -38,14 +38,3 @@ exports.receiverRequirementsObject = {
38
38
  key: ""
39
39
  }
40
40
  };
41
- exports.getReceiverRequirements = function (recRequirements, key) {
42
- return recRequirements[key];
43
- };
44
- exports.getReceiverRequirementsLabelWithDefault = function (recRequirements, key, defaultLabel) {
45
- if (recRequirements[key].label) {
46
- return recRequirements[key].label;
47
- }
48
- else {
49
- return defaultLabel;
50
- }
51
- };
@@ -1,9 +1,8 @@
1
- import "antd/dist/antd.compact.css";
2
1
  import "../style/index.css";
3
2
  import React from "react";
4
3
  import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
5
4
  interface Props {
6
- issuer: ProfileOutput;
5
+ customer: ProfileOutput;
7
6
  }
8
7
  declare const CreateInvoice: React.FC<Props>;
9
8
  export default CreateInvoice;
@@ -14,14 +14,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- require("antd/dist/antd.compact.css");
18
17
  require("../style/index.css");
19
18
  var react_1 = __importDefault(require("react"));
20
19
  var antd_1 = require("antd");
21
- var payer_1 = __importDefault(require("../common/components/payer"));
22
- var issuer_1 = __importDefault(require("../common/components/issuer"));
23
- var base_information_1 = __importDefault(require("../common/components/base-information"));
24
- var attachments_1 = __importDefault(require("../common/components/attachments"));
20
+ var components_1 = require("../common/components");
25
21
  // const [createCorrectWithCreditRequest, setCreateCorrectWithCreditRequest] = useState<CreateCorrectWithCreditRequest>(
26
22
  // {
27
23
  // conversationIdentifier: "test",
@@ -56,14 +52,14 @@ var CreateInvoice = function (props) {
56
52
  react_1.default.createElement("h1", null, "Credit note"),
57
53
  react_1.default.createElement(antd_1.Row, { gutter: [16, 16] },
58
54
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 12 } },
59
- react_1.default.createElement(payer_1.default, null)),
55
+ react_1.default.createElement(components_1.Supplier, null)),
60
56
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 12 } },
61
- react_1.default.createElement(issuer_1.default, { issuer: props.issuer })),
57
+ react_1.default.createElement(components_1.Customer, { customer: props.customer })),
62
58
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
63
- react_1.default.createElement(base_information_1.default, { form: form, documentType: "creditNote" })),
59
+ react_1.default.createElement(components_1.BaseInformation, { form: form, documentType: "creditNote" })),
64
60
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 }, xl: { span: 16 } }),
65
61
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 }, xl: { span: 24 } },
66
- react_1.default.createElement(attachments_1.default, null)),
62
+ react_1.default.createElement(components_1.Attachments, null)),
67
63
  react_1.default.createElement(antd_1.Col, { span: 24 },
68
64
  react_1.default.createElement(antd_1.Button, { type: "primary", htmlType: "submit" }, "Submit")))));
69
65
  };
@@ -1,10 +1,9 @@
1
- import "antd/dist/antd.compact.css";
2
1
  import "../style/index.css";
3
2
  import React from "react";
4
3
  import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
5
4
  import { CommonProps } from "../common/types/CommonProps";
6
5
  interface Props extends CommonProps {
7
- issuer: ProfileOutput;
6
+ customer: ProfileOutput;
8
7
  }
9
8
  /**
10
9
  * Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
@@ -14,18 +14,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- require("antd/dist/antd.compact.css");
18
17
  require("../style/index.css");
19
18
  var react_1 = __importDefault(require("react"));
20
19
  var antd_1 = require("antd");
21
20
  var is_IS_1 = __importDefault(require("antd/es/locale-provider/is_IS"));
22
21
  var en_US_1 = __importDefault(require("antd/es/locale-provider/en_US"));
23
- var payer_1 = __importDefault(require("../common/components/payer"));
24
- var issuer_1 = __importDefault(require("../common/components/issuer"));
25
- var delivery_location_1 = __importDefault(require("../common/components/delivery-location"));
26
- var payment_method_1 = __importDefault(require("../common/components/payment-method"));
27
- var base_information_1 = __importDefault(require("../common/components/base-information"));
28
- var billing_lines_1 = __importDefault(require("../common/components/billing-lines"));
22
+ var components_1 = require("../common/components");
29
23
  var utils_1 = require("../utils");
30
24
  var uuid_1 = require("uuid");
31
25
  /**
@@ -52,7 +46,7 @@ var CreateInvoice = function (props) {
52
46
  });
53
47
  };
54
48
  var handleSubmit = function (values) {
55
- var invoiceMetadataInput = utils_1.convertToInvoiceMetadataInput(values, props.issuer);
49
+ var invoiceMetadataInput = utils_1.convertToInvoiceMetadataInput(values, props.customer);
56
50
  var createSubmitInvoice = {
57
51
  invoiceMetadataInput: invoiceMetadataInput,
58
52
  more: false,
@@ -79,17 +73,17 @@ var CreateInvoice = function (props) {
79
73
  react_1.default.createElement("h1", null, "Invoice"),
80
74
  react_1.default.createElement(antd_1.Row, { gutter: [16, 16] },
81
75
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
82
- react_1.default.createElement(payer_1.default, null)),
76
+ react_1.default.createElement(components_1.Supplier, null)),
83
77
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
84
- react_1.default.createElement(delivery_location_1.default, null)),
78
+ react_1.default.createElement(components_1.DeliveryLocation, null)),
85
79
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
86
- react_1.default.createElement(issuer_1.default, { issuer: props.issuer })),
80
+ react_1.default.createElement(components_1.Customer, { customer: props.customer })),
87
81
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 12 }, xl: { span: 8 } },
88
- react_1.default.createElement(base_information_1.default, { form: form, documentType: "invoice" })),
82
+ react_1.default.createElement(components_1.BaseInformation, { form: form, documentType: "invoice" })),
89
83
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 24 }, xl: { span: 16 } },
90
- react_1.default.createElement(billing_lines_1.default, { setBillingLineMetadata: handleSetBillingLineMetadata, formInstance: form })),
84
+ react_1.default.createElement(components_1.BillingLines, { setBillingLineMetadata: handleSetBillingLineMetadata, formInstance: form })),
91
85
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 8 }, xl: { span: 8 } },
92
- react_1.default.createElement(payment_method_1.default, null)),
86
+ react_1.default.createElement(components_1.PaymentMethod, null)),
93
87
  react_1.default.createElement(antd_1.Col, { xs: { span: 24 }, md: { span: 16 }, xl: { span: 16 } }),
94
88
  react_1.default.createElement(antd_1.Col, { span: 24 },
95
89
  react_1.default.createElement(antd_1.Form.Item, null,
@@ -1 +1 @@
1
- export {};
1
+ import "antd/dist/antd.compact.css";
package/lib/index.js CHANGED
@@ -1,5 +1,10 @@
1
1
  "use strict";
2
+ function __export(m) {
3
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
+ }
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ // Enums, Types
7
+ __export(require("./common/enums"));
3
8
  // Components
4
9
  var create_invoice_1 = require("./create-invoice");
5
10
  exports.CreateInvoice = create_invoice_1.default;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import '@ant-design/compatible/assets/index.css';
3
+ interface Props {
4
+ fieldName: string;
5
+ }
6
+ interface States {
7
+ file: any[];
8
+ }
9
+ declare class Attachment extends React.Component<Props, States> {
10
+ constructor(props: Props);
11
+ handleRemoveFile: () => void;
12
+ normFile: (e: any) => any;
13
+ render(): JSX.Element;
14
+ }
15
+ export default Attachment;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const AttachmentsGroup: React.FC;
3
+ export default AttachmentsGroup;
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,10 @@
1
+ export { default as Attachments } from "./attachments";
2
+ export { default as BaseInformation } from "./base-information";
3
+ export { default as BillingLines } from "./billing-lines";
4
+ export { default as ComponentContainer } from "./component-container";
5
+ export { default as Customer } from "./customer";
6
+ export { default as DeliveryLocation } from "./delivery-location";
7
+ export { default as EditableCell } from "./editable-cell";
8
+ export { default as EditableRow } from "./editable-row";
9
+ export { default as PaymentMethod } from "./payment-method";
10
+ export { default as Supplier } from "./supplier";
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { wapi2 } from "@unimaze/api-clients";
3
3
  interface Props {
4
- issuer: wapi2.ProfileOutput;
4
+ customer: wapi2.ProfileOutput;
5
5
  }
6
6
  declare const Issuer: React.FC<Props>;
7
7
  export default Issuer;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const Supplier: React.FC;
3
+ export default Supplier;
@@ -21,7 +21,5 @@ export declare enum AvailableFields {
21
21
  'customer.name' = "customer.name",
22
22
  'customer.identifier' = "customer.identifier"
23
23
  }
24
- export { ReceiverRequirements };
24
+ export { ReceiverRequirements, FieldRequirement };
25
25
  export declare const receiverRequirementsObject: ReceiverRequirements;
26
- export declare const getReceiverRequirements: (recRequirements: ReceiverRequirements, key: AvailableFields) => FieldRequirement;
27
- export declare const getReceiverRequirementsLabelWithDefault: (recRequirements: ReceiverRequirements, key: AvailableFields, defaultLabel: string) => string;
@@ -1,10 +1,9 @@
1
- import "antd/dist/antd.compact.css";
2
1
  import "../style/index.css";
3
2
  import React from "react";
4
3
  import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
5
4
  import { CommonProps } from "../common/types/CommonProps";
6
5
  interface Props extends CommonProps {
7
- issuer: ProfileOutput;
6
+ customer: ProfileOutput;
8
7
  }
9
8
  /**
10
9
  * Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
@@ -1,5 +1,5 @@
1
1
  import { 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
- declare const convertToInvoiceMetadataInput: (formValues: Store, issuer: ProfileOutput) => InvoiceMetadataInput;
4
+ declare const convertToInvoiceMetadataInput: (formValues: Store, customer: ProfileOutput) => InvoiceMetadataInput;
5
5
  export { /*convertToCreditNoteMetadataInput,*/ convertToInvoiceMetadataInput };
@@ -0,0 +1,3 @@
1
+ import { AvailableFields, FieldRequirement, ReceiverRequirements } from "../common/types/ReceiverRequirements";
2
+ export declare const getReceiverRequirements: (recRequirements: ReceiverRequirements, key: AvailableFields) => FieldRequirement;
3
+ export declare const getReceiverRequirementsLabelWithDefault: (recRequirements: ReceiverRequirements, key: AvailableFields, defaultLabel: string) => string;