@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,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AvailableFields = void 0;
3
4
  var AvailableFields;
4
5
  (function (AvailableFields) {
5
6
  AvailableFields["invoiceNo"] = "invoiceNo";
@@ -1,2 +1,17 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./"), exports);
@@ -1,4 +1,3 @@
1
- import "../style/index.css";
2
1
  import React from "react";
3
2
  import { CommonProps } from "../common/types/CommonProps";
4
3
  import { ProfileOutputWithApiKey } from "../common/types/AppConfiguration";
@@ -8,10 +7,5 @@ interface Props extends CommonProps {
8
7
  referenceIdentifiersHelpText?: string;
9
8
  referenceIdentifiersLabelText?: string;
10
9
  }
11
- /**
12
- * Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
13
- *
14
- * @component
15
- */
16
10
  declare const CreateInvoice: React.FC<Props>;
17
11
  export default CreateInvoice;
@@ -3,49 +3,114 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- require("../style/index.css");
7
6
  var react_1 = __importDefault(require("react"));
8
7
  var antd_1 = require("antd");
9
- var is_IS_1 = __importDefault(require("antd/es/locale-provider/is_IS"));
10
- var en_US_1 = __importDefault(require("antd/es/locale-provider/en_US"));
8
+ var is_IS_1 = __importDefault(require("antd/es/locale/is_IS"));
9
+ var en_US_1 = __importDefault(require("antd/es/locale/en_US"));
11
10
  var locales_1 = __importDefault(require("../translations/locales"));
12
- var moment_1 = __importDefault(require("moment"));
13
- var react_intl_1 = require("react-intl");
14
- var en_1 = __importDefault(require("react-intl/locale-data/en"));
15
- var is_1 = __importDefault(require("react-intl/locale-data/is"));
11
+ var dayjs_1 = __importDefault(require("dayjs"));
16
12
  var index_1 = __importDefault(require("./index"));
17
13
  require("moment/locale/is");
14
+ var react_intl_1 = require("react-intl");
15
+ var colors_1 = require("@ant-design/colors");
18
16
  /**
19
17
  * Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
20
18
  *
21
19
  * @component
22
20
  */
21
+ function useWindowSize() {
22
+ var _a = react_1.default.useState([0, 0]), size = _a[0], setSize = _a[1];
23
+ react_1.default.useEffect(function () {
24
+ function updateSize() {
25
+ setSize([window.innerWidth, window.innerHeight]);
26
+ }
27
+ window.addEventListener("resize", updateSize);
28
+ updateSize();
29
+ return function () { return window.removeEventListener("resize", updateSize); };
30
+ }, []);
31
+ return size;
32
+ }
23
33
  var CreateInvoice = function (props) {
34
+ var _a, _b, _c, _d;
35
+ var _e = react_1.default.useState(false), isMobile = _e[0], setIsMobile = _e[1];
36
+ var width = useWindowSize()[0];
37
+ react_1.default.useEffect(function () {
38
+ if (width < 768) {
39
+ setIsMobile(true);
40
+ }
41
+ else {
42
+ setIsMobile(false);
43
+ }
44
+ }, [width]);
24
45
  var antLocale = is_IS_1.default;
25
46
  var languageString = "is";
26
47
  switch (props.language) {
27
48
  case "is":
28
49
  antLocale = is_IS_1.default;
29
- moment_1.default.locale("is");
50
+ dayjs_1.default.locale("is");
30
51
  languageString = "is";
31
52
  break;
32
53
  case "en":
33
54
  antLocale = en_US_1.default;
34
- moment_1.default.locale("en");
55
+ dayjs_1.default.locale("en");
35
56
  languageString = "en";
36
57
  break;
37
58
  default:
38
59
  antLocale = is_IS_1.default;
39
- moment_1.default.locale("is");
60
+ dayjs_1.default.locale("is");
40
61
  languageString = "is";
41
62
  break;
42
63
  }
43
64
  localStorage.setItem("languageString", languageString);
44
- react_intl_1.addLocaleData(en_1.default.concat(is_1.default));
45
- return (react_1.default.createElement(antd_1.ConfigProvider, { locale: antLocale, componentSize: "small" },
65
+ return (react_1.default.createElement(antd_1.ConfigProvider, { locale: antLocale, theme: {
66
+ token: {
67
+ colorPrimary: (_a = props.colorPrimary) !== null && _a !== void 0 ? _a : colors_1.blue.primary,
68
+ colorError: (_b = props.colorError) !== null && _b !== void 0 ? _b : colors_1.red[4],
69
+ colorLink: (_c = props.colorLink) !== null && _c !== void 0 ? _c : colors_1.blue.primary,
70
+ colorInfoBg: (_d = props.colorInfoBg) !== null && _d !== void 0 ? _d : colors_1.blue[0],
71
+ colorText: "rgba(0, 0, 0, 0.88)",
72
+ colorTextDescription: "rgba(0, 0, 0, 0.60)",
73
+ fontFamily: "Outfit",
74
+ fontSizeHeading5: isMobile ? 16 : 24,
75
+ fontSizeHeading4: isMobile ? 18 : 20,
76
+ fontSizeLG: isMobile ? 16 : 20,
77
+ fontSizeXL: 30,
78
+ fontSizeSM: 12,
79
+ fontSizeIcon: 20,
80
+ controlHeightLG: isMobile ? 51 : 60,
81
+ controlInteractiveSize: isMobile ? 16 : 26,
82
+ },
83
+ components: {
84
+ Steps: {
85
+ navArrowColor: "rgba(0, 0, 0, 0)",
86
+ navContentMaxWidth: "calc(100vw / 4)",
87
+ iconSize: isMobile ? 10 : 32,
88
+ iconFontSize: isMobile ? 12 : 14,
89
+ },
90
+ Input: {
91
+ inputFontSizeLG: isMobile ? 16 : 20,
92
+ paddingBlockLG: 13,
93
+ },
94
+ Button: {
95
+ contentFontSizeLG: isMobile ? 16 : 20,
96
+ },
97
+ DatePicker: {
98
+ paddingBlockLG: 13,
99
+ },
100
+ Form: {
101
+ itemMarginBottom: isMobile ? 24 : 32,
102
+ },
103
+ Layout: {
104
+ footerBg: "none",
105
+ },
106
+ Card: {
107
+ headerBg: "rgb(255,255,255)"
108
+ },
109
+ },
110
+ } },
46
111
  react_1.default.createElement(react_intl_1.IntlProvider, { locale: languageString, defaultLocale: "is", key: languageString, messages: locales_1.default[languageString] },
47
112
  react_1.default.createElement(index_1.default, { customers: props.customers, language: languageString, mapiBaseUrl: props.mapiBaseUrl, rapiBaseUrl: props.rapiBaseUrl, rapiApiKey: props.rapiApiKey, receiverRequirements: props.receiverRequirements, getReceiverRequirements: props.getReceiverRequirements, updateReceiverRequirementsProp: props.updateReceiverRequirementsProp,
48
113
  // legalIdentifier={props.legalIdentifier}
49
- uploadSizeLimit: props.uploadSizeLimit, attachmentTooltipText: props.attachmentTooltipText, referenceIdentifiersHelpText: props.referenceIdentifiersHelpText, referenceIdentifiersLabelText: props.referenceIdentifiersLabelText, dueDateMinimumOffset: props.dueDateMinimumOffset, defaultPaymentType: props.defaultPaymentType }))));
114
+ uploadSizeLimit: props.uploadSizeLimit, attachmentTooltipText: props.attachmentTooltipText, referenceIdentifiersHelpText: props.referenceIdentifiersHelpText, referenceIdentifiersLabelText: props.referenceIdentifiersLabelText, dueDateMinimumOffset: props.dueDateMinimumOffset, defaultPaymentType: props.defaultPaymentType, supportEmail: props.supportEmail, welcomeModalTitle: props.welcomeModalTitle, welcomeModalParagraph: props.welcomeModalParagraph, welcomeModalImageUrl: props.welcomeModalImageUrl }))));
50
115
  };
