@silexpert/core 1.3.1 → 1.3.2

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 (186) hide show
  1. package/dist/cjs/api/resources/ExercicePrestation.d.ts +7 -1
  2. package/dist/cjs/api/resources/ExercicePrestation.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/ExercicePrestation.js +8 -0
  4. package/dist/cjs/api/resources/ExercicePrestation.js.map +1 -1
  5. package/dist/cjs/types/Enum/BalanceSheet.d.ts +3 -3
  6. package/dist/cjs/types/Enum/BalanceSheet.js +3 -3
  7. package/dist/cjs/types/Enum/BalanceSheet.js.map +1 -1
  8. package/dist/cjs/types/Enum/BrandClementine.d.ts.map +1 -1
  9. package/dist/cjs/types/Enum/BrandClementine.js +2 -0
  10. package/dist/cjs/types/Enum/BrandClementine.js.map +1 -1
  11. package/dist/cjs/types/Enum/CommercialManagement.d.ts +1 -0
  12. package/dist/cjs/types/Enum/CommercialManagement.d.ts.map +1 -1
  13. package/dist/cjs/types/Enum/CommercialManagement.js +5 -0
  14. package/dist/cjs/types/Enum/CommercialManagement.js.map +1 -1
  15. package/dist/cjs/types/Enum/InternalService.d.ts +1 -5
  16. package/dist/cjs/types/Enum/InternalService.d.ts.map +1 -1
  17. package/dist/cjs/types/Enum/InternalService.js +7 -7
  18. package/dist/cjs/types/Enum/InternalService.js.map +1 -1
  19. package/dist/cjs/types/Enum/JobTitle.d.ts +1 -1
  20. package/dist/cjs/types/Enum/JobTitle.d.ts.map +1 -1
  21. package/dist/cjs/types/Enum/JobTitle.js +2 -2
  22. package/dist/cjs/types/Enum/JobTitle.js.map +1 -1
  23. package/dist/cjs/types/Enum/Role.d.ts +1 -2
  24. package/dist/cjs/types/Enum/Role.d.ts.map +1 -1
  25. package/dist/cjs/types/Enum/Role.js +3 -4
  26. package/dist/cjs/types/Enum/Role.js.map +1 -1
  27. package/dist/cjs/types/Enum/RoleDetail.d.ts +1 -11
  28. package/dist/cjs/types/Enum/RoleDetail.d.ts.map +1 -1
  29. package/dist/cjs/types/Enum/RoleDetail.js +13 -13
  30. package/dist/cjs/types/Enum/RoleDetail.js.map +1 -1
  31. package/dist/cjs/types/Enum/Supervision.d.ts +3 -1
  32. package/dist/cjs/types/Enum/Supervision.d.ts.map +1 -1
  33. package/dist/cjs/types/Enum/Supervision.js +15 -1
  34. package/dist/cjs/types/Enum/Supervision.js.map +1 -1
  35. package/dist/cjs/types/Enum/TaskResponseType.js +4 -4
  36. package/dist/cjs/types/Enum/TaskResponseType.js.map +1 -1
  37. package/dist/cjs/types/Enum/TimeCounterType.js +6 -6
  38. package/dist/cjs/types/Enum/TimeCounterType.js.map +1 -1
  39. package/dist/cjs/types/Enum/TimeSlot.js +1 -1
  40. package/dist/cjs/types/Enum/TimeSlot.js.map +1 -1
  41. package/dist/cjs/types/Interface/api/balanceSheet/Query.d.ts.map +1 -1
  42. package/dist/cjs/types/Interface/api/balanceSheet/Query.js +9 -1
  43. package/dist/cjs/types/Interface/api/balanceSheet/Query.js.map +1 -1
  44. package/dist/cjs/types/Interface/api/exercicePrestation/Query.d.ts +6 -0
  45. package/dist/cjs/types/Interface/api/exercicePrestation/Query.d.ts.map +1 -1
  46. package/dist/cjs/types/Interface/api/exercicePrestation/Query.js +28 -1
  47. package/dist/cjs/types/Interface/api/exercicePrestation/Query.js.map +1 -1
  48. package/dist/cjs/types/Interface/api/file/Create.d.ts +1 -0
  49. package/dist/cjs/types/Interface/api/file/Create.d.ts.map +1 -1
  50. package/dist/cjs/types/Interface/api/file/Create.js +8 -0
  51. package/dist/cjs/types/Interface/api/file/Create.js.map +1 -1
  52. package/dist/cjs/types/Interface/api/toDoExpress/Query.d.ts +13 -6
  53. package/dist/cjs/types/Interface/api/toDoExpress/Query.d.ts.map +1 -1
  54. package/dist/cjs/types/Interface/api/toDoExpress/Query.js +59 -12
  55. package/dist/cjs/types/Interface/api/toDoExpress/Query.js.map +1 -1
  56. package/dist/cjs/utils/brands.d.ts +2 -0
  57. package/dist/cjs/utils/brands.d.ts.map +1 -1
  58. package/dist/cjs/utils/brands.js.map +1 -1
  59. package/dist/cjs/utils/commercialManagement/document.d.ts.map +1 -1
  60. package/dist/cjs/utils/commercialManagement/document.js +21 -11
  61. package/dist/cjs/utils/commercialManagement/document.js.map +1 -1
  62. package/dist/cjs/utils/commercialManagement/internationalization/choices.d.ts +4 -0
  63. package/dist/cjs/utils/commercialManagement/internationalization/choices.d.ts.map +1 -1
  64. package/dist/cjs/utils/commercialManagement/internationalization/choices.js +112 -2
  65. package/dist/cjs/utils/commercialManagement/internationalization/choices.js.map +1 -1
  66. package/dist/cjs/utils/commercialManagement/templates/common.js +1 -1
  67. package/dist/cjs/utils/commercialManagement/templates/common.js.map +1 -1
  68. package/dist/cjs/utils/email.d.ts.map +1 -1
  69. package/dist/cjs/utils/email.js +25 -11
  70. package/dist/cjs/utils/email.js.map +1 -1
  71. package/dist/cjs/utils/task.d.ts.map +1 -1
  72. package/dist/cjs/utils/task.js +3 -7
  73. package/dist/cjs/utils/task.js.map +1 -1
  74. package/dist/cjs/utils/vat/3517/century23.js +1 -1
  75. package/dist/cjs/utils/vat/3517/century23.js.map +1 -1
  76. package/dist/cjs/utils/vat/centuries.js +1 -1
  77. package/dist/cjs/utils/vat/centuries.js.map +1 -1
  78. package/dist/cjs/utils/webmail.d.ts.map +1 -1
  79. package/dist/cjs/utils/webmail.js +3 -7
  80. package/dist/cjs/utils/webmail.js.map +1 -1
  81. package/dist/mjs/api/resources/ExercicePrestation.d.ts +7 -1
  82. package/dist/mjs/api/resources/ExercicePrestation.d.ts.map +1 -1
  83. package/dist/mjs/api/resources/ExercicePrestation.js +8 -0
  84. package/dist/mjs/api/resources/ExercicePrestation.js.map +1 -1
  85. package/dist/mjs/types/Enum/BalanceSheet.d.ts +3 -3
  86. package/dist/mjs/types/Enum/BalanceSheet.js +3 -3
  87. package/dist/mjs/types/Enum/BalanceSheet.js.map +1 -1
  88. package/dist/mjs/types/Enum/BrandClementine.d.ts.map +1 -1
  89. package/dist/mjs/types/Enum/BrandClementine.js +2 -0
  90. package/dist/mjs/types/Enum/BrandClementine.js.map +1 -1
  91. package/dist/mjs/types/Enum/CommercialManagement.d.ts +1 -0
  92. package/dist/mjs/types/Enum/CommercialManagement.d.ts.map +1 -1
  93. package/dist/mjs/types/Enum/CommercialManagement.js +5 -0
  94. package/dist/mjs/types/Enum/CommercialManagement.js.map +1 -1
  95. package/dist/mjs/types/Enum/InternalService.d.ts +1 -5
  96. package/dist/mjs/types/Enum/InternalService.d.ts.map +1 -1
  97. package/dist/mjs/types/Enum/InternalService.js +7 -7
  98. package/dist/mjs/types/Enum/InternalService.js.map +1 -1
  99. package/dist/mjs/types/Enum/JobTitle.d.ts +1 -1
  100. package/dist/mjs/types/Enum/JobTitle.d.ts.map +1 -1
  101. package/dist/mjs/types/Enum/JobTitle.js +2 -2
  102. package/dist/mjs/types/Enum/JobTitle.js.map +1 -1
  103. package/dist/mjs/types/Enum/Role.d.ts +1 -2
  104. package/dist/mjs/types/Enum/Role.d.ts.map +1 -1
  105. package/dist/mjs/types/Enum/Role.js +3 -4
  106. package/dist/mjs/types/Enum/Role.js.map +1 -1
  107. package/dist/mjs/types/Enum/RoleDetail.d.ts +1 -11
  108. package/dist/mjs/types/Enum/RoleDetail.d.ts.map +1 -1
  109. package/dist/mjs/types/Enum/RoleDetail.js +13 -13
  110. package/dist/mjs/types/Enum/RoleDetail.js.map +1 -1
  111. package/dist/mjs/types/Enum/Supervision.d.ts +3 -1
  112. package/dist/mjs/types/Enum/Supervision.d.ts.map +1 -1
  113. package/dist/mjs/types/Enum/Supervision.js +15 -1
  114. package/dist/mjs/types/Enum/Supervision.js.map +1 -1
  115. package/dist/mjs/types/Enum/TaskResponseType.js +4 -4
  116. package/dist/mjs/types/Enum/TaskResponseType.js.map +1 -1
  117. package/dist/mjs/types/Enum/TimeCounterType.js +6 -6
  118. package/dist/mjs/types/Enum/TimeCounterType.js.map +1 -1
  119. package/dist/mjs/types/Enum/TimeSlot.js +1 -1
  120. package/dist/mjs/types/Enum/TimeSlot.js.map +1 -1
  121. package/dist/mjs/types/Interface/api/balanceSheet/Query.d.ts.map +1 -1
  122. package/dist/mjs/types/Interface/api/balanceSheet/Query.js +9 -1
  123. package/dist/mjs/types/Interface/api/balanceSheet/Query.js.map +1 -1
  124. package/dist/mjs/types/Interface/api/exercicePrestation/Query.d.ts +6 -0
  125. package/dist/mjs/types/Interface/api/exercicePrestation/Query.d.ts.map +1 -1
  126. package/dist/mjs/types/Interface/api/exercicePrestation/Query.js +31 -1
  127. package/dist/mjs/types/Interface/api/exercicePrestation/Query.js.map +1 -1
  128. package/dist/mjs/types/Interface/api/file/Create.d.ts +1 -0
  129. package/dist/mjs/types/Interface/api/file/Create.d.ts.map +1 -1
  130. package/dist/mjs/types/Interface/api/file/Create.js +11 -2
  131. package/dist/mjs/types/Interface/api/file/Create.js.map +1 -1
  132. package/dist/mjs/types/Interface/api/toDoExpress/Query.d.ts +13 -6
  133. package/dist/mjs/types/Interface/api/toDoExpress/Query.d.ts.map +1 -1
  134. package/dist/mjs/types/Interface/api/toDoExpress/Query.js +66 -12
  135. package/dist/mjs/types/Interface/api/toDoExpress/Query.js.map +1 -1
  136. package/dist/mjs/utils/brands.d.ts +2 -0
  137. package/dist/mjs/utils/brands.d.ts.map +1 -1
  138. package/dist/mjs/utils/brands.js.map +1 -1
  139. package/dist/mjs/utils/commercialManagement/document.d.ts.map +1 -1
  140. package/dist/mjs/utils/commercialManagement/document.js +17 -6
  141. package/dist/mjs/utils/commercialManagement/document.js.map +1 -1
  142. package/dist/mjs/utils/commercialManagement/internationalization/choices.d.ts +4 -0
  143. package/dist/mjs/utils/commercialManagement/internationalization/choices.d.ts.map +1 -1
  144. package/dist/mjs/utils/commercialManagement/internationalization/choices.js +110 -2
  145. package/dist/mjs/utils/commercialManagement/internationalization/choices.js.map +1 -1
  146. package/dist/mjs/utils/commercialManagement/templates/common.js +1 -1
  147. package/dist/mjs/utils/commercialManagement/templates/common.js.map +1 -1
  148. package/dist/mjs/utils/email.d.ts.map +1 -1
  149. package/dist/mjs/utils/email.js +31 -11
  150. package/dist/mjs/utils/email.js.map +1 -1
  151. package/dist/mjs/utils/task.d.ts.map +1 -1
  152. package/dist/mjs/utils/task.js +3 -7
  153. package/dist/mjs/utils/task.js.map +1 -1
  154. package/dist/mjs/utils/vat/3517/century23.js +1 -1
  155. package/dist/mjs/utils/vat/3517/century23.js.map +1 -1
  156. package/dist/mjs/utils/vat/centuries.js +1 -1
  157. package/dist/mjs/utils/vat/centuries.js.map +1 -1
  158. package/dist/mjs/utils/webmail.d.ts.map +1 -1
  159. package/dist/mjs/utils/webmail.js +3 -7
  160. package/dist/mjs/utils/webmail.js.map +1 -1
  161. package/package.json +1 -1
  162. package/ts/api/resources/ExercicePrestation.ts +10 -1
  163. package/ts/types/Enum/BalanceSheet.ts +3 -3
  164. package/ts/types/Enum/BrandClementine.ts +2 -0
  165. package/ts/types/Enum/CommercialManagement.ts +6 -1
  166. package/ts/types/Enum/InternalService.ts +7 -7
  167. package/ts/types/Enum/JobTitle.ts +2 -2
  168. package/ts/types/Enum/Role.ts +3 -4
  169. package/ts/types/Enum/RoleDetail.ts +13 -13
  170. package/ts/types/Enum/Supervision.ts +15 -1
  171. package/ts/types/Enum/TaskResponseType.ts +4 -4
  172. package/ts/types/Enum/TimeCounterType.ts +6 -6
  173. package/ts/types/Enum/TimeSlot.ts +1 -1
  174. package/ts/types/Interface/api/balanceSheet/Query.ts +9 -1
  175. package/ts/types/Interface/api/exercicePrestation/Query.ts +23 -1
  176. package/ts/types/Interface/api/file/Create.ts +9 -2
  177. package/ts/types/Interface/api/toDoExpress/Query.ts +52 -12
  178. package/ts/utils/brands.ts +2 -0
  179. package/ts/utils/commercialManagement/document.ts +17 -6
  180. package/ts/utils/commercialManagement/internationalization/choices.ts +124 -2
  181. package/ts/utils/commercialManagement/templates/common.ts +1 -1
  182. package/ts/utils/email.ts +29 -12
  183. package/ts/utils/task.ts +3 -6
  184. package/ts/utils/vat/3517/century23.ts +1 -1
  185. package/ts/utils/vat/centuries.ts +1 -1
  186. package/ts/utils/webmail.ts +3 -6
