@silexpert/core 1.0.103 → 1.0.106

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 (224) hide show
  1. package/es/api/resources/BalanceSheet.d.ts +2 -1
  2. package/es/api/resources/BalanceSheet.d.ts.map +1 -1
  3. package/es/api/resources/BalanceSheet.js +3 -0
  4. package/es/api/resources/BalanceSheet.js.map +1 -1
  5. package/es/api/resources/Exercice.d.ts +2 -1
  6. package/es/api/resources/Exercice.d.ts.map +1 -1
  7. package/es/api/resources/Exercice.js +3 -0
  8. package/es/api/resources/Exercice.js.map +1 -1
  9. package/es/api/resources/Library.d.ts +3 -0
  10. package/es/api/resources/Library.d.ts.map +1 -1
  11. package/es/api/resources/Library.js +9 -0
  12. package/es/api/resources/Library.js.map +1 -1
  13. package/es/api/resources/SignFile.d.ts +6 -0
  14. package/es/api/resources/SignFile.d.ts.map +1 -0
  15. package/es/api/resources/SignFile.js +7 -0
  16. package/es/api/resources/SignFile.js.map +1 -0
  17. package/es/api/resources/SocietyConfigBalanceSheet.d.ts +10 -0
  18. package/es/api/resources/SocietyConfigBalanceSheet.d.ts.map +1 -0
  19. package/es/api/resources/SocietyConfigBalanceSheet.js +19 -0
  20. package/es/api/resources/SocietyConfigBalanceSheet.js.map +1 -0
  21. package/es/api/resources.d.ts +4 -0
  22. package/es/api/resources.d.ts.map +1 -1
  23. package/es/api/resources.js +4 -0
  24. package/es/api/resources.js.map +1 -1
  25. package/es/types/Enum/BalanceSheet.d.ts +118 -1
  26. package/es/types/Enum/BalanceSheet.d.ts.map +1 -1
  27. package/es/types/Enum/BalanceSheet.js +136 -0
  28. package/es/types/Enum/BalanceSheet.js.map +1 -1
  29. package/es/types/Enum/BrandClementine.d.ts +25 -0
  30. package/es/types/Enum/BrandClementine.d.ts.map +1 -1
  31. package/es/types/Enum/BrandClementine.js +5 -0
  32. package/es/types/Enum/BrandClementine.js.map +1 -1
  33. package/es/types/Enum/BrandComptalib.d.ts +20 -0
  34. package/es/types/Enum/BrandComptalib.d.ts.map +1 -1
  35. package/es/types/Enum/BrandComptalib.js +5 -0
  36. package/es/types/Enum/BrandComptalib.js.map +1 -1
  37. package/es/types/Enum/BrandPourcentage.d.ts +5 -0
  38. package/es/types/Enum/BrandPourcentage.d.ts.map +1 -1
  39. package/es/types/Enum/BrandPourcentage.js +5 -0
  40. package/es/types/Enum/BrandPourcentage.js.map +1 -1
  41. package/es/types/Enum/DepositDocumentType.d.ts +35 -0
  42. package/es/types/Enum/DepositDocumentType.d.ts.map +1 -0
  43. package/es/types/Enum/DepositDocumentType.js +191 -0
  44. package/es/types/Enum/DepositDocumentType.js.map +1 -0
  45. package/es/types/Enum/Ged.d.ts +17 -1
  46. package/es/types/Enum/Ged.d.ts.map +1 -1
  47. package/es/types/Enum/Ged.js +17 -8
  48. package/es/types/Enum/Ged.js.map +1 -1
  49. package/es/types/Enum/RevisionGuide.d.ts +56 -6
  50. package/es/types/Enum/RevisionGuide.d.ts.map +1 -1
  51. package/es/types/Enum/RevisionGuide.js +54 -4
  52. package/es/types/Enum/RevisionGuide.js.map +1 -1
  53. package/es/types/Enum/RoleDetail.js +1 -1
  54. package/es/types/Enum/RoleDetail.js.map +1 -1
  55. package/es/types/Enum/StatusSignature.d.ts +9 -0
  56. package/es/types/Enum/StatusSignature.d.ts.map +1 -0
  57. package/es/types/Enum/StatusSignature.js +10 -0
  58. package/es/types/Enum/StatusSignature.js.map +1 -0
  59. package/es/types/Interface/api/balanceSheet/UpdateBalanceSheet.d.ts +8 -0
  60. package/es/types/Interface/api/balanceSheet/UpdateBalanceSheet.d.ts.map +1 -0
  61. package/es/types/Interface/api/balanceSheet/UpdateBalanceSheet.js +44 -0
  62. package/es/types/Interface/api/balanceSheet/UpdateBalanceSheet.js.map +1 -0
  63. package/es/types/Interface/api/commercialManagement/Create.d.ts +18 -0
  64. package/es/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
  65. package/es/types/Interface/api/commercialManagement/Create.js +14 -0
  66. package/es/types/Interface/api/commercialManagement/Create.js.map +1 -1
  67. package/es/types/Interface/api/commercialManagement/Read.d.ts +3 -0
  68. package/es/types/Interface/api/commercialManagement/Read.d.ts.map +1 -1
  69. package/es/types/Interface/api/commercialManagement/Read.js.map +1 -1
  70. package/es/types/Interface/api/exercice/UpdateExercice.d.ts +16 -0
  71. package/es/types/Interface/api/exercice/UpdateExercice.d.ts.map +1 -0
  72. package/es/types/Interface/api/exercice/UpdateExercice.js +101 -0
  73. package/es/types/Interface/api/exercice/UpdateExercice.js.map +1 -0
  74. package/es/types/Interface/api/facturation/CreateRebilling.d.ts +1 -1
  75. package/es/types/Interface/api/facturation/CreateRebilling.js +3 -3
  76. package/es/types/Interface/api/facturation/CreateRebilling.js.map +1 -1
  77. package/es/types/Interface/api/gedFile/createFileAndGed.d.ts +15 -0
  78. package/es/types/Interface/api/gedFile/createFileAndGed.d.ts.map +1 -0
  79. package/es/types/Interface/api/gedFile/createFileAndGed.js +73 -0
  80. package/es/types/Interface/api/gedFile/createFileAndGed.js.map +1 -0
  81. package/es/types/Interface/api/gedFile/updateGedFile.d.ts +1 -0
  82. package/es/types/Interface/api/gedFile/updateGedFile.d.ts.map +1 -1
  83. package/es/types/Interface/api/gedFile/updateGedFile.js +4 -0
  84. package/es/types/Interface/api/gedFile/updateGedFile.js.map +1 -1
  85. package/es/types/Interface/api/library/QueryLibrary.d.ts +6 -0
  86. package/es/types/Interface/api/library/QueryLibrary.d.ts.map +1 -1
  87. package/es/types/Interface/api/library/QueryLibrary.js +41 -0
  88. package/es/types/Interface/api/library/QueryLibrary.js.map +1 -1
  89. package/es/types/Interface/api/signFile/CreateFileToSign.d.ts +12 -0
  90. package/es/types/Interface/api/signFile/CreateFileToSign.d.ts.map +1 -0
  91. package/es/types/Interface/api/signFile/CreateFileToSign.js +58 -0
  92. package/es/types/Interface/api/signFile/CreateFileToSign.js.map +1 -0
  93. package/es/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.d.ts +6 -0
  94. package/es/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.d.ts.map +1 -0
  95. package/es/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.js +36 -0
  96. package/es/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.js.map +1 -0
  97. package/es/types/Interface/api/societyConfigBalanceSheet/QueryPaginatedSocietyConfigBalanceSheet.d.ts +11 -0
  98. package/es/types/Interface/api/societyConfigBalanceSheet/QueryPaginatedSocietyConfigBalanceSheet.d.ts.map +1 -0
  99. package/es/types/Interface/api/societyConfigBalanceSheet/QueryPaginatedSocietyConfigBalanceSheet.js +58 -0
  100. package/es/types/Interface/api/societyConfigBalanceSheet/QueryPaginatedSocietyConfigBalanceSheet.js.map +1 -0
  101. package/es/types/Interface/models/ICustomerSignature.d.ts +5 -2
  102. package/es/types/Interface/models/ICustomerSignature.d.ts.map +1 -1
  103. package/es/types/Interface/models/ICustomerSignature.js.map +1 -1
  104. package/es/types/Interface/models/IExercice.d.ts +1 -1
  105. package/es/types/Interface/models/IExercice.js.map +1 -1
  106. package/es/types/Interface/models/IGedFile.d.ts +1 -0
  107. package/es/types/Interface/models/IGedFile.d.ts.map +1 -1
  108. package/es/types/Interface/models/IGedFile.js.map +1 -1
  109. package/es/types/Interface/models/ISocietyConfigBalanceSheet.d.ts +9 -3
  110. package/es/types/Interface/models/ISocietyConfigBalanceSheet.d.ts.map +1 -1
  111. package/es/types/Interface/models/ISocietyConfigBalanceSheet.js.map +1 -1
  112. package/es/types/Interface/models/ISocietyGescom.d.ts +2 -0
  113. package/es/types/Interface/models/ISocietyGescom.d.ts.map +1 -1
  114. package/es/types/Interface/models/ISocietyGescom.js.map +1 -1
  115. package/es/types/index.d.ts +8 -0
  116. package/es/types/index.d.ts.map +1 -1
  117. package/es/types/index.js +8 -0
  118. package/es/types/index.js.map +1 -1
  119. package/es/utils/amount.d.ts +4 -0
  120. package/es/utils/amount.d.ts.map +1 -1
  121. package/es/utils/amount.js +23 -0
  122. package/es/utils/amount.js.map +1 -1
  123. package/es/utils/commercialManagement/document.d.ts +4 -3
  124. package/es/utils/commercialManagement/document.d.ts.map +1 -1
  125. package/es/utils/commercialManagement/document.js +59 -13
  126. package/es/utils/commercialManagement/document.js.map +1 -1
  127. package/es/utils/commercialManagement/templates/common.d.ts +4 -0
  128. package/es/utils/commercialManagement/templates/common.d.ts.map +1 -1
  129. package/es/utils/commercialManagement/templates/common.js +123 -2
  130. package/es/utils/commercialManagement/templates/common.js.map +1 -1
  131. package/js/api/resources/BalanceSheet.js +4 -0
  132. package/js/api/resources/BalanceSheet.js.map +1 -1
  133. package/js/api/resources/Exercice.js +4 -0
  134. package/js/api/resources/Exercice.js.map +1 -1
  135. package/js/api/resources/Library.js +18 -0
  136. package/js/api/resources/Library.js.map +1 -1
  137. package/js/api/resources/SignFile.js +22 -0
  138. package/js/api/resources/SignFile.js.map +1 -0
  139. package/js/api/resources/SocietyConfigBalanceSheet.js +36 -0
  140. package/js/api/resources/SocietyConfigBalanceSheet.js.map +1 -0
  141. package/js/api/resources.js +6 -0
  142. package/js/api/resources.js.map +1 -1
  143. package/js/types/Enum/BalanceSheet.js +118 -1
  144. package/js/types/Enum/BalanceSheet.js.map +1 -1
  145. package/js/types/Enum/BrandClementine.js +6 -1
  146. package/js/types/Enum/BrandClementine.js.map +1 -1
  147. package/js/types/Enum/BrandComptalib.js +6 -1
  148. package/js/types/Enum/BrandComptalib.js.map +1 -1
  149. package/js/types/Enum/BrandPourcentage.js +6 -1
  150. package/js/types/Enum/BrandPourcentage.js.map +1 -1
  151. package/js/types/Enum/DepositDocumentType.js +166 -0
  152. package/js/types/Enum/DepositDocumentType.js.map +1 -0
  153. package/js/types/Enum/Ged.js +23 -11
  154. package/js/types/Enum/Ged.js.map +1 -1
  155. package/js/types/Enum/RevisionGuide.js +55 -4
  156. package/js/types/Enum/RevisionGuide.js.map +1 -1
  157. package/js/types/Enum/RoleDetail.js +1 -1
  158. package/js/types/Enum/RoleDetail.js.map +1 -1
  159. package/js/types/Enum/StatusSignature.js +16 -0
  160. package/js/types/Enum/StatusSignature.js.map +1 -0
  161. package/js/types/Interface/api/balanceSheet/UpdateBalanceSheet.js +37 -0
  162. package/js/types/Interface/api/balanceSheet/UpdateBalanceSheet.js.map +1 -0
  163. package/js/types/Interface/api/commercialManagement/Create.js +4 -0
  164. package/js/types/Interface/api/commercialManagement/Create.js.map +1 -1
  165. package/js/types/Interface/api/exercice/UpdateExercice.js +55 -0
  166. package/js/types/Interface/api/exercice/UpdateExercice.js.map +1 -0
  167. package/js/types/Interface/api/facturation/CreateRebilling.js +1 -1
  168. package/js/types/Interface/api/facturation/CreateRebilling.js.map +1 -1
  169. package/js/types/Interface/api/gedFile/createFileAndGed.js +49 -0
  170. package/js/types/Interface/api/gedFile/createFileAndGed.js.map +1 -0
  171. package/js/types/Interface/api/gedFile/updateGedFile.js +2 -0
  172. package/js/types/Interface/api/gedFile/updateGedFile.js.map +1 -1
  173. package/js/types/Interface/api/library/QueryLibrary.js +26 -1
  174. package/js/types/Interface/api/library/QueryLibrary.js.map +1 -1
  175. package/js/types/Interface/api/signFile/CreateFileToSign.js +43 -0
  176. package/js/types/Interface/api/signFile/CreateFileToSign.js.map +1 -0
  177. package/js/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.js +39 -0
  178. package/js/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.js.map +1 -0
  179. package/js/types/Interface/api/societyConfigBalanceSheet/QueryPaginatedSocietyConfigBalanceSheet.js +43 -0
  180. package/js/types/Interface/api/societyConfigBalanceSheet/QueryPaginatedSocietyConfigBalanceSheet.js.map +1 -0
  181. package/js/types/index.js +96 -0
  182. package/js/types/index.js.map +1 -1
  183. package/js/utils/amount.js +31 -0
  184. package/js/utils/amount.js.map +1 -1
  185. package/js/utils/commercialManagement/document.js +52 -4
  186. package/js/utils/commercialManagement/document.js.map +1 -1
  187. package/js/utils/commercialManagement/templates/common.js +127 -2
  188. package/js/utils/commercialManagement/templates/common.js.map +1 -1
  189. package/package.json +1 -1
  190. package/ts/api/resources/BalanceSheet.ts +5 -1
  191. package/ts/api/resources/Exercice.ts +5 -1
  192. package/ts/api/resources/Library.ts +12 -0
  193. package/ts/api/resources/SignFile.ts +8 -0
  194. package/ts/api/resources/SocietyConfigBalanceSheet.ts +27 -0
  195. package/ts/api/resources.ts +4 -0
  196. package/ts/types/Enum/BalanceSheet.ts +137 -0
  197. package/ts/types/Enum/BrandClementine.ts +5 -0
  198. package/ts/types/Enum/BrandComptalib.ts +5 -0
  199. package/ts/types/Enum/BrandPourcentage.ts +5 -0
  200. package/ts/types/Enum/DepositDocumentType.ts +194 -0
  201. package/ts/types/Enum/Ged.ts +17 -8
  202. package/ts/types/Enum/RevisionGuide.ts +56 -5
  203. package/ts/types/Enum/RoleDetail.ts +1 -1
  204. package/ts/types/Enum/StatusSignature.ts +8 -0
  205. package/ts/types/Interface/api/balanceSheet/UpdateBalanceSheet.ts +31 -0
  206. package/ts/types/Interface/api/commercialManagement/Create.ts +30 -1
  207. package/ts/types/Interface/api/commercialManagement/Read.ts +4 -0
  208. package/ts/types/Interface/api/exercice/UpdateExercice.ts +80 -0
  209. package/ts/types/Interface/api/facturation/CreateRebilling.ts +3 -3
  210. package/ts/types/Interface/api/gedFile/createFileAndGed.ts +55 -0
  211. package/ts/types/Interface/api/gedFile/updateGedFile.ts +3 -0
  212. package/ts/types/Interface/api/library/QueryLibrary.ts +34 -0
  213. package/ts/types/Interface/api/signFile/CreateFileToSign.ts +41 -0
  214. package/ts/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.ts +25 -0
  215. package/ts/types/Interface/api/societyConfigBalanceSheet/QueryPaginatedSocietyConfigBalanceSheet.ts +42 -0
  216. package/ts/types/Interface/models/ICustomerSignature.ts +5 -2
  217. package/ts/types/Interface/models/IExercice.ts +1 -1
  218. package/ts/types/Interface/models/IGedFile.ts +1 -0
  219. package/ts/types/Interface/models/ISocietyConfigBalanceSheet.ts +9 -3
  220. package/ts/types/Interface/models/ISocietyGescom.ts +2 -0
  221. package/ts/types/index.ts +8 -0
  222. package/ts/utils/amount.ts +37 -0
  223. package/ts/utils/commercialManagement/document.ts +135 -27
  224. package/ts/utils/commercialManagement/templates/common.ts +126 -2