51
116
  exports.default = CreateInvoice;
@@ -1,13 +1,74 @@
1
1
  import { ProfileOutputWithApiKey } from "../common/types/AppConfiguration";
2
2
  import React from "react";
3
- import { InjectedIntlProps } from "react-intl";
3
+ import { WrappedComponentProps } from "react-intl";
4
4
  import { CommonProps } from "../common/types/CommonProps";
5
- interface Props extends CommonProps, InjectedIntlProps {
5
+ import "../common/style/index.css";
6
+ export declare const translationMessages: {
7
+ createInvoice_addDocumentLineMsg: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ };
11
+ createInvoice_selectCustomerMsg: {
12
+ id: string;
13
+ defaultMessage: string;
14
+ };
15
+ createInvoice_successfullySubmittedInvoiceMsg: {
16
+ id: string;
17
+ defaultMessage: string;
18
+ };
19
+ createInvoice_successfullyUploadedAttachmentMsg: {
20
+ id: string;
21
+ defaultMessage: string;
22
+ };
23
+ createInvoice_ErrorUploadedAttachmentMsg: {
24
+ id: string;
25
+ defaultMessage: string;
26
+ };
27
+ createInvoice_Submit: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ };
31
+ createInvoice_SendCopy: {
32
+ id: string;
33
+ defaultMessage: string;
34
+ };
35
+ createInvoice_SendCopyTooltip: {
36
+ id: string;
37
+ defaultMessage: string;
38
+ };
39
+ createInvoice_SendCopyTooltipDisabled: {
40
+ id: string;
41
+ defaultMessage: string;
42
+ };
43
+ createInvoice_customerStepTitle: {
44
+ id: string;
45
+ defaultMessage: string;
46
+ };
47
+ createInvoice_supplierStepTitle: {
48
+ id: string;
49
+ defaultMessage: string;
50
+ };
51
+ createInvoice_invoiceStepTitle: {
52
+ id: string;
53
+ defaultMessage: string;
54
+ };
55
+ createInvoice_paymentStepTitle: {
56
+ id: string;
57
+ defaultMessage: string;
58
+ };
59
+ createInvoice_nextStep: {
60
+ id: string;
61
+ defaultMessage: string;
62
+ };
63
+ };
64
+ interface Props extends CommonProps, WrappedComponentProps {
6
65
  customers: ProfileOutputWithApiKey[];
7
66
  referenceIdentifiersHelpText?: string;
8
67
  referenceIdentifiersLabelText?: string;
9
68
  }
10
- declare const _default: React.ComponentClass<Pick<Props, "uploadSizeLimit" | "attachmentTooltipText" | "receiverRequirements" | "updateReceiverRequirementsProp" | "rapiBaseUrl" | "referenceIdentifiersLabelText" | "referenceIdentifiersHelpText" | "dueDateMinimumOffset" | "customers" | "rapiApiKey" | "language" | "mapiBaseUrl" | "getReceiverRequirements" | "defaultPaymentType">, any> & {
11
- WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
69
+ declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<Props, "intl"> & {
70
+ forwardedRef?: React.Ref<any> | undefined;
71
+ } & React.RefAttributes<any>> & {
72
+ WrappedComponent: React.ComponentType<Props>;
12
73
  };
13
74
  export default _default;