@@ -21,7 +21,7 @@ import {
21
21
  } from '../../types';
22
22
  import { thirdPartyToReadThirdPartyEditing } from './thirdParty';
23
23
  import { getBrandConfig } from '../brands';
24
- import { internationalizationChoices } from './internationalization/choices';
24
+ import { internationalizationChoices, internationalizationConsistency } from './internationalization/choices';
25
25
 
26
26
  import * as ejs from 'ejs';
27
27
  // eslint-disable-next-line @typescript-eslint/no-require-imports
@@ -77,10 +77,19 @@ export function generateCommercialDocument(
77
77
  paymentLink: payload.paymentLink ?? '#',
78
78
  idEstimateInvoiceType,
79
79
  title: payload.title ?? null,
80
- penalties: payload.penalties ?? null,
81
- compensation: payload.compensation ?? null,
82
- discount: payload.discount ?? null,
83
- vatMention: payload.vatMention ?? null,
80
+ penalties: payload.penalties
81
+ ? (internationalizationConsistency(locale, payload.penalties, 'penalties') ?? null)
82
+ : null,
83
+ termsOfPayment: payload.termsOfPayment
84
+ ? (internationalizationConsistency(locale, payload.termsOfPayment, 'termsOfPayment') ?? null)
85
+ : null,
86
+ compensation: payload.compensation
87
+ ? (internationalizationConsistency(locale, payload.compensation, 'recoveryCost') ?? null)
88
+ : null,
89
+ discount: payload.discount ? (internationalizationConsistency(locale, payload.discount, 'discount') ?? null) : null,
90
+ vatMention: payload.vatMention
91
+ ? (internationalizationConsistency(locale, payload.vatMention, 'vatMention') ?? null)
92
+ : null,
84
93
  phoneContact: payload.settings?.phoneContact ?? null,
85
94
  products,
86
95
  vats,
@@ -119,7 +128,9 @@ export function generateCommercialDocument(
119
128
  brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,
120
129
  brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv }) as unknown as string}`,
121
130
  shouldHideBrandName,
122
- paymentType: payload.paymentType,
131
+ paymentType: payload.paymentType
132
+ ? internationalizationConsistency(locale, payload.paymentType, 'paymentType')
133
+ : null,
123
134
  languageTemplate: languageOption,
124
135
  };
125
136
 
@@ -1,6 +1,14 @@
1
- import { AccountingCategoryId } from '../../../types/Enum/CommercialManagement';
1
+ import { AccountingCategoryId, InvoiceLanguage } from '../../../types/Enum/CommercialManagement';
2
2
  import { InternationalizationChoicesType } from './type';
3
3
 
4
+ type InternationalizationConsistencyKey =
5
+ | 'penalties'
6
+ | 'discount'
7
+ | 'vatMention'
8
+ | 'recoveryCost'
9
+ | 'paymentType'
10
+ | 'termsOfPayment';
11
+
4
12
  export const internationalizationChoices: InternationalizationChoicesType = {
5
13
  fr: {
6
14
  inputLists: {
@@ -228,7 +236,7 @@ export const internationalizationChoices: InternationalizationChoicesType = {
228
236
  'Specific regime - Works of art - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
229
237
  'Specific regime – Collectibles and antiques - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
230
238
  'Specific regime - Travel agencies - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
231
- ' Invoice subject to VAT reverse charge system',
239
+ 'Invoice subject to VAT reverse charge system',
232
240
  ],
233
241
  recoveryCost: ['Not applicable', '40€'],
234
242
  paymentType: ['Credit card', 'Check', 'Cash', 'Direct debit', 'Bank transfer'],
@@ -383,3 +391,117 @@ export const internationalizationChoices: InternationalizationChoicesType = {
383
391
  },
384
392
  },
385
393
  };
394
+
395
+ const internationalizationMatching: { [key: string]: { fr: string; en: string }[] } = {
396
+ penalties: [
397
+ { fr: 'Non applicable', en: 'Not applicable' },
398
+ { fr: '3 fois le taux légal', en: '3 times the legal rate' },
399
+ { fr: 'Taux directeur de la BCE + 10 points', en: 'ECB key rate + 10 points' },
400
+ ],
401
+ discount: [
402
+ { fr: 'Non applicable', en: 'Not applicable' },
403
+ { fr: 'Aucun escompte en cas de paiement anticipé', en: 'No discount for early payment' },
404
+ ],
405
+ recoveryCost: [
406
+ { fr: 'Non applicable', en: 'Not applicable' },
407
+ { fr: '40€', en: '40€' },
408
+ ],
409
+ paymentType: [
410
+ { fr: 'Carte bancaire', en: 'Credit card' },
411
+ { fr: 'Chèque', en: 'Check' },
412
+ { fr: 'Espèces', en: 'Cash' },
413
+ { fr: 'Prélèvement', en: 'Direct debit' },
414
+ { fr: 'Virement bancaire', en: 'Bank transfer' },
415
+ ],
416
+ vatMention: [
417
+ { fr: 'Non concerné', en: 'Not affected' },
418
+ { fr: 'Non applicable', en: 'Not applicable' },
419
+ {
420
+ fr: 'TVA non applicable, art. 293 B du CGI',
421
+ en: 'VAT not applicable, art. 293 B of the French General Tax Code (FGTC)',
422
+ },
423
+ {
424
+ fr: 'TVA non applicable - Exportation hors UE - Art. 259-1 du CGI',
425
+ en: 'VAT not applicable - Exports outside the EU - Art. 259-1 of the French General Tax Code (FGTC)',
426
+ },
427
+ {
428
+ fr: "Non soumis à TVA selon l'article 261C du CGI",
429
+ en: 'Not subject to VAT according to article 261C of the French General Tax Code (FGTC)',
430
+ },
431
+ { fr: 'Article 261 D du code général des impôts (CGI)', en: 'Article 261D of the French General Tax Code (FGTC)' },
432
+ {
433
+ fr: 'Exonération de TVA, article 283-2 du Code général des impôts',
434
+ en: 'VAT exemption, article 283-2 of the French General Tax Code (FGTC)',
435
+ },
436
+ {
437
+ fr: 'Exonération de la TVA : Article 262 ter I du CGI',
438
+ en: 'VAT exemption: Article 262 ter I of the French General Tax Code (FGTC)',
439
+ },
440
+ { fr: 'Mention de TVA 261.4.4 1 du CGI', en: 'VAT notice 261.4.4 1 of the French General Tax Code (FGTC)' },
441
+ {
442
+ fr: "Régime particulier – Biens d'occasion - article 297 A du CGI et directive communautaire 2006/112/CE",
443
+ en: 'Specific regime - Second-hand goods - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
444
+ },
445
+ {
446
+ fr: "Régime particulier – Objets d'art - article 297 A du CGI et directive communautaire 2006/112/CE",
447
+ en: 'Specific regime - Works of art - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
448
+ },
449
+ {
450
+ fr: "Régime particulier – Objets de collection ou d'antiquité - article 297 A du CGI et directive communautaire 2006/112/CE",
451
+ en: 'Specific regime – Collectibles and antiques - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
452
+ },
453
+ {
454
+ fr: 'Régime particulier – Agences de voyage - article 297 A du CGI et directive communautaire 2006/112/CE',
455
+ en: 'Specific regime - Travel agencies - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
456
+ },
457
+ {
458
+ fr: 'Facture soumise au régime de l’auto-liquidation de la TVA',
459
+ en: 'Invoice subject to VAT reverse charge system',
460
+ },
461
+ ],
462
+ termsOfPayment: [
463
+ {
464
+ fr: 'À la livraison',
465
+ en: 'On delivery',
466
+ },
467
+ {
468
+ fr: 'À la command',
469
+ en: 'On order',
470
+ },
471
+ {
472
+ fr: 'À réception de la facture',
473
+ en: 'Upon receipt of invoice',
474
+ },
475
+ {
476
+ fr: 'Exigible sous 14 jours',
477
+ en: 'Due within 14 days',
478
+ },
479
+ {
480
+ fr: 'Exigible sous 30 jours',
481
+ en: 'Due within 30 days',
482
+ },
483
+ {
484
+ fr: '30 jours à réception de la facture',
485
+ en: '30 days upon receipt of invoice',
486
+ },
487
+ {
488
+ fr: '45 jours à réception de la facture',
489
+ en: '45 days upon receipt of invoice',
490
+ },
491
+ {
492
+ fr: '60 jours à réception de la facture',
493
+ en: '60 days upon receipt of invoice',
494
+ },
495
+ ],
496
+ };
497
+
498
+ export const internationalizationConsistency = (
499
+ language: InvoiceLanguage,
500
+ value: string,
501
+ key: InternationalizationConsistencyKey,
502
+ ): string | undefined => {
503
+ const keyObjectToMacht = internationalizationMatching[key];
504
+ return language === InvoiceLanguage.FR
505
+ ? keyObjectToMacht.find((obj) => obj.fr === value)?.fr
506
+ : keyObjectToMacht.find((obj) => obj.fr === value)?.en;
507
+ };
@@ -9,7 +9,7 @@ export class CommercialDocumentCommonHTML {
9
9
  <% } %>`;