@@ -0,0 +1,41 @@
1
+ import { IsOptional, IsNumber } from 'class-validator';
2
+ import { ApiPropertyOptional, ApiProperty } from '../../../../utils';
3
+ import { TFile } from '../file/TFile';
4
+
5
+ export class CreateFileToSign {
6
+ @ApiProperty()
7
+ file: TFile;
8
+
9
+ @ApiPropertyOptional()
10
+ @IsNumber()
11
+ @IsOptional()
12
+ idUser: number;
13
+
14
+ @ApiProperty()
15
+ @IsNumber()
16
+ idGedFolder: number;
17
+
18
+ @ApiProperty()
19
+ @IsNumber()
20
+ idSociety: number;
21
+
22
+ @ApiPropertyOptional()
23
+ @IsNumber()
24
+ @IsOptional()
25
+ idExercice?: number;
26
+
27
+ @ApiPropertyOptional()
28
+ @IsNumber()
29
+ @IsOptional()
30
+ idBalanceSheet?: number;
31
+
32
+ @ApiPropertyOptional()
33
+ @IsNumber()
34
+ @IsOptional()
35
+ nbrPage: number;
36
+
37
+ @ApiPropertyOptional()
38
+ @IsNumber()
39
+ @IsOptional()
40
+ typeFile: number;
41
+ }
@@ -0,0 +1,25 @@
1
+ import {
2
+ IsOptional, IsString, IsIn, IsInt,
3
+ } from 'class-validator';
4
+ import { ApiPropertyOptional, ApiProperty } from '../../../../utils';
5
+
6
+ export class QueryGetAllSocietyConfigBalanceSheet {
7
+ @ApiProperty()
8
+ @IsInt()
9
+ idBalanceSheet?: number;
10
+
11
+ @ApiPropertyOptional()
12
+ @IsOptional()
13
+ @IsString({
14
+ each: true,
15
+ })
16
+ attributes?: string[];
17
+
18
+ @ApiPropertyOptional()
19
+ @IsOptional()
20
+ @IsString({
21
+ each: true,
22
+ })
23
+ @IsIn(['society'], { each: true })
24
+ include?: string[];
25
+ }
@@ -0,0 +1,42 @@
1
+ import {
2
+ IsNumber, IsOptional, IsString, IsInt,
3
+ } from 'class-validator';
4
+ import { ApiPropertyOptional, ApiProperty } from '../../../../utils';
5
+
6
+ export class QueryPaginatedSocietyConfigBalanceSheet {
7
+ @ApiPropertyOptional()
8
+ @IsOptional()
9
+ @IsInt()
10
+ state?: number;
11
+
12
+ @ApiPropertyOptional()
13
+ @IsOptional()
14
+ @IsInt()
15
+ stateClient?: number;
16
+
17
+ @ApiPropertyOptional()
18
+ @IsOptional()
19
+ @IsString()
20
+ comment?: string;
21
+
22
+ @ApiPropertyOptional()
23
+ @IsOptional()
24
+ @IsNumber()
25
+ amount?: number;
26
+
27
+ @ApiProperty()
28
+ @IsNumber()
29
+ idSociety: number;
30
+
31
+ @ApiProperty()
32
+ @IsNumber()
33
+ idTypeDocumentsWaiting: number;
34
+
35
+ @ApiProperty()
36
+ @IsNumber()
37
+ idExercice: number;
38
+
39
+ @ApiProperty()
40
+ @IsNumber()
41
+ idBalanceSheet: number;
42
+ }
@@ -1,6 +1,7 @@
1
1
  import { IUser } from './IUser';
