@unimaze/billing 0.3.4 → 0.3.5-sjova.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/lib/common/components/attachments/Attachment.js +15 -12
  2. package/lib/common/components/attachments/index.js +12 -11
  3. package/lib/common/components/base-information/ReferenceIdentifiers.js +24 -14
  4. package/lib/common/components/base-information/index.js +66 -39
  5. package/lib/common/components/billing-lines/BillingCalculations.d.ts +2 -2
  6. package/lib/common/components/billing-lines/BillingCalculations.js +8 -7
  7. package/lib/common/components/billing-lines/BillingTaxSummary.js +33 -5
  8. package/lib/common/components/billing-lines/index.d.ts +10 -1
  9. package/lib/common/components/billing-lines/index.js +74 -41
  10. package/lib/common/components/customer/index.d.ts +1 -1
  11. package/lib/common/components/customer/index.js +5 -11
  12. package/lib/common/components/editable-cell/index.d.ts +7 -3
  13. package/lib/common/components/editable-cell/index.js +131 -8
  14. package/lib/common/components/form-item/index.d.ts +4 -2
  15. package/lib/common/components/form-item/index.js +27 -7
  16. package/lib/common/components/payment-method/index.js +38 -62
  17. package/lib/common/components/payment-method/paymentMethodForConversion.js +2 -11
  18. package/lib/common/components/supplier/index.js +18 -35
  19. package/lib/common/consts/formLayout.d.ts +30 -0
  20. package/lib/common/consts/formLayout.js +9 -0
  21. package/lib/common/consts/validationRules.d.ts +2 -2
  22. package/lib/common/consts/validationRules.js +11 -8
  23. package/lib/common/types/AppConfiguration.d.ts +1 -1
  24. package/lib/common/types/BillingLineMetadataOverride.d.ts +5 -3
  25. package/lib/common/types/CommonProps.d.ts +1 -1
  26. package/lib/common/types/ReceiverRequirements.js +1 -1
  27. package/lib/create-invoice/IntlLoader.js +49 -0
  28. package/lib/create-invoice/index.d.ts +7 -10
  29. package/lib/create-invoice/index.js +110 -69
  30. package/lib/translations/locales/is.json +65 -4
  31. package/lib/translations/locales.d.ts +62 -1
  32. package/lib/utils/BillingLineUtility.d.ts +2 -2
  33. package/lib/utils/BillingLineUtility.js +2 -2
  34. package/lib/utils/FormatingUtility.d.ts +2 -0
  35. package/lib/utils/FormatingUtility.js +6 -0
  36. package/lib/utils/IntlUtility.d.ts +4 -0
  37. package/lib/utils/IntlUtility.js +54 -0
  38. package/package.json +3 -9
  39. package/lib/common/types/Configuration.d.ts +0 -14
  40. package/lib/common/types/Configuration.js +0 -2
  41. package/lib/example/src/index.d.ts +0 -1
  42. package/lib/src/common/components/attachments/Attachment.d.ts +0 -18
  43. package/lib/src/common/components/attachments/index.d.ts +0 -6
  44. package/lib/src/common/components/base-information/ReferenceIdentifiers.d.ts +0 -17
  45. package/lib/src/common/components/base-information/index.d.ts +0 -11
  46. package/lib/src/common/components/billing-lines/BillingCalculations.d.ts +0 -11
  47. package/lib/src/common/components/billing-lines/BillingTaxSummary.d.ts +0 -10
  48. package/lib/src/common/components/billing-lines/NewBillingLines.d.ts +0 -10
  49. package/lib/src/common/components/billing-lines/index.d.ts +0 -19
  50. package/lib/src/common/components/component-container/Content.d.ts +0 -7
  51. package/lib/src/common/components/component-container/Header.d.ts +0 -9
  52. package/lib/src/common/components/component-container/index.d.ts +0 -11
  53. package/lib/src/common/components/customer/index.d.ts +0 -16
  54. package/lib/src/common/components/delivery-location/index.d.ts +0 -6
  55. package/lib/src/common/components/editable-cell/index.d.ts +0 -11
  56. package/lib/src/common/components/editable-row/index.d.ts +0 -5
  57. package/lib/src/common/components/form-item/index.d.ts +0 -23
  58. package/lib/src/common/components/index.d.ts +0 -10
  59. package/lib/src/common/components/locale-intl/index.d.ts +0 -10
  60. package/lib/src/common/components/payment-method/index.d.ts +0 -6
  61. package/lib/src/common/components/payment-method/paymentMethodForConversion.d.ts +0 -9
  62. package/lib/src/common/components/supplier/index.d.ts +0 -10
  63. package/lib/src/common/consts/formLayout.d.ts +0 -44
  64. package/lib/src/common/consts/validationRules.d.ts +0 -6
  65. package/lib/src/common/types/ReceiverRequirements.d.ts +0 -81
  66. package/lib/src/translations/locales.d.ts +0 -78
  67. package/lib/src/utils/ApiUtility.d.ts +0 -21
  68. package/lib/src/utils/BillingLineUtility.d.ts +0 -10
  69. package/lib/src/utils/ConversionUtility.d.ts +0 -8
  70. package/lib/src/utils/RequirementsUtility.d.ts +0 -5
  71. package/lib/src/utils/index.d.ts +0 -2
  72. /package/lib/{src/create-invoice/index.d.ts → create-invoice/IntlLoader.d.ts} +0 -0
