@silexpert/core 1.1.140 → 1.1.141

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 (134) hide show
  1. package/es/api/resources/AccountingFiles.js.map +1 -1
  2. package/es/api/resources/BalanceSheet.d.ts +1 -0
  3. package/es/api/resources/BalanceSheet.d.ts.map +1 -1
  4. package/es/api/resources/BalanceSheet.js +3 -0
  5. package/es/api/resources/BalanceSheet.js.map +1 -1
  6. package/es/api/resources/Revision.d.ts +6 -1
  7. package/es/api/resources/Revision.d.ts.map +1 -1
  8. package/es/api/resources/Revision.js +16 -1
  9. package/es/api/resources/Revision.js.map +1 -1
  10. package/es/api/resources/RevisionGuide.d.ts +2 -2
  11. package/es/api/resources/RevisionGuide.d.ts.map +1 -1
  12. package/es/api/resources/RevisionGuide.js.map +1 -1
  13. package/es/api/resources/VatControl.d.ts +3 -1
  14. package/es/api/resources/VatControl.d.ts.map +1 -1
  15. package/es/api/resources/VatControl.js +6 -0
  16. package/es/api/resources/VatControl.js.map +1 -1
  17. package/es/types/Enum/BalanceSheetQuestion.d.ts.map +1 -1
  18. package/es/types/Enum/BalanceSheetQuestion.js.map +1 -1
  19. package/es/types/Enum/BrandClementine.js +2 -2
  20. package/es/types/Enum/BrandClementine.js.map +1 -1
  21. package/es/types/Enum/BrandPourcentage.js +2 -2
  22. package/es/types/Enum/BrandPourcentage.js.map +1 -1
  23. package/es/types/Enum/RevisionGuide.d.ts +28 -0
  24. package/es/types/Enum/RevisionGuide.d.ts.map +1 -1
  25. package/es/types/Enum/RevisionGuide.js +183 -0
  26. package/es/types/Enum/RevisionGuide.js.map +1 -1
  27. package/es/types/Enum/VatControl.d.ts +12 -0
  28. package/es/types/Enum/VatControl.d.ts.map +1 -0
  29. package/es/types/Enum/VatControl.js +195 -0
  30. package/es/types/Enum/VatControl.js.map +1 -0
  31. package/es/types/Interface/api/balanceSheet/VatControl.d.ts +13 -0
  32. package/es/types/Interface/api/balanceSheet/VatControl.d.ts.map +1 -0
  33. package/es/types/Interface/api/balanceSheet/VatControl.js +2 -0
  34. package/es/types/Interface/api/balanceSheet/VatControl.js.map +1 -0
  35. package/es/types/Interface/api/cerfa/3310.d.ts +47 -0
  36. package/es/types/Interface/api/cerfa/3310.d.ts.map +1 -1
  37. package/es/types/Interface/api/cerfa/3310.js.map +1 -1
  38. package/es/types/Interface/api/registration/CreateRegistration.d.ts +1 -0
  39. package/es/types/Interface/api/registration/CreateRegistration.d.ts.map +1 -1
  40. package/es/types/Interface/api/registration/CreateRegistration.js +7 -0
  41. package/es/types/Interface/api/registration/CreateRegistration.js.map +1 -1
  42. package/es/types/Interface/api/revision/Create.d.ts +26 -0
  43. package/es/types/Interface/api/revision/Create.d.ts.map +1 -0
  44. package/es/types/Interface/api/revision/Create.js +133 -0
  45. package/es/types/Interface/api/revision/Create.js.map +1 -0
  46. package/es/types/Interface/api/revision/Query.d.ts +8 -0
  47. package/es/types/Interface/api/revision/Query.d.ts.map +1 -1
  48. package/es/types/Interface/api/revision/Query.js +24 -0
  49. package/es/types/Interface/api/revision/Query.js.map +1 -1
  50. package/es/types/Interface/api/vatControl/CreateVatControl.d.ts +5 -0
  51. package/es/types/Interface/api/vatControl/CreateVatControl.d.ts.map +1 -0
  52. package/es/types/Interface/api/vatControl/CreateVatControl.js +26 -0
  53. package/es/types/Interface/api/vatControl/CreateVatControl.js.map +1 -0
  54. package/es/types/Interface/api/vatControl/QueryVatControl.d.ts +4 -0
  55. package/es/types/Interface/api/vatControl/QueryVatControl.d.ts.map +1 -0
  56. package/es/types/Interface/api/vatControl/QueryVatControl.js +21 -0
  57. package/es/types/Interface/api/vatControl/QueryVatControl.js.map +1 -0
  58. package/es/types/Interface/models/ISupervisionPendingPoint.d.ts +10 -0
  59. package/es/types/Interface/models/ISupervisionPendingPoint.d.ts.map +1 -1
  60. package/es/types/Interface/models/ISupervisionPendingPoint.js.map +1 -1
  61. package/es/types/Interface/models/ISupervisionPendingPointReply.d.ts +13 -0
  62. package/es/types/Interface/models/ISupervisionPendingPointReply.d.ts.map +1 -0
  63. package/es/types/Interface/models/ISupervisionPendingPointReply.js +2 -0
  64. package/es/types/Interface/models/ISupervisionPendingPointReply.js.map +1 -0
  65. package/es/types/index.d.ts +6 -0
  66. package/es/types/index.d.ts.map +1 -1
  67. package/es/types/index.js +6 -0
  68. package/es/types/index.js.map +1 -1
  69. package/es/utils/phone.js +1 -1
  70. package/es/utils/phone.js.map +1 -1
  71. package/es/utils/vat/3310/century23.js +65 -65
  72. package/es/utils/vat/3310/century23.js.map +1 -1
  73. package/js/api/resources/AccountingFiles.js.map +1 -1
  74. package/js/api/resources/BalanceSheet.js +3 -0
  75. package/js/api/resources/BalanceSheet.js.map +1 -1
  76. package/js/api/resources/Revision.js +20 -1
  77. package/js/api/resources/Revision.js.map +1 -1
  78. package/js/api/resources/RevisionGuide.js.map +1 -1
  79. package/js/api/resources/VatControl.js +6 -0
  80. package/js/api/resources/VatControl.js.map +1 -1
  81. package/js/types/Enum/BalanceSheetQuestion.js.map +1 -1
  82. package/js/types/Enum/BrandClementine.js +2 -2
  83. package/js/types/Enum/BrandClementine.js.map +1 -1
  84. package/js/types/Enum/BrandPourcentage.js +2 -2
  85. package/js/types/Enum/BrandPourcentage.js.map +1 -1
  86. package/js/types/Enum/RevisionGuide.js +311 -0
  87. package/js/types/Enum/RevisionGuide.js.map +1 -1
  88. package/js/types/Enum/VatControl.js +162 -0
  89. package/js/types/Enum/VatControl.js.map +1 -0
  90. package/js/types/Interface/api/balanceSheet/VatControl.js +6 -0
  91. package/js/types/Interface/api/balanceSheet/VatControl.js.map +1 -0
  92. package/js/types/Interface/api/cerfa/3310.js.map +1 -1
  93. package/js/types/Interface/api/registration/CreateRegistration.js +1 -0
  94. package/js/types/Interface/api/registration/CreateRegistration.js.map +1 -1
  95. package/js/types/Interface/api/revision/Create.js +45 -0
  96. package/js/types/Interface/api/revision/Create.js.map +1 -0
  97. package/js/types/Interface/api/revision/Query.js +9 -1
  98. package/js/types/Interface/api/revision/Query.js.map +1 -1
  99. package/js/types/Interface/api/vatControl/CreateVatControl.js +27 -0
  100. package/js/types/Interface/api/vatControl/CreateVatControl.js.map +1 -0
  101. package/js/types/Interface/api/vatControl/QueryVatControl.js +26 -0
  102. package/js/types/Interface/api/vatControl/QueryVatControl.js.map +1 -0
  103. package/js/types/Interface/models/ISupervisionPendingPoint.js.map +1 -1
  104. package/js/types/Interface/models/ISupervisionPendingPointReply.js +6 -0
  105. package/js/types/Interface/models/ISupervisionPendingPointReply.js.map +1 -0
  106. package/js/types/index.js +96 -36
  107. package/js/types/index.js.map +1 -1
  108. package/js/utils/phone.js +1 -1
  109. package/js/utils/phone.js.map +1 -1
  110. package/js/utils/vat/3310/century23.js +65 -65
  111. package/js/utils/vat/3310/century23.js.map +1 -1
  112. package/package.json +1 -1
  113. package/ts/api/resources/AccountingFiles.ts +1 -1
  114. package/ts/api/resources/BalanceSheet.ts +4 -0
  115. package/ts/api/resources/Revision.ts +22 -2
  116. package/ts/api/resources/RevisionGuide.ts +2 -2
  117. package/ts/api/resources/VatControl.ts +10 -1
  118. package/ts/types/Enum/BalanceSheetQuestion.ts +0 -1
  119. package/ts/types/Enum/BrandClementine.ts +2 -2
  120. package/ts/types/Enum/BrandPourcentage.ts +2 -2
  121. package/ts/types/Enum/RevisionGuide.ts +197 -1
  122. package/ts/types/Enum/VatControl.ts +198 -0
  123. package/ts/types/Interface/api/balanceSheet/VatControl.ts +10 -0
  124. package/ts/types/Interface/api/cerfa/3310.ts +49 -0
  125. package/ts/types/Interface/api/registration/CreateRegistration.ts +6 -0
  126. package/ts/types/Interface/api/revision/Create.ts +105 -0
  127. package/ts/types/Interface/api/revision/Query.ts +22 -0
  128. package/ts/types/Interface/api/vatControl/CreateVatControl.ts +14 -0
  129. package/ts/types/Interface/api/vatControl/QueryVatControl.ts +10 -0
  130. package/ts/types/Interface/models/ISupervisionPendingPoint.ts +10 -0
  131. package/ts/types/Interface/models/ISupervisionPendingPointReply.ts +16 -0
  132. package/ts/types/index.ts +6 -0
  133. package/ts/utils/phone.ts +1 -1
  134. package/ts/utils/vat/3310/century23.ts +26 -26
