@silexpert/core 1.1.265 → 1.1.266

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 (29) hide show
  1. package/dist/cjs/api/resources/IntermediateManagementRebate.d.ts +4 -2
  2. package/dist/cjs/api/resources/IntermediateManagementRebate.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/IntermediateManagementRebate.js +3 -0
  4. package/dist/cjs/api/resources/IntermediateManagementRebate.js.map +1 -1
  5. package/dist/cjs/types/Enum/IntermediateManagementRebate.d.ts.map +1 -1
  6. package/dist/cjs/types/Enum/IntermediateManagementRebate.js +10 -0
  7. package/dist/cjs/types/Enum/IntermediateManagementRebate.js.map +1 -1
  8. package/dist/cjs/types/Interface/api/IntermediateManagementRebate.d.ts +40 -1
  9. package/dist/cjs/types/Interface/api/IntermediateManagementRebate.d.ts.map +1 -1
  10. package/dist/cjs/types/Interface/api/IntermediateManagementRebate.js.map +1 -1
  11. package/dist/cjs/utils/email.js +1 -1
  12. package/dist/cjs/utils/email.js.map +1 -1
  13. package/dist/mjs/api/resources/IntermediateManagementRebate.d.ts +4 -2
  14. package/dist/mjs/api/resources/IntermediateManagementRebate.d.ts.map +1 -1
  15. package/dist/mjs/api/resources/IntermediateManagementRebate.js +3 -0
  16. package/dist/mjs/api/resources/IntermediateManagementRebate.js.map +1 -1
  17. package/dist/mjs/types/Enum/IntermediateManagementRebate.d.ts.map +1 -1
  18. package/dist/mjs/types/Enum/IntermediateManagementRebate.js +10 -0
  19. package/dist/mjs/types/Enum/IntermediateManagementRebate.js.map +1 -1
  20. package/dist/mjs/types/Interface/api/IntermediateManagementRebate.d.ts +40 -1
  21. package/dist/mjs/types/Interface/api/IntermediateManagementRebate.d.ts.map +1 -1
  22. package/dist/mjs/types/Interface/api/IntermediateManagementRebate.js.map +1 -1
  23. package/dist/mjs/utils/email.js +1 -1
  24. package/dist/mjs/utils/email.js.map +1 -1
  25. package/package.json +1 -1
  26. package/ts/api/resources/IntermediateManagementRebate.ts +6 -2
  27. package/ts/types/Enum/IntermediateManagementRebate.ts +10 -0
  28. package/ts/types/Interface/api/IntermediateManagementRebate.ts +41 -2
  29. package/ts/utils/email.ts +2 -2
@@ -1,7 +1,9 @@
1
- import { IMRTypeFilled, IntermediateManagementRebateType, ReadIMRWithExercices } from '../../types';
1
+ /// <reference types="node" />
2
+ import { IMRTypeFilled, IntermediateManagementRebateType, ReadFormattedIMRFilledWithExercice } from '../../types';
2
3
  import { Resource } from '../Resource';
3
4
  export declare class IntermediateManagementRebate extends Resource {
4
- get(idExercice: number): Promise<ReadIMRWithExercices>;
5
+ get(idExercice: number): Promise<ReadFormattedIMRFilledWithExercice[]>;
5
6
  getByType(idExercice: number, type: IntermediateManagementRebateType): Promise<IMRTypeFilled[]>;
7
+ getFile(idExercice: number): Promise<Buffer>;
6
8
  }
7
9
  //# sourceMappingURL=IntermediateManagementRebate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntermediateManagementRebate.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/IntermediateManagementRebate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gCAAgC,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,4BAA6B,SAAQ,QAAQ;IAExD,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAItD,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,gCAAgC,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAIhG"}
1
+ {"version":3,"file":"IntermediateManagementRebate.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/IntermediateManagementRebate.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,gCAAgC,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAC;AAClH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,4BAA6B,SAAQ,QAAQ;IAExD,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,kCAAkC,EAAE,CAAC;IAItE,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,gCAAgC,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAI/F,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAI7C"}
@@ -9,6 +9,9 @@ class IntermediateManagementRebate extends Resource_1.Resource {
9
9
  getByType(idExercice, type) {
10
10
  return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates/${type}`);
11
11
  }
12
+ getFile(idExercice) {
13
+ return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates/file`);
14
+ }
12
15
  }
13
16
  exports.IntermediateManagementRebate = IntermediateManagementRebate;
14
17
  //# sourceMappingURL=IntermediateManagementRebate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntermediateManagementRebate.js","sourceRoot":"","sources":["../../../../ts/api/resources/IntermediateManagementRebate.ts"],"names":[],"mappings":";;;AACA,0CAAuC;AAEvC,MAAa,4BAA6B,SAAQ,mBAAQ;IAExD,GAAG,CAAC,UAAkB;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,UAAU,kCAAkC,CAAC,CAAC;IACrF,CAAC;IAED,SAAS,CAAC,UAAkB,EAAE,IAAsC;QAClE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,UAAU,oCAAoC,IAAI,EAAE,CAAC,CAAC;IAC7F,CAAC;CAEF;AAVD,oEAUC","sourcesContent":["import { IMRTypeFilled, IntermediateManagementRebateType, ReadIMRWithExercices } from '../../types';\nimport { Resource } from '../Resource';\n\nexport class IntermediateManagementRebate extends Resource {\n \n get(idExercice: number): Promise<ReadIMRWithExercices> {\n return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates`);\n }\n\n getByType(idExercice: number, type: IntermediateManagementRebateType): Promise<IMRTypeFilled[]> {\n return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates/${type}`);\n }\n\n}"]}
