@silexpert/core 2.0.68 → 2.0.70-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 (109) hide show
  1. package/dist/api/resources/Account.d.ts +1 -0
  2. package/dist/api/resources/Account.d.ts.map +1 -1
  3. package/dist/api/resources/Account.js +3 -0
  4. package/dist/api/resources/Account.js.map +1 -1
  5. package/dist/api/resources/Acd.d.ts +2 -1
  6. package/dist/api/resources/Acd.d.ts.map +1 -1
  7. package/dist/api/resources/Acd.js +3 -0
  8. package/dist/api/resources/Acd.js.map +1 -1
  9. package/dist/api/resources/Notification.d.ts +2 -1
  10. package/dist/api/resources/Notification.d.ts.map +1 -1
  11. package/dist/api/resources/Notification.js +3 -0
  12. package/dist/api/resources/Notification.js.map +1 -1
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +1 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/types/Enum/Ged.d.ts +2 -1
  18. package/dist/types/Enum/Ged.d.ts.map +1 -1
  19. package/dist/types/Enum/Ged.js +1 -0
  20. package/dist/types/Enum/Ged.js.map +1 -1
  21. package/dist/types/Interface/api/account/Create.d.ts +5 -1
  22. package/dist/types/Interface/api/account/Create.d.ts.map +1 -1
  23. package/dist/types/Interface/api/account/Create.js +38 -4
  24. package/dist/types/Interface/api/account/Create.js.map +1 -1
  25. package/dist/types/Interface/api/acd/Vat.d.ts +52 -0
  26. package/dist/types/Interface/api/acd/Vat.d.ts.map +1 -0
  27. package/dist/types/Interface/api/acd/Vat.js +14 -0
  28. package/dist/types/Interface/api/acd/Vat.js.map +1 -0
  29. package/dist/types/Interface/api/docoon/Create.d.ts +25 -0
  30. package/dist/types/Interface/api/docoon/Create.d.ts.map +1 -1
  31. package/dist/types/Interface/api/docoon/Create.js +8 -1
  32. package/dist/types/Interface/api/docoon/Create.js.map +1 -1
  33. package/dist/types/Interface/api/docoon/Read.d.ts +106 -0
  34. package/dist/types/Interface/api/docoon/Read.d.ts.map +1 -1
  35. package/dist/types/Interface/api/docoon/Read.js.map +1 -1
  36. package/dist/types/Interface/api/einvoicing/SyncFlowStatusResult.d.ts +12 -0
  37. package/dist/types/Interface/api/einvoicing/SyncFlowStatusResult.d.ts.map +1 -0
  38. package/dist/types/Interface/api/einvoicing/SyncFlowStatusResult.js +2 -0
  39. package/dist/types/Interface/api/einvoicing/SyncFlowStatusResult.js.map +1 -0
  40. package/dist/types/Interface/api/notification/CreateInternalNotification.d.ts +17 -0
  41. package/dist/types/Interface/api/notification/CreateInternalNotification.d.ts.map +1 -0
  42. package/dist/types/Interface/api/notification/CreateInternalNotification.js +98 -0
  43. package/dist/types/Interface/api/notification/CreateInternalNotification.js.map +1 -0
  44. package/dist/types/Interface/api/product/CreateProduct.d.ts +1 -0
  45. package/dist/types/Interface/api/product/CreateProduct.d.ts.map +1 -1
  46. package/dist/types/Interface/api/product/CreateProduct.js +8 -1
  47. package/dist/types/Interface/api/product/CreateProduct.js.map +1 -1
  48. package/dist/types/Interface/models/IAccount.d.ts +1 -0
  49. package/dist/types/Interface/models/IAccount.d.ts.map +1 -1
  50. package/dist/types/Interface/models/IAccount.js +1 -0
  51. package/dist/types/Interface/models/IAccount.js.map +1 -1
  52. package/dist/types/Interface/models/IAccountingFile.d.ts +1 -0
  53. package/dist/types/Interface/models/IAccountingFile.d.ts.map +1 -1
  54. package/dist/types/Interface/models/IAccountingFile.js +1 -0
  55. package/dist/types/Interface/models/IAccountingFile.js.map +1 -1
  56. package/dist/types/Interface/models/IEInvoicing.d.ts +1 -1
  57. package/dist/types/Interface/models/IEInvoicing.d.ts.map +1 -1
  58. package/dist/types/Interface/models/IEInvoicing.js.map +1 -1
  59. package/dist/types/Interface/models/IProduct.d.ts +3 -0
  60. package/dist/types/Interface/models/IProduct.d.ts.map +1 -1
  61. package/dist/types/Interface/models/IProduct.js +2 -0
  62. package/dist/types/Interface/models/IProduct.js.map +1 -1
  63. package/dist/types/Interface/models/IProductInvoice.d.ts +3 -0
  64. package/dist/types/Interface/models/IProductInvoice.d.ts.map +1 -1
  65. package/dist/types/Interface/models/IProductInvoice.js +2 -0
  66. package/dist/types/Interface/models/IProductInvoice.js.map +1 -1
  67. package/dist/types/Interface/models/ISocietyGescom.d.ts +1 -0
  68. package/dist/types/Interface/models/ISocietyGescom.d.ts.map +1 -1
  69. package/dist/types/Interface/models/ISocietyGescom.js +2 -0
  70. package/dist/types/Interface/models/ISocietyGescom.js.map +1 -1
  71. package/dist/types/index.d.ts +3 -0
  72. package/dist/types/index.d.ts.map +1 -1
  73. package/dist/types/index.js +3 -0
  74. package/dist/types/index.js.map +1 -1
  75. package/dist/utils/acdVat.d.ts +4 -0
  76. package/dist/utils/acdVat.d.ts.map +1 -0
  77. package/dist/utils/acdVat.js +57 -0
  78. package/dist/utils/acdVat.js.map +1 -0
  79. package/dist/utils/index.d.ts +1 -0
  80. package/dist/utils/index.d.ts.map +1 -1
  81. package/dist/utils/index.js +1 -0
  82. package/dist/utils/index.js.map +1 -1
  83. package/dist/utils/tests/acdVat.spec.d.ts +2 -0
  84. package/dist/utils/tests/acdVat.spec.d.ts.map +1 -0
  85. package/dist/utils/tests/acdVat.spec.js +25 -0
  86. package/dist/utils/tests/acdVat.spec.js.map +1 -0
  87. package/package.json +1 -1
  88. package/ts/api/resources/Account.ts +4 -0
  89. package/ts/api/resources/Acd.ts +5 -1
  90. package/ts/api/resources/Notification.ts +5 -1
  91. package/ts/index.ts +1 -0
  92. package/ts/types/Enum/Ged.ts +1 -0
  93. package/ts/types/Interface/api/account/Create.ts +29 -3
  94. package/ts/types/Interface/api/acd/Vat.ts +52 -0
  95. package/ts/types/Interface/api/docoon/Create.ts +31 -1
  96. package/ts/types/Interface/api/docoon/Read.ts +114 -0
  97. package/ts/types/Interface/api/einvoicing/SyncFlowStatusResult.ts +12 -0
  98. package/ts/types/Interface/api/notification/CreateInternalNotification.ts +64 -0
  99. package/ts/types/Interface/api/product/CreateProduct.ts +6 -1
  100. package/ts/types/Interface/models/IAccount.ts +1 -0
  101. package/ts/types/Interface/models/IAccountingFile.ts +1 -0
  102. package/ts/types/Interface/models/IEInvoicing.ts +1 -1
  103. package/ts/types/Interface/models/IProduct.ts +3 -0
  104. package/ts/types/Interface/models/IProductInvoice.ts +3 -0
  105. package/ts/types/Interface/models/ISocietyGescom.ts +2 -0
  106. package/ts/types/index.ts +3 -0
  107. package/ts/utils/acdVat.ts +63 -0
  108. package/ts/utils/index.ts +1 -0
  109. package/ts/utils/tests/acdVat.spec.ts +26 -0