@@ -0,0 +1,105 @@
1
+ import { IsBoolean, IsDate, IsNumber, IsOptional, IsString } from 'class-validator';
2
+ import { ApiProperty, ApiPropertyOptional } from '../../../..';
3
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
4
+
5
+ export class SuperVisionPendingPointsPayload {
6
+ @ApiProperty()
7
+ @IsNumber()
8
+ @IsOptional()
9
+ idPendingPoint: number;
10
+
11
+ @ApiPropertyOptional()
12
+ @IsString()
13
+ @IsOptional()
14
+ value?: string;
15
+
16
+ @ApiPropertyOptional()
17
+ @IsBoolean()
18
+ @ToBoolean()
19
+ @IsOptional()
20
+ hasValueBeenUpdated?: boolean;
21
+
22
+ @ApiPropertyOptional()
23
+ @IsNumber()
24
+ @IsOptional()
25
+ createdBy?: number;
26
+
27
+ @ApiPropertyOptional()
28
+ @IsBoolean()
29
+ @ToBoolean()
30
+ @IsOptional()
31
+ isCritical?: boolean;
32
+
33
+ @ApiProperty()
34
+ @IsBoolean()
35
+ @ToBoolean()
36
+ @IsOptional()
37
+ activated?: boolean;
38
+
39
+ @ApiPropertyOptional()
40
+ @IsString()
41
+ @IsOptional()
42
+ note?: string;
43
+
44
+ @ApiPropertyOptional()
45
+ @IsBoolean()
46
+ @ToBoolean()
47
+ @IsOptional()
48
+ hasNoteBeenUpdated?: boolean;
49
+
50
+ @ApiPropertyOptional()
51
+ @IsNumber()
52
+ @IsOptional()
53
+ idUser?: number;
54
+
55
+ @ApiPropertyOptional()
56
+ @IsBoolean()
57
+ @ToBoolean()
58
+ @IsOptional()
59
+ isDone?: boolean;
60
+
61
+ @ApiPropertyOptional()
62
+ @IsNumber()
63
+ @IsOptional()
64
+ isDoneBy?: number;
65
+
66
+ @ApiPropertyOptional()
67
+ @IsBoolean()
68
+ @ToBoolean()
69
+ @IsOptional()
70
+ toBalanceSheetNote?: boolean;
71
+
72
+ @ApiPropertyOptional()
73
+ @IsBoolean()
74
+ @ToBoolean()
75
+ @IsOptional()
76
+ toSummaryNote?: boolean;
77
+
78
+ }
79
+
80
+ export class CreateOrUpdateState {
81
+ @ApiProperty()
82
+ pendingPoints: SuperVisionPendingPointsPayload[];
83
+
84
+ @ApiProperty()
85
+ @IsNumber()
86
+ idSociety: number;
87
+
88
+ @ApiProperty()
89
+ @IsDate()
90
+ startDate: Date;
91
+
92
+ @ApiProperty()
93
+ @IsDate()
94
+ endDate: Date;
95
+ }
96
+
97
+ export class CreateReply {
98
+ @ApiProperty()
99
+ @IsString()
100
+ reply: string;
101
+
102
+ @ApiProperty()
103
+ @IsNumber()
104
+ idUser: number;
105
+ }
@@ -277,3 +277,25 @@ export class QueryRevisionSearchEntries {
277
277
  @IsNumber()
278
278
  page?: number = 1;
279
279
  }
