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

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 (95) 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 +7 -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 +20 -6
  9. package/lib/common/components/billing-lines/index.js +22 -106
  10. package/lib/common/components/component-container/style/index.d.ts +1 -0
  11. package/lib/common/components/component-container/style/index.js +3 -0
  12. package/lib/common/components/delivery-location/index.d.ts +2 -5
  13. package/lib/common/components/delivery-location/index.js +11 -43
  14. package/lib/common/components/editable-cell/index.js +9 -7
  15. package/lib/common/components/index.d.ts +5 -10
  16. package/lib/common/components/index.js +8 -20
  17. package/lib/common/components/issuer/index.d.ts +7 -0
  18. package/lib/common/components/{customer/hardCoddedCustomer.js → issuer/index.js} +8 -5
  19. package/lib/common/components/payer/index.d.ts +3 -0
  20. package/lib/common/components/payer/index.js +51 -0
  21. package/lib/common/components/payment-method/index.d.ts +3 -6
  22. package/lib/common/components/payment-method/index.js +17 -57
  23. package/lib/common/consts/validationRules.js +7 -0
  24. package/lib/common/enums/index.d.ts +1 -1
  25. package/lib/common/enums/index.js +4 -2
  26. package/lib/common/types/ReceiverRequirements.d.ts +17 -72
  27. package/lib/common/types/ReceiverRequirements.js +14 -350
  28. package/lib/create-credit-note/index.d.ts +2 -1
  29. package/lib/create-credit-note/index.js +11 -5
  30. package/lib/create-invoice/index.d.ts +2 -1
  31. package/lib/create-invoice/index.js +17 -77
  32. package/lib/example/src/index.d.ts +1 -1
  33. package/lib/index.js +0 -5
  34. package/lib/src/common/components/base-information/index.d.ts +3 -6
  35. package/lib/src/common/components/billing-lines/index.d.ts +20 -6
  36. package/lib/src/common/components/delivery-location/index.d.ts +2 -5
  37. package/lib/src/common/components/issuer/index.d.ts +7 -0
  38. package/lib/src/common/components/payer/index.d.ts +3 -0
  39. package/lib/src/common/components/payment-method/index.d.ts +3 -6
  40. package/lib/src/common/types/ReceiverRequirements.d.ts +17 -72
  41. package/lib/src/create-invoice/index.d.ts +2 -1
  42. package/lib/src/utils/ApiUtility.d.ts +1 -8
  43. package/lib/src/utils/ConversionUtility.d.ts +2 -3
  44. package/lib/src/utils/index.d.ts +1 -1
  45. package/lib/style/index.css +1222 -0
  46. package/lib/style/index.d.ts +1 -0
  47. package/lib/style/index.js +3 -0
  48. package/lib/utils/ApiUtility.d.ts +1 -8
  49. package/lib/utils/ApiUtility.js +1 -17
  50. package/lib/utils/ConversionUtility.d.ts +2 -3
  51. package/lib/utils/ConversionUtility.js +62 -116
  52. package/lib/utils/index.d.ts +1 -1
  53. package/lib/utils/index.js +0 -1
  54. package/package.json +7 -12
  55. package/lib/common/components/base-information/ReferenceIdentifiers.d.ts +0 -6
  56. package/lib/common/components/base-information/ReferenceIdentifiers.js +0 -40
  57. package/lib/common/components/billing-lines/BillingCalculations.d.ts +0 -11
  58. package/lib/common/components/billing-lines/BillingCalculations.js +0 -61
  59. package/lib/common/components/billing-lines/BillingTaxSummary.d.ts +0 -10
  60. package/lib/common/components/billing-lines/BillingTaxSummary.js +0 -51
  61. package/lib/common/components/billing-lines/billingLIneFormData.d.ts +0 -7
  62. package/lib/common/components/billing-lines/billingLIneFormData.js +0 -63
  63. package/lib/common/components/customer/hardCoddedCustomer.d.ts +0 -7
  64. package/lib/common/components/customer/index.d.ts +0 -6
  65. package/lib/common/components/customer/index.js +0 -93
  66. package/lib/common/components/form-item/index.d.ts +0 -21
  67. package/lib/common/components/form-item/index.js +0 -27
  68. package/lib/common/components/locale-intl/index.d.ts +0 -10
  69. package/lib/common/components/locale-intl/index.js +0 -45
  70. package/lib/common/components/supplier/index.d.ts +0 -6
  71. package/lib/common/components/supplier/index.js +0 -93
  72. package/lib/src/common/components/attachments/Attachment.d.ts +0 -21
  73. package/lib/src/common/components/attachments/index.d.ts +0 -10
  74. package/lib/src/common/components/base-information/ReferenceIdentifiers.d.ts +0 -6
  75. package/lib/src/common/components/billing-lines/BillingCalculations.d.ts +0 -11
  76. package/lib/src/common/components/billing-lines/BillingTaxSummary.d.ts +0 -10
  77. package/lib/src/common/components/billing-lines/billingLIneFormData.d.ts +0 -7
  78. package/lib/src/common/components/customer/index.d.ts +0 -6
  79. package/lib/src/common/components/form-item/index.d.ts +0 -21
  80. package/lib/src/common/components/index.d.ts +0 -10
  81. package/lib/src/common/components/locale-intl/index.d.ts +0 -10
  82. package/lib/src/common/components/supplier/index.d.ts +0 -6
  83. package/lib/src/translations/locales.d.ts +0 -74
  84. package/lib/src/utils/BillingLineUtility.d.ts +0 -8
  85. package/lib/src/utils/RequirementsUtility.d.ts +0 -5
  86. package/lib/src/utils/billingLineFormData.d.ts +0 -7
  87. package/lib/translations/locales/is.json +0 -70
  88. package/lib/translations/locales.d.ts +0 -74
  89. package/lib/translations/locales.js +0 -10
  90. package/lib/utils/BillingLineUtility.d.ts +0 -8
  91. package/lib/utils/BillingLineUtility.js +0 -66
  92. package/lib/utils/RequirementsUtility.d.ts +0 -5
  93. package/lib/utils/RequirementsUtility.js +0 -23
  94. package/lib/utils/billingLineFormData.d.ts +0 -7
  95. package/lib/utils/billingLineFormData.js +0 -63
