@unimaze/billing 0.14.0 → 0.16.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.
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { NewReceiverRequirements } from "../../types/NewReceiverRequirements";
3
+ import { InjectedIntlProps } from "react-intl";
4
+ interface Props extends InjectedIntlProps {
5
+ receiverRequirements: NewReceiverRequirements;
6
+ }
7
+ declare const _default: React.ComponentClass<Pick<Props, "receiverRequirements">, any> & {
8
+ WrappedComponent: React.ComponentType<Props & InjectedIntlProps>;
9
+ };
10
+ export default _default;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var react_1 = __importDefault(require("react"));
7
+ var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
8
+ var ReceiverRequirements_1 = require("../../types/ReceiverRequirements");
9
+ var form_item_1 = __importDefault(require("../form-item"));
10
+ var react_intl_1 = require("react-intl");
11
+ var antd_1 = require("antd");
12
+ var translationMessages = react_intl_1.defineMessages({
13
+ baseInformation_projectReferenceLabel: {
14
+ id: "baseInformation_projectReferenceLabel",
15
+ defaultMessage: "Project reference"
16
+ },
17
+ });
18
+ var ProjectReference = function (props) {
19
+ var projectReferenceFieldDefinition = RequirementsUtility_1.getFieldRequirements(props.receiverRequirements, ReceiverRequirements_1.AvailableFields['documentReferences.project.documentNo']);
20
+ if (projectReferenceFieldDefinition) {
21
+ return (react_1.default.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields["documentReferences.project.documentNo"], defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_projectReferenceLabel), defaultIsRequired: false, fieldName: ["invoice", "documentReferences", "project", "documentNo"] },
22
+ react_1.default.createElement(antd_1.Input, null)));
23
+ }
24
+ else {
25
+ return null;
26
+ }
27
+ };
28
+ exports.default = react_intl_1.injectIntl(ProjectReference);
@@ -23,6 +23,7 @@ var RequirementsUtility_1 = require("../../../utils/RequirementsUtility");
23
23
  var OrderReference_1 = __importDefault(require("./OrderReference"));
24
24
  var AccountingCost_1 = __importDefault(require("./AccountingCost"));
25
25
  var react_1 = require("react");