@@ -57,6 +57,14 @@ var translationMessages = react_intl_1.defineMessages({
57
57
  id: "attachment_labels_File",
58
58
  defaultMessage: "File",
59
59
  },
60
+ attachment_labels_uploadFileMsg: {
61
+ id: "attachment_labels_uploadFileMsg",
62
+ defaultMessage: "Click or drag file to this area to upload",
63
+ },
64
+ attachment_labels_descriptionErrorMsg: {
65
+ id: "attachment_labels_descriptionErrorMsg",
66
+ defaultMessage: "Description must not match to another file description",
67
+ },
60
68
  });
61
69
  var Attachment = /** @class */ (function (_super) {
62
70
  __extends(Attachment, _super);
@@ -89,18 +97,15 @@ var Attachment = /** @class */ (function (_super) {
89
97
  return ["file1", "file2"];
90
98
  }
91
99
  };
100
+ var attachmentLabelsDescriptionErrorMsg = this.props.intl.formatMessage(translationMessages.attachment_labels_descriptionErrorMsg);
92
101
  return (React.createElement(React.Fragment, null,
93
- React.createElement(antd_1.Form.Item, __assign({}, formLayout_1.formItemLayout, {
94
- // this.props.intl.formatMessage(translationMessages.attachment_labels_File)
95
- label: "Skrá", name: ["attachments", "" + fieldName, "file"], valuePropName: "fileList", getValueFromEvent: this.normFile }),
102
+ React.createElement(antd_1.Form.Item, __assign({}, formLayout_1.formItemVerticalLayout, { label: this.props.intl.formatMessage(translationMessages.attachment_labels_File), name: ["attachments", "" + fieldName, "file"], valuePropName: "fileList", getValueFromEvent: this.normFile }),
96
103
  React.createElement(antd_1.Upload.Dragger, { name: "attachment:" + fieldName, multiple: false, onRemove: this.handleRemoveFile, beforeUpload: function () { return false; } },
97
- React.createElement("p", null, "Smelltu e\u00F0a drag\u00F0u inn skr\u00E1 h\u00E9r til a\u00F0 hla\u00F0a upp"))),
98
- React.createElement(antd_1.Form.Item, __assign({}, formLayout_1.formItemLayout, {
99
- // this.props.intl.formatMessage(translationMessages.attachment_labels_Description)
100
- label: "Lýsing", name: ["attachments", "" + fieldName, "description"], rules: [
104
+ React.createElement("p", null, this.props.intl.formatMessage(translationMessages.attachment_labels_uploadFileMsg)))),
105
+ React.createElement(antd_1.Form.Item, __assign({}, formLayout_1.formItemVerticalLayout, { label: this.props.intl.formatMessage(translationMessages.attachment_labels_Description), name: ["attachments", "" + fieldName, "description"], rules: [
101
106
  {
102
107
  required: this.state.file.length > 0,
103
- message: "Vinsamlega sláið inn lýsingu" // this.props.intl.formatMessage(translationMessages.attachment_labels_Description_requiredMessage),
108
+ message: this.props.intl.formatMessage(translationMessages.attachment_labels_Description_requiredMessage),
104
109
  },
105
110
  function (_a) {
106
111
  var getFieldValue = _a.getFieldValue;
@@ -109,8 +114,7 @@ var Attachment = /** @class */ (function (_super) {
109
114
  if (!value || getFieldValue(["attachments", returnOtherFieldNames(fieldName)[0], "description"]) !== value) {
110
115
  return Promise.resolve();
111
116
  }
112
- // return Promise.reject('Description must not match to another file description');
113
- return Promise.reject('Lýsing má ekki samsvara annarri skráalýsing');
117
+ return Promise.reject(attachmentLabelsDescriptionErrorMsg);
114
118
  }
115
119
  });
116
120
  },
@@ -121,8 +125,7 @@ var Attachment = /** @class */ (function (_super) {
121
125
  if (!value || getFieldValue(["attachments", returnOtherFieldNames(fieldName)[1], "description"]) !== value) {
122
126
  return Promise.resolve();
123
127
  }
124
- // return Promise.reject('Description must not match to another file description');
125
- return Promise.reject('Lýsing má ekki samsvara annarri skráalýsing');
128
+ return Promise.reject(attachmentLabelsDescriptionErrorMsg);
126
129
  }
127
130
  });
128
131
  },
@@ -18,26 +18,27 @@ var antd_1 = require("antd");
18
18
  var icons_1 = require("@ant-design/icons");
19
19
  var translationMessages = react_intl_1.defineMessages({
20
20
  attachment_title: {
21
- id: "attachment.title",
21
+ id: "attachment_title",
22
22
  defaultMessage: "Attachments",
23
23
  },
24
+ attachment_tooltip_title: {
25
+ id: "attachment_tooltip_title",
26
+ defaultMessage: "The maximum size is ??MB. Account supporting documents can be copies of the original invoice or supporting documents, such as time reports???" // "Hámarks stærð er ??MB. Fylgigögn reiknings geta verið afrit af upprunalega reikningnum eða fylgigögn, svo sem tímaskýrslur",
27
+ },
24
28
  });
25
29
  var AttachmentsGroup = function (props) {
26
- var attachmentLabelNode = (React.createElement(antd_1.Tooltip
27
- // props.intl.formatMessage(translationMessages.attachment_title)}
28
- , {
29
- // props.intl.formatMessage(translationMessages.attachment_title)}
30
- title: "Hámarks stærð er ??MB. Fylgigögn reiknings geta verið afrit af upprunalega reikningnum eða fylgigögn, svo sem tímaskýrslur", placement: "right" },
30
+ var attachmentLabelNode = (React.createElement(antd_1.Tooltip, { title: props.intl.formatMessage(translationMessages.attachment_tooltip_title), placement: "right" },
31
31
  React.createElement("span", null,
32
- "Vi\u00F0hengi ",
32
+ props.intl.formatMessage(translationMessages.attachment_title),
33
+ " ",
33
34
  React.createElement(icons_1.QuestionCircleOutlined, null))));
34
35
  return (React.createElement(components_1.ComponentContainer, { title: attachmentLabelNode },
35
- React.createElement(antd_1.Row, null,
36
- React.createElement(antd_1.Col, { span: 24 },
36
+ React.createElement(antd_1.Row, { gutter: [16, 16] },
37
+ React.createElement(antd_1.Col, { span: 8 },
37
38
  React.createElement(Attachment_1.default, { key: "attachment1", fieldName: "file1" })),
38
- React.createElement(antd_1.Col, { span: 24 },
39
+ React.createElement(antd_1.Col, { span: 8 },
39
40
  React.createElement(Attachment_1.default, { key: "attachment2", fieldName: "file2" })),
40
- React.createElement(antd_1.Col, { span: 24 },
41
+ React.createElement(antd_1.Col, { span: 8 },
41
42
  React.createElement(Attachment_1.default, { key: "attachment3", fieldName: "file3" })))));
42
43
  };
43
44
  var AttachmentGroupIntl = react_intl_1.injectIntl(AttachmentsGroup);
@@ -28,24 +28,37 @@ var translationMessages = react_intl_1.defineMessages({
28
28
  id: "referenceIdentifiers_labels_referenceIdentifier",
29
29
  defaultMessage: "Reference identifier",
30
30
  },
31
+ referenceIdentifiers_labels_referenceIdentifier_title: {
32
+ id: "referenceIdentifiers_labels_referenceIdentifier_title",
33
+ defaultMessage: "The number corresponds to the damage in question (car number, real estate number or ID number)???" // "Númer er á við tjónið sem um ræðir (bílnúmer, fasteignanúmer eða kennitala)",
34
+ },
35
+ referenceIdentifiers_labels_carNumber: {
36
+ id: "referenceIdentifiers_labels_carNumber",
37
+ defaultMessage: "Car number" // "Bílnúmer",
38
+ },
39
+ referenceIdentifiers_labels_identifier: {
40
+ id: "referenceIdentifiers_labels_identifier",
41
+ defaultMessage: "Identifier" // "Kennitala",
42
+ },
43
+ referenceIdentifiers_labels_propertyNumber: {
44
+ id: "referenceIdentifiers_labels_propertyNumber",
45
+ defaultMessage: "Property number" // "Fasteignanúmer",
46
+ },
31
47
  });
32
48
  var ReferenceIdentifiers = function (props) {
33
- var referenceIdentifierLabelNode = (react_1.default.createElement(antd_1.Tooltip
34
- // props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_referenceIdentifier)
35
- , {
36
- // props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_referenceIdentifier)
37
- title: "Númer er á við tjónið sem um ræðir (bílnúmer, fasteignanúmer eða kennitala)", placement: "right" },
49
+ var referenceIdentifierLabelNode = (react_1.default.createElement(antd_1.Tooltip, { title: props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_referenceIdentifier_title), placement: "right" },
38
50
  react_1.default.createElement("span", null,
39
- "Tilv\u00EDsunarn\u00FAmer ",
51
+ props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_referenceIdentifier),
52
+ " ",
40
53
  react_1.default.createElement(icons_1.QuestionCircleOutlined, null))));
41
54
  return (react_1.default.createElement("div", null,
42
55
  props.fields.map(function (field, index) { return (react_1.default.createElement(antd_1.Form.Item, __assign({ key: "referenceIdentifier-" + index }, (index === 0 ? formLayout_1.formItemLayout : formLayout_1.formItemLayoutWithOutLabel), { label: index === 0 ? referenceIdentifierLabelNode : "" }),
43
56
  react_1.default.createElement(antd_1.Space, { key: field.key, style: { display: "flex", marginBottom: 0 }, align: "start" },
44
57
  react_1.default.createElement(antd_1.Form.Item, __assign({}, field, { name: [field.name, "code"], fieldKey: [field.fieldKey, "code"], rules: [{ required: true }] }),
45
- react_1.default.createElement(antd_1.Select, { labelInValue: true, style: { width: "150px" } },
46
- react_1.default.createElement(antd_1.Select.Option, { value: "AKY" }, "B\u00EDln\u00FAmer"),
47
- react_1.default.createElement(antd_1.Select.Option, { value: "ARR" }, "Kennitala"),
48
- react_1.default.createElement(antd_1.Select.Option, { value: "LOC" }, "Fasteignan\u00FAmer"))),
58
+ react_1.default.createElement(antd_1.Select, { labelInValue: true, style: { width: "100px" } },
59
+ react_1.default.createElement(antd_1.Select.Option, { value: "AKY" }, props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_carNumber)),
60
+ react_1.default.createElement(antd_1.Select.Option, { value: "ARR" }, props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_identifier)),
61
+ react_1.default.createElement(antd_1.Select.Option, { value: "LOC" }, props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_propertyNumber)))),
49
62
  react_1.default.createElement(antd_1.Form.Item, __assign({}, field, { name: [field.name, "value"], fieldKey: [field.fieldKey, "value"], rules: [{ required: true }] }),
50
63
  react_1.default.createElement(antd_1.Input, null)),
51
64
  react_1.default.createElement(icons_1.MinusCircleOutlined, { onClick: function () {
@@ -54,9 +67,6 @@ var ReferenceIdentifiers = function (props) {
54
67
  react_1.default.createElement(antd_1.Form.Item, __assign({}, (props.fields.length === 0 ? formLayout_1.formItemLayout : formLayout_1.formItemLayoutWithOutLabel), { label: props.fields.length === 0 ? referenceIdentifierLabelNode : "" }),
55
68
  react_1.default.createElement(antd_1.Button, { type: "dashed", onClick: function () {
56
69
  props.add();
57
- }, style: { width: "100%" } },
58
- react_1.default.createElement(icons_1.PlusOutlined, null),
59
- " ",
60
- "Bætið við tilvísunarnúmeri"))));
70
+ }, style: { width: "100%" }, icon: react_1.default.createElement(icons_1.PlusOutlined, null) }, props.intl.formatMessage(translationMessages.referenceIdentifiers_labels_addButton)))));
61
71
  };
62
72
  exports.default = react_intl_1.injectIntl(ReferenceIdentifiers);
@@ -32,14 +32,26 @@ var translationMessages = react_intl_1.defineMessages({
32
32
  id: "baseInformation_issueDate",
33
33
  defaultMessage: "Issue date"
34
34
  },
35
+ baseInformation_issueDate_title: {
36
+ id: "baseInformation_issueDate_title",
37
+ defaultMessage: "The issuance date of the board during which the settlement period of the transaction is recorded???" // "Útgáfudagsetning stjórnar á hvaða uppgjörstímabili færslan skráist"
38
+ },
35
39
  baseInformation_dueDate: {
36
40
  id: "baseInformation_dueDate",
37
41
  defaultMessage: "Due date"
38
42
  },
43
+ baseInformation_dueDate_title: {
44
+ id: "baseInformation_dueDate_title",
45
+ defaultMessage: "Settlement period date shall be the same as the due date???" // "Eindagi skal vera sá sami og gjalddagi"
46
+ },
39
47
  baseInformation_orderReference_documentNo: {
40
48
  id: "baseInformation_orderReference_documentNo",
41
49
  defaultMessage: "Order no"
42
50
  },
51
+ baseInformation_orderReference_documentNo_title: {
52
+ id: "baseInformation_orderReference_documentNo_title",
53
+ defaultMessage: "Buyer reference can be as an example; an employee number, a code for a department or team, a claim number. If customer has not specified a reference, then the name of person who requested or ordered the services can be specified here."
54
+ },
43
55
  baseInformation_notes: {
44
56
  id: "baseInformation_notes",
45
57
  defaultMessage: "Notes"
@@ -47,39 +59,70 @@ var translationMessages = react_intl_1.defineMessages({
47
59
  baseInformation_currencyCode: {
48
60
  id: "baseInformation_currencyCode",
49
61
  defaultMessage: "Currency"
50
- }
62
+ },
63
+ baseInformation_dueDateErrorMsg: {
64
+ id: "baseInformation_dueDateErrorMsg",
65
+ defaultMessage: "Due date must be after the issue date"
66
+ },
67
+ baseInformation_currency_ISK: {
68
+ id: "baseInformation_currency_ISK",
69
+ defaultMessage: "Icelandic krona (ISK)"
70
+ },
71
+ baseInformation_currency_DKK: {
72
+ id: "baseInformation_currency_DKK",
73
+ defaultMessage: "Danish krona (DKK)"
74
+ },
75
+ baseInformation_currency_NOK: {
76
+ id: "baseInformation_currency_NOK",
77
+ defaultMessage: "Norwegian krona (NOK)"
78
+ },
79
+ baseInformation_currency_SEK: {
80
+ id: "baseInformation_currency_SEK",
81
+ defaultMessage: "Swedish krona (SEK)"
82
+ },
83
+ baseInformation_currency_EUR: {
84
+ id: "baseInformation_currency_EUR",
85
+ defaultMessage: "Euro (EUR)"
86
+ },
87
+ baseInformation_currency_USD: {
88
+ id: "baseInformation_currency_USD",
89
+ defaultMessage: "US dollar (USD)"
90
+ },
91
+ baseInformation_currency_GBP: {
92
+ id: "baseInformation_currency_GBP",
93
+ defaultMessage: "British pound (GBP)"
94
+ },
51
95
  });
52
96
  var BaseInformation = function (props) {
53
97
  var getCurrencies = function (recRequirements) {
54
98
  var currencies = [
55
99
  {
56
100
  key: "ISK",
57
- // label: "Icelandic krona (ISK)"
58
- label: "Íslensk króna (ISK)"
101
+ label: props.intl.formatMessage(translationMessages.baseInformation_currency_ISK)
59
102
  },
60
103
  {
61
104
  key: "DKK",
62
- label: "Danish krona (DKK)"
105
+ label: props.intl.formatMessage(translationMessages.baseInformation_currency_DKK)
63
106
  },
64
107
  {
65
108
  key: "NOK",
66
- label: "Norwegian krona (NOK)"
109
+ label: props.intl.formatMessage(translationMessages.baseInformation_currency_NOK)
67
110
  },
68
111
  {
69
112
  key: "SEK",
70
- label: "Swedish krona (SEK)"
113
+ label: props.intl.formatMessage(translationMessages.baseInformation_currency_SEK)
71
114
  },
72
115
  {
73
116
  key: "EUR",
74
- label: "Euro (EUR)"
117
+ label: props.intl.formatMessage(translationMessages.baseInformation_currency_EUR)
75
118
  },
76
119
  {
77
120
  key: "USD",
78
- label: "US dollar (USD)"
121
+ label: props.intl.formatMessage(translationMessages.baseInformation_currency_USD)
79
122
  },
80
123
  {
81
124
  key: "GBP",
82
- label: "British pound (GBP)"
125
+ label: props.intl.formatMessage(translationMessages.baseInformation_currency_GBP)
83
126
  },
84
127
  ];
85
128
  if (recRequirements.currencyCode && recRequirements.currencyCode.values && recRequirements.currencyCode.values.length > 0) {
@@ -104,39 +147,29 @@ var BaseInformation = function (props) {
104
147
  });
105
148
  }
106
149
  };
107
- var dueDateLabelNode = (React.createElement(antd_1.Tooltip
108
- // props.intl.formatMessage(translationMessages.baseInformation_dueDate)
109
- , {
110
- // props.intl.formatMessage(translationMessages.baseInformation_dueDate)
111
- title: "Eindagi skal vera sá sami og gjalddagi", placement: "right" },
150
+ var dueDateLabelNode = (React.createElement(antd_1.Tooltip, { title: props.intl.formatMessage(translationMessages.baseInformation_dueDate_title), placement: "right" },
112
151
  React.createElement("span", null,
113
- "Gjalddagi ",
152
+ props.intl.formatMessage(translationMessages.baseInformation_dueDate),
153
+ " ",
114
154
  React.createElement(icons_1.QuestionCircleOutlined, null))));
115
- var issueDateLabelNode = (React.createElement(antd_1.Tooltip
116
- // props.intl.formatMessage(translationMessages.baseInformation_issueDate)
117
- , {
118
- // props.intl.formatMessage(translationMessages.baseInformation_issueDate)
119
- title: "Útgáfudagsetning stjórnar á hvaða uppgjörstímabili færslan skráist", placement: "right" },
155
+ var issueDateLabelNode = (React.createElement(antd_1.Tooltip, { title: props.intl.formatMessage(translationMessages.baseInformation_issueDate_title), placement: "right" },
120
156
  React.createElement("span", null,
121
- "\u00DAtg\u00E1fudags. ",
157
+ props.intl.formatMessage(translationMessages.baseInformation_issueDate),
158
+ " ",
122
159
  React.createElement(icons_1.QuestionCircleOutlined, null))));
123
- return (
124
- // props.intl.formatMessage(translationMessages.baseInformation_title)
125
- React.createElement(components_1.ComponentContainer, { title: "Grunnupplýsingar" },
160
+ return (React.createElement(components_1.ComponentContainer, { title: props.intl.formatMessage(translationMessages.baseInformation_title) },
126
161
  React.createElement(form_item_1.default
127
162
  // // receiverRequirements={receiverRequirementsObject}
128
163
  , {
129
164
  // // receiverRequirements={receiverRequirementsObject}
130
- receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.invoiceNo,
131
- // props.intl.formatMessage(translationMessages.baseInformation_invoiceNo)
132
- defaultLabel: "Reikningsnr.", defaultIsRequired: true, fieldName: ["invoice", "invoiceNo"] },
165
+ receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.invoiceNo, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_invoiceNo), defaultIsRequired: true, fieldName: ["invoice", "invoiceNo"] },
133
166
  React.createElement(antd_1.Input, null)),
134
167
  React.createElement(form_item_1.default
135
168
  // // receiverRequirements={receiverRequirementsObject}
136
169
  , {
137
170
  // // receiverRequirements={receiverRequirementsObject}
138
171
  receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.issueDate, defaultLabel: issueDateLabelNode, defaultIsRequired: true, fieldName: ["invoice", "issueDate"] },
139
- React.createElement(antd_1.DatePicker, null)),
172
+ React.createElement(antd_1.DatePicker, { style: { width: "100%" } })),
140
173
  React.createElement(form_item_1.default
141
174
  // // receiverRequirements={receiverRequirementsObject}
142
175
  , {
@@ -149,35 +182,29 @@ var BaseInformation = function (props) {
149
182
  }
150
183
  var issueDate = props.form.getFieldValue(["invoice", "issueDate"]);
151
184
  value < issueDate
152
- ? callback("Due date must be after the issue date")
185
+ ? callback(props.intl.formatMessage(translationMessages.baseInformation_dueDateErrorMsg))
153
186
  : callback();
154
187
  }),
155
188
  },
156
189
  ] },
157
- React.createElement(antd_1.DatePicker, { onChange: checkIfEmpty, disabledDate: (function (current) { return disabledDate(current, props.form.getFieldValue(["invoice", "issueDate"])); }) })),
190
+ React.createElement(antd_1.DatePicker, { style: { width: "100%" }, onChange: checkIfEmpty, disabledDate: (function (current) { return disabledDate(current, props.form.getFieldValue(["invoice", "issueDate"])); }) })),
158
191
  React.createElement(form_item_1.default
159
192
  // // receiverRequirements={receiverRequirementsObject}
160
193
  , {
161
194
  // // receiverRequirements={receiverRequirementsObject}
162
- receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.buyerReference,
163
- // props.intl.formatMessage(translationMessages.baseInformation_orderReference_documentNo)
164
- defaultLabel: "Pöntunarnr", defaultIsRequired: true, fieldName: ["invoice", "buyerReference"] },
195
+ receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.buyerReference, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_orderReference_documentNo), defaultLabelTooltip: props.intl.formatMessage(translationMessages.baseInformation_orderReference_documentNo_title), defaultIsRequired: true, fieldName: ["invoice", "buyerReference"] },
165
196
  React.createElement(antd_1.Input, null)),
166
197
  React.createElement(form_item_1.default
167
198
  // receiverRequirements={receiverRequirementsObject}
168
199
  , {
169
200
  // receiverRequirements={receiverRequirementsObject}
170
- receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.notes,
171
- // props.intl.formatMessage(translationMessages.baseInformation_notes)
172
- defaultLabel: "Athugasemdir", defaultIsRequired: false, fieldName: ["invoice", "notes"] },
201
+ receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.notes, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_notes), defaultIsRequired: false, fieldName: ["invoice", "notes"] },
173
202
  React.createElement(antd_1.Input.TextArea, null)),
174
203
  React.createElement(form_item_1.default
175
204
  // receiverRequirements={receiverRequirementsObject}
176
205
  , {
177
206
  // receiverRequirements={receiverRequirementsObject}
178
- receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.currencyCode,
179
- // props.intl.formatMessage(translationMessages.baseInformation_currencyCode)
180
- defaultLabel: "Gjaldmiðill", defaultIsRequired: true, fieldName: ["invoice", "currencyCode"] },
207
+ receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.currencyCode, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_currencyCode), defaultIsRequired: true, fieldName: ["invoice", "currencyCode"] },
181
208
  React.createElement(antd_1.Select, { defaultActiveFirstOption: true }, getCurrencies(ReceiverRequirements_1.receiverRequirementsObject))),
182
209
  React.createElement(antd_1.Form.List, { name: ["invoice", "referenceIdentifiers"] }, function (fields, _a) {
183
210
  var add = _a.add, remove = _a.remove;
@@ -3,9 +3,9 @@ import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOver
3
3
  import { InjectedIntlProps } from "react-intl";
4
4
  interface Props extends InjectedIntlProps {
5
5
  billingLinesMetadata: BillingLineMetadataOverride[] | undefined;
6
- renderCurrencyColumn: (text: string | number) => string;
6
+ currencyCode: string;
7
7
  }
8
- declare const _default: React.ComponentClass<Pick<Props, "billingLinesMetadata" | "renderCurrencyColumn">, any> & {
8
+ declare const _default: React.ComponentClass<Pick<Props, "currencyCode" | "billingLinesMetadata">, any> & {
9
9
  WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
10
10
  };
11
11
  export default _default;
@@ -8,6 +8,7 @@ var antd_1 = require("antd");
8
8
  var BillingLineUtility_1 = require("../../../utils/BillingLineUtility");
9
9
  var api_1 = require("@unimaze/api-clients/lib/mapi/api");
10
10
  var react_intl_1 = require("react-intl");
11
+ var IntlUtility_1 = require("../../../utils/IntlUtility");
11
12
  var translationMessages = react_intl_1.defineMessages({
12
13
  billingCalculations_labels_TaxAmountWithoutVat: {
13
14
  id: "billingCalculations_labels_TaxAmountWithoutVat",
@@ -31,7 +32,7 @@ var BillingCalculations = function (props) {
31
32
  };
32
33
  if (billingLinesMetadata) {
33
34
  billingLinesMetadata.map(function (billingLine) {
34
- var taxAmount = BillingLineUtility_1.calculateTaxAmount(BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount), BillingLineUtility_1.calculateTaxPercentage(api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType])); // BillingLineMetadataTaxCategoryTypeEnum -> TaxCategoryTypeEnum
35
+ var taxAmount = BillingLineUtility_1.calculateTaxAmount(BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount), BillingLineUtility_1.calculateTaxPercentage(api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType.value])); // BillingLineMetadataTaxCategoryTypeEnum -> TaxCategoryTypeEnum
35
36
  var taxableAmount = BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount);
36
37
  var taxInclusiveAmount = taxableAmount + taxAmount;
37
38
  totals = {
@@ -44,20 +45,20 @@ var BillingCalculations = function (props) {
44
45
  return (react_1.default.createElement(react_1.default.Fragment, null,
45
46
  react_1.default.createElement(antd_1.Row, null,
46
47
  react_1.default.createElement(antd_1.Col, { span: 18, style: { textAlign: "right" } },
47
- "Samtals án VSK",
48
+ props.intl.formatMessage(translationMessages.billingCalculations_labels_TaxAmountWithoutVat),
48
49
  ":"),
49
- react_1.default.createElement(antd_1.Col, { span: 6, style: { textAlign: "right" } }, props.renderCurrencyColumn(Math.round(totals.totalTaxableAmount)))),
50
+ react_1.default.createElement(antd_1.Col, { span: 6, style: { textAlign: "right" } }, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(totals.totalTaxableAmount, props.intl, { style: "currency", currency: props.currencyCode }))),
50
51
  react_1.default.createElement(antd_1.Row, null,
51
52
  react_1.default.createElement(antd_1.Col, { span: 18, style: { textAlign: "right" } },
52
- "Samtals VSK upphæð",
53
+ props.intl.formatMessage(translationMessages.billingCalculations_labels_TotalVatAmount),
53
54
  ":"),
54
- react_1.default.createElement(antd_1.Col, { span: 6, style: { textAlign: "right" } }, props.renderCurrencyColumn(Math.round(totals.totalTaxAmount)))),
55
+ react_1.default.createElement(antd_1.Col, { span: 6, style: { textAlign: "right" } }, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(totals.totalTaxAmount, props.intl, { style: "currency", currency: props.currencyCode }))),
55
56
  react_1.default.createElement(antd_1.Row, null,
56
57
  react_1.default.createElement(antd_1.Col, { span: 18, style: { textAlign: "right" } },
57
58
  react_1.default.createElement("span", { style: { fontWeight: 600 } },
58
- "Samtals með VSK",
59
+ props.intl.formatMessage(translationMessages.billingCalculations_labels_TotalAmountWithVat),
59
60
  ":")),
60
61
  react_1.default.createElement(antd_1.Col, { span: 6, style: { textAlign: "right" } },
61
- react_1.default.createElement("span", { style: { fontWeight: 600 } }, props.renderCurrencyColumn(Math.round(totals.totalTaxInclusiveAmount)))))));
62
+ react_1.default.createElement("span", { style: { fontWeight: 600 } }, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(totals.totalTaxInclusiveAmount, props.intl, { style: "currency", currency: props.currencyCode }))))));
62
63
  };
63
64
  exports.default = react_intl_1.injectIntl(BillingCalculations);
@@ -8,6 +8,8 @@ var antd_1 = require("antd");
8
8
  var BillingLineUtility_1 = require("../../../utils/BillingLineUtility");
9
9
  var api_1 = require("@unimaze/api-clients/lib/mapi/api");
10
10
  var react_intl_1 = require("react-intl");
11
+ var editable_cell_1 = require("../editable-cell");
12
+ var IntlUtility_1 = require("../../../utils/IntlUtility");
11
13
  var translationMessages = react_intl_1.defineMessages({
12
14
  billingTaxSummary_taxOverview: {
13
15
  id: "billingTaxSummary_taxOverview",
@@ -21,14 +23,34 @@ var translationMessages = react_intl_1.defineMessages({
21
23
  id: "billingTaxSummary_taxAmount",
22
24
  defaultMessage: "Tax"
23
25
  },
26
+ billingTaxSummary_taxCategoryType_labels_StandardRated: {
27
+ id: "billingTaxSummary_taxCategoryType_labels_StandardRated",
28
+ defaultMessage: "Standard rated",
29
+ },
30
+ billingTaxSummary_taxCategoryType_labels_ReducedRated: {
31
+ id: "billingTaxSummary_taxCategoryType_labels_ReducedRated",
32
+ defaultMessage: "Reduced rated",
33
+ },
34
+ billingTaxSummary_taxCategoryType_labels_ZeroRated: {
35
+ id: "billingTaxSummary_taxCategoryType_labels_ZeroRated",
36
+ defaultMessage: "Zero rated",
37
+ },
38
+ billingTaxSummary_taxCategoryType_labels_Exempt: {
39
+ id: "billingTaxSummary_taxCategoryType_labels_Exempt",
40
+ defaultMessage: "Exempt",
41
+ },
24
42
  });
25
43
  var BillingTaxSummary = function (props) {
26
44
  var dataSource = props.billingLines
27
45
  ? props.billingLines.map(function (billingLine) {
46
+ var taxCategoryType = api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType.value];
47
+ var translationString = "taxCategoryType_labels_" + taxCategoryType;
48
+ var messageDescriptor = editable_cell_1.commonTranslationMessages[translationString];
49
+ var taxCategoryTypeTranslated = props.intl.formatMessage(messageDescriptor);
28
50
  return {
29
- taxOverview: BillingLineUtility_1.generateTaxCategoryLabel(billingLine.taxCategoryType),
51
+ taxOverview: BillingLineUtility_1.generateTaxCategoryLabel(taxCategoryType, taxCategoryTypeTranslated),
30
52
  taxableAmount: BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount),
31
- taxAmount: BillingLineUtility_1.calculateTaxAmount(BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount), BillingLineUtility_1.calculateTaxPercentage(api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType]))
53
+ taxAmount: BillingLineUtility_1.calculateTaxAmount(BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount), BillingLineUtility_1.calculateTaxPercentage(api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType.value]))
32
54
  };
33
55
  })
34
56
  : [];
@@ -49,16 +71,22 @@ var BillingTaxSummary = function (props) {
49
71
  // console.log(result);
50
72
  var columns = [
51
73
  {
52
- title: "Skattsyfirlit",
74
+ title: props.intl.formatMessage(translationMessages.billingTaxSummary_taxOverview),
53
75
  dataIndex: "taxOverview",
54
76
  },
55
77
  {
56
- title: "Skattskyld upphæð",
78
+ title: props.intl.formatMessage(translationMessages.billingTaxSummary_taxableAmount),
57
79
  dataIndex: "taxableAmount",
80
+ render: function (value, record) {
81
+ return IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(record.taxableAmount, props.intl, { style: "decimal" });
82
+ }
58
83
  },
59
84
  {
60
- title: "Skattur",
85
+ title: props.intl.formatMessage(translationMessages.billingTaxSummary_taxAmount),
61
86
  dataIndex: "taxAmount",
87
+ render: function (value, record) {
88
+ return IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(record.taxAmount, props.intl, { style: "decimal" });
89
+ }
62
90
  },
63
91
  ];
64
92
  return (react_1.default.createElement(antd_1.Table, { style: { minHeight: "170px" },
@@ -3,6 +3,14 @@ import { BillingLineMetadata } from "@unimaze/api-clients/lib/mapi/models";
3
3
  import { InjectedIntlProps } from "react-intl";
4
4
  import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOverride";
5
5
  import { FormInstance } from "antd/es/form";
6
+ export interface TaxCategoryTypeWithPercentageEnum {
7
+ value: "StandardRated" | "ReducedRated" | "ZeroRated" | "Exempt";
8
+ label: string;
9
+ }
10
+ export interface UnitOfMeasureLabelInValueEnum {
11
+ value: "Piece" | "Kilogram" | "Month" | "Package" | "Year" | "Day" | "Hour" | "Kilometre" | "Metre" | "Litre" | "SquareMetre" | "CubicMetre" | "Tonne" | "KiloWattHour" | "One" | "Rec20" | "Rec21";
12
+ label: string;
13
+ }
6
14
  interface Props extends InjectedIntlProps {
7
15
  formInstance: FormInstance;
8
16
  setBillingLineMetadata: (formInstance: FormInstance, billingLineMetadata: BillingLineMetadata[]) => void;
@@ -13,7 +21,8 @@ interface Props extends InjectedIntlProps {
13
21
  initialBillingLineData: BillingLineMetadataOverride;
14
22
  editableIndex: number;
15
23
  }
16
- declare const BillingLinesIntl: React.ComponentClass<Pick<Props, "dataSource" | "formInstance" | "setBillingLineMetadata" | "handleDelete" | "handleAdd" | "handleSave" | "initialBillingLineData" | "editableIndex">, any> & {
24
+ export declare const translationMessages: ReactIntl.Messages<"billingLines_title" | "billingLines_tooltip_title" | "billingLines_itemNo" | "billingLines_name" | "billingLines_quantity" | "billingLines_unitOfMeasure" | "billingLines_unitPriceAmount" | "billingLines_taxCategoryType" | "billingLines_taxCategoryType_title" | "billingLines_taxCategoryPercentage" | "billingLines_discount" | "billingLines_lineAmount" | "billingLines_taxAmount" | "billingLines_button_addRow" | "billingLines_placeholders_itemNo" | "billingLines_placeholders_newItem">;
25
+ declare const BillingLinesIntl: React.ComponentClass<Pick<Props, "dataSource" | "formInstance" | "handleSave" | "setBillingLineMetadata" | "handleDelete" | "handleAdd" | "initialBillingLineData" | "editableIndex">, any> & {
17
26
  WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
18
27
  };
19
28
  export default BillingLinesIntl;