@unimaze/billing 0.1.2-rc.4 → 0.1.2-rc.6

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 (39) hide show
  1. package/README.md +11 -3
  2. package/lib/common/components/attachments/index.js +2 -2
  3. package/lib/common/components/base-information/index.js +2 -5
  4. package/lib/common/components/billing-lines/index.js +4 -9
  5. package/lib/common/components/customer/index.d.ts +7 -0
  6. package/lib/common/components/customer/index.js +25 -0
  7. package/lib/common/components/delivery-location/index.js +2 -5
  8. package/lib/common/components/index.d.ts +10 -5
  9. package/lib/common/components/index.js +20 -8
  10. package/lib/common/components/payer/index.js +1 -1
  11. package/lib/common/components/payment-method/index.js +2 -5
  12. package/lib/common/components/supplier/index.d.ts +3 -0
  13. package/lib/common/components/supplier/index.js +49 -0
  14. package/lib/common/enums/index.d.ts +1 -1
  15. package/lib/common/enums/index.js +2 -4
  16. package/lib/common/types/ReceiverRequirements.d.ts +1 -3
  17. package/lib/common/types/ReceiverRequirements.js +0 -11
  18. package/lib/create-credit-note/index.d.ts +1 -2
  19. package/lib/create-credit-note/index.js +5 -9
  20. package/lib/create-invoice/index.d.ts +1 -2
  21. package/lib/create-invoice/index.js +8 -14
  22. package/lib/example/src/index.d.ts +1 -1
  23. package/lib/index.js +5 -0
  24. package/lib/src/common/components/attachments/Attachment.d.ts +15 -0
  25. package/lib/src/common/components/attachments/index.d.ts +3 -0
  26. package/lib/src/common/components/customer/index.d.ts +7 -0
  27. package/lib/src/common/components/index.d.ts +10 -0
  28. package/lib/src/common/components/issuer/index.d.ts +1 -1
  29. package/lib/src/common/components/supplier/index.d.ts +3 -0
  30. package/lib/src/common/types/ReceiverRequirements.d.ts +1 -3
  31. package/lib/src/create-invoice/index.d.ts +1 -2
  32. package/lib/src/utils/ConversionUtility.d.ts +1 -1
  33. package/lib/src/utils/RequirementsUtility.d.ts +3 -0
  34. package/lib/style/index.css +1268 -1268
  35. package/lib/utils/ConversionUtility.d.ts +1 -1
  36. package/lib/utils/ConversionUtility.js +23 -24
  37. package/lib/utils/RequirementsUtility.d.ts +3 -0
  38. package/lib/utils/RequirementsUtility.js +13 -0
  39. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { InvoiceMetadataInput } from "@unimaze/api-clients/lib/mapi";
2
2
  import { Store } from "antd/es/form/interface";
3
3
  import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
4
- declare const convertToInvoiceMetadataInput: (formValues: Store, issuer: ProfileOutput) => InvoiceMetadataInput;
4
+ declare const convertToInvoiceMetadataInput: (formValues: Store, customer: ProfileOutput) => InvoiceMetadataInput;
5
5
  export { /*convertToCreditNoteMetadataInput,*/ convertToInvoiceMetadataInput };
@@ -1,52 +1,51 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var convertToInvoiceMetadataInput = function (formValues, issuer) {
3
+ var convertToInvoiceMetadataInput = function (formValues, customer) {
4
4
  var resp = {
5
5
  messageHandling: {
6
- receiverIdentifier: issuer.participantLegalIsoIdentifier,
7
- fallbackEmailAddress: issuer.email,
8
- fallbackContactName: issuer.name,
6
+ receiverIdentifier: formValues.invoice.supplier.identifier,
7
+ fallbackEmailAddress: formValues.invoice.supplier.contact.email,
8
+ fallbackContactName: formValues.invoice.supplier.contact.name,
9
9
  },
10
- // MessageHandling is not part of the form
11
10
  invoice: {
12
- supplier: {
13
- identifier: issuer.participantLegalIsoIdentifier,
11
+ customer: {
12
+ identifier: customer.participantLegalIsoIdentifier,
14
13
  address: {
15
- streetNameAndNumber: issuer.participantLegalAddressStreet,
16
- postalZone: issuer.participantLegalAddressPostalCode,
17
- city: issuer.participantLegalAddressCity,
18
- countryCode: issuer.country,
14
+ streetNameAndNumber: customer.participantLegalAddressStreet,
15
+ postalZone: customer.participantLegalAddressPostalCode,
16
+ city: customer.participantLegalAddressCity,
17
+ countryCode: customer.country,
19
18
  countrySubEntity: "",
20
19
  addressLine2: "",
21
20
  addressLine3: ""
22
21
  },
23
- name: issuer.name,
24
- vatNumber: "",
22
+ name: customer.name,
25
23
  contact: {
26
- electronicMail: issuer.email,
24
+ electronicMail: customer.email,
27
25
  fax: "",
28
26
  name: "",
29
- telephone: issuer.phoneNumber
27
+ telephone: customer.phoneNumber
30
28
  }
31
29
  },
32
30
  // Supplier is pre filled, doesnt exist in the form || will be passed to already filled up form
33
- customer: {
34
- identifier: formValues.invoice.customer.identifier,
31
+ supplier: {
32
+ identifier: formValues.invoice.supplier.identifier,
35
33
  address: {
36
- streetNameAndNumber: formValues.invoice.customer.address.address,
37
- postalZone: formValues.invoice.customer.address.zip,
38
- city: formValues.invoice.customer.address.city,
39
- countryCode: formValues.invoice.customer.address.country,
34
+ streetNameAndNumber: formValues.invoice.supplier.address.address,
35
+ postalZone: formValues.invoice.supplier.address.zip,
36
+ city: formValues.invoice.supplier.address.city,
37
+ countryCode: formValues.invoice.supplier.address.country,
40
38
  countrySubEntity: "",
41
39
  addressLine2: "",
42
40
  addressLine3: ""
43
41
  // last 3 fileds in address are missing in form
44
42
  },
45
- name: formValues.invoice.customer.name,
43
+ vatNumber: "",
44
+ name: formValues.invoice.supplier.name,
46
45
  contact: {
47
- electronicMail: formValues.invoice.customer.contact.email,
46
+ electronicMail: formValues.invoice.supplier.contact.email,
48
47
  fax: "",
49
- name: formValues.invoice.customer.contact.name,
48
+ name: formValues.invoice.supplier.contact.name,
50
49
  telephone: ""
51
50
  // fax, telephone do not exist in form
52
51
  },
@@ -0,0 +1,3 @@
1
+ import { AvailableFields, FieldRequirement, ReceiverRequirements } from "../common/types/ReceiverRequirements";
2
+ export declare const getReceiverRequirements: (recRequirements: ReceiverRequirements, key: AvailableFields) => FieldRequirement;
3
+ export declare const getReceiverRequirementsLabelWithDefault: (recRequirements: ReceiverRequirements, key: AvailableFields, defaultLabel: string) => string;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getReceiverRequirements = function (recRequirements, key) {
4
+ return recRequirements[key];
5
+ };
6
+ exports.getReceiverRequirementsLabelWithDefault = function (recRequirements, key, defaultLabel) {
7
+ if (recRequirements[key].label) {
8
+ return recRequirements[key].label;
9
+ }
10
+ else {
11
+ return defaultLabel;
12
+ }
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unimaze/billing",
3
- "version": "0.1.2-rc.4",
3
+ "version": "0.1.2-rc.6",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",