10
10
 
11
11
  footer = `<div style="font-size: 8px !important; color: #838384; text-align: center; padding: 0 40px; display: block; width: 100%;">
12
- <% if (freeText) { %><%- freeText %><br/><br/><% } %><% if (accountingCategoryFormatted) {%><%= accountingCategoryFormatted %> | <%}%><% if(marginVats.length > 0) { %><%= languageTemplate.template.common.footer.marginVat %> - <% marginVats.forEach(function(v, index) { %><%= v %> - <% }) %><%= languageTemplate.template.common.footer.legalVatMention %> | <% } %><% if(penalties || compensation || discount) { %><%= penalties ? languageTemplate.template.common.footer.penalties + ' : ' + penalties : ''%><%= penalties && compensation ? ' | ' : ''%><%= compensation ? languageTemplate.template.common.footer.recoveryCosts + ' : ' + compensation + ' ' : '' %><%= (compensation || penalties) && discount ? ' | ' : '' %><%= discount ? discount + ' ' : '' %><%= shouldPayTaxAfterDebit ? "| " + languageTemplate.template.common.footer.shouldPayTaxAfterDebit : '' %><% if(name || legalForm || capital || siren || rcs) {%><br/><br/><% } %><% } %><%= name %><%= name && (legalForm || capital || siren || rcs) ? ', ' : ''%><%= legalForm %><%= capital ? ' ' + languageTemplate.template.common.footer.capital + ' ' + capitalFormatted + ' €' : '' %><%= siren ? ' ' + languageTemplate.template.common.footer.siren + ' ' + siren : ''%><%= rcs ? '| RCS ' + rcs : ''%><% if (vatCode || nafCode) {%><br/><% } %><%= vatCode ? languageTemplate.template.common.footer.vatCode + ' ' +vatCode : ''%><% if(vatCode && nafCode){%>|<%}%><%= nafCode ? 'APE '+nafCode : '' %>
12
+ <% if (freeText) { %><%- freeText %><br/><br/><% } %><% if (accountingCategoryFormatted) {%><%= accountingCategoryFormatted %> | <%}%><% if(marginVats.length > 0) { %><%= languageTemplate.template.common.footer.marginVat %> - <% marginVats.forEach(function(v, index) { %><%= v %> - <% }) %><%= languageTemplate.template.common.footer.legalVatMention %> | <% } %><% if(penalties || compensation || discount) { %><%= penalties ? languageTemplate.template.common.footer.penalties + ' : ' + penalties : ''%><%= penalties && compensation ? ' | ' : ''%><%= compensation ? languageTemplate.template.common.footer.recoveryCosts + ' : ' + compensation + ' ' : '' %><%= (compensation || penalties) && discount ? ' | ' : '' %><%= discount ? languageTemplate.template.common.footer.discount + ' : ' + discount : '' %><%= shouldPayTaxAfterDebit ? "| " + languageTemplate.template.common.footer.shouldPayTaxAfterDebit : '' %><% if(name || legalForm || capital || siren || rcs) {%><br/><br/><% } %><% } %><%= name %><%= name && (legalForm || capital || siren || rcs) ? ', ' : ''%><%= legalForm %><%= capital ? ' ' + languageTemplate.template.common.footer.capital + ' ' + capitalFormatted + ' €' : '' %><%= siren ? ' ' + languageTemplate.template.common.footer.siren + ' ' + siren : ''%><%= rcs ? '| RCS ' + rcs : ''%><% if (vatCode || nafCode) {%><br/><% } %><%= vatCode ? languageTemplate.template.common.footer.vatCode + ' ' +vatCode : ''%><% if(vatCode && nafCode){%>|<%}%><%= nafCode ? 'APE '+nafCode : '' %>
13
13
  <% if (["Clementine", "Pourcentage", "Comptalib"].includes(brandName) && !shouldHideBrandName) { %>
14
14
  <div style="display: grid; place-items: center;"><div style="background-color: <%= brandColors.primary50 %>; color: <%= brandColors.primary500 %>; display: flex; gap: 3px; max-width: fit-content; border-radius: 4px; padding: 4px 8px; margin-top: 8px; align-items: center; font-size: 9px; line-height: 140%; font-family: 'circular std', sans serif; font-weight: 450;">
15
15
  <%= languageTemplate.template.common.footer.generate %>
package/ts/utils/email.ts CHANGED
@@ -34,9 +34,7 @@ function getRoleSignature(user: any) {
34
34
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
35
35
  const isOnBoarder = user.roles.map((r: any) => r.id).includes(Role.ON_BOARDER);
36
36
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
37
- const isTermination = user.roles.map((r: any) => r.id).includes(Role.TERMINATION);
38
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
39
- const isLitige = user.roles.map((r: any) => r.id).includes(Role.LITIGE);
37
+ const isSatisfaction = user.roles.map((r: any) => r.id).includes(Role.SATISFACTION);
40
38
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
41
39
  const isDataOfficer = user.roles.map((r: any) => r.id).includes(Role.DATA_OFFICER);
42
40
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
@@ -77,20 +75,13 @@ function getRoleSignature(user: any) {
77
75
  return `Chargé${user.idCivility === 2 ? 'e' : ''} accueil clients`;
78
76
  }
79
77
 
80
- if (isTermination && isManager) {
78
+ if (isSatisfaction && isManager) {
81
79
  return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients`;