@@ -11,50 +11,18 @@ 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 antd_1 = require("antd");
16
- var form_item_1 = __importDefault(require("../form-item"));
17
- var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
18
- var react_intl_1 = require("react-intl");
19
- // import {defineMessages} from "react-intl.macro"
20
- var translationMessages = react_intl_1.defineMessages({
21
- deliveryLocation_title: {
22
- id: "deliveryLocation_title",
23
- defaultMessage: "Delivery location",
24
- },
25
- deliveryLocation_partyName: {
26
- id: "deliveryLocation_partyName",
27
- defaultMessage: "Party name",
28
- },
29
- deliveryLocation_streetNameAndNumber: {
30
- id: "deliveryLocation_streetNameAndNumber",
31
- defaultMessage: "Address"
32
- },
33
- deliveryLocation_postalZone: {
34
- id: "deliveryLocation_postalZone",
35
- defaultMessage: "Postal no"
36
- },
37
- deliveryLocation_city: {
38
- id: "deliveryLocation_city",
39
- defaultMessage: "Town/City"
40
- },
41
- deliveryLocation_countryCode: {
42
- id: "deliveryLocation_countryCode",
43
- defaultMessage: "Country code"
44
- }
45
- });
46
- var DeliveryLocation = function (props) {
47
- return (React.createElement(components_1.ComponentContainer, { title: props.intl.formatMessage(translationMessages.deliveryLocation_title) },
48
- React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.partyName"], defaultLabel: props.intl.formatMessage(translationMessages.deliveryLocation_partyName), defaultIsRequired: false, fieldName: ["invoice", "delivery", "partyName"] },
16
+ var DeliveryLocation = function () {
17
+ return (React.createElement(component_container_1.default, { title: "Delivery location" },
18
+ React.createElement(antd_1.Form.Item, { label: "Description", name: ["invoice", "delivery", "description"] },
49
19
  React.createElement(antd_1.Input, null)),
50
- React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.address.streetNameAndNumber"], defaultLabel: props.intl.formatMessage(translationMessages.deliveryLocation_streetNameAndNumber), defaultIsRequired: false, fieldName: ["invoice", "delivery", "address", "streetNameAndNumber"] },
20
+ React.createElement(antd_1.Form.Item, { label: "Address", name: ["invoice", "delivery", "address", "address"] },
51
21
  React.createElement(antd_1.Input, null)),
52
- React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.address.postalZone"], defaultLabel: props.intl.formatMessage(translationMessages.deliveryLocation_postalZone), defaultIsRequired: false, fieldName: ["invoice", "delivery", "address", "postalZone"] },
53
- React.createElement(antd_1.Input, null)),
54
- React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.address.city"], defaultLabel: props.intl.formatMessage(translationMessages.deliveryLocation_city), defaultIsRequired: false, fieldName: ["invoice", "delivery", "address", "city"] },
55
- React.createElement(antd_1.Input, null)),
56
- React.createElement(form_item_1.default, { receiverRequirements: ReceiverRequirements_1.receiverRequirementsObject, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["delivery.address.countryCode"], defaultLabel: props.intl.formatMessage(translationMessages.deliveryLocation_countryCode), defaultIsRequired: true, fieldName: ["invoice", "delivery", "address", "countryCode"] },
57
- React.createElement(antd_1.Input, null))));
22
+ React.createElement(antd_1.Form.Item, { label: "Post no., town/city", style: { marginBottom: 0 } },
23
+ React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, name: ["invoice", "delivery", "locationIdentifier"] },
24
+ React.createElement(antd_1.Input, null)),
25
+ React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "70%", paddingLeft: "3px" }, name: ["invoice", "delivery", "address", "city"] },
26
+ React.createElement(antd_1.Input, null)))));
58
27
  };