@@ -47,6 +47,8 @@ export class ISocietyGescom {
47
47
  idSociety?: number | null;
48
48
  shouldHideBrandName?: boolean;
49
49
  shouldHideEmailHeader?: boolean;
50
+ // Regroupe les ecritures comptables par compte pour l export des ecritures comptables.
51
+ areEntriesGroupedByAccount?: boolean;
50
52
  customerBlockBorderThickness?: number | null;
51
53
  customerBlockBorderColor?: string | null;
52
54
  lineSeparationThickness?: number | null;
package/ts/types/index.ts CHANGED
@@ -540,6 +540,7 @@ export * from './Enum/Kyc.js';
540
540
 
541
541
  // Interfaces API
542
542
  export * from './Interface/api/accountingTransaction/Create.js';
543
+ export * from './Interface/api/acd/Vat.js';
543
544
  export * from './Interface/api/acd/Create.js';
544
545
  export * from './Interface/api/authentification/AuthenticationResponse.js';
545
546
  export * from './Interface/api/exercice/ReadExercice.js';
@@ -939,6 +940,7 @@ export * from './Interface/api/calendarEvent/calendarEvent.js';
939
940
  export * from './Interface/api/checklist/Read.js';
940
941
  export * from './Interface/api/checklist/Query.js';
941
942
  export * from './Interface/api/checklist/Update.js';
943
+ export * from './Interface/api/notification/CreateInternalNotification.js';
942
944
  export * from './Interface/api/notification/CreateNotification.js';
943
945
  export * from './Interface/api/notification/Delete.js';
944
946
  export * from './Interface/api/notification/Update.js';
@@ -975,6 +977,7 @@ export * from './Interface/api/commercialManagement/Create.js';
975
977
  export * from './Interface/api/commercialManagement/Read.js';
976
978
  export * from './Interface/api/commercialManagement/Query.js';
977
979
  export * from './Interface/api/commercialManagement/Update.js';
980
+ export * from './Interface/api/einvoicing/SyncFlowStatusResult.js';
978
981
  export * from './Interface/api/commercialOffer/Query.js';
979
982
  export * from './Interface/api/documentSection/Update.js';
980
983
  export * from './Interface/api/connector/CreateConnector.js';
@@ -0,0 +1,63 @@
1
+ import { Vat } from '../types/Enum/Vat.js';
2
+ import { AcdVatCode } from '../types/Interface/api/acd/Vat.js';
3
+
4
+ export function idVatToAcdVatCode(idVat?: number | null): AcdVatCode | null {
5
+ if (!idVat) {
6
+ return null;
7
+ }
8
+
9
+ const vat = Object.values(Vat).find((currentVat) => currentVat.id === idVat);
10
+
11
+ if (!vat) {
12
+ return AcdVatCode.NON_AFFECTE;
13
+ }
14
+
15
+ if (vat.isVatIntracom) {
16
+ return AcdVatCode.INTRACOM;
17
+ }
18
+
19
+ if (vat.isVatImportation) {
20
+ return AcdVatCode.AUTOL;
21
+ }
22
+
23
+ switch (vat.value) {
24
+ case 2.1:
25
+ return AcdVatCode.REDUIT_2_1;
26
+ case 5.5:
27
+ return AcdVatCode.REDUIT_5_5;
28
+ case 10:
29
+ return AcdVatCode.REDUIT_10;
30
+ case 20:
31
+ return AcdVatCode.NORMAL;
32
+ case 0:
33
+ return null;
34
+ default:
35
+ return AcdVatCode.NON_AFFECTE;
36
+ }
37
+ }
38
+
39
+ export function acdVatCodeToIdVat(acdVatCode?: AcdVatCode | null): number | null {
40
+ switch (acdVatCode) {
41
+ case AcdVatCode.NORMAL:
42
+ return Vat.TX_20.id;
43
+ case AcdVatCode.REDUIT_10:
44
+ return Vat.TX_10.id;
45
+ case AcdVatCode.REDUIT_5_5:
46
+ return Vat.TX_5_5.id;
47
+ case AcdVatCode.REDUIT_2_1:
48
+ return Vat.TX_2_1.id;
49
+ case AcdVatCode.INTRACOM:
50
+ // L'information de taux est perdue dans le code ACD, on retombe sur l'intracom a 20% par defaut.
51
+ return Vat.INTRACOM_TX_20.id;
52
+ case AcdVatCode.AUTOL:
53
+ // L'information de taux est perdue dans le code ACD, on retombe sur l'importation a 20% par defaut.
54
+ return Vat.IMPORTATION_TX_20.id;
55
+ case AcdVatCode.NON_AFFECTE:
56
+ case AcdVatCode.ONI:
57
+ case AcdVatCode.SUR_IMMOBILISATION:
58
+ case AcdVatCode.SPECIAL:
59
+ case null:
60
+ case undefined:
61
+ return null;
62
+ }
63
+ }
package/ts/utils/index.ts CHANGED
@@ -20,5 +20,6 @@ export * from './bankAccount.js';
20
20
  export * from './commercialOffer.js';
21
21
  export * from './societyApproval.js';
22
22
  export * from './commercialManagement/saleEmail.js';
23
+ export * from './acdVat.js';
23
24
  export * from './transforms/boolean.transform.js';
24
25
  export * from './transforms/number.transform.js';
@@ -0,0 +1,26 @@
1
+ import { describe, expect, test } from 'vitest';
2
+ import { Vat } from '../../types/Enum/Vat.js';
3
+ import { AcdVatCode } from '../../types/Interface/api/acd/Vat.js';
4
+ import { acdVatCodeToIdVat, idVatToAcdVatCode } from '../acdVat.js';
5
+
6
+ describe('acdVat utils', () => {
7
+ test('should map internal VAT ids to ACD VAT codes', () => {
8
+ expect(idVatToAcdVatCode(Vat.TX_20.id)).toBe(AcdVatCode.NORMAL);
9
+ expect(idVatToAcdVatCode(Vat.TX_10.id)).toBe(AcdVatCode.REDUIT_10);
10
+ expect(idVatToAcdVatCode(Vat.TX_5_5.id)).toBe(AcdVatCode.REDUIT_5_5);
11
+ expect(idVatToAcdVatCode(Vat.TX_2_1.id)).toBe(AcdVatCode.REDUIT_2_1);
12
+ expect(idVatToAcdVatCode(Vat.INTRACOM_TX_20.id)).toBe(AcdVatCode.INTRACOM);
13
+ expect(idVatToAcdVatCode(Vat.IMPORTATION_TX_20.id)).toBe(AcdVatCode.AUTOL);
14
+ expect(idVatToAcdVatCode(Vat.WITHOUT_TAXE.id)).toBeNull();
15
+ });
16
+
17
+ test('should map ACD VAT codes back to internal VAT ids', () => {
18
+ expect(acdVatCodeToIdVat(AcdVatCode.NORMAL)).toBe(Vat.TX_20.id);
19
+ expect(acdVatCodeToIdVat(AcdVatCode.REDUIT_10)).toBe(Vat.TX_10.id);
20
+ expect(acdVatCodeToIdVat(AcdVatCode.REDUIT_5_5)).toBe(Vat.TX_5_5.id);
21
+ expect(acdVatCodeToIdVat(AcdVatCode.REDUIT_2_1)).toBe(Vat.TX_2_1.id);
22
+ expect(acdVatCodeToIdVat(AcdVatCode.INTRACOM)).toBe(Vat.INTRACOM_TX_20.id);
23
+ expect(acdVatCodeToIdVat(AcdVatCode.AUTOL)).toBe(Vat.IMPORTATION_TX_20.id);
24
+ expect(acdVatCodeToIdVat(AcdVatCode.NON_AFFECTE)).toBeNull();
25
+ });
26
+ });