26
+ var ProjectReference_1 = __importDefault(require("./ProjectReference"));
26
27
  var translationMessages = react_intl_1.defineMessages({
27
28
  baseInformation_title: {
28
29
  id: "baseInformation_title",
@@ -56,6 +57,10 @@ var translationMessages = react_intl_1.defineMessages({
56
57
  id: "baseInformation_buyerReferenceLabel_helpText",
57
58
  defaultMessage: "A reference the buyer has requested to be assigned to the invoice, often called \"your reference\". Used by the buyer for internal routing. If buyer has not specifically requested it, the name of the person who ordered or requested the products or services can be used. Must be used when order number is not specified."
58
59
  },
60
+ baseInformation_projectReferenceLabel: {
61
+ id: "baseInformation_projectReferenceLabel",
62
+ defaultMessage: "Project reference"
63
+ },
59
64
  baseInformation_notes: {
60
65
  id: "baseInformation_notes",
61
66
  defaultMessage: "Notes"
@@ -216,6 +221,7 @@ var BaseInformation = function (props) {
216
221
  React.createElement(antd_1.Input, null)),
217
222
  React.createElement(ReferenceIdentifiers_1.default, { receiverRequirements: props.receiverRequirements, formInstance: props.form, updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, rapiBaseUrl: props.rapiBaseUrl, legalIdentifier: props.legalIdentifier, referenceIdentifiersLabelText: props.referenceIdentifiersLabelText, referenceIdentifiersHelpText: props.referenceIdentifiersHelpText, referenceIdentifierValidateStatus: props.referenceIdentifierValidateStatus, setReferenceIdentifierValidateStatus: props.setReferenceIdentifierValidateStatus }),
218
223
  React.createElement(AccountingCost_1.default, { formInstance: props.form, rapiBaseUrl: props.rapiBaseUrl, receiverRequirements: props.receiverRequirements, updateReceiverRequirementsProp: props.updateReceiverRequirementsProp, legalIdentifier: props.legalIdentifier }),
224
+ React.createElement(ProjectReference_1.default, { receiverRequirements: props.receiverRequirements }),
219
225
  React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.notes, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_notes), defaultIsRequired: false, fieldName: ["invoice", "notes"] },
220
226
  React.createElement(antd_1.Input.TextArea, null)),
221
227
  React.createElement(form_item_1.default, { receiverRequirements: props.receiverRequirements, receiverRequirementsKey: ReceiverRequirements_1.AvailableFields.currencyCode, defaultLabel: props.intl.formatMessage(translationMessages.baseInformation_currencyCode), defaultIsRequired: true, fieldName: ["invoice", "currencyCode"], initialValue: getCurrencies(props.receiverRequirements)[0].key },
@@ -18,6 +18,7 @@ export declare enum AvailableFields {
18
18
  "notes" = "notes",
19
19
  "accountingCost" = "accountingCost",
20
20
  "buyerReference" = "buyerReference",
21
+ "documentReferences.project.documentNo" = "documentReferences.project.documentNo",
21
22
  "orderReference.documentNo" = "orderReference.documentNo",
22
23
  "billingReferences.invoices" = "billingReferences.invoices",
23
24
  "billingReferences.documentNo" = "billingReferences.documentNo",
@@ -10,6 +10,7 @@ var AvailableFields;
10
10
  AvailableFields["notes"] = "notes";
11
11
  AvailableFields["accountingCost"] = "accountingCost";
12
12
  AvailableFields["buyerReference"] = "buyerReference";
13
+ AvailableFields["documentReferences.project.documentNo"] = "documentReferences.project.documentNo";
13
14
  AvailableFields["orderReference.documentNo"] = "orderReference.documentNo";
14
15
  AvailableFields["billingReferences.invoices"] = "billingReferences.invoices";
15
16
  AvailableFields["billingReferences.documentNo"] = "billingReferences.documentNo";
@@ -1,51 +1,51 @@
1
- .component_header {
2
- height: 3.3em;
3
- background-color: #fff;
4
- border-bottom: solid 1px #d9d9d9;
5
- border-radius: 4px 4px 0 0;
6
- display: flex;
7
- align-items: center;
8
- justify-content: space-between;
9
- padding: 1em 2em;
10
- }
11
- .component_header_title {
12
- font-size: 1.1em;
13
- }
14
- .component_header_title > span > i {
15
- font-size: 20px;
16
- }
17
- .header_icon {
18
- font-size: 1.5em;
19
- margin-right: 0.75em;
20
- color: #1890ff;
21
- }
22
- .header_right {
23
- display: flex;
24
- justify-content: flex-end;
25
- }
26
- @media screen and (max-width: 768px) {
27
- .header_right {
28
- justify-content: flex-start;
29
- }
30
- }
31
- .header_right > button {
32
- margin-bottom: unset !important;
33
- }
34
- .component_body {
35
- border-radius: 0 0 4px 4px;
36
- }
37
- .component_wrapper {
38
- align-self: stretch;
39
- height: 100%;
40
- background-color: #fff;
41
- border: solid 1px #d9d9d9;
42
- border-radius: 4px;
43
- }
44
- .component_wrapper_padding {
45
- padding: 1em;
46
- }
47
- .umz_noValidationMessage .ant-form-item-explain {
48
- height: 20px !important;
49
- visibility: hidden !important;
50
- }
1
+ .component_header {
2
+ height: 3.3em;
3
+ background-color: #fff;
4
+ border-bottom: solid 1px #d9d9d9;
5
+ border-radius: 4px 4px 0 0;
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: space-between;
9
+ padding: 1em 2em;
10
+ }
11
+ .component_header_title {
12
+ font-size: 1.1em;
13
+ }
14
+ .component_header_title > span > i {
15
+ font-size: 20px;
16
+ }
17
+ .header_icon {
18
+ font-size: 1.5em;
19
+ margin-right: 0.75em;
20
+ color: #1890ff;
21
+ }
22
+ .header_right {
23
+ display: flex;
24
+ justify-content: flex-end;
25
+ }
26
+ @media screen and (max-width: 768px) {
27
+ .header_right {
28
+ justify-content: flex-start;
29
+ }
30
+ }
31
+ .header_right > button {
32
+ margin-bottom: unset !important;
33
+ }
34
+ .component_body {
35
+ border-radius: 0 0 4px 4px;
36
+ }
37
+ .component_wrapper {
38
+ align-self: stretch;
39
+ height: 100%;
40
+ background-color: #fff;
41
+ border: solid 1px #d9d9d9;
42
+ border-radius: 4px;
43
+ }
44
+ .component_wrapper_padding {
45
+ padding: 1em;
46
+ }
47
+ .umz_noValidationMessage .ant-form-item-explain {
48
+ height: 20px !important;
49
+ visibility: hidden !important;
50
+ }
51
51
  /*# sourceMappingURL=index.css.map */
@@ -99,6 +99,12 @@ var convertToInvoiceMetadataInput = function (formValues, invoiceLinesWithCalcul
99
99
  var orderReference = invoice.orderReference && invoice.orderReference.hasOwnProperty("documentNo")
100
100
  ? invoice.orderReference
101
101
  : undefined;
102
+ // NBNB: FOR NOW THIS IS ONLY FOR PROJECT, CREATE FUNCTION THAT WOULD RETURN CORRECT OBJECT STRUCTURE IF OTHER PROPERTIES ARE BEING USED
103
+ var documentReferences = invoice.documentReferences
104
+ && invoice.documentReferences.project
105
+ && invoice.documentReferences.project.documentNo
106
+ ? invoice.documentReferences
107
+ : undefined;
102
108
  var resp = {
103
109
  messageHandling: getMessageHandling(chosenCustomer),
104
110
  invoice: {
@@ -144,6 +150,7 @@ var convertToInvoiceMetadataInput = function (formValues, invoiceLinesWithCalcul
144
150
  buyerReference: invoice.buyerReference,
145
151
  paymentMeans: paymentMethod,
146
152
  referenceIdentifiers: referenceIdentifiers,
153
+ documentReferences: documentReferences,
147
154
  orderReference: orderReference,
148
155
  }
149
156
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unimaze/billing",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",