@bisondesk/documents-sdk 1.0.364 → 1.0.365

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 (37) hide show
  1. package/lib/apis/document-drafts.d.ts +2 -2
  2. package/lib/apis/document-drafts.d.ts.map +1 -1
  3. package/lib/apis/document-drafts.js +1 -1
  4. package/lib/apis/document-drafts.js.map +1 -1
  5. package/lib/apis/documents.d.ts +5 -2
  6. package/lib/apis/documents.d.ts.map +1 -1
  7. package/lib/apis/documents.js +28 -5
  8. package/lib/apis/documents.js.map +1 -1
  9. package/lib/types/booking.d.ts +4 -0
  10. package/lib/types/booking.d.ts.map +1 -1
  11. package/lib/types/booking.js.map +1 -1
  12. package/lib/types/document-categories.d.ts +1 -0
  13. package/lib/types/document-categories.d.ts.map +1 -1
  14. package/lib/types/document-categories.js.map +1 -1
  15. package/lib/types/documents.d.ts +0 -3
  16. package/lib/types/documents.d.ts.map +1 -1
  17. package/lib/types/documents.js.map +1 -1
  18. package/lib/types/leasing.d.ts +25 -0
  19. package/lib/types/leasing.d.ts.map +1 -0
  20. package/lib/types/leasing.js +9 -0
  21. package/lib/types/leasing.js.map +1 -0
  22. package/lib/types/legacy.d.ts +0 -1
  23. package/lib/types/legacy.d.ts.map +1 -1
  24. package/lib/types/legacy.js.map +1 -1
  25. package/lib/types/search.d.ts +4 -0
  26. package/lib/types/search.d.ts.map +1 -1
  27. package/lib/types/search.js.map +1 -1
  28. package/package.json +1 -1
  29. package/src/apis/document-drafts.ts +3 -3
  30. package/src/apis/documents.ts +40 -6
  31. package/src/types/booking.ts +5 -0
  32. package/src/types/document-categories.ts +1 -0
  33. package/src/types/documents.ts +3 -4
  34. package/src/types/leasing.ts +26 -0
  35. package/src/types/legacy.ts +0 -1
  36. package/src/types/search.ts +4 -0
  37. package/tsconfig.tsbuildinfo +1 -1
@@ -21,6 +21,7 @@ type BaseDocumentCategory = {
21
21
 
22
22
  export type AdministrativeDocumentCategory = BaseDocumentCategory & {
23
23
  type: DocumentCategoryType.Administrative;
24
+ subtype: 'generic' | 'deal';
24
25
  };
25
26
 
26
27
  export type FinanceDocumentCategory = BaseDocumentCategory & {
@@ -85,7 +85,6 @@ export type FinanceDocumentV2 = BaseDocument & {
85
85
  transferDescription?: string; // we ask clients to put this as description of the transfer
86
86
  invoiceId?: string; // mandatory in credit notes but forbidden in invoices
87
87
  issueDate: string;
88
- paymentNotes?: string;
89
88
  lines: FinanceDocumentLine[];
90
89
  accountingLines?: FinanceDocumentLine[];
91
90
  notes?: string;
@@ -108,7 +107,7 @@ export type FinanceDocumentV2 = BaseDocument & {
108
107
  vatAmount: string;
109
108
  };
110
109
 
111
- paidAt?: string;
110
+ paidAt?: string; // ONLY for when accounting integration is not used. Otherwise ALWAYS look at the Finance Booking paidAt
112
111
 
113
112
  reportingPeriod?: string;
114
113
  reportingYear?: string;
@@ -283,8 +282,8 @@ export type FinanceDocumentBisondeskSettings = {
283
282
  };
284
283
 
285
284
  export type FinanceDocumentPayment = { documentId: string } & (
286
- | { paid: true; paidAt: string; comment?: string }
287
- | { paid: false; paidAt?: undefined; comment?: undefined }
285
+ | { paid: true; paidAt: string }
286
+ | { paid: false; paidAt?: undefined }
288
287
  );
289
288
 
290
289
  export enum FinanceDocumentSubtype {
@@ -0,0 +1,26 @@
1
+ import { AttachmentValue } from '@bisondesk/commons-sdk/types';
2
+ import { FinanceDocType, FinanceDocumentSubtype } from './documents.js';
3
+
4
+ export type NewExistingLeasingFinanceDocument = {
5
+ id?: undefined;
6
+ type: FinanceDocType.Sale;
7
+ subtype: FinanceDocumentSubtype.Invoice | FinanceDocumentSubtype.CreditNote;
8
+ issueDate: string;
9
+ contractId: string;
10
+ amountExcl: string;
11
+ paidAt?: string;
12
+ dueDate?: string;
13
+ attachment: AttachmentValue;
14
+ invoiceNumber: string;
15
+ vatPercentage: string;
16
+ period: string;
17
+ description: string;
18
+ };
19
+
20
+ export const LEASING_DOCUMENT_CATEGORY_ID = 'leasing_sale';
21
+ export const LEASING_COST_CENTER_ID = 'leasing_cost_center';
22
+ export enum LeasingFinanceLineCode {
23
+ Residual = 'LEASING_RESIDUAL',
24
+ Deposit = 'LEASING_DEPOSIT',
25
+ Rent = 'LEASING_RENT',
26
+ }
@@ -33,7 +33,6 @@ export type FinanceDocumentV1 = {
33
33
  createdBy: string;
34
34
  issueDate: string;
35
35
  paidAt?: string;
36
- paymentNotes?: string;
37
36
  amount?: string;
38
37
  dueDate?: string;
39
38
 
@@ -50,12 +50,16 @@ export type SearchFinanceDocument = {
50
50
 
51
51
  export type SearchAdministrativeDocument = {
52
52
  doc: AdministrativeDocument;
53
+ custom: {
54
+ categorySubtype: 'generic' | 'deal';
55
+ };
53
56
  };
54
57
 
55
58
  export type RelatedDocumentsRequest = {
56
59
  businessEntityId: BusinessEntityIds;
57
60
  recordId: string;
58
61
  docTypes?: DocumentType[];
62
+ subtype?: 'generic' | 'deal';
59
63
  } & PaginatedRequest;
60
64
 
61
65
  export type SearchDocumentDraftDefinitions = {