280
+
281
+ export class QueryRevisionGenericPendingPoint {
282
+ // Mandatory
283
+ @ApiProperty()
284
+ @IsNumber()
285
+ idTypeLegalForm: number;
286
+ }
287
+
288
+ export class QueryRevisionPendingPoint {
289
+ // Mandatory
290
+ @ApiProperty()
291
+ @IsNumber()
292
+ idSociety: number;
293
+
294
+ @ApiProperty()
295
+ @IsDate()
296
+ startDate: Date;
297
+
298
+ @ApiProperty()
299
+ @IsDate()
300
+ endDate: Date;
301
+ }
@@ -0,0 +1,14 @@
1
+ import { ArrayUnique, IsInt, IsPositive, IsString } from 'class-validator';
2
+ import { ApiProperty } from '../../../..';
3
+
4
+ export class CreateVatControl {
5
+ @ApiProperty()
6
+ @ArrayUnique()
7
+ @IsInt({ each: true })
8
+ @IsPositive({ each: true })
9
+ idRegistration: number[];
10
+
11
+ @ApiProperty()
12
+ @IsString()
13
+ payload: string;
14
+ }
@@ -0,0 +1,10 @@
1
+ import { ArrayUnique, IsInt, IsPositive } from 'class-validator';
2
+ import { ApiProperty } from '../../../../utils';
3
+
4
+ export class QueryVatControl {
5
+ @ApiProperty()
6
+ @ArrayUnique()
7
+ @IsInt({ each: true })
8
+ @IsPositive({ each: true })
9
+ idRegistration: number[];
10
+ }
@@ -1,4 +1,5 @@
1
1
  import { ISupervision } from './ISupervision';
