@unimaze/billing 0.20.17 → 0.21.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 (114) hide show
  1. package/lib/common/components/CommonTranslations.d.ts +102 -2
  2. package/lib/common/components/CommonTranslations.js +10 -1
  3. package/lib/common/components/attachments/Attachment.d.ts +6 -4
  4. package/lib/common/components/attachments/Attachment.js +26 -10
  5. package/lib/common/components/attachments/AttachmentModal.d.ts +21 -0
  6. package/lib/common/components/attachments/AttachmentModal.js +195 -0
  7. package/lib/common/components/attachments/index.d.ts +13 -17
  8. package/lib/common/components/attachments/index.js +189 -23
  9. package/lib/common/components/base-information/AccountingCost.d.ts +7 -5
  10. package/lib/common/components/base-information/AccountingCost.js +32 -11
  11. package/lib/common/components/base-information/OrderReference.d.ts +6 -4
  12. package/lib/common/components/base-information/OrderReference.js +31 -14
  13. package/lib/common/components/base-information/ProjectReference.d.ts +9 -5
  14. package/lib/common/components/base-information/ProjectReference.js +8 -6
  15. package/lib/common/components/base-information/ReferenceIdentifiers.d.ts +32 -5
  16. package/lib/common/components/base-information/ReferenceIdentifiers.js +126 -83
  17. package/lib/common/components/base-information/index.d.ts +51 -5
  18. package/lib/common/components/base-information/index.js +99 -154
  19. package/lib/common/components/billing-lines/BillingCalculations.d.ts +7 -5
  20. package/lib/common/components/billing-lines/BillingCalculations.js +79 -46
  21. package/lib/common/components/billing-lines/BillingLinePreview.d.ts +21 -0
  22. package/lib/common/components/billing-lines/BillingLinePreview.js +41 -0
  23. package/lib/common/components/billing-lines/BillingTaxSummary.d.ts +6 -4
  24. package/lib/common/components/billing-lines/BillingTaxSummary.js +39 -13
  25. package/lib/common/components/billing-lines/NewBillingLines.d.ts +120 -4
  26. package/lib/common/components/billing-lines/NewBillingLines.js +396 -72
  27. package/lib/common/components/billing-lines/index.d.ts +33 -6
  28. package/lib/common/components/billing-lines/index.js +71 -244
  29. package/lib/common/components/component-container/Content.d.ts +2 -2
  30. package/lib/common/components/component-container/index.d.ts +1 -0
  31. package/lib/common/components/component-container/index.js +1 -1
  32. package/lib/common/components/customer/CostCenter.d.ts +6 -4
  33. package/lib/common/components/customer/CostCenter.js +25 -9
  34. package/lib/common/components/customer/CustomerContactName.d.ts +6 -4
  35. package/lib/common/components/customer/CustomerContactName.js +24 -8
  36. package/lib/common/components/customer/hardCoddedCustomer.js +19 -3
  37. package/lib/common/components/customer/index.d.ts +11 -5
  38. package/lib/common/components/customer/index.js +97 -42
  39. package/lib/common/components/date-picker/index.d.ts +21 -0
  40. package/lib/common/components/date-picker/index.js +23 -0
  41. package/lib/common/components/delivery-location/index.d.ts +6 -4
  42. package/lib/common/components/delivery-location/index.js +20 -4
  43. package/lib/common/components/editable-cell/index.js +2 -2
  44. package/lib/common/components/editable-row/index.d.ts +1 -1
  45. package/lib/common/components/editable-row/index.js +24 -7
  46. package/lib/common/components/form-item/index.d.ts +13 -6
  47. package/lib/common/components/form-item/index.js +16 -20
  48. package/lib/common/components/index.d.ts +10 -0
  49. package/lib/common/components/index.js +30 -8
  50. package/lib/common/components/input/index.d.ts +23 -0
  51. package/lib/common/components/input/index.js +37 -0
  52. package/lib/common/components/invoice/index.d.ts +40 -0
  53. package/lib/common/components/invoice/index.js +52 -0
  54. package/lib/common/components/invoice-preview/InvoicePreviewHeader.d.ts +12 -0
  55. package/lib/common/components/invoice-preview/InvoicePreviewHeader.js +105 -0
  56. package/lib/common/components/invoice-preview/index.d.ts +16 -0
  57. package/lib/common/components/invoice-preview/index.js +393 -0
  58. package/lib/common/components/locale-intl/index.d.ts +0 -10
  59. package/lib/common/components/locale-intl/index.js +50 -42
  60. package/lib/common/components/payment-method/index.d.ts +69 -6
  61. package/lib/common/components/payment-method/index.js +145 -57
  62. package/lib/common/components/payment-method/paymentMethodForConversion.js +3 -1
  63. package/lib/common/components/submit-confirmation/SubmitConfirmationSVG.d.ts +3 -0
  64. package/lib/common/components/submit-confirmation/SubmitConfirmationSVG.js +17 -0
  65. package/lib/common/components/submit-confirmation/index.d.ts +8 -0
  66. package/lib/common/components/submit-confirmation/index.js +34 -0
  67. package/lib/common/components/supplier/CityAutofill.d.ts +18 -0
  68. package/lib/common/components/supplier/CityAutofill.js +159 -0
  69. package/lib/common/components/supplier/index.d.ts +79 -5
  70. package/lib/common/components/supplier/index.js +195 -103
  71. package/lib/common/components/tooltip/index.d.ts +7 -0
  72. package/lib/common/components/tooltip/index.js +15 -0
  73. package/lib/common/components/welcome-modal/index.d.ts +15 -0
  74. package/lib/common/components/welcome-modal/index.js +26 -0
  75. package/lib/common/consts/formLayout.js +4 -3
  76. package/lib/common/consts/validationRules.d.ts +1 -1
  77. package/lib/common/consts/validationRules.js +6 -0
  78. package/lib/common/enums/index.js +5 -1
  79. package/lib/common/style/index.css +18 -0
  80. package/lib/common/types/BillingLineMetadataOverride.d.ts +2 -0
  81. package/lib/common/types/CommonProps.d.ts +15 -1
  82. package/lib/common/types/DiscountType.d.ts +1 -0
  83. package/lib/common/types/DiscountType.js +2 -0
  84. package/lib/common/types/ReceiverRequirements.d.ts +1 -1
  85. package/lib/common/types/ReceiverRequirements.js +1 -0
  86. package/lib/common/types/index.js +15 -0
  87. package/lib/create-invoice/IntlLoader.d.ts +0 -6
  88. package/lib/create-invoice/IntlLoader.js +78 -13
  89. package/lib/create-invoice/index.d.ts +65 -4
  90. package/lib/create-invoice/index.js +437 -181
  91. package/lib/enums.d.ts +2 -3
  92. package/lib/enums.js +1 -0
  93. package/lib/index.js +22 -6
  94. package/lib/translations/locales/en.json +181 -0
  95. package/lib/translations/locales/is.json +135 -116
  96. package/lib/translations/locales.d.ts +360 -161
  97. package/lib/translations/locales.js +3 -2
  98. package/lib/utils/ApiUtility.d.ts +4 -4
  99. package/lib/utils/ApiUtility.js +13 -10
  100. package/lib/utils/BillingLineUtility.d.ts +16 -5
  101. package/lib/utils/BillingLineUtility.js +65 -26
  102. package/lib/utils/ConversionUtility.js +15 -7
  103. package/lib/utils/FileUploadUtility.d.ts +4 -2
  104. package/lib/utils/FileUploadUtility.js +28 -9
  105. package/lib/utils/IntlUtility.d.ts +3 -2
  106. package/lib/utils/IntlUtility.js +2 -1
  107. package/lib/utils/LocationUtility.d.ts +1 -0
  108. package/lib/utils/LocationUtility.js +81 -0
  109. package/lib/utils/ReferenceIdentifierUtility.js +2 -1
  110. package/lib/utils/RequirementsUtility.d.ts +9 -7
  111. package/lib/utils/RequirementsUtility.js +46 -22
  112. package/lib/utils/index.js +4 -3
  113. package/package.json +36 -18
  114. package/lib/style/index.css +0 -51