2
2
  import { IStatusSignature } from './IStatusSignature';
3
3
  import { IPrestation } from './IPrestation';
4
+ import { IGedFile } from './IGedFile';
4
5
 
5
6
  // customersSignatures
6
7
  export interface ICustomerSignature {
@@ -8,15 +9,16 @@ export interface ICustomerSignature {
8
9
  idDemand: string;
9
10
  idFileFilesInfos: string;
10
11
  fileNameFilesInfos: string;
11
- sha1FilesInfos: string | null;
12
+ sha1FilesInfos?: string | null;
12
13
  memberId: string;
13
14
  tokenSigner: string;
14
15
  mailSigner: string;
15
16
  phoneSigner: string;
16
17
  idSendMethod: number;
17
18
  idStatusSignature: number;
18
- idPrestation: number;
19
+ idPrestation?: number;
19
20
  idUser: number | null;
21
+ idGedFile?: number;
20
22
  dateSendPlaqToClient: Date | null;
21
23
  createdAt?: Date | null;
22
24
  updatedAt?: Date | null;
@@ -25,4 +27,5 @@ export interface ICustomerSignature {
25
27
  user?: IUser;
26
28
  statusSignature?: IStatusSignature;
27
29
  prestation?: IPrestation;
30
+ gedFile?: IGedFile;
28
31
  }
@@ -33,7 +33,7 @@ export interface IExercice {
33
33
  receiptJeDeclare: boolean;
34
34
  annualFolderEdition: boolean;
35
35
  turnoverDone: string;
36
- turnoverMax?: string;
36
+ turnoverMax?: number;
37
37
  processClossingExercice: boolean;
38
38
  idFilePaymentSchedule?: number | null;
39
39
  isDefault: boolean;
@@ -15,6 +15,7 @@ export interface IGedFile {
15
15
  idGedFolder: number;
16
16
  idSociety: number;
17
17
  idFile: number;
18
+ typeFile?: number | null;
18
19
  idExercice?: number | null;
19
20
  idUserBP?: number | null; // Attention: lorsqu'on ajoute un fichier dans la modale "Documents manquants", on stock ici l'idUser associé au BP
20
21
  createdAt?: Date | null;
@@ -1,5 +1,7 @@
1
1
  import { IDocumentWaitingType } from './IDocumentWaitingType';
2
2
  import { IExercice } from './IExercice';
3
+ import { IBalanceSheet } from './IBalanceSheet';
4
+ import { ISociety } from './ISociety';
3
5
 
4
6
  // societyConfigBalanceSheet
5
7
  export interface ISocietyConfigBalanceSheet {
@@ -9,12 +11,16 @@ export interface ISocietyConfigBalanceSheet {
9
11
  idSociety: number | null;
10
12
  comment: string | null;
11
13
  amount: number | null;
12
- idTypeDocumentsWaiting: number | null;
14
+ idTypeDocumentsWaiting?: number | null;
13
15
  idExercice: number | null;
16
+ idBalanceSheet: number | null;
17
+ idDepositDocumentType: number | null,
14
18
  createdAt?: Date | null;
15
19
  updatedAt?: Date | null;
16
20
 
17
21
  // Associations
18
- typeDocumentsWaiting: IDocumentWaitingType;
19
- exercice: IExercice;
22
+ typeDocumentsWaiting?: IDocumentWaitingType;
23
+ exercice?: IExercice;
24
+ society?: ISociety;
25
+ balanceSheet?: IBalanceSheet;
20
26
  }
@@ -49,4 +49,6 @@ export interface ISocietyGescom {
49
49
  idTvaMargin?: number | null;
50
50
  createdAt?: Date | null;
51
51
  updatedAt?: Date | null;
52
+ shouldHideBrandName?: boolean;
53
+ shouldHideEmailHeader?: boolean;
52
54
  }
package/ts/types/index.ts CHANGED
@@ -461,6 +461,8 @@ export * from './Enum/ReportService';
461
461
  export * from './Enum/RegulateType';
462
462
  export * from './Enum/ProcessingState';
463
463
  export * from './Enum/InpiType';
464
+ export * from './Enum/DepositDocumentType';
465
+ export * from './Enum/StatusSignature';
464
466
  export * from './Enum/BankCollectingState';
465
467
  export * from './Enum/Phone';
466
468
  export * from './Enum/GeneralThirdParty';
@@ -573,6 +575,7 @@ export * from './Interface/api/internalInvoicing/RegenerateInternalInvoicing';
573
575
  export * from './Interface/api/internalInvoicing/GetLastRef';
574
576
  export * from './Interface/api/exercice/QueryExercice';
575
577
  export * from './Interface/api/exercice/CreateExercice';
578
+ export * from './Interface/api/exercice/UpdateExercice';
576
579
  export * from './Interface/api/accountingIncome/ReadAccountingIncome';
577
580
  export * from './Interface/api/ocr/OcrTransactions';
578
581
  export * from './Interface/api/bankStatement/QueryBankStatement';
@@ -653,6 +656,7 @@ export * from './Interface/api/generalLedger/IGeneralLedgerThirdParty';
653
656
  export * from './Interface/api/incomeStatement/QueryIncomeStatement';
654
657
  export * from './Interface/api/incomeStatement/ReadIncomeStatement';
655
658
  export * from './Interface/api/balanceSheet/ReadBalanceSheet';
659
+ export * from './Interface/api/balanceSheet/UpdateBalanceSheet';
656
660
  export * from './Interface/api/pappers/QueryPappers';
657
661
  export * from './Interface/api/pappers/ReadPappers';
658
662
  export * from './Interface/api/sponsorship/SendSponsorshipLink';
@@ -812,6 +816,8 @@ export * from './Interface/api/task/QueryCountTask';
812
816
  export * from './Interface/api/task/QueryStatsByRolesInCsv';
813
817
  export * from './Interface/api/task/QueryStatsByServiceInCsv';
814
818
  export * from './Interface/api/task/QueryStatsByTaskTypeInCsv';
819
+ export * from './Interface/api/societyConfigBalanceSheet/QueryPaginatedSocietyConfigBalanceSheet';
820
+ export * from './Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet';
815
821
  export * from './Interface/api/3cx/Query3cxSearch';
816
822
  export * from './Interface/api/3cx/Read3cxSearch';
817
823
  export * from './Interface/api/3cx/Create3cxLog';
@@ -849,9 +855,11 @@ export * from './Interface/api/terminationList/QueryTerminationList';
849
855
  export * from './Interface/api/terminationList/DestroyTerminationList';
850
856
  export * from './Interface/api/pdf/ReadPdfizer';
851
857
  export * from './Interface/api/gedFile/updateGedFile';
858
+ export * from './Interface/api/gedFile/createFileAndGed';
852
859
  export * from './Interface/api/iDocus/iDocus';
853
860
  export * from './Interface/api/iDocus/CreateExport';
854
861
  export * from './Interface/api/pdf/ReadPdftkizer';
862
+ export * from './Interface/api/signFile/CreateFileToSign';
855
863
  export * from './Interface/api/rule/Query';
856
864
  export * from './Interface/api/revive/PostRevive';
857
865
 
@@ -1,3 +1,6 @@
1
+ import { MathematicalSign } from '../types/Enum/Util';
2
+ import { FormattedAmount } from '../types/Interface/api/amount/FormattedAmount';
3
+
1
4
  export function integerToFormattedAmountString(value: number): string {
2
5
  const abs = Math.abs(value / 100);
3
6
  let integer = Math.trunc(abs);
@@ -10,4 +13,38 @@ export function integerToFormattedAmountString(value: number): string {
10
13
 
11
14
  const integerWithMask = `${integer}`.split('').reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '').trim();
12
15
  return `${value < 0 ? '- ' : ''}${integerWithMask},${cents < 10 ? '0' : ''}${cents}`;
16
+ }
17
+
18
+ export function integerToFormattedAmountObject(
19
+ value: number,
20
+ options: {
21
+ thousandSeparator?: string;
22
+ } = {
23
+ thousandSeparator: ' ',
24
+ },
25
+ ): FormattedAmount {
26
+ const { thousandSeparator } = options;
27
+ const abs = Math.abs(value / 100);
28
+ let integer = Math.trunc(abs);
29
+ let cents = Math.round(abs * 100 - integer * 100);
30
+
31
+ while (cents >= 100) {
32
+ cents = Math.max(0, cents - 100);
33
+ integer += 1;
34
+ }
35
+
36
+ const result = {
37
+ value,
38
+ sign: value > 0 ? MathematicalSign.PLUS : value < 0 ? MathematicalSign.LESS : MathematicalSign.EQUAL,
39
+ integerValue: `${integer}`
40
+ .split('')
41
+ .reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? thousandSeparator : ''}${acc}`, '')
42
+ .trim(),
43
+ centValue: `${cents < 10 ? '0' : ''}${cents}`,
44
+ };
45
+
46
+ return {
47
+ ...result,
48
+ formattedValue: `${result.sign !== MathematicalSign.EQUAL ? `${result.sign} ` : ''}${result.integerValue},${result.centValue}`,
49
+ };
13
50
  }
@@ -8,22 +8,35 @@ import {
8
8
  } from '../../types/Enum/CommercialManagement';
9
9
  import { EstimateInvoiceType } from '../../types/Enum/EstimateInvoice';
10
10
  import { Vat } from '../../types/Enum/Vat';
11
- import { integerToFormattedAmountString } from '../amount';
12
- import { CommercialDocumentCommonHTML } from './templates/common';
11
+ import { integerToFormattedAmountString, integerToFormattedAmountObject } from '../amount';
12
+ import { CommercialDocumentCommonHTML, CommercialDocumentMailHTML } from './templates/common';
13
13
  import { bodyTemplate } from './templates/body';
14
14
  import { productToReadProductEditing } from './product';
15
15
  import { vatToReadVatEditing } from './vat';
16
- import { CreateInvoiceDocument, CreatePreSaleDocument } from '../../types';
16
+ import {
17
+ CreateInvoiceDocument, CreateMailHeader, CreatePreSaleDocument, ReadCommercialMailTemplate,
18
+ } from '../../types';
17
19
  import { thirdPartyToReadThirdPartyEditing } from './thirdParty';
20
+ import { getBrandConfig } from '../brands';
18
21
 
19
22
  const ejs = require('ejs');
23
+ require('dayjs/locale/fr');
24
+
25
+ type brandColorType = {
26
+ primary: string,
27
+ primary50: string,
28
+ primary100: string,
29
+ primary300: string,
30
+ primary500: string,
31
+ primary700: string
32
+ };
20
33
 
21
- export function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoiceType, payload: CreateInvoiceDocument | CreatePreSaleDocument): ReadCommercialDocumentTemplate {
34
+ export function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoiceType, payload: CreateInvoiceDocument | CreatePreSaleDocument, shouldHideBrandName = false): ReadCommercialDocumentTemplate {
22
35
  const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));
23
36
  const vats = _orderBy(Object.values(_groupBy(products, 'vatFormatted')).map((v) => (vatToReadVatEditing(v)), 'value')).filter((v) => v.id !== Vat.MARGE.id);
24
37
  const thirdParty = thirdPartyToReadThirdPartyEditing(payload.thirdParty);
25
38
 
26
- const data: ReadDocumentEditing = {
39
+ const data: ReadDocumentEditing & { brandColors: brandColorType, brandName: string, shouldHideBrandName: boolean } = {
27
40
  ...payload,
28
41
  thirdParty,
29
42
  paymentLink: payload.paymentLink ?? '#',
@@ -50,38 +63,68 @@ export function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoic
50
63
  name: fontList.find((f) => f.id === payload.settings?.idFont)?.name ?? fontList[0].name,
51
64
  url: fontList.find((f) => f.id === payload.settings?.idFont)?.link ?? fontList[0].link,
52
65
  },
53
- capitalFormatted: payload.capital ? `${payload.capital}`.split('').reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '').trim() : null,
66
+ capitalFormatted: payload.capital
67
+ ? `${payload.capital}`.split('')
68
+ .reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '')
69
+ .trim()
70
+ : null,
54
71
  dueDateFormatted: payload.dueDate ? dayjs(payload.dueDate).format('DD/MM/YYYY') : null,
55
72
  expirationDateFormatted: payload.expirationDate ? dayjs(payload.expirationDate).format('DD/MM/YYYY') : null,
56
73
  emissionDateFormatted: payload.emissionDate ? dayjs(payload.emissionDate).format('DD/MM/YYYY') : null,
57
- shouldDisplayDiscountColumn: !!products.find((p) => p.discount2 && p.discount2 > 0),
74
+ shouldDisplayDiscountColumn: !!products.find(
75
+ (p) => p.discount2 && p.discount2 > 0,
76
+ ),
77
+ // @ts-ignore
78
+ marginVats: _uniq(
79
+ products
80
+ .filter((p) => p.marginVatFormatted !== null)
81
+ .map((p) => p.marginVatFormatted),
82
+ ),
83
+ accountingCategoryFormatted:
84
+ AccountingCategoryList.find((a) => a.id === payload.accountingCategory)
85
+ ?.label ?? null,
58
86
  // @ts-ignore
59
- marginVats: _uniq(products.filter((p) => p.marginVatFormatted !== null).map((p) => p.marginVatFormatted)),
60
- accountingCategoryFormatted: AccountingCategoryList.find((a) => a.id === payload.accountingCategory)?.label ?? null,
87
+ brandColors: getBrandConfig({ objectWaited: 'colors' }) as brandColorType,
88
+ brandName: `${getBrandConfig({ objectWaited: 'name' })}`,
89
+ shouldHideBrandName,
61
90
  };
62
91
 
63
92
  const commonTemplate = new CommercialDocumentCommonHTML();
64
- const documentFreeText = [EstimateInvoiceType.DEVIS, EstimateInvoiceType.BON].includes(idEstimateInvoiceType) ? payload?.settings?.freeEstimateText : payload?.settings?.freeInvoiceText;
93
+ const documentFreeText = [
94
+ EstimateInvoiceType.DEVIS,
95
+ EstimateInvoiceType.BON,
96
+ ].includes(idEstimateInvoiceType)
97
+ ? payload?.settings?.freeEstimateText
98
+ : payload?.settings?.freeInvoiceText;
65
99
 
66
100
  return {
67
101
  header: ejs.render(commonTemplate.header, data),
68
102
  body: ejs.render(bodyTemplate, {
69
103
  ...data,
70
- comment: data.comment && typeof data.comment === 'string' ? data.comment?.replace(/\n/g, '<br/>') : null,
104
+ comment:
105
+ data.comment && typeof data.comment === 'string'
106
+ ? data.comment?.replace(/\n/g, '<br/>')
107
+ : null,
71
108
  products: data.products.map((p) => ({
72
109
  ...p,
73
- comment: p.comment && typeof p.comment === 'string' ? p.comment?.replace(/\n/g, '<br/>') : null,
110
+ comment:
111
+ p.comment && typeof p.comment === 'string'
112
+ ? p.comment?.replace(/\n/g, '<br/>')
113
+ : null,
74
114
  })),
75
115
  }),
76
- footer: ejs.render(commonTemplate.footer, { ...data, freeText: documentFreeText ?? null }),
116
+ footer: ejs.render(commonTemplate.footer, {
117
+ ...data,
118
+ freeText: documentFreeText ?? null,
119
+ }),
77
120
  data,
78
121
  };
79
122
  }
80
123
 
81
- export function generateAdvanceDocument(payload: CreateInvoiceDocument): ReadCommercialDocumentTemplate {
124
+ export function generateAdvanceDocument(payload: CreateInvoiceDocument, shouldHideBrandName = false): ReadCommercialDocumentTemplate {
82
125
  if (!payload.deposit) throw new Error('Aucun acompte défini');
83
126
 
84
- const data: ReadDocumentEditing = {
127
+ const data: ReadDocumentEditing & { brandColors: brandColorType, brandName: string, shouldHideBrandName: boolean } = {
85
128
  ...payload,
86
129
  title: payload.title ?? null,
87
130
  paymentLink: payload.paymentLink ?? '#',
@@ -96,22 +139,52 @@ export function generateAdvanceDocument(payload: CreateInvoiceDocument): ReadCom
96
139
  depositFormatted: integerToFormattedAmountString(payload.deposit),
97
140
  totalTaxExcludedFormatted: integerToFormattedAmountString(payload.deposit),
98
141
  totalTaxIncludedFormatted: integerToFormattedAmountString(payload.deposit),
99
- totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(payload.deposit),
142
+ totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(
143
+ payload.deposit,
144
+ ),
100
145
  totalVatAmountFormatted: integerToFormattedAmountString(0),
101
146
  font: {
102
147
  id: payload.settings?.idFont ?? FontIds.CIRCULAR_STD,
103
- name: fontList.find((f) => f.id === payload.settings?.idFont)?.name ?? fontList[0].name,
104
- url: fontList.find((f) => f.id === payload.settings?.idFont)?.link ?? fontList[0].link,
148
+ name:
149
+ fontList.find((f) => f.id === payload.settings?.idFont)?.name
150
+ ?? fontList[0].name,
151
+ url:
152
+ fontList.find((f) => f.id === payload.settings?.idFont)?.link
153
+ ?? fontList[0].link,
105
154
  },
106
- capitalFormatted: payload.capital ? `${payload.capital}`.split('').reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '').trim() : null,
107
- dueDateFormatted: payload.dueDate ? dayjs(payload.dueDate).format('DD/MM/YYYY') : null,
108
- expirationDateFormatted: payload.expirationDate ? dayjs(payload.expirationDate).format('DD/MM/YYYY') : null,
109
- emissionDateFormatted: payload.emissionDate ? dayjs(payload.emissionDate).format('DD/MM/YYYY') : null,
155
+ capitalFormatted: payload.capital
156
+ ? `${payload.capital}`
157
+ .split('')
158
+ .reduceRight(
159
+ (acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`,
160
+ '',
161
+ )
162
+ .trim()
163
+ : null,
164
+ dueDateFormatted: payload.dueDate
165
+ ? dayjs(payload.dueDate).format('DD/MM/YYYY')
166
+ : null,
167
+ expirationDateFormatted: payload.expirationDate
168
+ ? dayjs(payload.expirationDate).format('DD/MM/YYYY')
169
+ : null,
170
+ emissionDateFormatted: payload.emissionDate
171
+ ? dayjs(payload.emissionDate).format('DD/MM/YYYY')
172
+ : null,
110
173
  shouldDisplayDiscountColumn: false,
111
174
  disableVat: true,
112
175
  // @ts-ignore
113
- marginVats: _uniq((payload.assetMarginVatIds ?? []).map((m) => VatMarginCategyList.find((c) => c.id === m)?.label ?? null)),
114
- accountingCategoryFormatted: AccountingCategoryList.find((a) => a.id === payload.accountingCategory)?.label ?? null,
176
+ marginVats: _uniq(
177
+ (payload.assetMarginVatIds ?? []).map(
178
+ (m) => VatMarginCategyList.find((c) => c.id === m)?.label ?? null,
179
+ ),
180
+ ),
181
+ accountingCategoryFormatted:
182
+ AccountingCategoryList.find((a) => a.id === payload.accountingCategory)
183
+ ?.label ?? null,
184
+ // @ts-ignore
185
+ brandColors: getBrandConfig({ objectWaited: 'colors' }) as brandColorType,
186
+ brandName: `${getBrandConfig({ objectWaited: 'name' })}`,
187
+ shouldHideBrandName,
115
188
  };
116
189
 
117
190
  const commonTemplate = new CommercialDocumentCommonHTML();
@@ -120,13 +193,48 @@ export function generateAdvanceDocument(payload: CreateInvoiceDocument): ReadCom
120
193
  header: ejs?.render(commonTemplate.header, data),
121
194
  body: ejs?.render(bodyTemplate, {
122
195
  ...data,
123
- comment: data.comment && typeof data.comment === 'string' ? data.comment?.replace(/\n/g, '<br/>') : null,
196
+ comment:
197
+ data.comment && typeof data.comment === 'string'
198
+ ? data.comment?.replace(/\n/g, '<br/>')
199
+ : null,
124
200
  products: data.products.map((p) => ({
125
201
  ...p,
126
- comment: p.comment && typeof p.comment === 'string' ? p.comment?.replace(/\n/g, '<br/>') : null,
202
+ comment:
203
+ p.comment && typeof p.comment === 'string'
204
+ ? p.comment?.replace(/\n/g, '<br/>')
205
+ : null,
127
206
  })),
128
207
  }),
129
- footer: ejs?.render(commonTemplate.footer, { ...data, freeText: payload?.settings?.freeInvoiceText ?? null }),
208
+ footer: ejs?.render(commonTemplate.footer, {
209
+ ...data,
210
+ freeText: payload?.settings?.freeInvoiceText ?? null,
211
+ }),
130
212
  data,
131
213
  };
214
+ }
215
+
216
+ export function generateMailHeader(params: CreateMailHeader, shouldHideBrandName = false): ReadCommercialMailTemplate {
217
+ dayjs.locale('fr');
218
+ const data = {
219
+ ...params.payload,
220
+ totalTaxExcludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxExcluded),
221
+ totalTaxIncludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxIncluded),
222
+ totalVatFormatted: integerToFormattedAmountObject(params.payload.totalTaxIncluded - params.payload.totalTaxExcluded),
223
+ dueDateFormatted: params.payload.dueDate ? dayjs(params.payload.dueDate).format('DD MMMM YYYY') : null,
224
+ hasVat: params.hasVat,
225
+ hostS3: params.hostS3,
226
+ logoUrl: params.logoUrl,
227
+ companyName: params.companyName,
228
+ fileUrl: params.fileUrl,
229
+ // @ts-ignore
230
+ brandColors: getBrandConfig({ objectWaited: 'colors' }) as brandColorType,
231
+ brandName: `${getBrandConfig({ objectWaited: 'name' })}`,
232
+ shouldHideBrandName,
233
+ };
234
+
235
+ const mailTemplate = new CommercialDocumentMailHTML();
236
+
237
+ return {
238
+ header: ejs.render(mailTemplate.header, data),
239
+ };
132
240
  }