59
- var DeliveryLocationIntl = react_intl_1.injectIntl(DeliveryLocation);
60
- exports.default = DeliveryLocationIntl;
28
+ exports.default = DeliveryLocation;
@@ -107,23 +107,25 @@ var EditableCell = function (props) {
107
107
  switch (dataIdx) {
108
108
  case "quantity":
109
109
  case "unitPriceAmount":
110
- return react_1.default.createElement(antd_1.InputNumber, { step: 1,
110
+ case "taxableAmount":
111
+ case "taxAmount":
112
+ case "taxPercentage":
113
+ case "discountValue":
114
+ case "accountingCost":
115
+ return react_1.default.createElement(antd_1.InputNumber, { step: 0.01,
111
116
  // ref={node => (input = node)}
112
117
  // onPressEnter={save}
113
118
  onBlur: save });
114
- case "discountValue":
115
- return react_1.default.createElement(antd_1.Input, { onBlur: save });
116
119
  case "unitOfMeasure":
117
120
  return (react_1.default.createElement(antd_1.Select, { ref: function (node) { return (input = node); }, defaultActiveFirstOption: true,
118
121
  // onSelect={save}
119
- onChange: save }, Object.keys(models_1.UnitOfMeasureMetadataUnitEnum).map(function (unitOfMeasure) {
120
- if (unitOfMeasure !== "Rec20" && unitOfMeasure !== "Rec21")
121
- return (react_1.default.createElement(antd_1.Select.Option, { value: unitOfMeasure, title: unitOfMeasure, key: unitOfMeasure }, unitOfMeasure));
122
+ onBlur: save }, Object.keys(models_1.UnitOfMeasureMetadataUnitEnum).map(function (unitOfMeasure) {
123
+ return (react_1.default.createElement(antd_1.Select.Option, { value: unitOfMeasure, title: unitOfMeasure, key: unitOfMeasure }, unitOfMeasure));
122
124
  })));
123
125
  case "taxCategoryType":
124
126
  return (react_1.default.createElement(antd_1.Select, { ref: function (node) { return (input = node); }, defaultActiveFirstOption: true,
125
127
  // onSelect={save}
126
- onChange: save }, Object.keys(models_1.BillingLineMetadataTaxCategoryTypeEnum).map(function (taxCategoryType) {
128
+ onBlur: save }, Object.keys(models_1.BillingLineMetadataTaxCategoryTypeEnum).map(function (taxCategoryType) {
127
129
  return (react_1.default.createElement(antd_1.Select.Option, { value: taxCategoryType, title: taxCategoryType, key: taxCategoryType }, taxCategoryType));
128
130
  })));
129
131
  default:
@@ -1,10 +1,5 @@
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
+ export * from "./component-container";
2
+ export * from "./payer";
3
+ export * from "./issuer";
4
+ export * from "./base-information";
5
+ export * from "./delivery-location";
@@ -1,22 +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 });
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;
6
+ __export(require("./component-container"));
7
+ __export(require("./payer"));
8
+ __export(require("./issuer"));
9
+ __export(require("./base-information"));
10
+ __export(require("./delivery-location"));
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { wapi2 } from "@unimaze/api-clients";
3
+ interface Props {
4
+ issuer: wapi2.ProfileOutput;
5
+ }
6
+ declare const Issuer: React.FC<Props>;
7
+ export default Issuer;
@@ -6,12 +6,15 @@ 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
+ };
9
12
  Object.defineProperty(exports, "__esModule", { value: true });
10
13
  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" },
14
+ var component_container_1 = __importDefault(require("../component-container"));
15
+ var Issuer = function (props) {
16
+ var _a = props.issuer, participantLegalIsoIdentifier = _a.participantLegalIsoIdentifier, participantLegalAddressPostalCode = _a.participantLegalAddressPostalCode, participantLegalAddressCity = _a.participantLegalAddressCity, participantLegalAddressStreet = _a.participantLegalAddressStreet, email = _a.email, name = _a.name, country = _a.country;
17
+ return (React.createElement(component_container_1.default, { title: "Issuer" },
15
18
  React.createElement("div", null,
16
19
  React.createElement("strong", null, name),
17
20
  " (",
@@ -22,4 +25,4 @@ var Customer = function (props) {
22
25
  React.createElement("div", null, country),
23
26
  React.createElement("div", null, email)));
24
27
  };
25
- exports.default = Customer;
28
+ exports.default = Issuer;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const Payer: React.FC;
3
+ export default Payer;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __importStar = (this && this.__importStar) || function (mod) {
3
+ if (mod && mod.__esModule) return mod;
4
+ var result = {};
5
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
+ result["default"] = mod;
7
+ return result;
8
+ };
9
+ var __importDefault = (this && this.__importDefault) || function (mod) {
10
+ return (mod && mod.__esModule) ? mod : { "default": mod };
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ var React = __importStar(require("react"));
14
+ var component_container_1 = __importDefault(require("../component-container"));
15
+ var antd_1 = require("antd");
16
+ var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
17
+ var Payer = function () {
18
+ return (React.createElement(component_container_1.default, { title: "Payer" },
19
+ React.createElement(antd_1.Form.Item, { label: "Name/Identifier", style: { marginBottom: 0 } },
20
+ React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "50%" }, name: ["invoice", "customer", "name"], rules: [
21
+ {
22
+ required: ReceiverRequirements_1.getReceiverRequirements(ReceiverRequirements_1.receiverRequirementsObject, ReceiverRequirements_1.AvailableFields["payer.name"]).isRequired,
23
+ message: 'Please input payer name',
24
+ },
25
+ ] },
26
+ React.createElement(antd_1.Input, null)),
27
+ React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "50%", paddingLeft: "3px" }, name: ["invoice", "customer", "isoIdentifier"], rules: [
28
+ {
29
+ required: true,
30
+ message: 'Please input payer identifier',
31
+ },
32
+ ] },
33
+ React.createElement(antd_1.Input, null))),
34
+ React.createElement(antd_1.Form.Item, { label: "Address", name: ["invoice", "customer", "address", "address"] },
35
+ React.createElement(antd_1.Input, null)),
36
+ React.createElement(antd_1.Form.Item, { label: "Zip/City" },
37
+ React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "30%" }, name: ["invoice", "customer", "address", "zip"] },
38
+ React.createElement(antd_1.Input, null)),
39
+ React.createElement(antd_1.Form.Item, { style: { display: 'inline-block', width: "70%", paddingLeft: "3px" }, name: ["invoice", "customer", "address", "city"] },
40
+ React.createElement(antd_1.Input, null))),
41
+ React.createElement(antd_1.Form.Item, { label: "Country", name: ["invoice", "customer", "address", "country"] },
42
+ React.createElement(antd_1.Input, null)),
43
+ React.createElement(antd_1.Form.Item, { label: "E-mail", name: ["invoice", "customer", "contact", "email"], rules: [
44
+ {
45
+ type: 'email',
46
+ message: 'The input is not valid E-mail!',
47
+ }
48
+ ] },
49
+ React.createElement(antd_1.Input, null))));
50
+ };
51
+ exports.default = Payer;
@@ -1,6 +1,3 @@
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;
1
+ /// <reference types="react" />
2
+ declare const PaymentMethod: () => JSX.Element;
3
+ export default PaymentMethod;
@@ -6,72 +6,32 @@ 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
+ };
9
12
  Object.defineProperty(exports, "__esModule", { value: true });