2
+ import { ISupervisionPendingPointReply } from './ISupervisionPendingPointReply';
2
3
  import { IUser } from './IUser';
3
4
 
4
5
  // supervisionsPendingPoints
@@ -7,15 +8,24 @@ export interface ISupervisionPendingPoint {
7
8
  idSupervision: number;
8
9
  idPendingPoint: number;
9
10
  isDone: boolean;
11
+ isDoneBy: number | null;
12
+ isDoneDate: Date | null;
10
13
  idUser: number | null;
14
+ replyDate: Date | null;
11
15
  createdBy: number | null;
16
+ createdByDate: Date | null;
12
17
  value: string | null;
13
18
  note: string | null;
19
+ isCritical: boolean;
20
+ toBalanceSheetNote: boolean;
21
+ toSummaryNote: boolean;
14
22
  createdAt?: Date | null;
15
23
  updatedAt?: Date | null;
16
24
 
17
25
  // Associations
26
+ pendingPointReplies: ISupervisionPendingPointReply[];
18
27
  supervision: ISupervision;
19
28
  user: IUser;
20
29
  ppIsCreatedBy: IUser;
30
+ isDoneUser: IUser;
21
31
  }
@@ -0,0 +1,16 @@
1
+ import { ISupervisionPendingPoint } from './ISupervisionPendingPoint';
2
+ import { IUser } from './IUser';
3
+
4
+ // supervisionsPendingPoints
5
+ export interface ISupervisionPendingPointReply {
6
+ id?: number;
7
+ reply: string;
8
+ idSupervisionPendingPoint: number;
9
+ idUser: number;
10
+ createdAt?: Date | null;
11
+ updatedAt?: Date | null;
12
+
13
+ // Associations
14
+ supervisionPendingPoint: ISupervisionPendingPoint;
15
+ user: IUser;
16
+ }
package/ts/types/index.ts CHANGED
@@ -202,6 +202,7 @@ export * from './Interface/models/IStatusSignature';
202
202
  export * from './Interface/models/IStripeEvent';