1
+ {"version":3,"file":"IntermediateManagementRebate.js","sourceRoot":"","sources":["../../../../ts/api/resources/IntermediateManagementRebate.ts"],"names":[],"mappings":";;;AACA,0CAAuC;AAEvC,MAAa,4BAA6B,SAAQ,mBAAQ;IAExD,GAAG,CAAC,UAAkB;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,UAAU,kCAAkC,CAAC,CAAC;IACrF,CAAC;IAED,SAAS,CAAC,UAAkB,EAAE,IAAsC;QAClE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,UAAU,oCAAoC,IAAI,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED,OAAO,CAAC,UAAkB;QACxB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,UAAU,uCAAuC,CAAC,CAAC;IAC1F,CAAC;CAEF;AAdD,oEAcC","sourcesContent":["import { IMRTypeFilled, IntermediateManagementRebateType, ReadFormattedIMRFilledWithExercice } from '../../types';\nimport { Resource } from '../Resource';\n\nexport class IntermediateManagementRebate extends Resource {\n \n get(idExercice: number): Promise<ReadFormattedIMRFilledWithExercice[]> {\n return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates`);\n }\n\n getByType(idExercice: number, type: IntermediateManagementRebateType): Promise<IMRTypeFilled[]> {\n return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates/${type}`);\n }\n\n getFile(idExercice: number): Promise<Buffer> {\n return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates/file`);\n }\n\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IntermediateManagementRebate.d.ts","sourceRoot":"","sources":["../../../../ts/types/Enum/IntermediateManagementRebate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAE3E,oBAAY,gCAAgC;IAC1C,QAAQ,IAAI;IACZ,GAAG,IAAI;IACP,MAAM,IAAI;IACV,KAAK,IAAI;IACT,SAAS,IAAI;IACb,GAAG,IAAI;IACP,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,YAAY,IAAI;IAChB,YAAY,KAAK;IACjB,iBAAiB,KAAK;IACtB,OAAO,KAAK;IACZ,0BAA0B,KAAK;IAC/B,gBAAgB,KAAK;IACrB,mBAAmB,KAAK;IACxB,iBAAiB,KAAK;IACtB,4BAA4B,KAAK;IACjC,kBAAkB,KAAK;IACvB,cAAc,KAAK;CACpB;AAED,eAAO,MAAM,oCAAoC,EAAE,UAAU,EA8H5D,CAAC"}
1
+ {"version":3,"file":"IntermediateManagementRebate.d.ts","sourceRoot":"","sources":["../../../../ts/types/Enum/IntermediateManagementRebate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAE3E,oBAAY,gCAAgC;IAC1C,QAAQ,IAAI;IACZ,GAAG,IAAI;IACP,MAAM,IAAI;IACV,KAAK,IAAI;IACT,SAAS,IAAI;IACb,GAAG,IAAI;IACP,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,YAAY,IAAI;IAChB,YAAY,KAAK;IACjB,iBAAiB,KAAK;IACtB,OAAO,KAAK;IACZ,0BAA0B,KAAK;IAC/B,gBAAgB,KAAK;IACrB,mBAAmB,KAAK;IACxB,iBAAiB,KAAK;IACtB,4BAA4B,KAAK;IACjC,kBAAkB,KAAK;IACvB,cAAc,KAAK;CACpB;AAED,eAAO,MAAM,oCAAoC,EAAE,UAAU,EAwI5D,CAAC"}
@@ -28,6 +28,7 @@ exports.IntermediateManagementRebateSegments = [
28
28
  name: 'Chiffre d\'affaires',
29
29
  accounts: ['70'],
30
30
  type: IntermediateManagementRebateType.TURNOVER,
31
+ isPositive: true,
31
32
  },
32
33
  {
33
34
  name: 'Ventes + Production réelle',
@@ -35,6 +36,7 @@ exports.IntermediateManagementRebateSegments = [
35
36
  {
36
37
  name: 'Achats consommés',
37
38
  accounts: ['60'],
39
+ isNegative: true,
38
40
  type: IntermediateManagementRebateType.BUY,
39
41
  },
40
42
  {
@@ -43,6 +45,7 @@ exports.IntermediateManagementRebateSegments = [
43
45
  {
44
46
  name: 'Charges externes',
45
47
  accounts: ['61', '62'],
48
+ isNegative: true,
46
49
  type: IntermediateManagementRebateType.CHARGE,
47
50
  },
48
51
  {
@@ -63,11 +66,13 @@ exports.IntermediateManagementRebateSegments = [
63
66
  {
64
67
  name: 'Impôts et taxes',
65
68
  accounts: ['63'],
69
+ isNegative: true,
66
70
  type: IntermediateManagementRebateType.TAX,
67
71
  },
68
72
  {
69
73
  name: 'Charges de personnel',
70
74
  accounts: ['64'],
75
+ isNegative: true,
71
76
  type: IntermediateManagementRebateType.PERSONAL,
72
77
  },
73
78
  {
@@ -82,11 +87,13 @@ exports.IntermediateManagementRebateSegments = [
82
87
  {
83
88
  name: 'Autres charges d\'exploitation',
84
89
  accounts: ['65'],
90
+ isNegative: true,
85
91
  type: IntermediateManagementRebateType.OTHER_CHARGE,
86
92
  },
87
93
  {
88
94
  name: 'Dotations aux amortissements',
89
95
  accounts: ['681', '682', '683', '684', '685'],
96
+ isNegative: true,
90
97
  type: IntermediateManagementRebateType.OTHER_CHARGE,
91
98
  },
92
99
  {
@@ -113,6 +120,7 @@ exports.IntermediateManagementRebateSegments = [
113
120
  {
114
121
  name: 'Charges financières',
115
122
  type: IntermediateManagementRebateType.FINANCIAL_CHARGE,
123
+ isNegative: true,
116
124
  accounts: ['66'],
117
125
  },
118
126
  {
@@ -136,6 +144,7 @@ exports.IntermediateManagementRebateSegments = [
136
144
  {
137
145
  name: 'Charges exceptionnelles',
138
146
  accounts: ['67'],
147
+ isNegative: true,
139
148
  type: IntermediateManagementRebateType.EXCEPTIONAL_CHARGE,
140
149
  },
141
150
  {
@@ -144,6 +153,7 @@ exports.IntermediateManagementRebateSegments = [
144
153
  {
145
154
  name: 'Impôts sur les bénéfices',
146
155
  accounts: ['695'],
156
+ isNegative: true,
147
157
  type: IntermediateManagementRebateType.TAX_ON_BENEFIT,
148
158
  },
149
159
  {
@@ -1 +1 @@
1
- {"version":3,"file":"IntermediateManagementRebate.js","sourceRoot":"","sources":["../../../../ts/types/Enum/IntermediateManagementRebate.ts"],"names":[],"mappings":";;;AAEA,IAAY,gCAoBX;AApBD,WAAY,gCAAgC;IAC1C,+FAAY,CAAA;IACZ,qFAAO,CAAA;IACP,2FAAU,CAAA;IACV,yFAAS,CAAA;IACT,iGAAa,CAAA;IACb,qFAAO,CAAA;IACP,+FAAY,CAAA;IACZ,6FAAW,CAAA;IACX,uGAAgB,CAAA;IAChB,wGAAiB,CAAA;IACjB,kHAAsB,CAAA;IACtB,8FAAY,CAAA;IACZ,oIAA+B,CAAA;IAC/B,gHAAqB,CAAA;IACrB,sHAAwB,CAAA;IACxB,kHAAsB,CAAA;IACtB,wIAAiC,CAAA;IACjC,oHAAuB,CAAA;IACvB,4GAAmB,CAAA;AACrB,CAAC,EApBW,gCAAgC,GAAhC,wCAAgC,KAAhC,wCAAgC,QAoB3C;AAEY,QAAA,oCAAoC,GAAiB;IAChE;QACE,IAAI,EAAE,qBAAqB;QAC3B,QAAQ,EAAE,CAAC,IAAI,CAAC;QAChB,IAAI,EAAE,gCAAgC,CAAC,QAAQ;KAChD;IACD;QACE,IAAI,EAAE,4BAA4B;KACnC;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,QAAQ,EAAE,CAAC,IAAI,CAAC;QAChB,IAAI,EAAE,gCAAgC,CAAC,GAAG;KAC3C;IACD;QACE,IAAI,EAAE,eAAe;KACtB;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QACtB,IAAI,EAAE,gCAAgC,CAAC,MAAM;KAC9C;IACD;QACE,IAAI,EAAE,gBAAgB;KACvB;IACD;QACE,IAAI,EAA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AE,+CAA+C;QACrD,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,IAAI,EAAE,gCAAgC,CAAC,OAAO;KAC/C;IACD;QACE,IAAI,EAAE,kCAAkC;QACxC,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,IAAI,EAAE,gCAAgC,CAAC,0BAA0B;KAClE;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,gCAAgC,CAAC,gBAAgB;QACvD,QAAQ,EAAE,CAAC,IAAI,CAAC;KACjB;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,QAAQ,EAAE,CAAC,IAAI,CAAC;QAChB,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,gCAAgC,CAAC,mBAAmB;KAC3D;IACD;QACE,IAAI,EAAE,iDAAiD;QACvD,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,IAAI,EAAE,gCAAgC,CAAC,iBAAiB;KACzD;IACD;QACE,IAAI,EAAE,sCAAsC;QAC5C,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,IAAI,EAAE,gCAAgC,CAAC,4BAA4B;KACpE;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,QAAQ,EAAE,CAAC,IAAI,CAAC;QAChB,IAAI,EAAE,gCAAgC,CAAC,kBAAkB;KAC1D;IACD;QACE,IAAI,EAAE,uBAAuB;KAC9B;IACD;QACE,IAAI,EAAE,0BAA0B;QAChC,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,IAAI,EAAE,gCAAgC,CAAC,cAAc;KACtD;IACD;QACE,IAAI,EAAE,UAAU;KACjB;CACF,CAAC","sourcesContent":["import { IMRSegment } from '../Interface/api/IntermediateManagementRebate';\n\nexport enum IntermediateManagementRebateType {\n TURNOVER = 1,\n BUY = 2,\n CHARGE = 3,\n GRANT = 4,\n TRANSFERT = 5,\n TAX = 6,\n PERSONAL = 7,\n PRODUCT = 8,\n OTHER_CHARGE = 9,\n AMORTIZATION = 10,\n FINANCIAL_PRODUCT = 11,\n REPRISE = 12,\n TRANSFERT_FINANCIAL_CHARGE = 13,\n FINANCIAL_CHARGE = 14,\n EXCEPTIONAL_PRODUCT = 15,\n REPRISE_PROVISION = 16,\n TRANSFERT_EXCEPTIONAL_CHARGE = 17,\n EXCEPTIONAL_CHARGE = 18,\n TAX_ON_BENEFIT = 19,\n}\n\nexport const IntermediateManagementRebateSegments: IMRSegment[] = [\n {\n name: 'Chiffre d\\'affaires',\n accounts: ['70'],\n type: IntermediateManagementRebateType.TURNOVER,\n },\n {\n name: 'Ventes + Production réelle',\n },\n {\n name: 'Achats consommés',\n accounts: ['60'],\n type: IntermediateManagementRebateType.BUY,\n },\n {\n name: 'Marge globale',\n },\n {\n name: 'Charges externes',\n accounts: ['61', '62'],\n type: IntermediateManagementRebateType.CHARGE,\n },\n {\n name: 'Valeur ajoutée',\n },\n {\n name: 'Subvention d\\'exploitation',\n accounts: ['74'],\n isPositive: true,\n type: IntermediateManagementRebateType.GRANT,\n },\n {\n name: 'Transfert de charges d’exploitation',\n accounts: ['791', '792', '793', '794', '795'],\n isPositive: true,\n type: IntermediateManagementRebateType.TRANSFERT,\n },\n {\n name: 'Impôts et taxes',\n accounts: ['63'],\n type: IntermediateManagementRebateType.TAX,\n },\n {\n name: 'Charges de personnel',\n accounts: ['64'],\n type: IntermediateManagementRebateType.PERSONAL,\n },\n {\n name: 'Excédent brut d\\'exploitation',\n },\n {\n name: 'Autres produits d\\'exploitation',\n accounts: ['781', '782', '783', '784', '785', '75'],\n isPositive: true,\n type: IntermediateManagementRebateType.PRODUCT,\n },\n {\n name: 'Autres charges d\\'exploitation',\n accounts: ['65'],\n type: IntermediateManagementRebateType.OTHER_CHARGE,\n },\n {\n name: 'Dotations aux amortissements',\n accounts: ['681', '682', '683', '684', '685'],\n type: IntermediateManagementRebateType.OTHER_CHARGE,\n },\n {\n name: 'Résultat d\\'exploitation',\n },\n {\n name: 'Produits financiers',\n accounts: ['76'],\n isPositive: true,\n type: IntermediateManagementRebateType.FINANCIAL_PRODUCT,\n },\n {\n name: 'Reprises sur amort. et provisions financières',\n isPositive: true,\n accounts: ['786'],\n type: IntermediateManagementRebateType.REPRISE,\n },\n {\n name: 'Transfert de charges financières',\n isPositive: true,\n accounts: ['796'],\n type: IntermediateManagementRebateType.TRANSFERT_FINANCIAL_CHARGE,\n },\n {\n name: 'Charges financières',\n type: IntermediateManagementRebateType.FINANCIAL_CHARGE,\n accounts: ['66'],\n },\n {\n name: 'Produits exceptionnels',\n accounts: ['77'],\n isPositive: true,\n type: IntermediateManagementRebateType.EXCEPTIONAL_PRODUCT,\n },\n {\n name: 'Reprises sur amort. et provisions exceptionnels',\n isPositive: true,\n accounts: ['787'],\n type: IntermediateManagementRebateType.REPRISE_PROVISION,\n },\n {\n name: 'Transfert de charges exceptionnelles',\n isPositive: true,\n accounts: ['797'],\n type: IntermediateManagementRebateType.TRANSFERT_EXCEPTIONAL_CHARGE,\n },\n {\n name: 'Charges exceptionnelles',\n accounts: ['67'],\n type: IntermediateManagementRebateType.EXCEPTIONAL_CHARGE,\n },\n {\n name: 'Résultat exceptionnel',\n },\n {\n name: 'Impôts sur les bénéfices',\n accounts: ['695'],\n type: IntermediateManagementRebateType.TAX_ON_BENEFIT,\n },\n {\n name: 'Résultat',\n },\n];"]}
1
+ {"version":3,"file":"IntermediateManagementRebate.js","sourceRoot":"","sources":["../../../../ts/types/Enum/IntermediateManagementRebate.ts"],"names":[],"mappings":";;;AAEA,IAAY,gCAoBX;AApBD,WAAY,gCAAgC;IAC1C,+FAAY,CAAA;IACZ,qFAAO,CAAA;IACP,2FAAU,CAAA;IACV,yFAAS,CAAA;IACT,iGAAa,CAAA;IACb,qFAAO,CAAA;IACP,+FAAY,CAAA;IACZ,6FAAW,CAAA;IACX,uGAAgB,CAAA;IAChB,wGAAiB,CAAA;IACjB,kH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,CAAC,gBAAgB;QACvD,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,CAAC,IAAI,CAAC;KACjB;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,QAAQ,EAAE,CAAC,IAAI,CAAC;QAChB,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,gCAAgC,CAAC,mBAAmB;KAC3D;IACD;QACE,IAAI,EAAE,iDAAiD;QACvD,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,IAAI,EAAE,gCAAgC,CAAC,iBAAiB;KACzD;IACD;QACE,IAAI,EAAE,sCAAsC;QAC5C,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,IAAI,EAAE,gCAAgC,CAAC,4BAA4B;KACpE;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,QAAQ,EAAE,CAAC,IAAI,CAAC;QAChB,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,gCAAgC,CAAC,kBAAkB;KAC1D;IACD;QACE,IAAI,EAAE,uBAAuB;KAC9B;IACD;QACE,IAAI,EAAE,0BAA0B;QAChC,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,gCAAgC,CAAC,cAAc;KACtD;IACD;QACE,IAAI,EAAE,UAAU;KACjB;CACF,CAAC","sourcesContent":["import { IMRSegment } from '../Interface/api/IntermediateManagementRebate';\n\nexport enum IntermediateManagementRebateType {\n TURNOVER = 1,\n BUY = 2,\n CHARGE = 3,\n GRANT = 4,\n TRANSFERT = 5,\n TAX = 6,\n PERSONAL = 7,\n PRODUCT = 8,\n OTHER_CHARGE = 9,\n AMORTIZATION = 10,\n FINANCIAL_PRODUCT = 11,\n REPRISE = 12,\n TRANSFERT_FINANCIAL_CHARGE = 13,\n FINANCIAL_CHARGE = 14,\n EXCEPTIONAL_PRODUCT = 15,\n REPRISE_PROVISION = 16,\n TRANSFERT_EXCEPTIONAL_CHARGE = 17,\n EXCEPTIONAL_CHARGE = 18,\n TAX_ON_BENEFIT = 19,\n}\n\nexport const IntermediateManagementRebateSegments: IMRSegment[] = [\n {\n name: 'Chiffre d\\'affaires',\n accounts: ['70'],\n type: IntermediateManagementRebateType.TURNOVER,\n isPositive: true,\n },\n {\n name: 'Ventes + Production réelle',\n },\n {\n name: 'Achats consommés',\n accounts: ['60'],\n isNegative: true,\n type: IntermediateManagementRebateType.BUY,\n },\n {\n name: 'Marge globale',\n },\n {\n name: 'Charges externes',\n accounts: ['61', '62'],\n isNegative: true,\n type: IntermediateManagementRebateType.CHARGE,\n },\n {\n name: 'Valeur ajoutée',\n },\n {\n name: 'Subvention d\\'exploitation',\n accounts: ['74'],\n isPositive: true,\n type: IntermediateManagementRebateType.GRANT,\n },\n {\n name: 'Transfert de charges d’exploitation',\n accounts: ['791', '792', '793', '794', '795'],\n isPositive: true,\n type: IntermediateManagementRebateType.TRANSFERT,\n },\n {\n name: 'Impôts et taxes',\n accounts: ['63'],\n isNegative: true,\n type: IntermediateManagementRebateType.TAX,\n },\n {\n name: 'Charges de personnel',\n accounts: ['64'],\n isNegative: true,\n type: IntermediateManagementRebateType.PERSONAL,\n },\n {\n name: 'Excédent brut d\\'exploitation',\n },\n {\n name: 'Autres produits d\\'exploitation',\n accounts: ['781', '782', '783', '784', '785', '75'],\n isPositive: true,\n type: IntermediateManagementRebateType.PRODUCT,\n },\n {\n name: 'Autres charges d\\'exploitation',\n accounts: ['65'],\n isNegative: true,\n type: IntermediateManagementRebateType.OTHER_CHARGE,\n },\n {\n name: 'Dotations aux amortissements',\n accounts: ['681', '682', '683', '684', '685'],\n isNegative: true,\n type: IntermediateManagementRebateType.OTHER_CHARGE,\n },\n {\n name: 'Résultat d\\'exploitation',\n },\n {\n name: 'Produits financiers',\n accounts: ['76'],\n isPositive: true,\n type: IntermediateManagementRebateType.FINANCIAL_PRODUCT,\n },\n {\n name: 'Reprises sur amort. et provisions financières',\n isPositive: true,\n accounts: ['786'],\n type: IntermediateManagementRebateType.REPRISE,\n },\n {\n name: 'Transfert de charges financières',\n isPositive: true,\n accounts: ['796'],\n type: IntermediateManagementRebateType.TRANSFERT_FINANCIAL_CHARGE,\n },\n {\n name: 'Charges financières',\n type: IntermediateManagementRebateType.FINANCIAL_CHARGE,\n isNegative: true,\n accounts: ['66'],\n },\n {\n name: 'Produits exceptionnels',\n accounts: ['77'],\n isPositive: true,\n type: IntermediateManagementRebateType.EXCEPTIONAL_PRODUCT,\n },\n {\n name: 'Reprises sur amort. et provisions exceptionnels',\n isPositive: true,\n accounts: ['787'],\n type: IntermediateManagementRebateType.REPRISE_PROVISION,\n },\n {\n name: 'Transfert de charges exceptionnelles',\n isPositive: true,\n accounts: ['797'],\n type: IntermediateManagementRebateType.TRANSFERT_EXCEPTIONAL_CHARGE,\n },\n {\n name: 'Charges exceptionnelles',\n accounts: ['67'],\n isNegative: true,\n type: IntermediateManagementRebateType.EXCEPTIONAL_CHARGE,\n },\n {\n name: 'Résultat exceptionnel',\n },\n {\n name: 'Impôts sur les bénéfices',\n accounts: ['695'],\n isNegative: true,\n type: IntermediateManagementRebateType.TAX_ON_BENEFIT,\n },\n {\n name: 'Résultat',\n },\n];"]}
@@ -1,10 +1,11 @@
1
- import { IExercice } from '../..';
1
+ import { IAccountingEntry, IExercice } from '../..';
2
2
  import { IntermediateManagementRebateType } from '../../Enum/IntermediateManagementRebate';
3
3
  export type IMRSegment = {
4
4
  name: string;
5
5
  accounts?: string[];
6
6
  type?: IntermediateManagementRebateType;
7
7
  isPositive?: boolean;
8
+ isNegative?: boolean;
8
9
  };
9
10
  export type IMRSegmentFilled = {
10
11
  name: string;
@@ -26,4 +27,42 @@ export type ReadIMRWithExercices = {
26
27
  };
27
28
  imr: IMRSegmentFilled[];
28
29
  };
30
+ export type IMRExerciceData = {
31
+ exercice: IExercice;
32
+ previousExercice: IExercice | null;
33
+ entries: IAccountingEntry[];
34
+ };
35
+ export type ReadFormattedIMRFilled = {
36
+ name: string;
37
+ amount: number;
38
+ previousAmount: number | undefined;
39
+ percentOfTurnover: number | undefined;
40
+ previousPercentOfTurnover: number | undefined;
41
+ variation: number | undefined;
42
+ type?: IntermediateManagementRebateType | null;
43
+ details: Array<IMRTypeFilled & {
44
+ percentOfTurnover: number;
45
+ previousPercentOfTurnover: number | undefined;
46
+ variation: number | undefined;
47
+ }>;
48
+ };
49
+ export type ReadFormattedIMRFilledWithExercice = {
50
+ exercices: {
51
+ current: IExercice;
52
+ previous: IExercice | null;
53
+ };
54
+ imr: Array<{
55
+ name: string;
56
+ amount: number;
57
+ previousAmount: number | undefined;
58
+ percentOfTurnover: number | undefined;
59
+ previousPercentOfTurnover: number | undefined;
60
+ variation: number | undefined;
61
+ details: Array<IMRTypeFilled & {
62
+ percentOfTurnover: number;
63
+ previousPercentOfTurnover: number | undefined;
64
+ variation: number | undefined;
65
+ }>;
66
+ }>;
67
+ };
29
68
  //# sourceMappingURL=IntermediateManagementRebate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntermediateManagementRebate.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/IntermediateManagementRebate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAE3F,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,gCAAgC,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,gCAAgC,CAAC;IACxC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;CACnC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE;QACT,OAAO,EAAE,SAAS,CAAC;QACnB,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;KAC5B,CAAA;IACD,GAAG,EAAE,gBAAgB,EAAE,CAAC;CACzB,CAAC"}
1
+ {"version":3,"file":"IntermediateManagementRebate.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/IntermediateManagementRebate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAE3F,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,gCAAgC,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,gCAAgC,CAAC;IACxC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,CAA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MAAM,GAAG,SAAS,CAAC;QAC9B,OAAO,EAAE,KAAK,CAAC,aAAa,GAAG;YAC7B,iBAAiB,EAAE,MAAM,CAAC;YAC1B,yBAAyB,EAAE,MAAM,GAAG,SAAS,CAAC;YAC9C,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;SAC/B,CAAC,CAAC;KACJ,CAAC,CAAA;CACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"IntermediateManagementRebate.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/IntermediateManagementRebate.ts"],"names":[],"mappings":"","sourcesContent":["import { IExercice } from '../..';\nimport { IntermediateManagementRebateType } from '../../Enum/IntermediateManagementRebate';\n\nexport type IMRSegment = {\n name: string;\n accounts?: string[];\n type?: IntermediateManagementRebateType;\n isPositive?: boolean;\n};\n\nexport type IMRSegmentFilled = {\n name: string;\n type?: IntermediateManagementRebateType;\n amount: number | undefined;\n previousAmount: number | undefined;\n totalAmount: number;\n totalPreviousAmount: number;\n};\n\nexport type IMRTypeFilled = {\n name: string;\n amount: number;\n previousAmount: number | undefined\n};\n\nexport type ReadIMRWithExercices = { \n exercices: {\n current: IExercice,\n previous: IExercice | null;\n }\n imr: IMRSegmentFilled[];\n};"]}
1
+ {"version":3,"file":"IntermediateManagementRebate.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/IntermediateManagementRebate.ts"],"names":[],"mappings":"","sourcesContent":["import { IAccountingEntry, IExercice } from '../..';\nimport { IntermediateManagementRebateType } from '../../Enum/IntermediateManagementRebate';\n\nexport type IMRSegment = {\n name: string;\n accounts?: string[];\n type?: IntermediateManagementRebateType;\n isPositive?: boolean;\n isNegative?: boolean;\n};\n\nexport type IMRSegmentFilled = {\n name: string;\n type?: IntermediateManagementRebateType;\n amount: number | undefined;\n previousAmount: number | undefined;\n totalAmount: number;\n totalPreviousAmount: number;\n};\n\nexport type IMRTypeFilled = {\n name: string;\n amount: number;\n previousAmount: number | undefined;\n};\n\nexport type ReadIMRWithExercices = { \n exercices: {\n current: IExercice,\n previous: IExercice | null;\n }\n imr: IMRSegmentFilled[];\n};\n\nexport type IMRExerciceData = { exercice: IExercice; previousExercice: IExercice | null; entries: IAccountingEntry[] };\n\n\nexport type ReadFormattedIMRFilled = {\n name: string;\n amount: number;\n previousAmount: number | undefined;\n percentOfTurnover: number | undefined;\n previousPercentOfTurnover: number | undefined;\n variation: number | undefined;\n type?: IntermediateManagementRebateType | null; \n details: Array<IMRTypeFilled & { \n percentOfTurnover: number;\n previousPercentOfTurnover: number | undefined;\n variation: number | undefined;\n }>;\n};\n\nexport type ReadFormattedIMRFilledWithExercice = {\n exercices: {\n current: IExercice,\n previous: IExercice | null;\n };\n imr: Array<{\n name: string;\n amount: number;\n previousAmount: number | undefined;\n percentOfTurnover: number | undefined;\n previousPercentOfTurnover: number | undefined;\n variation: number | undefined;\n details: Array<IMRTypeFilled & { \n percentOfTurnover: number;\n previousPercentOfTurnover: number | undefined;\n variation: number | undefined;\n }>;\n }>\n};"]}
@@ -195,7 +195,7 @@ function generateSignature(params) {
195
195
  let phoneSignature;
196
196
  let horaires;
197
197
  [roleSignature, mailSignature, phoneSignature, horaires] = ['Expert-Comptable', bonjourMail, null, 'Du lundi au vendredi de 9h à 19h'];
198
- if (user.roles && user.roles.some((r) => r.id === Role_1.Role.DATA_OFFICER)) { // Signature data_officer
198
+ if ((user === null || user === void 0 ? void 0 : user.roles) && user.roles.some((r) => r.id === Role_1.Role.DATA_OFFICER)) { // Signature data_officer
199
199
  user = {
200
200
  firstname: `L'équipe ${commercialName}`,
201
201
  isAll: true,
@@ -1 +1 @@
1
- {"version":3,"file":"email.js","sourceRoot":"","sources":["../../../ts/utils/email.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kCAAkC;AAClC,qDAAqD;AACrD,yDAAsD;AACtD,6CAA0C;AAE1C,qCAAuD;AACvD,2DAAgE;AAEhE,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAE3B,SAAS,Y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C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,WAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK;QAC1F,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,WAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1F,SAAS;QACT,kBAAkB;QAClB,SAAS;QACT,WAAW;QACX,cAAc;QACd,IAAI;QACJ,GAAG;QACH,MAAM;QACN,IAAI;QACJ,aAAa;QACb,aAAa;QACb,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;QACjF,sBAAsB,EAAE,sBAAsB,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC;QACzE,QAAQ;QACR,YAAY;QACZ,WAAW;KACZ,CAAC,CAAC;AACL,CAAC;AA5JD,8CA4JC","sourcesContent":["// import * as dayjs from 'dayjs';\n// import { orderBy as orderByLodash } from 'lodash';\nimport { EntityType } from '../types/Enum/EntityType';\nimport { Role } from '../types/Enum/Role';\nimport { IUser } from '../types/Interface/models/IUser';\nimport { getBrandConfig, isItThisEnv } from './brands';\nimport { signatureTemplate } from './email/templates/signature';\n\nconst ejs = require('ejs');\n\nfunction intersection<T>(arr: [T[], T[]]) { return arr.reduce((a: T[], b: T[]) => a.filter((c) => b.includes(c)), []); }\n\nfunction getRoleSignature(user:any) {\n if (user.positionLabel) return user.positionLabel;\n\n const isStagiaireOrAlternant = user.roles.map((r: any) => r.id).includes(Role.INTERN) || user.roles.map((r: any) => r.id).includes(Role.ALTERNATE);\n const isManager = user.roles.map((r: any) => r.id).includes(Role.MANAGER);\n\n const isSocial = user.roles.map((r: any) => r.id).includes(Role.SOCIAL);\n const isJuridic = user.roles.map((r: any) => r.id).includes(Role.JURIDIC);\n const isFacturation = user.roles.map((r: any) => r.id).includes(Role.FACTURATION);\n const isExpert = user.roles.map((r: any) => r.id).includes(Role.EXPERT_ACCOUNTANT);\n const isCS = user.roles.map((r: any) => r.id).includes(Role.CUSTOMER_SUCCESS);\n const isOnBoarder = user.roles.map((r: any) => r.id).includes(Role.ON_BOARDER);\n const isTermination = user.roles.map((r: any) => r.id).includes(Role.TERMINATION);\n const isLitige = user.roles.map((r: any) => r.id).includes(Role.LITIGE);\n const isDataOfficer = user.roles.map((r: any) => r.id).includes(Role.DATA_OFFICER);\n const isSales = user.roles.map((r: any) => r.id).includes(Role.COMMERCIAL);\n const isAdmin = user.roles.map((r: any) => r.id).includes(Role.ADMIN);\n const isFront = !!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS]]).length;\n\n if (isSales && isManager) { return 'Responsable commercial'; }\n if (isSales) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de clientèle`; }\n\n if (isCS && isManager) { return 'Responsable relations clients'; }\n if (isCS) { return `Conseill${user.idCivility === 2 ? 'ère' : 'er'} comptable`; }\n\n if (isOnBoarder && isManager) { return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} accueil clients`; }\n if (isOnBoarder) { return `Chargé${user.idCivility === 2 ? 'e' : ''} accueil clients`; }\n\n if (isTermination && isManager) { return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients`; }\n if (isTermination) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients`; }\n\n if (isLitige && isManager) { return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients (Litige)`; }\n if (isLitige) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients (Litige)`; }\n\n if (isDataOfficer && isManager) { return 'Responsable aide comptable'; }\n if (isDataOfficer) { return 'Aide comptable'; }\n\n if (isFacturation && isStagiaireOrAlternant) { return 'Assistant facturation'; }\n if (isFacturation && isManager) { return 'Responsable facturation'; }\n if (isFacturation) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de facturation`; }\n\n if (isJuridic && isStagiaireOrAlternant) { return 'Assistant juridique'; }\n if (isJuridic && isManager) { return 'Responsable juridique'; }\n if (isJuridic) { return 'Juriste'; }\n\n if (isSocial && isStagiaireOrAlternant) { return 'Assistant paie'; }\n if (isSocial && isManager) { return 'Responsable paie'; }\n if (isSocial) { return 'Gestionnaire de paie'; }\n\n if (isExpert) { return `Expert${user.idCivility === 2 ? 'e' : ''}-comptable`; }\n\n if (isAdmin) { return 'Développeur web'; }\n\n if (isFront && isManager) return 'Responsable comptable';\n if (isFront && isStagiaireOrAlternant) return 'Assistant comptable';\n if (isFront) return `Comptable dédié${user.idCivility === 2 ? 'e' : ''}`;\n return `Comptable dédié${user.idCivility === 2 ? 'e' : ''}`;\n}\n\nfunction getHoraires(user:IUser) { // On affiche les horaires uniquement pour les front, et pas pour les TVA\n\n if (isItThisEnv('Pourcentage') && user?.entity && [EntityType.COMPTALIB, EntityType.AMEX, EntityType.CABINET_RONCHIERI_LANDRA].includes(user.entity)) {\n return 'Du lundi au vendredi de 9h à 18h';\n }\n \n return 'Du lundi au vendredi de 9h à 19h';\n\n // if (!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.COMMERCIAL]]).length) return 'Du lundi au vendredi de 9h à 19h';\n\n // if (!user.workingSchedules.length) return 'Du lundi au vendredi de 9h à 19h';\n\n // let reducedSchedules = user.workingSchedules.reduce((acc: any, e:any, index: number) => {\n // const name = `${dayjs(e.morningStart, 'HH:mm:ss').format('HH:mm')}-${dayjs(e.afternoonEnd || e.morningEnd, 'HH:mm:ss').format('HH:mm')}`;\n // if (!acc[name]) acc[name] = [index];\n // else acc[name].push(index);\n // return acc;\n // }, {});\n\n // reducedSchedules = orderByLodash(reducedSchedules, (elem) => elem.length, ['desc']);\n\n // let resultHoraire = '';\n // let startH;\n // let startM;\n // let endH;\n // let endM;\n // let firstDayOfWeek;\n // let lastDayOfWeek;\n\n // reducedSchedules.forEach((schedule: any, index: number) => {\n // startH = dayjs(user.workingSchedules[schedule[0]].morningStart ? user.workingSchedules[schedule[0]].morningStart : user.workingSchedules[schedule[0]].afternoonStart, 'HH:mm:ss').get('hour');\n // startM = dayjs(user.workingSchedules[schedule[0]].morningStart ? user.workingSchedules[schedule[0]].morningStart : user.workingSchedules[schedule[0]].afternoonStart, 'HH:mm:ss').get('minute');\n // endH = dayjs(user.workingSchedules[schedule[0]].afternoonEnd || user.workingSchedules[schedule[0]].morningEnd, 'HH:mm:ss').get('hour');\n // endM = dayjs(user.workingSchedules[schedule[0]].afternoonEnd || user.workingSchedules[schedule[0]].morningEnd, 'HH:mm:ss').get('minute');\n // firstDayOfWeek = dayjs().locale('fr').day(user.workingSchedules[schedule[0]].idDay).format('dddd');\n // if (!index) {\n // // pour le premier index, on affiche l'amplitude horaire la plus commune, du XX au XX de Xh à Xh\n // lastDayOfWeek = dayjs().locale('fr').day(user.workingSchedules[user.workingSchedules.length - 1].idDay).format('dddd');\n // resultHoraire += `Du ${firstDayOfWeek} au ${lastDayOfWeek} de ${startH}h${startM > 0 ? startM : ''} à ${endH}h${endM > 0 ? endM : ''}`;\n // } else { // Fonctionnel si uniquement un jour par semaine avec des horaires différents\n // resultHoraire += `<br/>Le ${firstDayOfWeek} de ${startH}h${startM > 0 ? startM : ''} à ${endH}h${endM > 0 ? endM : ''}`;\n // }\n // });\n // return resultHoraire;\n}\n\nfunction getMailSignature(user:any, idTypeBrand:number) {\n const informatiqueMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.informatique',\n }) as unknown as string;\n const bonjourMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.bonjour',\n }) as unknown as string;\n\n if (user.roles.map((r: any) => r.id).includes(Role.ADMIN)) { return informatiqueMail; }\n if (user && !!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.DATA_OFFICER, Role.COMMERCIAL]]).length) return user.email;\n return bonjourMail;\n}\n\nfunction getPhoneSignature(user:any) {\n if (user.phone !== '0383931414') { return user.phone.replace(/\\B(?=(\\d{2})+(?!\\d))/g, '&nbsp;'); }\n return null;\n}\n\nexport function generateSignature(params: any): string {\n const {\n forceRole = null, idTypeBrand = 1, ...otherParams\n } = params;\n let {\n user,\n } = otherParams;\n \n const hostS3 = getBrandConfig({\n idTypeBrand,\n objectWaited: 'urlS3',\n });\n\n const brandName = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'name',\n }) as unknown as string;\n const brandPostalAddress = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'companyInformation.postalAddress',\n }) as unknown as string;\n const brandCity = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'companyInformation.city',\n }) as unknown as string;\n const commercialName = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'commercialName',\n }) as unknown as string;\n const iban = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'bank.IBAN',\n }) as unknown as string;\n const bic = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'bank.BIC',\n }) as unknown as string;\n const bonjourMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.bonjour',\n }) as unknown as string;\n const socialMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.social',\n }) as unknown as string;\n const dataOfficerMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.gestion',\n }) as unknown as string;\n const supportMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.support',\n }) as unknown as string;\n const juridiqueMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.juridique',\n }) as unknown as string;\n const facturationMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.facturation',\n }) as unknown as string;\n const primaryColor = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'colors.primary',\n }) as unknown as string;\n const standardPhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.contact',\n }) as unknown as string;\n const juridiquePhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.juridique',\n }) as unknown as string;\n const socialPhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.social',\n }) as unknown as string;\n\n let roleSignature: string | null;\n let mailSignature: string | null;\n let phoneSignature: string | null;\n let horaires: string | null;\n [roleSignature, mailSignature, phoneSignature, horaires] = ['Expert-Comptable', bonjourMail, null, 'Du lundi au vendredi de 9h à 19h'];\n\n if (user.roles && user.roles.some((r: any) => r.id === Role.DATA_OFFICER)) { // Signature data_officer\n user = {\n firstname: `L'équipe ${commercialName}`,\n isAll: true,\n };\n mailSignature = dataOfficerMail;\n roleSignature = '';\n } else if (forceRole === 'social') { // Signature social\n user = {\n firstname: 'Service social',\n isAll: true,\n };\n mailSignature = socialMail;\n roleSignature = '';\n phoneSignature = socialPhoneSignature;\n } else if (forceRole === 'support') { // Signature support\n user = {\n firstname: 'Service Support',\n isAll: true,\n };\n mailSignature = supportMail;\n roleSignature = null;\n } else if (forceRole === 'juridique') { // Signature juridique\n user = {\n firstname: 'Service juridique',\n isAll: true,\n };\n mailSignature = juridiqueMail;\n roleSignature = null;\n phoneSignature = juridiquePhoneSignature;\n } else if (forceRole === 'facturation') { // Signature facturation\n user = {\n firstname: 'Service facturation',\n isAll: true,\n };\n mailSignature = facturationMail;\n roleSignature = null;\n phoneSignature = standardPhoneSignature;\n } else if (!user) { // Signature Clementine\n user = {\n firstname: `L'équipe ${commercialName}`,\n isAll: true,\n };\n roleSignature = '';\n } else if (user !== 0) { // Signature par défaut\n roleSignature = getRoleSignature(user);\n mailSignature = getMailSignature(user, idTypeBrand);\n horaires = getHoraires(user);\n phoneSignature = getPhoneSignature(user);\n }\n\n return ejs.render(signatureTemplate, {\n forceRole,\n isFacturation: user.roles ? user.roles.some((r: any) => r.id === Role.FACTURATION) : false,\n isDataOfficer: user.roles ? user.roles.some((r: any) => r.id === Role.DATA_OFFICER) : true,\n brandName,\n brandPostalAddress,\n brandCity,\n idTypeBrand,\n commercialName,\n iban,\n bic,\n hostS3,\n user,\n roleSignature,\n mailSignature,\n phoneSignature: phoneSignature ? phoneSignature.replace(/\\s+/gm, '&nbsp;') : null,\n standardPhoneSignature: standardPhoneSignature.replace(/\\s+/gm, '&nbsp;'),\n horaires,\n primaryColor,\n supportMail,\n });\n}"]}
1
+ {"version":3,"file":"email.js","sourceRoot":"","sources":["../../../ts/utils/email.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kCAAkC;AAClC,qDAAqD;AACrD,yDAAsD;AACtD,6CAA0C;AAE1C,qCAAuD;AACvD,2DAAgE;AAEhE,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAE3B,SAAS,YAAY,CAAI,GAAe,IAAI,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAM,EAAE,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAExH,SAAS,gBAAgB,CAAC,IAAQ;IAChC,IAAI,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAC,aAAa,CA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,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1F,SAAS;QACT,kBAAkB;QAClB,SAAS;QACT,WAAW;QACX,cAAc;QACd,IAAI;QACJ,GAAG;QACH,MAAM;QACN,IAAI;QACJ,aAAa;QACb,aAAa;QACb,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;QACjF,sBAAsB,EAAE,sBAAsB,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC;QACzE,QAAQ;QACR,YAAY;QACZ,WAAW;KACZ,CAAC,CAAC;AACL,CAAC;AA5JD,8CA4JC","sourcesContent":["// import * as dayjs from 'dayjs';\n// import { orderBy as orderByLodash } from 'lodash';\nimport { EntityType } from '../types/Enum/EntityType';\nimport { Role } from '../types/Enum/Role';\nimport { IUser } from '../types/Interface/models/IUser';\nimport { getBrandConfig, isItThisEnv } from './brands';\nimport { signatureTemplate } from './email/templates/signature';\n\nconst ejs = require('ejs');\n\nfunction intersection<T>(arr: [T[], T[]]) { return arr.reduce((a: T[], b: T[]) => a.filter((c) => b.includes(c)), []); }\n\nfunction getRoleSignature(user:any) {\n if (user.positionLabel) return user.positionLabel;\n\n const isStagiaireOrAlternant = user.roles.map((r: any) => r.id).includes(Role.INTERN) || user.roles.map((r: any) => r.id).includes(Role.ALTERNATE);\n const isManager = user.roles.map((r: any) => r.id).includes(Role.MANAGER);\n\n const isSocial = user.roles.map((r: any) => r.id).includes(Role.SOCIAL);\n const isJuridic = user.roles.map((r: any) => r.id).includes(Role.JURIDIC);\n const isFacturation = user.roles.map((r: any) => r.id).includes(Role.FACTURATION);\n const isExpert = user.roles.map((r: any) => r.id).includes(Role.EXPERT_ACCOUNTANT);\n const isCS = user.roles.map((r: any) => r.id).includes(Role.CUSTOMER_SUCCESS);\n const isOnBoarder = user.roles.map((r: any) => r.id).includes(Role.ON_BOARDER);\n const isTermination = user.roles.map((r: any) => r.id).includes(Role.TERMINATION);\n const isLitige = user.roles.map((r: any) => r.id).includes(Role.LITIGE);\n const isDataOfficer = user.roles.map((r: any) => r.id).includes(Role.DATA_OFFICER);\n const isSales = user.roles.map((r: any) => r.id).includes(Role.COMMERCIAL);\n const isAdmin = user.roles.map((r: any) => r.id).includes(Role.ADMIN);\n const isFront = !!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS]]).length;\n\n if (isSales && isManager) { return 'Responsable commercial'; }\n if (isSales) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de clientèle`; }\n\n if (isCS && isManager) { return 'Responsable relations clients'; }\n if (isCS) { return `Conseill${user.idCivility === 2 ? 'ère' : 'er'} comptable`; }\n\n if (isOnBoarder && isManager) { return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} accueil clients`; }\n if (isOnBoarder) { return `Chargé${user.idCivility === 2 ? 'e' : ''} accueil clients`; }\n\n if (isTermination && isManager) { return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients`; }\n if (isTermination) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients`; }\n\n if (isLitige && isManager) { return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients (Litige)`; }\n if (isLitige) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients (Litige)`; }\n\n if (isDataOfficer && isManager) { return 'Responsable aide comptable'; }\n if (isDataOfficer) { return 'Aide comptable'; }\n\n if (isFacturation && isStagiaireOrAlternant) { return 'Assistant facturation'; }\n if (isFacturation && isManager) { return 'Responsable facturation'; }\n if (isFacturation) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de facturation`; }\n\n if (isJuridic && isStagiaireOrAlternant) { return 'Assistant juridique'; }\n if (isJuridic && isManager) { return 'Responsable juridique'; }\n if (isJuridic) { return 'Juriste'; }\n\n if (isSocial && isStagiaireOrAlternant) { return 'Assistant paie'; }\n if (isSocial && isManager) { return 'Responsable paie'; }\n if (isSocial) { return 'Gestionnaire de paie'; }\n\n if (isExpert) { return `Expert${user.idCivility === 2 ? 'e' : ''}-comptable`; }\n\n if (isAdmin) { return 'Développeur web'; }\n\n if (isFront && isManager) return 'Responsable comptable';\n if (isFront && isStagiaireOrAlternant) return 'Assistant comptable';\n if (isFront) return `Comptable dédié${user.idCivility === 2 ? 'e' : ''}`;\n return `Comptable dédié${user.idCivility === 2 ? 'e' : ''}`;\n}\n\nfunction getHoraires(user:IUser) { // On affiche les horaires uniquement pour les front, et pas pour les TVA\n\n if (isItThisEnv('Pourcentage') && user?.entity && [EntityType.COMPTALIB, EntityType.AMEX, EntityType.CABINET_RONCHIERI_LANDRA].includes(user.entity)) {\n return 'Du lundi au vendredi de 9h à 18h';\n }\n \n return 'Du lundi au vendredi de 9h à 19h';\n\n // if (!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.COMMERCIAL]]).length) return 'Du lundi au vendredi de 9h à 19h';\n\n // if (!user.workingSchedules.length) return 'Du lundi au vendredi de 9h à 19h';\n\n // let reducedSchedules = user.workingSchedules.reduce((acc: any, e:any, index: number) => {\n // const name = `${dayjs(e.morningStart, 'HH:mm:ss').format('HH:mm')}-${dayjs(e.afternoonEnd || e.morningEnd, 'HH:mm:ss').format('HH:mm')}`;\n // if (!acc[name]) acc[name] = [index];\n // else acc[name].push(index);\n // return acc;\n // }, {});\n\n // reducedSchedules = orderByLodash(reducedSchedules, (elem) => elem.length, ['desc']);\n\n // let resultHoraire = '';\n // let startH;\n // let startM;\n // let endH;\n // let endM;\n // let firstDayOfWeek;\n // let lastDayOfWeek;\n\n // reducedSchedules.forEach((schedule: any, index: number) => {\n // startH = dayjs(user.workingSchedules[schedule[0]].morningStart ? user.workingSchedules[schedule[0]].morningStart : user.workingSchedules[schedule[0]].afternoonStart, 'HH:mm:ss').get('hour');\n // startM = dayjs(user.workingSchedules[schedule[0]].morningStart ? user.workingSchedules[schedule[0]].morningStart : user.workingSchedules[schedule[0]].afternoonStart, 'HH:mm:ss').get('minute');\n // endH = dayjs(user.workingSchedules[schedule[0]].afternoonEnd || user.workingSchedules[schedule[0]].morningEnd, 'HH:mm:ss').get('hour');\n // endM = dayjs(user.workingSchedules[schedule[0]].afternoonEnd || user.workingSchedules[schedule[0]].morningEnd, 'HH:mm:ss').get('minute');\n // firstDayOfWeek = dayjs().locale('fr').day(user.workingSchedules[schedule[0]].idDay).format('dddd');\n // if (!index) {\n // // pour le premier index, on affiche l'amplitude horaire la plus commune, du XX au XX de Xh à Xh\n // lastDayOfWeek = dayjs().locale('fr').day(user.workingSchedules[user.workingSchedules.length - 1].idDay).format('dddd');\n // resultHoraire += `Du ${firstDayOfWeek} au ${lastDayOfWeek} de ${startH}h${startM > 0 ? startM : ''} à ${endH}h${endM > 0 ? endM : ''}`;\n // } else { // Fonctionnel si uniquement un jour par semaine avec des horaires différents\n // resultHoraire += `<br/>Le ${firstDayOfWeek} de ${startH}h${startM > 0 ? startM : ''} à ${endH}h${endM > 0 ? endM : ''}`;\n // }\n // });\n // return resultHoraire;\n}\n\nfunction getMailSignature(user:any, idTypeBrand:number) {\n const informatiqueMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.informatique',\n }) as unknown as string;\n const bonjourMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.bonjour',\n }) as unknown as string;\n\n if (user.roles.map((r: any) => r.id).includes(Role.ADMIN)) { return informatiqueMail; }\n if (user && !!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.DATA_OFFICER, Role.COMMERCIAL]]).length) return user.email;\n return bonjourMail;\n}\n\nfunction getPhoneSignature(user:any) {\n if (user.phone !== '0383931414') { return user.phone.replace(/\\B(?=(\\d{2})+(?!\\d))/g, '&nbsp;'); }\n return null;\n}\n\nexport function generateSignature(params: any): string {\n const {\n forceRole = null, idTypeBrand = 1, ...otherParams\n } = params;\n let {\n user,\n } = otherParams;\n \n const hostS3 = getBrandConfig({\n idTypeBrand,\n objectWaited: 'urlS3',\n });\n\n const brandName = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'name',\n }) as unknown as string;\n const brandPostalAddress = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'companyInformation.postalAddress',\n }) as unknown as string;\n const brandCity = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'companyInformation.city',\n }) as unknown as string;\n const commercialName = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'commercialName',\n }) as unknown as string;\n const iban = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'bank.IBAN',\n }) as unknown as string;\n const bic = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'bank.BIC',\n }) as unknown as string;\n const bonjourMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.bonjour',\n }) as unknown as string;\n const socialMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.social',\n }) as unknown as string;\n const dataOfficerMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.gestion',\n }) as unknown as string;\n const supportMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.support',\n }) as unknown as string;\n const juridiqueMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.juridique',\n }) as unknown as string;\n const facturationMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.facturation',\n }) as unknown as string;\n const primaryColor = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'colors.primary',\n }) as unknown as string;\n const standardPhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.contact',\n }) as unknown as string;\n const juridiquePhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.juridique',\n }) as unknown as string;\n const socialPhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.social',\n }) as unknown as string;\n\n let roleSignature: string | null;\n let mailSignature: string | null;\n let phoneSignature: string | null;\n let horaires: string | null;\n [roleSignature, mailSignature, phoneSignature, horaires] = ['Expert-Comptable', bonjourMail, null, 'Du lundi au vendredi de 9h à 19h'];\n \n if (user?.roles && user.roles.some((r: any) => r.id === Role.DATA_OFFICER)) { // Signature data_officer\n user = {\n firstname: `L'équipe ${commercialName}`,\n isAll: true,\n };\n mailSignature = dataOfficerMail;\n roleSignature = '';\n } else if (forceRole === 'social') { // Signature social\n user = {\n firstname: 'Service social',\n isAll: true,\n };\n mailSignature = socialMail;\n roleSignature = '';\n phoneSignature = socialPhoneSignature;\n } else if (forceRole === 'support') { // Signature support\n user = {\n firstname: 'Service Support',\n isAll: true,\n };\n mailSignature = supportMail;\n roleSignature = null;\n } else if (forceRole === 'juridique') { // Signature juridique\n user = {\n firstname: 'Service juridique',\n isAll: true,\n };\n mailSignature = juridiqueMail;\n roleSignature = null;\n phoneSignature = juridiquePhoneSignature;\n } else if (forceRole === 'facturation') { // Signature facturation\n user = {\n firstname: 'Service facturation',\n isAll: true,\n };\n mailSignature = facturationMail;\n roleSignature = null;\n phoneSignature = standardPhoneSignature;\n } else if (!user) { // Signature Clementine\n user = {\n firstname: `L'équipe ${commercialName}`,\n isAll: true,\n };\n roleSignature = '';\n } else if (user !== 0) { // Signature par défaut\n roleSignature = getRoleSignature(user);\n mailSignature = getMailSignature(user, idTypeBrand);\n horaires = getHoraires(user);\n phoneSignature = getPhoneSignature(user);\n }\n\n return ejs.render(signatureTemplate, {\n forceRole,\n isFacturation: user.roles ? user.roles.some((r: any) => r.id === Role.FACTURATION) : false,\n isDataOfficer: user.roles ? user.roles.some((r: any) => r.id === Role.DATA_OFFICER) : true,\n brandName,\n brandPostalAddress,\n brandCity,\n idTypeBrand,\n commercialName,\n iban,\n bic,\n hostS3,\n user,\n roleSignature,\n mailSignature,\n phoneSignature: phoneSignature ? phoneSignature.replace(/\\s+/gm, '&nbsp;') : null,\n standardPhoneSignature: standardPhoneSignature.replace(/\\s+/gm, '&nbsp;'),\n horaires,\n primaryColor,\n supportMail,\n });\n}"]}
@@ -1,7 +1,9 @@
1
- import { IMRTypeFilled, IntermediateManagementRebateType, ReadIMRWithExercices } from '../../types';
1
+ /// <reference types="node" />
2
+ import { IMRTypeFilled, IntermediateManagementRebateType, ReadFormattedIMRFilledWithExercice } from '../../types';
2
3
  import { Resource } from '../Resource';
3
4
  export declare class IntermediateManagementRebate extends Resource {
4
- get(idExercice: number): Promise<ReadIMRWithExercices>;
5
+ get(idExercice: number): Promise<ReadFormattedIMRFilledWithExercice[]>;
5
6
  getByType(idExercice: number, type: IntermediateManagementRebateType): Promise<IMRTypeFilled[]>;
7
+ getFile(idExercice: number): Promise<Buffer>;
6
8
  }
7
9
  //# sourceMappingURL=IntermediateManagementRebate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntermediateManagementRebate.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/IntermediateManagementRebate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gCAAgC,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,4BAA6B,SAAQ,QAAQ;IAExD,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAItD,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,gCAAgC,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAIhG"}
1
+ {"version":3,"file":"IntermediateManagementRebate.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/IntermediateManagementRebate.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,gCAAgC,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAC;AAClH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,4BAA6B,SAAQ,QAAQ;IAExD,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,kCAAkC,EAAE,CAAC;IAItE,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,gCAAgC,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAI/F,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAI7C"}
@@ -6,5 +6,8 @@ export class IntermediateManagementRebate extends Resource {
6
6
  getByType(idExercice, type) {
7
7
  return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates/${type}`);
8
8
  }
9
+ getFile(idExercice) {
10
+ return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates/file`);
11
+ }
9
12
  }
10
13
  //# sourceMappingURL=IntermediateManagementRebate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntermediateManagementRebate.js","sourceRoot":"","sources":["../../../../ts/api/resources/IntermediateManagementRebate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,OAAO,4BAA6B,SAAQ,QAAQ;IAExD,GAAG,CAAC,UAAkB;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,UAAU,kCAAkC,CAAC,CAAC;IACrF,CAAC;IAED,SAAS,CAAC,UAAkB,EAAE,IAAsC;QAClE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,UAAU,oCAAoC,IAAI,EAAE,CAAC,CAAC;IAC7F,CAAC;CAEF","sourcesContent":["import { IMRTypeFilled, IntermediateManagementRebateType, ReadIMRWithExercices } from '../../types';\nimport { Resource } from '../Resource';\n\nexport class IntermediateManagementRebate extends Resource {\n \n get(idExercice: number): Promise<ReadIMRWithExercices> {\n return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates`);\n }\n\n getByType(idExercice: number, type: IntermediateManagementRebateType): Promise<IMRTypeFilled[]> {\n return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates/${type}`);\n }\n\n}"]}
1
+ {"version":3,"file":"IntermediateManagementRebate.js","sourceRoot":"","sources":["../../../../ts/api/resources/IntermediateManagementRebate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,OAAO,4BAA6B,SAAQ,QAAQ;IAExD,GAAG,CAAC,UAAkB;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,UAAU,kCAAkC,CAAC,CAAC;IACrF,CAAC;IAED,SAAS,CAAC,UAAkB,EAAE,IAAsC;QAClE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,UAAU,oCAAoC,IAAI,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED,OAAO,CAAC,UAAkB;QACxB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,UAAU,uCAAuC,CAAC,CAAC;IAC1F,CAAC;CAEF","sourcesContent":["import { IMRTypeFilled, IntermediateManagementRebateType, ReadFormattedIMRFilledWithExercice } from '../../types';\nimport { Resource } from '../Resource';\n\nexport class IntermediateManagementRebate extends Resource {\n \n get(idExercice: number): Promise<ReadFormattedIMRFilledWithExercice[]> {\n return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates`);\n }\n\n getByType(idExercice: number, type: IntermediateManagementRebateType): Promise<IMRTypeFilled[]> {\n return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates/${type}`);\n }\n\n getFile(idExercice: number): Promise<Buffer> {\n return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates/file`);\n }\n\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IntermediateManagementRebate.d.ts","sourceRoot":"","sources":["../../../../ts/types/Enum/IntermediateManagementRebate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAE3E,oBAAY,gCAAgC;IAC1C,QAAQ,IAAI;IACZ,GAAG,IAAI;IACP,MAAM,IAAI;IACV,KAAK,IAAI;IACT,SAAS,IAAI;IACb,GAAG,IAAI;IACP,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,YAAY,IAAI;IAChB,YAAY,KAAK;IACjB,iBAAiB,KAAK;IACtB,OAAO,KAAK;IACZ,0BAA0B,KAAK;IAC/B,gBAAgB,KAAK;IACrB,mBAAmB,KAAK;IACxB,iBAAiB,KAAK;IACtB,4BAA4B,KAAK;IACjC,kBAAkB,KAAK;IACvB,cAAc,KAAK;CACpB;AAED,eAAO,MAAM,oCAAoC,EAAE,UAAU,EA8H5D,CAAC"}
1
+ {"version":3,"file":"IntermediateManagementRebate.d.ts","sourceRoot":"","sources":["../../../../ts/types/Enum/IntermediateManagementRebate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAE3E,oBAAY,gCAAgC;IAC1C,QAAQ,IAAI;IACZ,GAAG,IAAI;IACP,MAAM,IAAI;IACV,KAAK,IAAI;IACT,SAAS,IAAI;IACb,GAAG,IAAI;IACP,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,YAAY,IAAI;IAChB,YAAY,KAAK;IACjB,iBAAiB,KAAK;IACtB,OAAO,KAAK;IACZ,0BAA0B,KAAK;IAC/B,gBAAgB,KAAK;IACrB,mBAAmB,KAAK;IACxB,iBAAiB,KAAK;IACtB,4BAA4B,KAAK;IACjC,kBAAkB,KAAK;IACvB,cAAc,KAAK;CACpB;AAED,eAAO,MAAM,oCAAoC,EAAE,UAAU,EAwI5D,CAAC"}
@@ -25,6 +25,7 @@ export const IntermediateManagementRebateSegments = [
25
25
  name: 'Chiffre d\'affaires',
26
26
  accounts: ['70'],
27
27
  type: IntermediateManagementRebateType.TURNOVER,
28
+ isPositive: true,
28
29
  },
29
30
  {
30
31
  name: 'Ventes + Production réelle',
@@ -32,6 +33,7 @@ export const IntermediateManagementRebateSegments = [
32
33
  {
33
34
  name: 'Achats consommés',
34
35
  accounts: ['60'],
36
+ isNegative: true,
35
37
  type: IntermediateManagementRebateType.BUY,
36
38
  },
37
39
  {
@@ -40,6 +42,7 @@ export const IntermediateManagementRebateSegments = [
40
42
  {
41
43
  name: 'Charges externes',
42
44
  accounts: ['61', '62'],
45
+ isNegative: true,
43
46
  type: IntermediateManagementRebateType.CHARGE,
44
47
  },
45
48
  {
@@ -60,11 +63,13 @@ export const IntermediateManagementRebateSegments = [
60
63
  {
61
64
  name: 'Impôts et taxes',
62
65
  accounts: ['63'],
66
+ isNegative: true,
63
67
  type: IntermediateManagementRebateType.TAX,
64
68
  },
65
69
  {
66
70
  name: 'Charges de personnel',
67
71
  accounts: ['64'],
72
+ isNegative: true,
68
73
  type: IntermediateManagementRebateType.PERSONAL,
69
74
  },
70
75
  {
@@ -79,11 +84,13 @@ export const IntermediateManagementRebateSegments = [
79
84
  {
80
85
  name: 'Autres charges d\'exploitation',
81
86
  accounts: ['65'],
87
+ isNegative: true,
82
88
  type: IntermediateManagementRebateType.OTHER_CHARGE,
83
89
  },
84
90
  {
85
91
  name: 'Dotations aux amortissements',
86
92
  accounts: ['681', '682', '683', '684', '685'],
93
+ isNegative: true,
87
94
  type: IntermediateManagementRebateType.OTHER_CHARGE,
88
95
  },
89
96
  {
@@ -110,6 +117,7 @@ export const IntermediateManagementRebateSegments = [
110
117
  {
111
118
  name: 'Charges financières',
112
119
  type: IntermediateManagementRebateType.FINANCIAL_CHARGE,
120
+ isNegative: true,
113
121
  accounts: ['66'],
114
122
  },
115
123
  {
@@ -133,6 +141,7 @@ export const IntermediateManagementRebateSegments = [
133
141
  {
134
142
  name: 'Charges exceptionnelles',
135
143
  accounts: ['67'],
144
+ isNegative: true,
136
145
  type: IntermediateManagementRebateType.EXCEPTIONAL_CHARGE,
137
146
  },
138
147
  {
@@ -141,6 +150,7 @@ export const IntermediateManagementRebateSegments = [
141
150
  {
142
151
  name: 'Impôts sur les bénéfices',
143
152
  accounts: ['695'],
153
+ isNegative: true,
144
154
  type: IntermediateManagementRebateType.TAX_ON_BENEFIT,
145
155
  },
146
156
  {
@@ -1 +1 @@
1
- {"version":3,"file":"IntermediateManagementRebate.js","sourceRoot":"","sources":["../../../../ts/types/Enum/IntermediateManagementRebate.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,gCAoBX;AApBD,WAAY,gCAAgC;IAC1C,+FAAY,CAAA;IACZ,qFAAO,CAAA;IACP,2FAAU,CAAA;IACV,yFAAS,CAAA;IACT,iGAAa,CAAA;IACb,qFAAO,CAAA;IACP,+FAAY,CAAA;IACZ,6FAAW,CAAA;IACX,uGAAgB,CAAA;IAChB,wGAAiB,CAAA;IACjB,kHAAsB,CAAA;IACtB,8FAAY,CAAA;IACZ,oIAA+B,CAAA;IAC/B,gHAAqB,CAAA;IACrB,sHAAwB,CAAA;IACxB,kHAAsB,CAAA;IACtB,wIAAiC,CAAA;IACjC,oHAAuB,CAAA;IACvB,4GAAmB,CAAA;AACrB,CAAC,EApBW,gCAAgC,KAAhC,gCAAgC,QAoB3C;AAED,MAAM,CAAC,MAAM,oCAAoC,GAAiB;IAChE;QACE,IAAI,EAAE,qBAAqB;QAC3B,QAAQ,EAAE,CAAC,IAAI,CAAC;QAChB,IAAI,EAAE,gCAAgC,CAAC,QAAQ;KAChD;IACD;QACE,IAAI,EAAE,4BAA4B;KACnC;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,QAAQ,EAAE,CAAC,IAAI,CAAC;QAChB,IAAI,EAAE,gCAAg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AAC,KAAK,CAAC;QACjB,IAAI,EAAE,gCAAgC,CAAC,cAAc;KACtD;IACD;QACE,IAAI,EAAE,UAAU;KACjB;CACF,CAAC","sourcesContent":["import { IMRSegment } from '../Interface/api/IntermediateManagementRebate';\n\nexport enum IntermediateManagementRebateType {\n TURNOVER = 1,\n BUY = 2,\n CHARGE = 3,\n GRANT = 4,\n TRANSFERT = 5,\n TAX = 6,\n PERSONAL = 7,\n PRODUCT = 8,\n OTHER_CHARGE = 9,\n AMORTIZATION = 10,\n FINANCIAL_PRODUCT = 11,\n REPRISE = 12,\n TRANSFERT_FINANCIAL_CHARGE = 13,\n FINANCIAL_CHARGE = 14,\n EXCEPTIONAL_PRODUCT = 15,\n REPRISE_PROVISION = 16,\n TRANSFERT_EXCEPTIONAL_CHARGE = 17,\n EXCEPTIONAL_CHARGE = 18,\n TAX_ON_BENEFIT = 19,\n}\n\nexport const IntermediateManagementRebateSegments: IMRSegment[] = [\n {\n name: 'Chiffre d\\'affaires',\n accounts: ['70'],\n type: IntermediateManagementRebateType.TURNOVER,\n },\n {\n name: 'Ventes + Production réelle',\n },\n {\n name: 'Achats consommés',\n accounts: ['60'],\n type: IntermediateManagementRebateType.BUY,\n },\n {\n name: 'Marge globale',\n },\n {\n name: 'Charges externes',\n accounts: ['61', '62'],\n type: IntermediateManagementRebateType.CHARGE,\n },\n {\n name: 'Valeur ajoutée',\n },\n {\n name: 'Subvention d\\'exploitation',\n accounts: ['74'],\n isPositive: true,\n type: IntermediateManagementRebateType.GRANT,\n },\n {\n name: 'Transfert de charges d’exploitation',\n accounts: ['791', '792', '793', '794', '795'],\n isPositive: true,\n type: IntermediateManagementRebateType.TRANSFERT,\n },\n {\n name: 'Impôts et taxes',\n accounts: ['63'],\n type: IntermediateManagementRebateType.TAX,\n },\n {\n name: 'Charges de personnel',\n accounts: ['64'],\n type: IntermediateManagementRebateType.PERSONAL,\n },\n {\n name: 'Excédent brut d\\'exploitation',\n },\n {\n name: 'Autres produits d\\'exploitation',\n accounts: ['781', '782', '783', '784', '785', '75'],\n isPositive: true,\n type: IntermediateManagementRebateType.PRODUCT,\n },\n {\n name: 'Autres charges d\\'exploitation',\n accounts: ['65'],\n type: IntermediateManagementRebateType.OTHER_CHARGE,\n },\n {\n name: 'Dotations aux amortissements',\n accounts: ['681', '682', '683', '684', '685'],\n type: IntermediateManagementRebateType.OTHER_CHARGE,\n },\n {\n name: 'Résultat d\\'exploitation',\n },\n {\n name: 'Produits financiers',\n accounts: ['76'],\n isPositive: true,\n type: IntermediateManagementRebateType.FINANCIAL_PRODUCT,\n },\n {\n name: 'Reprises sur amort. et provisions financières',\n isPositive: true,\n accounts: ['786'],\n type: IntermediateManagementRebateType.REPRISE,\n },\n {\n name: 'Transfert de charges financières',\n isPositive: true,\n accounts: ['796'],\n type: IntermediateManagementRebateType.TRANSFERT_FINANCIAL_CHARGE,\n },\n {\n name: 'Charges financières',\n type: IntermediateManagementRebateType.FINANCIAL_CHARGE,\n accounts: ['66'],\n },\n {\n name: 'Produits exceptionnels',\n accounts: ['77'],\n isPositive: true,\n type: IntermediateManagementRebateType.EXCEPTIONAL_PRODUCT,\n },\n {\n name: 'Reprises sur amort. et provisions exceptionnels',\n isPositive: true,\n accounts: ['787'],\n type: IntermediateManagementRebateType.REPRISE_PROVISION,\n },\n {\n name: 'Transfert de charges exceptionnelles',\n isPositive: true,\n accounts: ['797'],\n type: IntermediateManagementRebateType.TRANSFERT_EXCEPTIONAL_CHARGE,\n },\n {\n name: 'Charges exceptionnelles',\n accounts: ['67'],\n type: IntermediateManagementRebateType.EXCEPTIONAL_CHARGE,\n },\n {\n name: 'Résultat exceptionnel',\n },\n {\n name: 'Impôts sur les bénéfices',\n accounts: ['695'],\n type: IntermediateManagementRebateType.TAX_ON_BENEFIT,\n },\n {\n name: 'Résultat',\n },\n];"]}
1
+ {"version":3,"file":"IntermediateManagementRebate.js","sourceRoot":"","sources":["../../../../ts/types/Enum/IntermediateManagementRebate.ts"],"names":[],"mappings":"AAEA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QACjB,IAAI,EAAE,gCAAgC,CAAC,OAAO;KAC/C;IACD;QACE,IAAI,EAAE,kCAAkC;QACxC,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,IAAI,EAAE,gCAAgC,CAAC,0BAA0B;KAClE;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,gCAAgC,CAAC,gBAAgB;QACvD,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,CAAC,IAAI,CAAC;KACjB;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,QAAQ,EAAE,CAAC,IAAI,CAAC;QAChB,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,gCAAgC,CAAC,mBAAmB;KAC3D;IACD;QACE,IAAI,EAAE,iDAAiD;QACvD,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,IAAI,EAAE,gCAAgC,CAAC,iBAAiB;KACzD;IACD;QACE,IAAI,EAAE,sCAAsC;QAC5C,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,IAAI,EAAE,gCAAgC,CAAC,4BAA4B;KACpE;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,QAAQ,EAAE,CAAC,IAAI,CAAC;QAChB,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,gCAAgC,CAAC,kBAAkB;KAC1D;IACD;QACE,IAAI,EAAE,uBAAuB;KAC9B;IACD;QACE,IAAI,EAAE,0BAA0B;QAChC,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,gCAAgC,CAAC,cAAc;KACtD;IACD;QACE,IAAI,EAAE,UAAU;KACjB;CACF,CAAC","sourcesContent":["import { IMRSegment } from '../Interface/api/IntermediateManagementRebate';\n\nexport enum IntermediateManagementRebateType {\n TURNOVER = 1,\n BUY = 2,\n CHARGE = 3,\n GRANT = 4,\n TRANSFERT = 5,\n TAX = 6,\n PERSONAL = 7,\n PRODUCT = 8,\n OTHER_CHARGE = 9,\n AMORTIZATION = 10,\n FINANCIAL_PRODUCT = 11,\n REPRISE = 12,\n TRANSFERT_FINANCIAL_CHARGE = 13,\n FINANCIAL_CHARGE = 14,\n EXCEPTIONAL_PRODUCT = 15,\n REPRISE_PROVISION = 16,\n TRANSFERT_EXCEPTIONAL_CHARGE = 17,\n EXCEPTIONAL_CHARGE = 18,\n TAX_ON_BENEFIT = 19,\n}\n\nexport const IntermediateManagementRebateSegments: IMRSegment[] = [\n {\n name: 'Chiffre d\\'affaires',\n accounts: ['70'],\n type: IntermediateManagementRebateType.TURNOVER,\n isPositive: true,\n },\n {\n name: 'Ventes + Production réelle',\n },\n {\n name: 'Achats consommés',\n accounts: ['60'],\n isNegative: true,\n type: IntermediateManagementRebateType.BUY,\n },\n {\n name: 'Marge globale',\n },\n {\n name: 'Charges externes',\n accounts: ['61', '62'],\n isNegative: true,\n type: IntermediateManagementRebateType.CHARGE,\n },\n {\n name: 'Valeur ajoutée',\n },\n {\n name: 'Subvention d\\'exploitation',\n accounts: ['74'],\n isPositive: true,\n type: IntermediateManagementRebateType.GRANT,\n },\n {\n name: 'Transfert de charges d’exploitation',\n accounts: ['791', '792', '793', '794', '795'],\n isPositive: true,\n type: IntermediateManagementRebateType.TRANSFERT,\n },\n {\n name: 'Impôts et taxes',\n accounts: ['63'],\n isNegative: true,\n type: IntermediateManagementRebateType.TAX,\n },\n {\n name: 'Charges de personnel',\n accounts: ['64'],\n isNegative: true,\n type: IntermediateManagementRebateType.PERSONAL,\n },\n {\n name: 'Excédent brut d\\'exploitation',\n },\n {\n name: 'Autres produits d\\'exploitation',\n accounts: ['781', '782', '783', '784', '785', '75'],\n isPositive: true,\n type: IntermediateManagementRebateType.PRODUCT,\n },\n {\n name: 'Autres charges d\\'exploitation',\n accounts: ['65'],\n isNegative: true,\n type: IntermediateManagementRebateType.OTHER_CHARGE,\n },\n {\n name: 'Dotations aux amortissements',\n accounts: ['681', '682', '683', '684', '685'],\n isNegative: true,\n type: IntermediateManagementRebateType.OTHER_CHARGE,\n },\n {\n name: 'Résultat d\\'exploitation',\n },\n {\n name: 'Produits financiers',\n accounts: ['76'],\n isPositive: true,\n type: IntermediateManagementRebateType.FINANCIAL_PRODUCT,\n },\n {\n name: 'Reprises sur amort. et provisions financières',\n isPositive: true,\n accounts: ['786'],\n type: IntermediateManagementRebateType.REPRISE,\n },\n {\n name: 'Transfert de charges financières',\n isPositive: true,\n accounts: ['796'],\n type: IntermediateManagementRebateType.TRANSFERT_FINANCIAL_CHARGE,\n },\n {\n name: 'Charges financières',\n type: IntermediateManagementRebateType.FINANCIAL_CHARGE,\n isNegative: true,\n accounts: ['66'],\n },\n {\n name: 'Produits exceptionnels',\n accounts: ['77'],\n isPositive: true,\n type: IntermediateManagementRebateType.EXCEPTIONAL_PRODUCT,\n },\n {\n name: 'Reprises sur amort. et provisions exceptionnels',\n isPositive: true,\n accounts: ['787'],\n type: IntermediateManagementRebateType.REPRISE_PROVISION,\n },\n {\n name: 'Transfert de charges exceptionnelles',\n isPositive: true,\n accounts: ['797'],\n type: IntermediateManagementRebateType.TRANSFERT_EXCEPTIONAL_CHARGE,\n },\n {\n name: 'Charges exceptionnelles',\n accounts: ['67'],\n isNegative: true,\n type: IntermediateManagementRebateType.EXCEPTIONAL_CHARGE,\n },\n {\n name: 'Résultat exceptionnel',\n },\n {\n name: 'Impôts sur les bénéfices',\n accounts: ['695'],\n isNegative: true,\n type: IntermediateManagementRebateType.TAX_ON_BENEFIT,\n },\n {\n name: 'Résultat',\n },\n];"]}
@@ -1,10 +1,11 @@
1
- import { IExercice } from '../..';
1
+ import { IAccountingEntry, IExercice } from '../..';
2
2
  import { IntermediateManagementRebateType } from '../../Enum/IntermediateManagementRebate';
3
3
  export type IMRSegment = {
4
4
  name: string;
5
5
  accounts?: string[];
6
6
  type?: IntermediateManagementRebateType;
7
7
  isPositive?: boolean;
8
+ isNegative?: boolean;
8
9
  };
9
10
  export type IMRSegmentFilled = {
10
11
  name: string;
@@ -26,4 +27,42 @@ export type ReadIMRWithExercices = {
26
27
  };
27
28
  imr: IMRSegmentFilled[];
28
29
  };
30
+ export type IMRExerciceData = {
31
+ exercice: IExercice;
32
+ previousExercice: IExercice | null;
33
+ entries: IAccountingEntry[];
34
+ };
35
+ export type ReadFormattedIMRFilled = {
36
+ name: string;
37
+ amount: number;
38
+ previousAmount: number | undefined;
39
+ percentOfTurnover: number | undefined;
40
+ previousPercentOfTurnover: number | undefined;
41
+ variation: number | undefined;
42
+ type?: IntermediateManagementRebateType | null;
43
+ details: Array<IMRTypeFilled & {
44
+ percentOfTurnover: number;
45
+ previousPercentOfTurnover: number | undefined;
46
+ variation: number | undefined;
47
+ }>;
48
+ };
49
+ export type ReadFormattedIMRFilledWithExercice = {
50
+ exercices: {
51
+ current: IExercice;
52
+ previous: IExercice | null;
53
+ };
54
+ imr: Array<{
55
+ name: string;
56
+ amount: number;
57
+ previousAmount: number | undefined;
58
+ percentOfTurnover: number | undefined;
59
+ previousPercentOfTurnover: number | undefined;
60
+ variation: number | undefined;
61
+ details: Array<IMRTypeFilled & {
62
+ percentOfTurnover: number;
63
+ previousPercentOfTurnover: number | undefined;
64
+ variation: number | undefined;
65
+ }>;
66
+ }>;
67
+ };
29
68
  //# sourceMappingURL=IntermediateManagementRebate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntermediateManagementRebate.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/IntermediateManagementRebate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAE3F,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,gCAAgC,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,gCAAgC,CAAC;IACxC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;CACnC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE;QACT,OAAO,EAAE,SAAS,CAAC;QACnB,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;KAC5B,CAAA;IACD,GAAG,EAAE,gBAAgB,EAAE,CAAC;CACzB,CAAC"}
1
+ {"version":3,"file":"IntermediateManagementRebate.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/IntermediateManagementRebate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAE3F,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,gCAAgC,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,gCAAgC,CAAC;IACxC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,cAAc,EAAE,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AAC;IACF,GAAG,EAAE,KAAK,CAAC;QACT,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;QACnC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;QACtC,yBAAyB,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9C,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,OAAO,EAAE,KAAK,CAAC,aAAa,GAAG;YAC7B,iBAAiB,EAAE,MAAM,CAAC;YAC1B,yBAAyB,EAAE,MAAM,GAAG,SAAS,CAAC;YAC9C,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;SAC/B,CAAC,CAAC;KACJ,CAAC,CAAA;CACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"IntermediateManagementRebate.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/IntermediateManagementRebate.ts"],"names":[],"mappings":"","sourcesContent":["import { IExercice } from '../..';\nimport { IntermediateManagementRebateType } from '../../Enum/IntermediateManagementRebate';\n\nexport type IMRSegment = {\n name: string;\n accounts?: string[];\n type?: IntermediateManagementRebateType;\n isPositive?: boolean;\n};\n\nexport type IMRSegmentFilled = {\n name: string;\n type?: IntermediateManagementRebateType;\n amount: number | undefined;\n previousAmount: number | undefined;\n totalAmount: number;\n totalPreviousAmount: number;\n};\n\nexport type IMRTypeFilled = {\n name: string;\n amount: number;\n previousAmount: number | undefined\n};\n\nexport type ReadIMRWithExercices = { \n exercices: {\n current: IExercice,\n previous: IExercice | null;\n }\n imr: IMRSegmentFilled[];\n};"]}
1
+ {"version":3,"file":"IntermediateManagementRebate.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/IntermediateManagementRebate.ts"],"names":[],"mappings":"","sourcesContent":["import { IAccountingEntry, IExercice } from '../..';\nimport { IntermediateManagementRebateType } from '../../Enum/IntermediateManagementRebate';\n\nexport type IMRSegment = {\n name: string;\n accounts?: string[];\n type?: IntermediateManagementRebateType;\n isPositive?: boolean;\n isNegative?: boolean;\n};\n\nexport type IMRSegmentFilled = {\n name: string;\n type?: IntermediateManagementRebateType;\n amount: number | undefined;\n previousAmount: number | undefined;\n totalAmount: number;\n totalPreviousAmount: number;\n};\n\nexport type IMRTypeFilled = {\n name: string;\n amount: number;\n previousAmount: number | undefined;\n};\n\nexport type ReadIMRWithExercices = { \n exercices: {\n current: IExercice,\n previous: IExercice | null;\n }\n imr: IMRSegmentFilled[];\n};\n\nexport type IMRExerciceData = { exercice: IExercice; previousExercice: IExercice | null; entries: IAccountingEntry[] };\n\n\nexport type ReadFormattedIMRFilled = {\n name: string;\n amount: number;\n previousAmount: number | undefined;\n percentOfTurnover: number | undefined;\n previousPercentOfTurnover: number | undefined;\n variation: number | undefined;\n type?: IntermediateManagementRebateType | null; \n details: Array<IMRTypeFilled & { \n percentOfTurnover: number;\n previousPercentOfTurnover: number | undefined;\n variation: number | undefined;\n }>;\n};\n\nexport type ReadFormattedIMRFilledWithExercice = {\n exercices: {\n current: IExercice,\n previous: IExercice | null;\n };\n imr: Array<{\n name: string;\n amount: number;\n previousAmount: number | undefined;\n percentOfTurnover: number | undefined;\n previousPercentOfTurnover: number | undefined;\n variation: number | undefined;\n details: Array<IMRTypeFilled & { \n percentOfTurnover: number;\n previousPercentOfTurnover: number | undefined;\n variation: number | undefined;\n }>;\n }>\n};"]}
@@ -235,7 +235,7 @@ export function generateSignature(params) {
235
235
  let phoneSignature;
236
236
  let horaires;
237
237
  [roleSignature, mailSignature, phoneSignature, horaires] = ['Expert-Comptable', bonjourMail, null, 'Du lundi au vendredi de 9h à 19h'];
238
- if (user.roles && user.roles.some((r) => r.id === Role.DATA_OFFICER)) { // Signature data_officer
238
+ if (user?.roles && user.roles.some((r) => r.id === Role.DATA_OFFICER)) { // Signature data_officer
239
239
  user = {
240
240
  firstname: `L'équipe ${commercialName}`,
241
241
  isAll: true,
@@ -1 +1 @@
1
- {"version":3,"file":"email.js","sourceRoot":"","s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derBy as orderByLodash } from 'lodash';\nimport { EntityType } from '../types/Enum/EntityType';\nimport { Role } from '../types/Enum/Role';\nimport { IUser } from '../types/Interface/models/IUser';\nimport { getBrandConfig, isItThisEnv } from './brands';\nimport { signatureTemplate } from './email/templates/signature';\n\nconst ejs = require('ejs');\n\nfunction intersection<T>(arr: [T[], T[]]) { return arr.reduce((a: T[], b: T[]) => a.filter((c) => b.includes(c)), []); }\n\nfunction getRoleSignature(user:any) {\n if (user.positionLabel) return user.positionLabel;\n\n const isStagiaireOrAlternant = user.roles.map((r: any) => r.id).includes(Role.INTERN) || user.roles.map((r: any) => r.id).includes(Role.ALTERNATE);\n const isManager = user.roles.map((r: any) => r.id).includes(Role.MANAGER);\n\n const isSocial = user.roles.map((r: any) => r.id).includes(Role.SOCIAL);\n const isJuridic = user.roles.map((r: any) => r.id).includes(Role.JURIDIC);\n const isFacturation = user.roles.map((r: any) => r.id).includes(Role.FACTURATION);\n const isExpert = user.roles.map((r: any) => r.id).includes(Role.EXPERT_ACCOUNTANT);\n const isCS = user.roles.map((r: any) => r.id).includes(Role.CUSTOMER_SUCCESS);\n const isOnBoarder = user.roles.map((r: any) => r.id).includes(Role.ON_BOARDER);\n const isTermination = user.roles.map((r: any) => r.id).includes(Role.TERMINATION);\n const isLitige = user.roles.map((r: any) => r.id).includes(Role.LITIGE);\n const isDataOfficer = user.roles.map((r: any) => r.id).includes(Role.DATA_OFFICER);\n const isSales = user.roles.map((r: any) => r.id).includes(Role.COMMERCIAL);\n const isAdmin = user.roles.map((r: any) => r.id).includes(Role.ADMIN);\n const isFront = !!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS]]).length;\n\n if (isSales && isManager) { return 'Responsable commercial'; }\n if (isSales) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de clientèle`; }\n\n if (isCS && isManager) { return 'Responsable relations clients'; }\n if (isCS) { return `Conseill${user.idCivility === 2 ? 'ère' : 'er'} comptable`; }\n\n if (isOnBoarder && isManager) { return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} accueil clients`; }\n if (isOnBoarder) { return `Chargé${user.idCivility === 2 ? 'e' : ''} accueil clients`; }\n\n if (isTermination && isManager) { return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients`; }\n if (isTermination) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients`; }\n\n if (isLitige && isManager) { return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients (Litige)`; }\n if (isLitige) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients (Litige)`; }\n\n if (isDataOfficer && isManager) { return 'Responsable aide comptable'; }\n if (isDataOfficer) { return 'Aide comptable'; }\n\n if (isFacturation && isStagiaireOrAlternant) { return 'Assistant facturation'; }\n if (isFacturation && isManager) { return 'Responsable facturation'; }\n if (isFacturation) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de facturation`; }\n\n if (isJuridic && isStagiaireOrAlternant) { return 'Assistant juridique'; }\n if (isJuridic && isManager) { return 'Responsable juridique'; }\n if (isJuridic) { return 'Juriste'; }\n\n if (isSocial && isStagiaireOrAlternant) { return 'Assistant paie'; }\n if (isSocial && isManager) { return 'Responsable paie'; }\n if (isSocial) { return 'Gestionnaire de paie'; }\n\n if (isExpert) { return `Expert${user.idCivility === 2 ? 'e' : ''}-comptable`; }\n\n if (isAdmin) { return 'Développeur web'; }\n\n if (isFront && isManager) return 'Responsable comptable';\n if (isFront && isStagiaireOrAlternant) return 'Assistant comptable';\n if (isFront) return `Comptable dédié${user.idCivility === 2 ? 'e' : ''}`;\n return `Comptable dédié${user.idCivility === 2 ? 'e' : ''}`;\n}\n\nfunction getHoraires(user:IUser) { // On affiche les horaires uniquement pour les front, et pas pour les TVA\n\n if (isItThisEnv('Pourcentage') && user?.entity && [EntityType.COMPTALIB, EntityType.AMEX, EntityType.CABINET_RONCHIERI_LANDRA].includes(user.entity)) {\n return 'Du lundi au vendredi de 9h à 18h';\n }\n \n return 'Du lundi au vendredi de 9h à 19h';\n\n // if (!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.COMMERCIAL]]).length) return 'Du lundi au vendredi de 9h à 19h';\n\n // if (!user.workingSchedules.length) return 'Du lundi au vendredi de 9h à 19h';\n\n // let reducedSchedules = user.workingSchedules.reduce((acc: any, e:any, index: number) => {\n // const name = `${dayjs(e.morningStart, 'HH:mm:ss').format('HH:mm')}-${dayjs(e.afternoonEnd || e.morningEnd, 'HH:mm:ss').format('HH:mm')}`;\n // if (!acc[name]) acc[name] = [index];\n // else acc[name].push(index);\n // return acc;\n // }, {});\n\n // reducedSchedules = orderByLodash(reducedSchedules, (elem) => elem.length, ['desc']);\n\n // let resultHoraire = '';\n // let startH;\n // let startM;\n // let endH;\n // let endM;\n // let firstDayOfWeek;\n // let lastDayOfWeek;\n\n // reducedSchedules.forEach((schedule: any, index: number) => {\n // startH = dayjs(user.workingSchedules[schedule[0]].morningStart ? user.workingSchedules[schedule[0]].morningStart : user.workingSchedules[schedule[0]].afternoonStart, 'HH:mm:ss').get('hour');\n // startM = dayjs(user.workingSchedules[schedule[0]].morningStart ? user.workingSchedules[schedule[0]].morningStart : user.workingSchedules[schedule[0]].afternoonStart, 'HH:mm:ss').get('minute');\n // endH = dayjs(user.workingSchedules[schedule[0]].afternoonEnd || user.workingSchedules[schedule[0]].morningEnd, 'HH:mm:ss').get('hour');\n // endM = dayjs(user.workingSchedules[schedule[0]].afternoonEnd || user.workingSchedules[schedule[0]].morningEnd, 'HH:mm:ss').get('minute');\n // firstDayOfWeek = dayjs().locale('fr').day(user.workingSchedules[schedule[0]].idDay).format('dddd');\n // if (!index) {\n // // pour le premier index, on affiche l'amplitude horaire la plus commune, du XX au XX de Xh à Xh\n // lastDayOfWeek = dayjs().locale('fr').day(user.workingSchedules[user.workingSchedules.length - 1].idDay).format('dddd');\n // resultHoraire += `Du ${firstDayOfWeek} au ${lastDayOfWeek} de ${startH}h${startM > 0 ? startM : ''} à ${endH}h${endM > 0 ? endM : ''}`;\n // } else { // Fonctionnel si uniquement un jour par semaine avec des horaires différents\n // resultHoraire += `<br/>Le ${firstDayOfWeek} de ${startH}h${startM > 0 ? startM : ''} à ${endH}h${endM > 0 ? endM : ''}`;\n // }\n // });\n // return resultHoraire;\n}\n\nfunction getMailSignature(user:any, idTypeBrand:number) {\n const informatiqueMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.informatique',\n }) as unknown as string;\n const bonjourMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.bonjour',\n }) as unknown as string;\n\n if (user.roles.map((r: any) => r.id).includes(Role.ADMIN)) { return informatiqueMail; }\n if (user && !!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.DATA_OFFICER, Role.COMMERCIAL]]).length) return user.email;\n return bonjourMail;\n}\n\nfunction getPhoneSignature(user:any) {\n if (user.phone !== '0383931414') { return user.phone.replace(/\\B(?=(\\d{2})+(?!\\d))/g, '&nbsp;'); }\n return null;\n}\n\nexport function generateSignature(params: any): string {\n const {\n forceRole = null, idTypeBrand = 1, ...otherParams\n } = params;\n let {\n user,\n } = otherParams;\n \n const hostS3 = getBrandConfig({\n idTypeBrand,\n objectWaited: 'urlS3',\n });\n\n const brandName = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'name',\n }) as unknown as string;\n const brandPostalAddress = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'companyInformation.postalAddress',\n }) as unknown as string;\n const brandCity = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'companyInformation.city',\n }) as unknown as string;\n const commercialName = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'commercialName',\n }) as unknown as string;\n const iban = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'bank.IBAN',\n }) as unknown as string;\n const bic = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'bank.BIC',\n }) as unknown as string;\n const bonjourMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.bonjour',\n }) as unknown as string;\n const socialMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.social',\n }) as unknown as string;\n const dataOfficerMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.gestion',\n }) as unknown as string;\n const supportMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.support',\n }) as unknown as string;\n const juridiqueMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.juridique',\n }) as unknown as string;\n const facturationMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.facturation',\n }) as unknown as string;\n const primaryColor = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'colors.primary',\n }) as unknown as string;\n const standardPhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.contact',\n }) as unknown as string;\n const juridiquePhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.juridique',\n }) as unknown as string;\n const socialPhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.social',\n }) as unknown as string;\n\n let roleSignature: string | null;\n let mailSignature: string | null;\n let phoneSignature: string | null;\n let horaires: string | null;\n [roleSignature, mailSignature, phoneSignature, horaires] = ['Expert-Comptable', bonjourMail, null, 'Du lundi au vendredi de 9h à 19h'];\n\n if (user.roles && user.roles.some((r: any) => r.id === Role.DATA_OFFICER)) { // Signature data_officer\n user = {\n firstname: `L'équipe ${commercialName}`,\n isAll: true,\n };\n mailSignature = dataOfficerMail;\n roleSignature = '';\n } else if (forceRole === 'social') { // Signature social\n user = {\n firstname: 'Service social',\n isAll: true,\n };\n mailSignature = socialMail;\n roleSignature = '';\n phoneSignature = socialPhoneSignature;\n } else if (forceRole === 'support') { // Signature support\n user = {\n firstname: 'Service Support',\n isAll: true,\n };\n mailSignature = supportMail;\n roleSignature = null;\n } else if (forceRole === 'juridique') { // Signature juridique\n user = {\n firstname: 'Service juridique',\n isAll: true,\n };\n mailSignature = juridiqueMail;\n roleSignature = null;\n phoneSignature = juridiquePhoneSignature;\n } else if (forceRole === 'facturation') { // Signature facturation\n user = {\n firstname: 'Service facturation',\n isAll: true,\n };\n mailSignature = facturationMail;\n roleSignature = null;\n phoneSignature = standardPhoneSignature;\n } else if (!user) { // Signature Clementine\n user = {\n firstname: `L'équipe ${commercialName}`,\n isAll: true,\n };\n roleSignature = '';\n } else if (user !== 0) { // Signature par défaut\n roleSignature = getRoleSignature(user);\n mailSignature = getMailSignature(user, idTypeBrand);\n horaires = getHoraires(user);\n phoneSignature = getPhoneSignature(user);\n }\n\n return ejs.render(signatureTemplate, {\n forceRole,\n isFacturation: user.roles ? user.roles.some((r: any) => r.id === Role.FACTURATION) : false,\n isDataOfficer: user.roles ? user.roles.some((r: any) => r.id === Role.DATA_OFFICER) : true,\n brandName,\n brandPostalAddress,\n brandCity,\n idTypeBrand,\n commercialName,\n iban,\n bic,\n hostS3,\n user,\n roleSignature,\n mailSignature,\n phoneSignature: phoneSignature ? phoneSignature.replace(/\\s+/gm, '&nbsp;') : null,\n standardPhoneSignature: standardPhoneSignature.replace(/\\s+/gm, '&nbsp;'),\n horaires,\n primaryColor,\n supportMail,\n });\n}"]}
1
+ {"version":3,"file":"email.js","sourceRoot":"","sources":["../../../ts/utils/email.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,qDAAqD;AAC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,aAAa,GAAG,EAAE,CAAC;KACpB;SAAM,IAAI,IAAI,KAAK,CAAC,EAAE,EAAE,uBAAuB;QAC9C,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACvC,aAAa,GAAG,gBAAgB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACpD,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAC7B,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;KAC1C;IAED,OAAO,GAAG,CAAC,MAAM,CAAC,iBAAiB,EAAE;QACnC,SAAS;QACT,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK;QAC1F,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1F,SAAS;QACT,kBAAkB;QAClB,SAAS;QACT,WAAW;QACX,cAAc;QACd,IAAI;QACJ,GAAG;QACH,MAAM;QACN,IAAI;QACJ,aAAa;QACb,aAAa;QACb,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;QACjF,sBAAsB,EAAE,sBAAsB,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC;QACzE,QAAQ;QACR,YAAY;QACZ,WAAW;KACZ,CAAC,CAAC;AACL,CAAC","sourcesContent":["// import * as dayjs from 'dayjs';\n// import { orderBy as orderByLodash } from 'lodash';\nimport { EntityType } from '../types/Enum/EntityType';\nimport { Role } from '../types/Enum/Role';\nimport { IUser } from '../types/Interface/models/IUser';\nimport { getBrandConfig, isItThisEnv } from './brands';\nimport { signatureTemplate } from './email/templates/signature';\n\nconst ejs = require('ejs');\n\nfunction intersection<T>(arr: [T[], T[]]) { return arr.reduce((a: T[], b: T[]) => a.filter((c) => b.includes(c)), []); }\n\nfunction getRoleSignature(user:any) {\n if (user.positionLabel) return user.positionLabel;\n\n const isStagiaireOrAlternant = user.roles.map((r: any) => r.id).includes(Role.INTERN) || user.roles.map((r: any) => r.id).includes(Role.ALTERNATE);\n const isManager = user.roles.map((r: any) => r.id).includes(Role.MANAGER);\n\n const isSocial = user.roles.map((r: any) => r.id).includes(Role.SOCIAL);\n const isJuridic = user.roles.map((r: any) => r.id).includes(Role.JURIDIC);\n const isFacturation = user.roles.map((r: any) => r.id).includes(Role.FACTURATION);\n const isExpert = user.roles.map((r: any) => r.id).includes(Role.EXPERT_ACCOUNTANT);\n const isCS = user.roles.map((r: any) => r.id).includes(Role.CUSTOMER_SUCCESS);\n const isOnBoarder = user.roles.map((r: any) => r.id).includes(Role.ON_BOARDER);\n const isTermination = user.roles.map((r: any) => r.id).includes(Role.TERMINATION);\n const isLitige = user.roles.map((r: any) => r.id).includes(Role.LITIGE);\n const isDataOfficer = user.roles.map((r: any) => r.id).includes(Role.DATA_OFFICER);\n const isSales = user.roles.map((r: any) => r.id).includes(Role.COMMERCIAL);\n const isAdmin = user.roles.map((r: any) => r.id).includes(Role.ADMIN);\n const isFront = !!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS]]).length;\n\n if (isSales && isManager) { return 'Responsable commercial'; }\n if (isSales) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de clientèle`; }\n\n if (isCS && isManager) { return 'Responsable relations clients'; }\n if (isCS) { return `Conseill${user.idCivility === 2 ? 'ère' : 'er'} comptable`; }\n\n if (isOnBoarder && isManager) { return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} accueil clients`; }\n if (isOnBoarder) { return `Chargé${user.idCivility === 2 ? 'e' : ''} accueil clients`; }\n\n if (isTermination && isManager) { return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients`; }\n if (isTermination) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients`; }\n\n if (isLitige && isManager) { return `Responsable chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients (Litige)`; }\n if (isLitige) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de la satisfaction clients (Litige)`; }\n\n if (isDataOfficer && isManager) { return 'Responsable aide comptable'; }\n if (isDataOfficer) { return 'Aide comptable'; }\n\n if (isFacturation && isStagiaireOrAlternant) { return 'Assistant facturation'; }\n if (isFacturation && isManager) { return 'Responsable facturation'; }\n if (isFacturation) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de facturation`; }\n\n if (isJuridic && isStagiaireOrAlternant) { return 'Assistant juridique'; }\n if (isJuridic && isManager) { return 'Responsable juridique'; }\n if (isJuridic) { return 'Juriste'; }\n\n if (isSocial && isStagiaireOrAlternant) { return 'Assistant paie'; }\n if (isSocial && isManager) { return 'Responsable paie'; }\n if (isSocial) { return 'Gestionnaire de paie'; }\n\n if (isExpert) { return `Expert${user.idCivility === 2 ? 'e' : ''}-comptable`; }\n\n if (isAdmin) { return 'Développeur web'; }\n\n if (isFront && isManager) return 'Responsable comptable';\n if (isFront && isStagiaireOrAlternant) return 'Assistant comptable';\n if (isFront) return `Comptable dédié${user.idCivility === 2 ? 'e' : ''}`;\n return `Comptable dédié${user.idCivility === 2 ? 'e' : ''}`;\n}\n\nfunction getHoraires(user:IUser) { // On affiche les horaires uniquement pour les front, et pas pour les TVA\n\n if (isItThisEnv('Pourcentage') && user?.entity && [EntityType.COMPTALIB, EntityType.AMEX, EntityType.CABINET_RONCHIERI_LANDRA].includes(user.entity)) {\n return 'Du lundi au vendredi de 9h à 18h';\n }\n \n return 'Du lundi au vendredi de 9h à 19h';\n\n // if (!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.COMMERCIAL]]).length) return 'Du lundi au vendredi de 9h à 19h';\n\n // if (!user.workingSchedules.length) return 'Du lundi au vendredi de 9h à 19h';\n\n // let reducedSchedules = user.workingSchedules.reduce((acc: any, e:any, index: number) => {\n // const name = `${dayjs(e.morningStart, 'HH:mm:ss').format('HH:mm')}-${dayjs(e.afternoonEnd || e.morningEnd, 'HH:mm:ss').format('HH:mm')}`;\n // if (!acc[name]) acc[name] = [index];\n // else acc[name].push(index);\n // return acc;\n // }, {});\n\n // reducedSchedules = orderByLodash(reducedSchedules, (elem) => elem.length, ['desc']);\n\n // let resultHoraire = '';\n // let startH;\n // let startM;\n // let endH;\n // let endM;\n // let firstDayOfWeek;\n // let lastDayOfWeek;\n\n // reducedSchedules.forEach((schedule: any, index: number) => {\n // startH = dayjs(user.workingSchedules[schedule[0]].morningStart ? user.workingSchedules[schedule[0]].morningStart : user.workingSchedules[schedule[0]].afternoonStart, 'HH:mm:ss').get('hour');\n // startM = dayjs(user.workingSchedules[schedule[0]].morningStart ? user.workingSchedules[schedule[0]].morningStart : user.workingSchedules[schedule[0]].afternoonStart, 'HH:mm:ss').get('minute');\n // endH = dayjs(user.workingSchedules[schedule[0]].afternoonEnd || user.workingSchedules[schedule[0]].morningEnd, 'HH:mm:ss').get('hour');\n // endM = dayjs(user.workingSchedules[schedule[0]].afternoonEnd || user.workingSchedules[schedule[0]].morningEnd, 'HH:mm:ss').get('minute');\n // firstDayOfWeek = dayjs().locale('fr').day(user.workingSchedules[schedule[0]].idDay).format('dddd');\n // if (!index) {\n // // pour le premier index, on affiche l'amplitude horaire la plus commune, du XX au XX de Xh à Xh\n // lastDayOfWeek = dayjs().locale('fr').day(user.workingSchedules[user.workingSchedules.length - 1].idDay).format('dddd');\n // resultHoraire += `Du ${firstDayOfWeek} au ${lastDayOfWeek} de ${startH}h${startM > 0 ? startM : ''} à ${endH}h${endM > 0 ? endM : ''}`;\n // } else { // Fonctionnel si uniquement un jour par semaine avec des horaires différents\n // resultHoraire += `<br/>Le ${firstDayOfWeek} de ${startH}h${startM > 0 ? startM : ''} à ${endH}h${endM > 0 ? endM : ''}`;\n // }\n // });\n // return resultHoraire;\n}\n\nfunction getMailSignature(user:any, idTypeBrand:number) {\n const informatiqueMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.informatique',\n }) as unknown as string;\n const bonjourMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.bonjour',\n }) as unknown as string;\n\n if (user.roles.map((r: any) => r.id).includes(Role.ADMIN)) { return informatiqueMail; }\n if (user && !!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.DATA_OFFICER, Role.COMMERCIAL]]).length) return user.email;\n return bonjourMail;\n}\n\nfunction getPhoneSignature(user:any) {\n if (user.phone !== '0383931414') { return user.phone.replace(/\\B(?=(\\d{2})+(?!\\d))/g, '&nbsp;'); }\n return null;\n}\n\nexport function generateSignature(params: any): string {\n const {\n forceRole = null, idTypeBrand = 1, ...otherParams\n } = params;\n let {\n user,\n } = otherParams;\n \n const hostS3 = getBrandConfig({\n idTypeBrand,\n objectWaited: 'urlS3',\n });\n\n const brandName = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'name',\n }) as unknown as string;\n const brandPostalAddress = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'companyInformation.postalAddress',\n }) as unknown as string;\n const brandCity = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'companyInformation.city',\n }) as unknown as string;\n const commercialName = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'commercialName',\n }) as unknown as string;\n const iban = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'bank.IBAN',\n }) as unknown as string;\n const bic = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'bank.BIC',\n }) as unknown as string;\n const bonjourMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.bonjour',\n }) as unknown as string;\n const socialMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.social',\n }) as unknown as string;\n const dataOfficerMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.gestion',\n }) as unknown as string;\n const supportMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.support',\n }) as unknown as string;\n const juridiqueMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.juridique',\n }) as unknown as string;\n const facturationMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.facturation',\n }) as unknown as string;\n const primaryColor = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'colors.primary',\n }) as unknown as string;\n const standardPhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.contact',\n }) as unknown as string;\n const juridiquePhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.juridique',\n }) as unknown as string;\n const socialPhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.social',\n }) as unknown as string;\n\n let roleSignature: string | null;\n let mailSignature: string | null;\n let phoneSignature: string | null;\n let horaires: string | null;\n [roleSignature, mailSignature, phoneSignature, horaires] = ['Expert-Comptable', bonjourMail, null, 'Du lundi au vendredi de 9h à 19h'];\n \n if (user?.roles && user.roles.some((r: any) => r.id === Role.DATA_OFFICER)) { // Signature data_officer\n user = {\n firstname: `L'équipe ${commercialName}`,\n isAll: true,\n };\n mailSignature = dataOfficerMail;\n roleSignature = '';\n } else if (forceRole === 'social') { // Signature social\n user = {\n firstname: 'Service social',\n isAll: true,\n };\n mailSignature = socialMail;\n roleSignature = '';\n phoneSignature = socialPhoneSignature;\n } else if (forceRole === 'support') { // Signature support\n user = {\n firstname: 'Service Support',\n isAll: true,\n };\n mailSignature = supportMail;\n roleSignature = null;\n } else if (forceRole === 'juridique') { // Signature juridique\n user = {\n firstname: 'Service juridique',\n isAll: true,\n };\n mailSignature = juridiqueMail;\n roleSignature = null;\n phoneSignature = juridiquePhoneSignature;\n } else if (forceRole === 'facturation') { // Signature facturation\n user = {\n firstname: 'Service facturation',\n isAll: true,\n };\n mailSignature = facturationMail;\n roleSignature = null;\n phoneSignature = standardPhoneSignature;\n } else if (!user) { // Signature Clementine\n user = {\n firstname: `L'équipe ${commercialName}`,\n isAll: true,\n };\n roleSignature = '';\n } else if (user !== 0) { // Signature par défaut\n roleSignature = getRoleSignature(user);\n mailSignature = getMailSignature(user, idTypeBrand);\n horaires = getHoraires(user);\n phoneSignature = getPhoneSignature(user);\n }\n\n return ejs.render(signatureTemplate, {\n forceRole,\n isFacturation: user.roles ? user.roles.some((r: any) => r.id === Role.FACTURATION) : false,\n isDataOfficer: user.roles ? user.roles.some((r: any) => r.id === Role.DATA_OFFICER) : true,\n brandName,\n brandPostalAddress,\n brandCity,\n idTypeBrand,\n commercialName,\n iban,\n bic,\n hostS3,\n user,\n roleSignature,\n mailSignature,\n phoneSignature: phoneSignature ? phoneSignature.replace(/\\s+/gm, '&nbsp;') : null,\n standardPhoneSignature: standardPhoneSignature.replace(/\\s+/gm, '&nbsp;'),\n horaires,\n primaryColor,\n supportMail,\n });\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.1.265",
3
+ "version": "1.1.266",
4
4
  "description": "Silex Core perform HTTP Request and object binding. Silex core helps developers to retrieve and return formatted object",
5
5
  "homepage": "https://gitlab.compta-clementine.fr/dev/silex-api",
6
6
  "main": "dist/cjs/index.js",
@@ -1,9 +1,9 @@
1
- import { IMRTypeFilled, IntermediateManagementRebateType, ReadIMRWithExercices } from '../../types';
1
+ import { IMRTypeFilled, IntermediateManagementRebateType, ReadFormattedIMRFilledWithExercice } from '../../types';
2
2
  import { Resource } from '../Resource';
3
3
 
4
4
  export class IntermediateManagementRebate extends Resource {
5
5
 
6
- get(idExercice: number): Promise<ReadIMRWithExercices> {
6
+ get(idExercice: number): Promise<ReadFormattedIMRFilledWithExercice[]> {
7
7
  return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates`);
8
8
  }
9
9
 
@@ -11,4 +11,8 @@ export class IntermediateManagementRebate extends Resource {
11
11
  return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates/${type}`);
12
12
  }
13
13
 
14
+ getFile(idExercice: number): Promise<Buffer> {
15
+ return this.axios.$get(`/exercices/${idExercice}/intermediate-management-rebates/file`);
16
+ }
17
+
14
18
  }
@@ -27,6 +27,7 @@ export const IntermediateManagementRebateSegments: IMRSegment[] = [
27
27
  name: 'Chiffre d\'affaires',
28
28
  accounts: ['70'],
29
29
  type: IntermediateManagementRebateType.TURNOVER,
30
+ isPositive: true,
30
31
  },
31
32
  {
32
33
  name: 'Ventes + Production réelle',
@@ -34,6 +35,7 @@ export const IntermediateManagementRebateSegments: IMRSegment[] = [
34
35
  {
35
36
  name: 'Achats consommés',
36
37
  accounts: ['60'],
38
+ isNegative: true,
37
39
  type: IntermediateManagementRebateType.BUY,
38
40
  },
39
41
  {
@@ -42,6 +44,7 @@ export const IntermediateManagementRebateSegments: IMRSegment[] = [
42
44
  {
43
45
  name: 'Charges externes',
44
46
  accounts: ['61', '62'],
47
+ isNegative: true,
45
48
  type: IntermediateManagementRebateType.CHARGE,
46
49
  },
47
50
  {
@@ -62,11 +65,13 @@ export const IntermediateManagementRebateSegments: IMRSegment[] = [
62
65
  {
63
66
  name: 'Impôts et taxes',
64
67
  accounts: ['63'],
68
+ isNegative: true,
65
69
  type: IntermediateManagementRebateType.TAX,
66
70
  },
67
71
  {
68
72
  name: 'Charges de personnel',
69
73
  accounts: ['64'],
74
+ isNegative: true,
70
75
  type: IntermediateManagementRebateType.PERSONAL,
71
76
  },
72
77
  {
@@ -81,11 +86,13 @@ export const IntermediateManagementRebateSegments: IMRSegment[] = [
81
86
  {
82
87
  name: 'Autres charges d\'exploitation',
83
88
  accounts: ['65'],
89
+ isNegative: true,
84
90
  type: IntermediateManagementRebateType.OTHER_CHARGE,
85
91
  },
86
92
  {
87
93
  name: 'Dotations aux amortissements',
88
94
  accounts: ['681', '682', '683', '684', '685'],
95
+ isNegative: true,
89
96
  type: IntermediateManagementRebateType.OTHER_CHARGE,
90
97
  },
91
98
  {
@@ -112,6 +119,7 @@ export const IntermediateManagementRebateSegments: IMRSegment[] = [
112
119
  {
113
120
  name: 'Charges financières',
114
121
  type: IntermediateManagementRebateType.FINANCIAL_CHARGE,
122
+ isNegative: true,
115
123
  accounts: ['66'],
116
124
  },
117
125
  {
@@ -135,6 +143,7 @@ export const IntermediateManagementRebateSegments: IMRSegment[] = [
135
143
  {
136
144
  name: 'Charges exceptionnelles',
137
145
  accounts: ['67'],
146
+ isNegative: true,
138
147
  type: IntermediateManagementRebateType.EXCEPTIONAL_CHARGE,
139
148
  },
140
149
  {
@@ -143,6 +152,7 @@ export const IntermediateManagementRebateSegments: IMRSegment[] = [
143
152
  {
144
153
  name: 'Impôts sur les bénéfices',
145
154
  accounts: ['695'],
155
+ isNegative: true,
146
156
  type: IntermediateManagementRebateType.TAX_ON_BENEFIT,
147
157
  },
148
158
  {
@@ -1,4 +1,4 @@
1
- import { IExercice } from '../..';
1
+ import { IAccountingEntry, IExercice } from '../..';
2
2
  import { IntermediateManagementRebateType } from '../../Enum/IntermediateManagementRebate';
3
3
 
4
4
  export type IMRSegment = {
@@ -6,6 +6,7 @@ export type IMRSegment = {
6
6
  accounts?: string[];
7
7
  type?: IntermediateManagementRebateType;
8
8
  isPositive?: boolean;
9
+ isNegative?: boolean;
9
10
  };
10
11
 
11
12
  export type IMRSegmentFilled = {
@@ -20,7 +21,7 @@ export type IMRSegmentFilled = {
20
21
  export type IMRTypeFilled = {
21
22
  name: string;
22
23
  amount: number;
23
- previousAmount: number | undefined
24
+ previousAmount: number | undefined;
24
25
  };
25
26
 
26
27
  export type ReadIMRWithExercices = {
@@ -29,4 +30,42 @@ export type ReadIMRWithExercices = {
29
30
  previous: IExercice | null;
30
31
  }
31
32
  imr: IMRSegmentFilled[];
33
+ };
34
+
35
+ export type IMRExerciceData = { exercice: IExercice; previousExercice: IExercice | null; entries: IAccountingEntry[] };
36
+
37
+
38
+ export type ReadFormattedIMRFilled = {
39
+ name: string;
40
+ amount: number;
41
+ previousAmount: number | undefined;
42
+ percentOfTurnover: number | undefined;
43
+ previousPercentOfTurnover: number | undefined;
44
+ variation: number | undefined;
45
+ type?: IntermediateManagementRebateType | null;
46
+ details: Array<IMRTypeFilled & {
47
+ percentOfTurnover: number;
48
+ previousPercentOfTurnover: number | undefined;
49
+ variation: number | undefined;
50
+ }>;
51
+ };
52
+
53
+ export type ReadFormattedIMRFilledWithExercice = {
54
+ exercices: {
55
+ current: IExercice,
56
+ previous: IExercice | null;
57
+ };
58
+ imr: Array<{
59
+ name: string;
60
+ amount: number;
61
+ previousAmount: number | undefined;
62
+ percentOfTurnover: number | undefined;
63
+ previousPercentOfTurnover: number | undefined;
64
+ variation: number | undefined;
65
+ details: Array<IMRTypeFilled & {
66
+ percentOfTurnover: number;
67
+ previousPercentOfTurnover: number | undefined;
68
+ variation: number | undefined;
69
+ }>;
70
+ }>
32
71
  };
package/ts/utils/email.ts CHANGED
@@ -218,8 +218,8 @@ export function generateSignature(params: any): string {
218
218
  let phoneSignature: string | null;
219
219
  let horaires: string | null;
220
220
  [roleSignature, mailSignature, phoneSignature, horaires] = ['Expert-Comptable', bonjourMail, null, 'Du lundi au vendredi de 9h à 19h'];
221
-
222
- if (user.roles && user.roles.some((r: any) => r.id === Role.DATA_OFFICER)) { // Signature data_officer
221
+
222
+ if (user?.roles && user.roles.some((r: any) => r.id === Role.DATA_OFFICER)) { // Signature data_officer
223
223
  user = {
224
224
  firstname: `L'équipe ${commercialName}`,
225
225
  isAll: true,