@@ -1,11 +1,36 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
2
18
  var __importStar = (this && this.__importStar) || function (mod) {
3
19
  if (mod && mod.__esModule) return mod;
4
20
  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;
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
7
23
  return result;
8
24
  };
25
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
26
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
27
+ if (ar || !(i in from)) {
28
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
29
+ ar[i] = from[i];
30
+ }
31
+ }
32
+ return to.concat(ar || Array.prototype.slice.call(from));
33
+ };
9
34
  Object.defineProperty(exports, "__esModule", { value: true });
10
35
  var react_1 = __importStar(require("react"));
11
36
  var antd_1 = require("antd");
@@ -14,7 +39,7 @@ var api_1 = require("@unimaze/api-clients/lib/mapi/api");
14
39
  var react_intl_1 = require("react-intl");
15
40
  var CommonTranslations_1 = require("../CommonTranslations");
16
41
  var IntlUtility_1 = require("../../../utils/IntlUtility");
17
- var translationMessages = react_intl_1.defineMessages({
42
+ var translationMessages = (0, react_intl_1.defineMessages)({
18
43
  billingTaxSummary_taxOverview: {
19
44
  id: "billingTaxSummary_taxOverview",
20
45
  defaultMessage: "Tax overview"
@@ -48,26 +73,27 @@ var translationMessages = react_intl_1.defineMessages({
48
73
  defaultMessage: "Outside tax scope",
49
74
  },
50
75
  });
76
+ ;
51
77
  var BillingTaxSummary = function (props) {
52
- var _a = react_1.useState(props.formInstance.getFieldValue(["invoice", "invoiceLines"])), invoiceLines = _a[0], setInvoiceLines = _a[1];
53
- react_1.useEffect(function () {
78
+ var _a = (0, react_1.useState)(props.formInstance.getFieldValue(["invoice", "invoiceLines"])), invoiceLines = _a[0], setInvoiceLines = _a[1];
79
+ (0, react_1.useEffect)(function () {
54
80
  setInvoiceLines(props.formInstance.getFieldValue(["invoice", "invoiceLines"]));
55
81
  }, [props.outsideVatScope, props.formInstance.getFieldValue(["invoice", "invoiceLines"])]);
56
82
  var dataSource = invoiceLines
57
83
  ? invoiceLines.map(function (billingLine) {
58
84
  var taxCategoryType = billingLine.taxCategoryType ? api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType] : undefined;
59
- var translationString = "taxCategoryType_labels_" + taxCategoryType;
85
+ var translationString = "taxCategoryType_labels_".concat(taxCategoryType);
60
86
  var taxCategoryTypeTranslated = CommonTranslations_1.commonTranslationMessages.hasOwnProperty(translationString)
61
87
  ? props.intl.formatMessage(CommonTranslations_1.commonTranslationMessages[translationString])
62
88
  : "";
63
89
  return {
64
- taxOverview: BillingLineUtility_1.generateTaxCategoryLabel(taxCategoryType, taxCategoryTypeTranslated),
65
- taxableAmount: BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount),
66
- taxAmount: BillingLineUtility_1.calculateTaxAmount(BillingLineUtility_1.calculateTaxableAmount(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount), BillingLineUtility_1.calculateTaxPercentage(billingLine.taxCategoryType ? api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType] : undefined))
90
+ taxOverview: (0, BillingLineUtility_1.generateTaxCategoryLabel)(taxCategoryType, taxCategoryTypeTranslated),
91
+ taxableAmount: (0, BillingLineUtility_1.calculateTaxableAmount)(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount, billingLine.discountType),
92
+ taxAmount: (0, BillingLineUtility_1.calculateTaxAmount)((0, BillingLineUtility_1.calculateTaxableAmount)(billingLine.discountValue, billingLine.quantity, billingLine.unitPriceAmount, billingLine.discountType), (0, BillingLineUtility_1.calculateTaxPercentage)(billingLine.taxCategoryType ? api_1.TaxCategoryTypeEnum[billingLine.taxCategoryType] : undefined))
67
93
  };
68
94
  })
69
95
  : [];
70
- var hlpArray = dataSource ? dataSource.slice() : [];
96
+ var hlpArray = dataSource ? __spreadArray([], dataSource, true) : [];
71
97
  var helper = {};
72
98
  var result = hlpArray.reduce(function (r, o) {
73
99
  var key = o.taxOverview;
@@ -90,14 +116,14 @@ var BillingTaxSummary = function (props) {
90
116
  title: props.intl.formatMessage(translationMessages.billingTaxSummary_taxableAmount),
91
117
  dataIndex: "taxableAmount",
92
118
  render: function (value, record) {
93
- return IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(record.taxableAmount, props.intl, { style: "decimal" });
119
+ return (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(record.taxableAmount, props.intl, { style: "decimal" });
94
120
  }
95
121
  },
96
122
  {
97
123
  title: props.intl.formatMessage(translationMessages.billingTaxSummary_taxAmount),
98
124
  dataIndex: "taxAmount",
99
125
  render: function (value, record) {
100
- return IntlUtility_1.icelandicNumberLocaleWorkaroundChrome(record.taxAmount, props.intl, { style: "decimal" });
126
+ return (0, IntlUtility_1.icelandicNumberLocaleWorkaroundChrome)(record.taxAmount, props.intl, { style: "decimal" });
101
127
  }
102
128
  },
103
129
  ];
@@ -105,4 +131,4 @@ var BillingTaxSummary = function (props) {
105
131
  // showHeader={false}
106
132
  columns: columns, dataSource: result, pagination: false, rowKey: (function (record, index) { return index.toString(); }) }));
107
133
  };
108
- exports.default = react_intl_1.injectIntl(BillingTaxSummary);
134
+ exports.default = (0, react_intl_1.injectIntl)(BillingTaxSummary);
@@ -1,13 +1,129 @@
1
1
  import React from "react";
2
- import { InjectedIntlProps } from "react-intl";
2
+ import { WrappedComponentProps } from "react-intl";
3
3
  import { FormInstance } from "antd/es/form";
4
4
  import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
5
- interface Props extends InjectedIntlProps {
5
+ export declare const translationMessages: {
6
+ billingLines_labels_addButton: {
7
+ id: string;
8
+ defaultMessage: string;
9
+ };
10
+ billingLines_itemNo: {
11
+ id: string;
12
+ defaultMessage: string;
13
+ };
14
+ billingLines_name: {
15
+ id: string;
16
+ defaultMessage: string;
17
+ };
18
+ billingLines_quantity: {
19
+ id: string;
20
+ defaultMessage: string;
21
+ };
22
+ billingLines_unitOfMeasure: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ };
26
+ billingLines_unitPriceAmount: {
27
+ id: string;
28
+ defaultMessage: string;
29
+ };
30
+ billingLines_taxCategoryType: {
31
+ id: string;
32
+ defaultMessage: string;
33
+ };
34
+ billingLines_taxCategoryType_title: {
35
+ id: string;
36
+ defaultMessage: string;
37
+ };
38
+ billingLines_taxCategoryPercentage: {
39
+ id: string;
40
+ defaultMessage: string;
41
+ };
42
+ billingLines_discount: {
43
+ id: string;
44
+ defaultMessage: string;
45
+ };
46
+ billingLines_discount_helpText: {
47
+ id: string;
48
+ defaultMessage: string;
49
+ };
50
+ billingLines_lineAmount: {
51
+ id: string;
52
+ defaultMessage: string;
53
+ };
54
+ billingLines_taxAmount: {
55
+ id: string;
56
+ defaultMessage: string;
57
+ };
58
+ billingLines_currencyCode: {
59
+ id: string;
60
+ defaultMessage: string;
61
+ };
62
+ billingLines_currency_ISK: {
63
+ id: string;
64
+ defaultMessage: string;
65
+ };
66
+ billingLines_currency_ISK_short: {
67
+ id: string;
68
+ defaultMessage: string;
69
+ };
70
+ billingLines_currency_DKK: {
71
+ id: string;
72
+ defaultMessage: string;
73
+ };
74
+ billingLines_currency_DKK_short: {
75
+ id: string;
76
+ defaultMessage: string;
77
+ };
78
+ billingLines_currency_NOK: {
79
+ id: string;
80
+ defaultMessage: string;
81
+ };
82
+ billingLines_currency_NOK_short: {
83
+ id: string;
84
+ defaultMessage: string;
85
+ };
86
+ billingLines_currency_SEK: {
87
+ id: string;
88
+ defaultMessage: string;
89
+ };
90
+ billingLines_currency_SEK_short: {
91
+ id: string;
92
+ defaultMessage: string;
93
+ };
94
+ billingLines_currency_EUR: {
95
+ id: string;
96
+ defaultMessage: string;
97
+ };
98
+ billingLines_currency_EUR_short: {
99
+ id: string;
100
+ defaultMessage: string;
101
+ };
102
+ billingLines_currency_USD: {
103
+ id: string;
104
+ defaultMessage: string;
105
+ };
106
+ billingLines_currency_USD_short: {
107
+ id: string;
108
+ defaultMessage: string;
109
+ };
110
+ billingLines_currency_GBP: {
111
+ id: string;
112
+ defaultMessage: string;
113
+ };
114
+ billingLines_currency_GBP_short: {
115
+ id: string;
116
+ defaultMessage: string;
117
+ };
118
+ };
119
+ interface Props extends WrappedComponentProps {
6
120
  receiverRequirements: NewReceiverRequirements;
7
121
  formInstance: FormInstance;
8
122
  outsideVatScope: boolean;
9
123
  }
10
- declare const BillingLinesWithIntl: React.ComponentClass<Pick<Props, "formInstance" | "receiverRequirements" | "outsideVatScope">, any> & {
11
- WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
124
+ declare const BillingLinesWithIntl: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
125
+ forwardedRef?: React.Ref<any> | undefined;
126
+ } & React.RefAttributes<any>> & {
127
+ WrappedComponent: React.ComponentType<Props>;
12
128
  };
13
129
  export default BillingLinesWithIntl;