203
203
  export * from './Interface/models/ISupervision';
204
204
  export * from './Interface/models/ISupervisionPendingPoint';
205
+ export * from './Interface/models/ISupervisionPendingPointReply';
205
206
  export * from './Interface/models/ISurvey';
206
207
  export * from './Interface/models/ITag';
207
208
  export * from './Interface/models/ITaxSystem';
@@ -489,6 +490,7 @@ export * from './Enum/FollowList';
489
490
  export * from './Enum/ClientOrProspect';
490
491
  export * from './Enum/MissionAcceptation';
491
492
  export * from './Enum/Bank';
493
+ export * from './Enum/VatControl';
492
494
 
493
495
  // Interfaces API
494
496
  export * from './Interface/api/cerfa/das2';
@@ -635,6 +637,7 @@ export * from './Interface/api/revision/Query';
635
637
  export * from './Interface/api/revision/Read';
636
638
  export * from './Interface/api/revision/RevisionObject';
637
639
  export * from './Interface/api/revision/Revision';
640
+ export * from './Interface/api/revision/Create';
638
641
  export * from './Interface/api/vatDeclaration/QueryVatDeclaration';
639
642
  export * from './Interface/api/vatDeclaration/ReadVatVariousOperations';
640
643
  export * from './Interface/api/vatDeclaration/ResultFormatToEntries';
@@ -820,6 +823,7 @@ export * from './Interface/api/journal/Journals';
820
823
  export * from './Interface/api/journal/QueryJournal';
821
824
  export * from './Interface/api/registration/DeclareRegistration';
822
825
  export * from './Interface/api/balanceSheet/ReadBalanceSheetTransaction';
826
+ export * from './Interface/api/balanceSheet/VatControl';
823
827
  export * from './Interface/api/mealExpense/CreateMealExpense';
824
828
  export * from './Interface/api/mealExpense/ReadMealExpense';
825
829
  export * from './Interface/api/exerciceQuestion/QueryQuestion';
@@ -954,6 +958,8 @@ export * from './Interface/api/accountsSectors/Query';
954
958
  export * from './Interface/api/visualizedInformation/Query';
955
959
  export * from './Interface/api/visualizedInformation/Update';
956
960
  export * from './Interface/api/society/QueryArchived';
961
+ export * from './Interface/api/vatControl/CreateVatControl';
962
+ export * from './Interface/api/vatControl/QueryVatControl';
957
963
  // Enums types
958
964
  export * from './Interface/enum/Util';
959
965
  export * from './Interface/enum/Date';
package/ts/utils/phone.ts CHANGED
@@ -5,7 +5,7 @@ import { RoleDetail } from '../types/Enum/RoleDetail';
5
5
 
6
6
  export function formatPhoneNumberToE164(phoneNumber: string | null, prefix = '+33'): string | null {
7
7
  if (!phoneNumber) return null;
8
- if (phoneNumber.charAt(0) !== '+' && phoneNumber.charAt(0) === '0') {
8
+ if (phoneNumber.charAt(0) !== '+') {
9
9
  const numberInt = phoneNumber.replace(/\D/g, '');
10
10
  if (prefix) {
11
11
  if (numberInt.length === 10 && numberInt.charAt(0) === '0') {
@@ -49,8 +49,8 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
49
49
  // Opérations taxées -
50
50
  const taxedServicesEntries = vatEntries.filter((ae) => frenchVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
51
51
  const servicesAccounts = ['701', '702', '703', '704', '705', '706', '707', '708', '472'];
52
- const taxedServicesFromFrance = setZeroIfIsNegative(getAmountByAccountNumber(taxedServicesEntries, servicesAccounts, 0, true));
53
- const taxedOther = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => withTaxVat.includes(ae.idVat)), ['775'], 0, true));
52
+ const taxedServicesFromFrance = setZeroIfIsNegative(getAmountByAccountNumber(taxedServicesEntries, servicesAccounts, 0, true)) + (payload?.vatControl?.france?.base20 ?? 0) + (payload?.vatControl?.france?.base10 ?? 0) + (payload?.vatControl?.france?.base8Dot5 ?? 0) + (payload?.vatControl?.france?.base5Dot5 ?? 0) + (payload?.vatControl?.france?.base2Dot1 ?? 0);
53
+ const taxedOther = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => withTaxVat.includes(ae.idVat)), ['775'], 0, true)) + (payload?.vatControl?.other?.base20 ?? 0) + (payload?.vatControl?.other?.base10 ?? 0) + (payload?.vatControl?.other?.base5Dot5 ?? 0) + (payload?.vatControl?.other?.base2Dot1 ?? 0);
54
54
  const intracommunityServiceAccounts = ['604', '611', '612', '613', '614', '615', '616', '617', '618', '619', '62'];