10
13
  var react_1 = __importStar(require("react"));
11
- var components_1 = require("../../components");
14
+ var component_container_1 = __importDefault(require("../component-container"));
12
15
  var antd_1 = require("antd");
13
16
  var models_1 = require("@unimaze/api-clients/lib/mapi/models");
14
- var react_intl_1 = require("react-intl");
15
- var translationMessages = react_intl_1.defineMessages({
16
- paymentMethod_labels_domesticTransfer_bankNo: {
17
- id: "paymentMethod_labels_domesticTransfer_bankNo",
18
- defaultMessage: "Bank no",
19
- },
20
- paymentMethod_labels_domesticTransfer_typeNo: {
21
- id: "paymentMethod_labels_domesticTransfer_typeNo",
22
- defaultMessage: "Type no",
23
- },
24
- paymentMethod_labels_domesticTransfer_accountNo: {
25
- id: "paymentMethod_labels_domesticTransfer_accountNo",
26
- defaultMessage: "Account no",
27
- },
28
- paymentMethod_labels_domesticTransfer_paymentReference: {
29
- id: "paymentMethod_labels_domesticTransfer_paymentReference",
30
- defaultMessage: "Payment reference",
31
- },
32
- paymentMethod_labels_icelandicClaim_bankNo: {
33
- id: "paymentMethod_labels_icelandicClaim_bankNo",
34
- defaultMessage: "Bank no",
35
- },
36
- paymentMethod_labels_icelandicClaim_claimNo: {
37
- id: "paymentMethod_labels_icelandicClaim_claimNo",
38
- defaultMessage: "Claim no",
39
- },
40
- paymentMethod_labels_methods_undefined: {
41
- id: "paymentMethod_labels_methods_undefined",
42
- defaultMessage: "Undefined",
43
- },
44
- paymentMethod_labels_methods_mutuallyAgreed: {
45
- id: "paymentMethod_labels_methods_mutuallyAgreed",
46
- defaultMessage: "Mutually agreed",
47
- },
48
- paymentMethod_labels_methods_domesticTransfer: {
49
- id: "paymentMethod_labels_methods_domesticTransfer",
50
- defaultMessage: "Domestic transfer",
51
- },
52
- paymentMethod_labels_methods_domesticClaim: {
53
- id: "paymentMethod_labels_methods_domesticClaim",
54
- defaultMessage: "Claim (Icelandic)",
55
- },
56
- });
57
- var PaymentMethod = function (props) {
17
+ var PaymentMethod = function () {
58
18
  var _a = react_1.useState(models_1.PaymentMeansMetadataTypeEnum.NotSpecified), paymentMethod = _a[0], setPaymentMethod = _a[1];
59
19
  var domesticTransferFormFields = react_1.default.createElement(react_1.default.Fragment, null,
60
- react_1.default.createElement(antd_1.Form.Item, { label: props.intl.formatMessage(translationMessages.paymentMethod_labels_domesticTransfer_bankNo), name: "paymentMethod:bankNo" },
20
+ react_1.default.createElement(antd_1.Form.Item, { label: "Bank no.", name: "paymentMethod:bankNo" },
61
21
  react_1.default.createElement(antd_1.Input, null)),
62
- react_1.default.createElement(antd_1.Form.Item, { label: props.intl.formatMessage(translationMessages.paymentMethod_labels_domesticTransfer_typeNo), name: "paymentMethod:typeNo" },
22
+ react_1.default.createElement(antd_1.Form.Item, { label: "Type no.", name: "paymentMethod:typeNo" },
63
23
  react_1.default.createElement(antd_1.Select, null,
64
24
  react_1.default.createElement(antd_1.Select.Option, { value: "05" }, "05"),
65
25
  react_1.default.createElement(antd_1.Select.Option, { value: "15" }, "15"),
66
26
  react_1.default.createElement(antd_1.Select.Option, { value: "26" }, "26"))),
67
- react_1.default.createElement(antd_1.Form.Item, { label: props.intl.formatMessage(translationMessages.paymentMethod_labels_domesticTransfer_accountNo), name: "paymentMethod:accountNo" },
27
+ react_1.default.createElement(antd_1.Form.Item, { label: "Account no.", name: "paymentMethod:accountNo" },
68
28
  react_1.default.createElement(antd_1.Input, null)),
69
- react_1.default.createElement(antd_1.Form.Item, { label: props.intl.formatMessage(translationMessages.paymentMethod_labels_domesticTransfer_paymentReference), name: "paymentMethod:paymentReference" },
29
+ react_1.default.createElement(antd_1.Form.Item, { label: "Payment reference", name: "paymentMethod:paymentReference" },
70
30
  react_1.default.createElement(antd_1.Input, null)));
71
31
  var icelandicClaimFormFields = react_1.default.createElement(react_1.default.Fragment, null,
72
- react_1.default.createElement(antd_1.Form.Item, { label: props.intl.formatMessage(translationMessages.paymentMethod_labels_icelandicClaim_bankNo), name: "paymentMethod:bankNo" },
32
+ react_1.default.createElement(antd_1.Form.Item, { label: "Bank no.", name: "paymentMethod:bankNo" },
73
33
  react_1.default.createElement(antd_1.Input, null)),
74
- react_1.default.createElement(antd_1.Form.Item, { label: props.intl.formatMessage(translationMessages.paymentMethod_labels_icelandicClaim_claimNo), name: "paymentMethod:claimNo" },
34
+ react_1.default.createElement(antd_1.Form.Item, { label: "Claim no.", name: "paymentMethod:claimNo" },
75
35
  react_1.default.createElement(antd_1.Input, null)));
76
36
  var renderFormFields = function (payMthd) {
77
37
  switch (payMthd) {
@@ -89,25 +49,25 @@ var PaymentMethod = function (props) {
89
49
  var paymentMethods = [
90
50
  {
91
51
  value: models_1.PaymentMeansMetadataTypeEnum.NotSpecified,
92
- display: props.intl.formatMessage(translationMessages.paymentMethod_labels_methods_undefined) // "Undefined"
52
+ display: "Undefined"
93
53
  },
94
54
  {
95
55
  value: models_1.PaymentMeansMetadataTypeEnum.MutuallyAgreed,
96
- display: props.intl.formatMessage(translationMessages.paymentMethod_labels_methods_mutuallyAgreed) // "Mutually agreed"
56
+ display: "Mutually agreed"
97
57
  },
98
58
  {
99
59
  value: models_1.PaymentMeansMetadataTypeEnum.DomesticTransfer,
100
- display: props.intl.formatMessage(translationMessages.paymentMethod_labels_methods_domesticTransfer) // "Domestic transfer"
60
+ display: "Domestic transfer"
101
61
  },
102
62
  {
103
63
  value: models_1.PaymentMeansMetadataTypeEnum.DomesticClaim,
104
- display: props.intl.formatMessage(translationMessages.paymentMethod_labels_methods_domesticClaim) // "Claim (Icelandic)"
64
+ display: "Claim (Icelandic)"
105
65
  }
106
66
  ];
107
- return (react_1.default.createElement(components_1.ComponentContainer, { title: "Payment method" },
67
+ return (react_1.default.createElement(component_container_1.default, { title: "Payment method" },
108
68
  react_1.default.createElement(antd_1.Select, { value: paymentMethod, onSelect: setPaymentMethod }, paymentMethods.map(function (payMthd) {
109
69
  return react_1.default.createElement(antd_1.Select.Option, { value: payMthd.value, title: payMthd.display, key: payMthd.value }, payMthd.display);
110
70
  })),
111
71
  renderFormFields(paymentMethod)));
112
72
  };
113
- exports.default = react_intl_1.injectIntl(PaymentMethod);
73
+ exports.default = PaymentMethod;
@@ -10,30 +10,37 @@ exports.validationRules = {
10
10
  name: [
11
11
  {
12
12
  required: true,
13
+ message: "Please insert item name",
13
14
  }
14
15
  ],
15
16
  unitOfMeasure: [
16
17
  {
17
18
  required: true,
19
+ message: "Please choose unit of measure",
18
20
  },
19
21
  {
20
22
  enum: Object.keys(models_1.UnitOfMeasureMetadataUnitEnum),
23
+ message: "Unit of measure must be one of the accepted values",
21
24
  },
22
25
  ],
23
26
  unitPriceAmount: [
24
27
  {
25
28
  required: true,
29
+ message: "Please fill in unit price amount",
26
30
  },
27
31
  {
28
32
  type: "number",
33
+ message: "Unit price amount mu st be a number",
29
34
  }
30
35
  ],
31
36
  taxCategoryType: [
32
37
  {
33
38
  required: true,
39
+ message: "Please choose tax category type",
34
40
  },
35
41
  {
36
42
  enum: Object.keys(models_1.BillingLineMetadataTaxCategoryTypeEnum),
43
+ message: "Tax category must be one of the accepted values",
37
44
  },
38
45
  ],
39
46
  discountValue: [],
@@ -1 +1 @@
1
- export { default as DocumentTypeEnum } from "./DocumentTypeEnum";
1
+ export * from "./DocumentTypeEnum";
@@ -1,4 +1,6 @@
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 });
3
- var DocumentTypeEnum_1 = require("./DocumentTypeEnum");
4
- exports.DocumentTypeEnum = DocumentTypeEnum_1.default;
6
+ __export(require("./DocumentTypeEnum"));
@@ -1,81 +1,26 @@
1
- interface Values {
2
- key?: string;
3
- label?: string;
4
- values?: Values[];
1
+ interface KeyValuePair {
2
+ key: string;
3
+ value: string;
5
4
  }
6
- interface FieldRequirement extends Values {
5
+ interface FieldRequirement {
6
+ label: string;
7
+ key: string;
7
8
  isRequired: boolean;
9
+ values?: KeyValuePair[];
8
10
  }
9
11
  declare type ReceiverRequirements = {
10
12
  [key in AvailableFields]?: FieldRequirement;
11
13
  };
12
14
  export declare enum AvailableFields {
13
- "invoiceNo" = "invoiceNo",
14
- "issueDate" = "issueDate",
15
- "dueDate" = "dueDate",
16
- "graceDate" = "graceDate",
17
- "currencyCode" = "currencyCode",
18
- "notes" = "notes",
19
- "accountingCost" = "accountingCost",
20
- "buyerReference" = "buyerReference",
21
- "orderReference.documentNo" = "orderReference.documentNo",
22
- "billingReferences.invoices" = "billingReferences.invoices",
23
- "billingReferences.documentNo" = "billingReferences.documentNo",
24
- "billingReferences.issueDate" = "billingReferences.issueDate",
25
- "billingReferences.creditNotes" = "billingReferences.creditNotes",
26
- "referenceIdentifiers.type" = "referenceIdentifiers.type",
27
- "referenceIdentifiers.code" = "referenceIdentifiers.code",
28
- "referenceIdentifiers.value" = "referenceIdentifiers.value",
29
- "referenceIdentifiers" = "referenceIdentifiers",
30
- "supplier.vatNumber" = "supplier.vatNumber",
31
- "supplier.address.streetNameAndNumber" = "supplier.address.streetNameAndNumber",
32
- "supplier.address.city" = "supplier.address.city",
33
- "supplier.address.postalZone" = "supplier.address.postalZone",
34
- "supplier.address.countryCode" = "supplier.address.countryCode",
35
- "supplier.contact.name" = "supplier.contact.name",
36
- "supplier.contact.electronicMail" = "supplier.contact.electronicMail",
37
- "supplier.contact.telephone" = "supplier.contact.telephone",
38
- "supplier.name" = "supplier.name",
39
- "supplier.identifier" = "supplier.identifier",
40
- "customer.address.streetNameAndNumber" = "customer.address.streetNameAndNumber",
41
- "customer.address.city" = "customer.address.city",
42
- "customer.address.postalZone" = "customer.address.postalZone",
43
- "customer.address.countryCode" = "customer.address.countryCode",
44
- "customer.contact.name" = "customer.contact.name",
45
- "customer.contact.electronicMail" = "customer.contact.electronicMail",
46
- "customer.contact.telephone" = "customer.contact.telephone",
47
- "customer.name" = "customer.name",
48
- "customer.identifier" = "customer.identifier",
49
- "customer.locationIdentifier" = "customer.locationIdentifier",
50
- "payee.name" = "payee.name",
51
- "payee.identifier" = "payee.identifier",
52
- "payee.sepaBankIdentification" = "payee.sepaBankIdentification",
53
- "invoiceLines.itemNo" = "invoiceLines.itemNo",
54
- "invoiceLines.name" = "invoiceLines.name",
55
- "invoiceLines.quantity" = "invoiceLines.quantity",
56
- "invoiceLines.uniteOfMeasure.unit" = "invoiceLines.unitOfMeasure.unit",
57
- "invoiceLines.uniteOfMeasure.code" = "invoiceLines.unitOfMeasure.code",
58
- "invoiceLines.priceAmount" = "invoiceLines.priceAmount",
59
- "invoiceLines.taxCategoryType" = "invoiceLines.taxCategoryType",
60
- "invoiceLines.taxableAmount" = "invoiceLines.taxableAmount",
61
- "invoiceLines.taxAmount" = "invoiceLines.taxAmount",
62
- "invoiceLines.taxPercentage" = "invoiceLines.taxPercentage",
63
- "invoiceLines.discountValue" = "invoiceLines.discountValue",
64
- "paymentTerms.note" = "paymentTerms.note",
65
- "paymentMeans.type" = "paymentMeans.type",
66
- "paymentMeans.internationalTransfer" = "paymentMeans.internationalTransfer",
67
- "paymentMeans.domesticTransfer" = "paymentMeans.domesticTransfer",
68
- "paymentMeans.domesticClaim" = "paymentMeans.domesticClaim",
69
- "delivery.partyName" = "delivery.partyName",
70
- "delivery.locationIdentifier" = "delivery.locationIdentifier",
71
- "delivery.address.streetNameAndNumber" = "delivery.address.streetNameAndNumber",
72
- "delivery.address.city" = "delivery.address.city",
73
- "delivery.address.postalZone" = "delivery.address.postalZone",
74
- "delivery.address.countryCode" = "delivery.address.countryCode",
75
- "delivery.actualDeliveryDate" = "delivery.actualDeliveryDate",
76
- "prepaidAmount" = "prepaidAmount",
77
- "payableAmount" = "payableAmount",
78
- "payableRoundingAmount" = "payableRoundingAmount"
15
+ 'invoiceNo' = "invoiceNo",
16
+ 'issueDate' = "issueDate",
17
+ 'dueDate' = "dueDate",
18
+ 'currencyCode' = "currencyCode",
19
+ 'payer.name' = "payer.name",
20
+ 'payer.identifier' = "payer.identifier",
21
+ 'customer.name' = "customer.name",
22
+ 'customer.identifier' = "customer.identifier"
79
23
  }
80
- export { ReceiverRequirements, FieldRequirement };
24
+ export { ReceiverRequirements };
81
25
  export declare const receiverRequirementsObject: ReceiverRequirements;
26
+ export declare const getReceiverRequirements: (recRequirements: ReceiverRequirements, key: AvailableFields) => FieldRequirement;