82
80
  }
83
- if (isTermination) {
81
+ if (isSatisfaction) {
84
82
  return `Chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients`;
85
83
  }
86
84
 
87
- if (isLitige && isManager) {
88
- return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients (Litige)`;
89
- }
90
- if (isLitige) {
91
- return `Chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients (Litige)`;
92
- }
93
-
94
85
  if (isDataOfficer && isManager) {
95
86
  return 'Responsable aide comptable';
96
87
  }
@@ -275,6 +266,14 @@ export function generateSignature(params: any): string {
275
266
  ...(idTypeBrand ? { idTypeBrand } : {}),
276
267
  objectWaited: 'listMails.gestion',
277
268
  }) as unknown as string;
269
+ const satisfactionMail = getBrandConfig({
270
+ ...(idTypeBrand ? { idTypeBrand } : {}),
271
+ objectWaited: 'listMails.satisfaction',
272
+ }) as unknown as string;
273
+ const resiliationMail = getBrandConfig({
274
+ ...(idTypeBrand ? { idTypeBrand } : {}),
275
+ objectWaited: 'listMails.resiliation',
276
+ }) as unknown as string;
278
277
  const supportMail = getBrandConfig({
279
278
  ...(idTypeBrand ? { idTypeBrand } : {}),
280
279
  objectWaited: 'listMails.support',
@@ -338,6 +337,24 @@ export function generateSignature(params: any): string {
338
337
  };
339
338
  mailSignature = bonjourMail;
340
339
  roleSignature = '';
340
+ } else if (forceRole === 'satisfaction') {
341
+ // Signature satisfaction
342
+ user = {
343
+ firstname: 'Service satisfaction clients',
344
+ isAll: true,
345
+ };
346
+ mailSignature = satisfactionMail;
347
+ roleSignature = '';
348
+ phoneSignature = standardPhoneSignature;
349
+ } else if (forceRole === 'resiliation') {
350
+ // Signature resiliation
351
+ user = {
352
+ firstname: 'Service satisfaction clients',
353
+ isAll: true,
354
+ };
355
+ mailSignature = resiliationMail;
356
+ roleSignature = '';
357
+ phoneSignature = standardPhoneSignature;
341
358
  } else if (forceRole === 'social') {
342
359
  // Signature social
343
360
  user = {
package/ts/utils/task.ts CHANGED
@@ -23,10 +23,8 @@ const getIdRoleUsedForTask = (listRoles: Role[]): Role => {
23
23
  idRole = Role.TECHNICAL_ADVISOR;
24
24
  } else if (listRoles.includes(Role.ON_BOARDER)) {
25
25
  idRole = Role.ON_BOARDER;
26
- } else if (listRoles.includes(Role.TERMINATION)) {
27
- idRole = Role.TERMINATION;
28
- } else if (listRoles.includes(Role.LITIGE)) {
29
- idRole = Role.LITIGE;
26
+ } else if (listRoles.includes(Role.SATISFACTION)) {
27
+ idRole = Role.SATISFACTION;
30
28
  } else if (listRoles.includes(Role.FRONT_OFFICE)) {
31
29
  idRole = Role.FRONT_OFFICE;
32
30
  } else if (listRoles.includes(Role.DATA_OFFICER)) {
@@ -66,8 +64,7 @@ const getListIdRolesUsedForTask = (listRoles: Role[]): Role[] => {
66
64
  Role.CUSTOMER_SUCCESS,
67
65
  Role.TECHNICAL_ADVISOR,
68
66
  Role.ON_BOARDER,
69
- Role.TERMINATION,
70
- Role.LITIGE,
67
+ Role.SATISFACTION,
71
68
  Role.FRONT_OFFICE,
72
69
  Role.DATA_OFFICER,
73
70
  ].includes(r));
@@ -103,7 +103,7 @@ export function getCerfa3517Century23Payload(
103
103
  );
104
104
 
105
105
  const prestation2Entries = vatEntries.filter((ae) => intracomVat.includes(ae.idVat));
106
- const presta2Accounts = ['604', '61', '62', '607', '651', '601', '602']; // Ajout suite à la demande de Ben x Angelo
106
+ const presta2Accounts = ['604', '61', '62', '607', '651', '601', '602', '606']; // Ajout suite à la demande de Ben x Angelo, 606 Angelo
107
107
  const prestation2Base = setZeroIfIsNegative(getAmountByAccountNumber(prestation2Entries, presta2Accounts, 0, true));
108
108
  const prestation2AmountOfVat = setZeroIfIsNegative(
109
109
  getTaxAmountByAccountNumber(prestation2Entries, presta2Accounts, 0, false, true),
@@ -75,7 +75,7 @@ const vatDocuments: VatDocument[] = [
75
75
  fileName: '3310-2024',
76
76
  annex: {
77
77
  name: '3519',
78
- century: '24',
78
+ century: dayjs().month() === 0 ? dayjs().subtract(1, 'month').format('YY') : dayjs().format('YY'),
79
79
  shouldInclude: (data: Cerfa3310_2023) => Boolean(data.credit?.refundAsked && data.credit.refundAsked > 0),
80
80
  payload: (amount: number, payload: PayloadCerfa3519_2017) => getCerfa3519Century17Payload(amount, payload),
81
81
  asponePayload: (data: Cerfa3519_2017) => getCerfa3519Century23RegistrationFields(data),
@@ -24,10 +24,8 @@ const getIdRoleUsedForEmail = (listRoles: number[]): Role => {
24
24
  idRole = Role.SOCIAL;
25
25
  } else if (listRoles.includes(Role.ON_BOARDER)) {
26
26
  idRole = Role.ON_BOARDER;
27
- } else if (listRoles.includes(Role.TERMINATION)) {
28
- idRole = Role.TERMINATION;
29
- } else if (listRoles.includes(Role.LITIGE)) {
30
- idRole = Role.LITIGE;
27
+ } else if (listRoles.includes(Role.SATISFACTION)) {
28
+ idRole = Role.SATISFACTION;
31
29
  }
32
30
  return idRole;
33
31
  };
@@ -46,8 +44,7 @@ const getListIdRolesUsedForEmail = (listRoles: number[]): Role[] => {
46
44
  Role.JURIDIC,
47
45
  Role.SOCIAL,
48
46
  Role.ON_BOARDER,
49
- Role.TERMINATION,
50
- Role.LITIGE
47
+ Role.SATISFACTION
51
48
  ].includes(r));
52
49
  return listIdRoles;
53
50
  };