55
55
  const intracommunityServiceEntries = vatEntries.filter((ae) => withTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat));
56
56
 
@@ -59,64 +59,64 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
59
59
 
60
60
  const taxedImportEntries = vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
61
61
  const taxedImportAccounts = ['6'];
62
- const taxedImport = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries, taxedImportAccounts, 0, true));
62
+ const taxedImport = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries, taxedImportAccounts, 0, true)) + (payload?.vatControl?.importations?.base20 ?? 0) + (payload?.vatControl?.importations?.base10 ?? 0) + (payload?.vatControl?.importations?.base8Dot5 ?? 0) + (payload?.vatControl?.importations?.base5Dot5 ?? 0) + (payload?.vatControl?.importations?.base2Dot1 ?? 0);
63
63
 
64
64
  const intracommunityAccounts2 = ['601', '602', '603', '605', '606', '607', '651'];
65
65
  const taxedIntracommunityAcquisitions = getAmountByAccountNumber(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat)), [...intracommunityAccounts2, ...intracommunityServiceAccounts], 0, true);
66
66
 
67
67
  // Opérations non taxées
68
- const untaxedExportationNotInEurope = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts, 0, true));
69
- const untaxedOther = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['70', '71', '72', '73', '75', '77', '78', '790', '792', '793', '794', '795', '796', '797', '798', '799'], 0, true)); // 02/08/23 - ne plus prendre en compte les comptes 76,74,791 - Chloé R.
70
- const untaxedImport = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6'], 0, true));
71
- const untaxedIntracomunity = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), intracommunityAccounts2, 0, true));
68
+ const untaxedExportationNotInEurope = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts, 0, true)) + (payload?.vatControl?.untaxed?.exportation ?? 0);
69
+ const untaxedOther = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['70', '71', '72', '73', '75', '77', '78', '790', '792', '793', '794', '795', '796', '797', '798', '799'], 0, true)) + (payload?.vatControl?.untaxed?.other ?? 0);// 02/08/23 - ne plus prendre en compte les comptes 76,74,791 - Chloé R.
70
+ const untaxedImport = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6'], 0, true)) + (payload?.vatControl?.untaxed?.importation ?? 0);
71
+ const untaxedIntracomunity = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), intracommunityAccounts2, 0, true)) + (payload?.vatControl?.untaxed?.intracomunity ?? 0);
72
72
  const untaxedIntracommunityDelivery = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => withoutTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat)), ['701', '707'], 0, true));
73
73
  // TVA brute
74
74
  const normalRate = setZeroIfIsNegative(getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
75
- + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), ['6'], 0, true));
75
+ + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + (payload?.vatControl?.france?.base20 ?? 0);
76
76
 
77
77
  const normalRateTax = _round(normalRate * 0.2);
78
78
 
79
79
  const reducedRate5Dot5 = setZeroIfIsNegative(getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
80
- + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true));
80
+ + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + (payload?.vatControl?.france?.base5Dot5 ?? 0);
81
81
  const reducedRate5Dot5Tax = _round(reducedRate5Dot5 * 0.055);
82
82
 
83
83
  const reducedRate10 = setZeroIfIsNegative(getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
84
- + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), ['6'], 0, true));
84
+ + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + (payload?.vatControl?.france?.base10 ?? 0);
85
85
  const reducedRate10Tax = _round(reducedRate10 * 0.1);
86
86
 
87
87
  const reducedRate8Dot5 = setZeroIfIsNegative(getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
88
- + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true));
88
+ + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + (payload?.vatControl?.france?.base8Dot5 ?? 0);
89
89
  const reducedRate8Dot5Tax = _round(reducedRate8Dot5 * 0.085);
90
90
 
91
91
  const reducedRate2Dot1 = setZeroIfIsNegative(getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
92
- + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), ['6'], 0, true));
92
+ + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + (payload?.vatControl?.france?.base2Dot1 ?? 0);
93
93
  const reducedRate2Dot1Tax = _round(reducedRate2Dot1 * 0.021);
94
94
 
95
- const importNormalRate = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
95
+ const importNormalRate = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + (payload?.vatControl?.importations?.base20 ?? 0);
96
96
  const importNormalRateTax = _round(importNormalRate * 0.2);
97
- const importReducedRate10 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
97
+ const importReducedRate10 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + (payload?.vatControl?.importations?.base10 ?? 0);
98
98
  const importReducedRate10Tax = _round(importReducedRate10 * 0.1);
99
- const importReducedRate8Dot5 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
99
+ const importReducedRate8Dot5 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + (payload?.vatControl?.importations?.base8Dot5 ?? 0);
100
100
  const importReducedRate8Dot5Tax = _round(importReducedRate8Dot5 * 0.085);
101
- const importReducedRate5Dot5 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
101
+ const importReducedRate5Dot5 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + (payload?.vatControl?.importations?.base5Dot5 ?? 0);
102
102
  const importReducedRate5Dot5Tax = _round(importReducedRate8Dot5 * 0.055);
103
- const importReducedRate2Dot1 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
103
+ const importReducedRate2Dot1 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + (payload?.vatControl?.importations?.base2Dot1 ?? 0);
104
104
  const importReducedRate2Dot1Tax = _round(importReducedRate2Dot1 * 0.021);
105
105
  const importReducedRate1Dot05 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 1.05).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
106
106
  const importReducedRate1Dot05Tax = _round(importReducedRate1Dot05 * 0.0105);
107
107
  const intracommunityTax = setZeroIfIsNegative(getTaxAmountByAccountNumber(intracommunityServiceEntries, [...intracommunityServiceAccounts, ...intracommunityAccounts2], 0));
108
108
 
109
109
  // TVA Déductible
110
- const immobilizationTax = setZeroIfIsNegative(getTaxAmountByAccountNumber(vatEntries, ['2']));
111
- const otherGoodsAndServices = setZeroIfIsNegative(getTaxAmountByAccountNumber(vatEntries.filter((e) => vats.filter((v) => !v.isVatImportation).map((v) => v.id).includes(e.idVat)), ['6']));
112
- const otherDeductibles = setZeroIfIsNegative(getTaxAmountByAccountNumber(vatEntries.filter((e) => vats.filter((v) => v.isVatImportation).map((v) => v.id).includes(e.idVat)), ['6']));
113
- const report = payload.vat?.deductible?.toReport && payload.vat?.deductible?.toReport > 0 ? _round(payload.vat?.deductible?.toReport ?? 0) : payload.previousVatDeclaration?.credit?.toReport ?? 0;
110
+ const immobilizationTax = setZeroIfIsNegative(getTaxAmountByAccountNumber(vatEntries, ['2'])) + (payload?.vatControl?.deducted?.immobilization ?? 0);
111
+ const otherGoodsAndServices = setZeroIfIsNegative(getTaxAmountByAccountNumber(vatEntries.filter((e) => vats.filter((v) => !v.isVatImportation).map((v) => v.id).includes(e.idVat)), ['6'])) + (payload?.vatControl?.deducted?.abs ?? 0);
112
+ const otherDeductibles = setZeroIfIsNegative(getTaxAmountByAccountNumber(vatEntries.filter((e) => vats.filter((v) => v.isVatImportation).map((v) => v.id).includes(e.idVat)), ['6'])) + (payload?.vatControl?.deducted?.other ?? 0);
113
+ const report = (payload.vat?.deductible?.toReport && payload.vat?.deductible?.toReport > 0 ? _round(payload.vat?.deductible?.toReport ?? 0) : payload.previousVatDeclaration?.credit?.toReport ?? 0) + (payload?.vatControl?.deducted?.reported ?? 0);
114
114
 
115
115
  const coefficient = _round(payload.vat?.deductible?.coefficient ?? 100, 2);
116
116
  const isNil = payload.isNil === true;
117
117
  const isHolidayDeposit = payload.isHolidayDeposit === true;
118
118
 
119
- const sumToAdd = setZeroIfIsNegative(isNil ? 0 : isHolidayDeposit ? (_round((payload.previousVatDeclaration?.toPay?.total ?? 0) * 0.8)) : (_round(payload.vat?.sumToAdd ?? 0) + mxToAdd));
119
+ const sumToAdd = setZeroIfIsNegative(isNil ? 0 : isHolidayDeposit ? (_round((payload.previousVatDeclaration?.toPay?.total ?? 0) * 0.8)) : (_round(payload.vat?.sumToAdd ?? 0) + mxToAdd)) + (payload?.vatControl?.regularisations?.case5B ?? 0);
120
120
  const comment = isHolidayDeposit ? `ACOMPTE CONGES ${payload.comment ?? ''}` : (payload.comment ?? null);
121
121
 
122
122
  const initialPayload: Cerfa3310_2023 = {
@@ -184,7 +184,7 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
184
184
  intracommunityAcquisitions: isNil || isHolidayDeposit ? 0 : taxedIntracommunityAcquisitions,
185
185
  energyDelivery: isNil || isHolidayDeposit ? 0 : _round(payload.taxedOperations?.energyDelivery ?? 0),
186
186
  purchaseOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : _round(payload.taxedOperations?.purchaseOfServicesNotInFrance ?? 0),
187
- regularizations: isNil || isHolidayDeposit ? 0 : _round(payload.taxedOperations?.regularizations ?? 0),
187
+ regularizations: isNil || isHolidayDeposit ? 0 : _round(payload.taxedOperations?.regularizations ?? 0) + (payload?.vatControl?.regularisations?.base20 ?? 0) + (payload?.vatControl?.regularisations?.base10 ?? 0) + (payload?.vatControl?.regularisations?.base5Dot5 ?? 0) + (payload?.vatControl?.regularisations?.base2Dot1 ?? 0),
188
188
  },
189
189
  untaxedOperations: {
190
190
  exportationNotInEurope: isNil || isHolidayDeposit ? 0 : untaxedExportationNotInEurope,
@@ -200,7 +200,7 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
200
200
  importPetrolInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : _round(payload.untaxedOperations?.importPetrolInSuspensiveSystem ?? 0),
201
201
  purchaseInFranchise: isNil || isHolidayDeposit ? 0 : _round(payload.untaxedOperations?.purchaseInFranchise ?? 0),
202
202
  saleOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : _round(payload.untaxedOperations?.saleOfServicesNotInFrance ?? 0),
203
- regularizations: isNil || isHolidayDeposit ? 0 : _round(payload.untaxedOperations?.regularizations ?? 0),
203
+ regularizations: isNil || isHolidayDeposit ? 0 : _round(payload.untaxedOperations?.regularizations ?? 0) + (payload?.vatControl?.untaxed?.regularisation ?? 0),
204
204
  internalUniq: isNil || isHolidayDeposit ? 0 : _round(payload.untaxedOperations?.internalUniq ?? 0),
205
205
  },
206
206
  vat: {
@@ -283,7 +283,7 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
283
283
  total: isNil || isHolidayDeposit ? 0 : otherDeductibles,
284
284
  },
285
285
  report,
286
- toImpute: isNil || isHolidayDeposit ? 0 : (_round(payload.vat?.deductible?.toImpute ?? 0) + mxToSub),
286
+ toImpute: isNil || isHolidayDeposit ? 0 : (_round(payload.vat?.deductible?.toImpute ?? 0) + mxToSub) + (payload?.vatControl?.deducted?.case2C ?? 0),
287
287
  total: 0, // Calculé plus bas
288
288
  onImportOtherThanOilProducts: isNil || isHolidayDeposit ? 0 : otherDeductibles,
289
289
  coefficient: isNil || isHolidayDeposit ? 100 : coefficient,
@@ -326,7 +326,7 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
326
326
  },
327
327
  credit: {
328
328
  amount: 0, // Calculé plus bas
329
- refundAsked: isNil || isHolidayDeposit ? 0 : _round(payload.credit?.refundAsked ?? 0),
329
+ refundAsked: isNil || isHolidayDeposit ? 0 : _round(payload.credit?.refundAsked ?? 0) + (payload?.vatControl?.refundAsked ?? 0),
330
330
  transferedToSocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : _round(payload.credit?.transferedToSocietyHeadOfGroup ?? 0),
331
331
  assimiledTaxes: isNil || isHolidayDeposit ? 0 : _round(payload.credit?.assimiledTaxes ?? 0),
332
332
  toReport: 0, // Calculé plus bas