@silexpert/core 1.0.203 → 1.0.205

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 (107) hide show
  1. package/es/types/Enum/Activity.d.ts +50 -0
  2. package/es/types/Enum/Activity.d.ts.map +1 -1
  3. package/es/types/Enum/Activity.js +50 -0
  4. package/es/types/Enum/Activity.js.map +1 -1
  5. package/es/types/Enum/BrandClems.d.ts +164 -0
  6. package/es/types/Enum/BrandClems.d.ts.map +1 -0
  7. package/es/types/Enum/BrandClems.js +155 -0
  8. package/es/types/Enum/BrandClems.js.map +1 -0
  9. package/es/types/Enum/BrandLegalstart.js +3 -3
  10. package/es/types/Enum/BrandLegalstart.js.map +1 -1
  11. package/es/types/Enum/BrandPourcentage.js +2 -2
  12. package/es/types/Enum/BrandPourcentage.js.map +1 -1
  13. package/es/types/Enum/Country.d.ts +200 -0
  14. package/es/types/Enum/Country.d.ts.map +1 -1
  15. package/es/types/Enum/Country.js +393 -0
  16. package/es/types/Enum/Country.js.map +1 -1
  17. package/es/types/Enum/PaymentExpectation.d.ts +18 -0
  18. package/es/types/Enum/PaymentExpectation.d.ts.map +1 -0
  19. package/es/types/Enum/PaymentExpectation.js +66 -0
  20. package/es/types/Enum/PaymentExpectation.js.map +1 -0
  21. package/es/types/Enum/PrestationType.d.ts +4 -1
  22. package/es/types/Enum/PrestationType.d.ts.map +1 -1
  23. package/es/types/Enum/PrestationType.js +54 -0
  24. package/es/types/Enum/PrestationType.js.map +1 -1
  25. package/es/types/Interface/api/exercice/QueryExercice.d.ts +1 -0
  26. package/es/types/Interface/api/exercice/QueryExercice.d.ts.map +1 -1
  27. package/es/types/Interface/api/exercice/QueryExercice.js +7 -0
  28. package/es/types/Interface/api/exercice/QueryExercice.js.map +1 -1
  29. package/es/types/Interface/api/society/CreateSocietyDetail.d.ts +6 -0
  30. package/es/types/Interface/api/society/CreateSocietyDetail.d.ts.map +1 -0
  31. package/es/types/Interface/api/society/CreateSocietyDetail.js +32 -0
  32. package/es/types/Interface/api/society/CreateSocietyDetail.js.map +1 -0
  33. package/es/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.d.ts +15 -0
  34. package/es/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.d.ts.map +1 -0
  35. package/es/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.js +71 -0
  36. package/es/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.js.map +1 -0
  37. package/es/types/Interface/api/statutsGeneration/SendInviteMailParams.d.ts +4 -0
  38. package/es/types/Interface/api/statutsGeneration/SendInviteMailParams.d.ts.map +1 -0
  39. package/es/types/Interface/api/statutsGeneration/SendInviteMailParams.js +19 -0
  40. package/es/types/Interface/api/statutsGeneration/SendInviteMailParams.js.map +1 -0
  41. package/es/types/Interface/api/statutsGeneration/UpdateExercice.d.ts +5 -0
  42. package/es/types/Interface/api/statutsGeneration/UpdateExercice.d.ts.map +1 -0
  43. package/es/types/Interface/api/statutsGeneration/UpdateExercice.js +26 -0
  44. package/es/types/Interface/api/statutsGeneration/UpdateExercice.js.map +1 -0
  45. package/es/types/Interface/api/statutsGeneration/UpdateExerciceParams.d.ts +5 -0
  46. package/es/types/Interface/api/statutsGeneration/UpdateExerciceParams.d.ts.map +1 -0
  47. package/es/types/Interface/api/statutsGeneration/UpdateExerciceParams.js +26 -0
  48. package/es/types/Interface/api/statutsGeneration/UpdateExerciceParams.js.map +1 -0
  49. package/es/types/Interface/models/ISocietyDetail.d.ts +97 -97
  50. package/es/types/Interface/models/ISocietyDetail.d.ts.map +1 -1
  51. package/es/types/Interface/models/ISocietyDetail.js.map +1 -1
  52. package/es/types/index.d.ts +5 -0
  53. package/es/types/index.d.ts.map +1 -1
  54. package/es/types/index.js +5 -0
  55. package/es/types/index.js.map +1 -1
  56. package/es/utils/amount.d.ts +1 -0
  57. package/es/utils/amount.d.ts.map +1 -1
  58. package/es/utils/amount.js +300 -0
  59. package/es/utils/amount.js.map +1 -1
  60. package/js/types/Enum/Activity.js +50 -0
  61. package/js/types/Enum/Activity.js.map +1 -1
  62. package/js/types/Enum/BrandClems.js +157 -0
  63. package/js/types/Enum/BrandClems.js.map +1 -0
  64. package/js/types/Enum/BrandLegalstart.js +3 -3
  65. package/js/types/Enum/BrandLegalstart.js.map +1 -1
  66. package/js/types/Enum/BrandPourcentage.js +2 -2
  67. package/js/types/Enum/BrandPourcentage.js.map +1 -1
  68. package/js/types/Enum/Country.js +780 -0
  69. package/js/types/Enum/Country.js.map +1 -1
  70. package/js/types/Enum/PaymentExpectation.js +60 -0
  71. package/js/types/Enum/PaymentExpectation.js.map +1 -0
  72. package/js/types/Enum/PrestationType.js +54 -0
  73. package/js/types/Enum/PrestationType.js.map +1 -1
  74. package/js/types/Interface/api/exercice/QueryExercice.js +1 -0
  75. package/js/types/Interface/api/exercice/QueryExercice.js.map +1 -1
  76. package/js/types/Interface/api/society/CreateSocietyDetail.js +24 -0
  77. package/js/types/Interface/api/society/CreateSocietyDetail.js.map +1 -0
  78. package/js/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.js +34 -0
  79. package/js/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.js.map +1 -0
  80. package/js/types/Interface/api/statutsGeneration/SendInviteMailParams.js +22 -0
  81. package/js/types/Interface/api/statutsGeneration/SendInviteMailParams.js.map +1 -0
  82. package/js/types/Interface/api/statutsGeneration/UpdateExercice.js +23 -0
  83. package/js/types/Interface/api/statutsGeneration/UpdateExercice.js.map +1 -0
  84. package/js/types/Interface/api/statutsGeneration/UpdateExerciceParams.js +23 -0
  85. package/js/types/Interface/api/statutsGeneration/UpdateExerciceParams.js.map +1 -0
  86. package/js/types/Interface/models/ISocietyDetail.js.map +1 -1
  87. package/js/types/index.js +50 -0
  88. package/js/types/index.js.map +1 -1
  89. package/js/utils/amount.js +238 -0
  90. package/js/utils/amount.js.map +1 -1
  91. package/package.json +1 -1
  92. package/ts/types/Enum/Activity.ts +52 -1
  93. package/ts/types/Enum/BrandClems.ts +154 -0
  94. package/ts/types/Enum/BrandLegalstart.ts +3 -3
  95. package/ts/types/Enum/BrandPourcentage.ts +2 -2
  96. package/ts/types/Enum/Country.ts +394 -0
  97. package/ts/types/Enum/PaymentExpectation.ts +65 -0
  98. package/ts/types/Enum/PrestationType.ts +54 -0
  99. package/ts/types/Interface/api/exercice/QueryExercice.ts +6 -0
  100. package/ts/types/Interface/api/society/CreateSocietyDetail.ts +19 -0
  101. package/ts/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.ts +54 -0
  102. package/ts/types/Interface/api/statutsGeneration/SendInviteMailParams.ts +10 -0
  103. package/ts/types/Interface/api/statutsGeneration/UpdateExercice.ts +16 -0
  104. package/ts/types/Interface/api/statutsGeneration/UpdateExerciceParams.ts +16 -0
  105. package/ts/types/Interface/models/ISocietyDetail.ts +97 -97
  106. package/ts/types/index.ts +5 -0
  107. package/ts/utils/amount.ts +171 -0
@@ -5,105 +5,105 @@ import { ISociety } from './ISociety';
5
5
  // societyDetails
6
6
  export interface ISocietyDetail {
7
7
  id?: number;
8
- detailActivity: string | null;
9
- historyComments: string | null;
10
- isLoans: string | null;
11
- loans: string | null;
12
- personnalContribution: string | null;
13
- nbBanks: string | null;
14
- nbBankaccounts: number | null;
15
- isCashdesk: boolean | null;
16
- nbTva: number | null;
17
- professionnalRent: string | null;
18
- isPersoAdress: string | null;
19
- vehicle: string | null;
20
- interestOtherCompanies: string | null;
21
- nbAssociates: number | null;
22
- nbEmployees: number | null;
23
- hiringPromess: string | null;
24
- aNouveaux: boolean | null;
25
- bilanN1: boolean | null;
26
- revisionDate: Date | null;
27
- dateFirstContact: Date | null;
28
- userIdFirstContact: number | null;
29
- tauxTvaComment: string | null;
30
- remarqueComment: string | null;
31
- remarqueCommentCab: string | null;
32
- acceptation: number | null;
33
- userIdAcceptation: number | null;
34
- lab: boolean | null;
35
- userIdLab: number | null;
36
- previsionCa: string | null;
37
- externalMeans: string | null;
38
- needTreasury: string | null;
39
- judiciaryRecovery: string | null;
40
- fiscalControl: string | null;
41
- descriptionFormation: string | null;
42
- fonctionAndInterlocutors: string | null;
43
- managementKnowledge: string | null;
44
- otherIncome: string | null;
45
- politicalResponsability: string | null;
46
- prohibitedBanking: string | null;
47
- accreARCEOrARE: string | null;
48
- frenchTaxResident: string | null;
49
- isIrTaxable: string | null;
50
- billingSoftware: string | null;
51
- collectionSystem: string | null;
52
- flowSheet: string | null;
53
- rankFiles: string | null;
54
- specificNeeds: string | null;
55
- configAccount: boolean | null;
56
- investissement: string | null;
57
- workInternationnal: string | null;
58
- creationEntreprise: string | null;
59
- oldActivite: string | null;
60
- indemnite: string | null;
61
- findClementine: string | null;
62
- validationDate: Date | null;
63
- idSociety: number | null;
64
- idUser: number | null;
65
- idFile: number | null;
66
- idFileToClient: number | null;
67
- idFindClementine: number | null;
68
- nbAssociatesInCompany: number | null;
69
- hasCommercialLease: string | null;
70
- amountBaseBefore: number | null;
71
- trainingIsDone: boolean;
72
- commercialArea: string | null;
73
- commercialRentAmount: string | null;
74
- hasTravellingExpenses: string | null;
75
- personnalContributionCapital: string | null;
76
- personnalContributionCurrentBankAccount: string | null;
77
- personnalContributionInKind: string | null;
78
- poleEmploiAid: string | null;
79
- poleEmploiAidType: number | null;
80
- honorLoan: string | null;
81
- honorLoanAmount: string | null;
82
- financingStartingStock: string | null;
83
- financingStartingStockAmount: string | null;
84
- yearSocietyCreation: string | null;
85
- lastExerciceCA: string | null;
86
- borrowingInProgress: string | null;
87
- borrowingInProgressAmount: string | null;
88
- investissementCTMT: string | null;
89
- changeECReason: string | null;
90
- isSocietyCreation: boolean | null;
91
- participationsInOtherSociety: string | null;
92
- entrepriseProject: boolean;
93
- contractorProfil: boolean;
94
- notificationForConstitution: boolean;
95
- notificationForOtherMissions: boolean | null;
96
- takeKnowledge: boolean;
97
- bankSynchronisationState: number | null;
98
- platformExplanation:number | null;
99
- mobileAppInstallationProposal:number | null;
100
- verifiedDocuments: boolean | null;
8
+ detailActivity?: string | null;
9
+ historyComments?: string | null;
10
+ isLoans?: string | null;
11
+ loans?: string | null;
12
+ personnalContribution?: string | null;
13
+ nbBanks?: string | null;
14
+ nbBankaccounts?: number | null;
15
+ isCashdesk?: boolean | null;
16
+ nbTva?: number | null;
17
+ professionnalRent?: string | null;
18
+ isPersoAdress?: string | null;
19
+ vehicle?: string | null;
20
+ interestOtherCompanies?: string | null;
21
+ nbAssociates?: number | null;
22
+ nbEmployees?: number | null;
23
+ hiringPromess?: string | null;
24
+ aNouveaux?: boolean | null;
25
+ bilanN1?: boolean | null;
26
+ revisionDate?: Date | null;
27
+ dateFirstContact?: Date | null;
28
+ userIdFirstContact?: number | null;
29
+ tauxTvaComment?: string | null;
30
+ remarqueComment?: string | null;
31
+ remarqueCommentCab?: string | null;
32
+ acceptation?: number | null;
33
+ userIdAcceptation?: number | null;
34
+ lab?: boolean | null;
35
+ userIdLab?: number | null;
36
+ previsionCa?: string | null;
37
+ externalMeans?: string | null;
38
+ needTreasury?: string | null;
39
+ judiciaryRecovery?: string | null;
40
+ fiscalControl?: string | null;
41
+ descriptionFormation?: string | null;
42
+ fonctionAndInterlocutors?: string | null;
43
+ managementKnowledge?: string | null;
44
+ otherIncome?: string | null;
45
+ politicalResponsability?: string | null;
46
+ prohibitedBanking?: string | null;
47
+ accreARCEOrARE?: string | null;
48
+ frenchTaxResident?: string | null;
49
+ isIrTaxable?: string | null;
50
+ billingSoftware?: string | null;
51
+ collectionSystem?: string | null;
52
+ flowSheet?: string | null;
53
+ rankFiles?: string | null;
54
+ specificNeeds?: string | null;
55
+ configAccount?: boolean | null;
56
+ investissement?: string | null;
57
+ workInternationnal?: string | null;
58
+ creationEntreprise?: string | null;
59
+ oldActivite?: string | null;
60
+ indemnite?: string | null;
61
+ findClementine?: string | null;
62
+ validationDate?: Date | null;
63
+ idSociety?: number | null;
64
+ idUser?: number | null;
65
+ idFile?: number | null;
66
+ idFileToClient?: number | null;
67
+ idFindClementine?: number | null;
68
+ nbAssociatesInCompany?: number | null;
69
+ hasCommercialLease?: string | null;
70
+ amountBaseBefore?: number | null;
71
+ trainingIsDone?: boolean;
72
+ commercialArea?: string | null;
73
+ commercialRentAmount?: string | null;
74
+ hasTravellingExpenses?: string | null;
75
+ personnalContributionCapital?: string | null;
76
+ personnalContributionCurrentBankAccount?: string | null;
77
+ personnalContributionInKind?: string | null;
78
+ poleEmploiAid?: string | null;
79
+ poleEmploiAidType?: number | null;
80
+ honorLoan?: string | null;
81
+ honorLoanAmount?: string | null;
82
+ financingStartingStock?: string | null;
83
+ financingStartingStockAmount?: string | null;
84
+ yearSocietyCreation?: string | null;
85
+ lastExerciceCA?: string | null;
86
+ borrowingInProgress?: string | null;
87
+ borrowingInProgressAmount?: string | null;
88
+ investissementCTMT?: string | null;
89
+ changeECReason?: string | null;
90
+ isSocietyCreation?: boolean | null;
91
+ participationsInOtherSociety?: string | null;
92
+ entrepriseProject?: boolean;
93
+ contractorProfil?: boolean;
94
+ notificationForConstitution?: boolean;
95
+ notificationForOtherMissions?: boolean | null;
96
+ takeKnowledge?: boolean;
97
+ bankSynchronisationState?: number | null;
98
+ platformExplanation?:number | null;
99
+ mobileAppInstallationProposal?:number | null;
100
+ verifiedDocuments?: boolean | null;
101
101
  createdAt?: Date | null;
102
102
  updatedAt?: Date | null;
103
103
 
104
104
  // Associations
105
- user: IUser;
106
- file: IFile;
107
- fileToClient: IFile;
108
- society: ISociety;
105
+ user?: IUser;
106
+ file?: IFile;
107
+ fileToClient?: IFile;
108
+ society?: ISociety;
109
109
  }
package/ts/types/index.ts CHANGED
@@ -462,6 +462,7 @@ export * from './Enum/EntityType';
462
462
  export * from './Enum/Compensation';
463
463
  export * from './Enum/CashDeskTransactionType';
464
464
  export * from './Enum/ThirdParty';
465
+ export * from './Enum/PaymentExpectation';
465
466
 
466
467
  // Interfaces API
467
468
  export * from './Interface/api/partnerTransactionType/ReadPartnerTransactionType';
@@ -538,6 +539,7 @@ export * from './Interface/api/commercial/QueryFetchDialogDatasInfosOk';
538
539
  export * from './Interface/api/commercial/QueryMovePrestationsToNextMonth';
539
540
  export * from './Interface/api/society/GetDataSociety';
540
541
  export * from './Interface/api/society/CreateSociety';
542
+ export * from './Interface/api/society/CreateSocietyDetail';
541
543
  export * from './Interface/api/society/UpdateSociety';
542
544
  export * from './Interface/api/society/ListUserSociety';
543
545
  export * from './Interface/api/society/CreateUserToSocietyWithPermission';
@@ -576,6 +578,9 @@ export * from './Interface/api/internalInvoicing/GetLastRef';
576
578
  export * from './Interface/api/exercice/QueryExercice';
577
579
  export * from './Interface/api/exercice/CreateExercice';
578
580
  export * from './Interface/api/exercice/UpdateExercice';
581
+ export * from './Interface/api/statutsGeneration/UpdateExerciceParams';
582
+ export * from './Interface/api/statutsGeneration/SendInviteMailParams';
583
+ export * from './Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams';
579
584
  export * from './Interface/api/accountingIncome/ReadAccountingIncome';
580
585
  export * from './Interface/api/ocr/OcrTransactions';
581
586
  export * from './Interface/api/bankStatement/QueryBankStatement';
@@ -47,4 +47,175 @@ export function integerToFormattedAmountObject(
47
47
  ...result,
48
48
  formattedValue: `${result.sign !== MathematicalSign.EQUAL ? `${result.sign} ` : ''}${result.integerValue},${result.centValue}`,
49
49
  };
50
+ }
51
+
52
+ /**
53
+ * Convertit jusqu'à 999 999 999 999 999 (billion) *
54
+ * @param nombre
55
+ * @returns {string}
56
+ */
57
+ function getUnite(nombre: number):string {
58
+ let unite;
59
+ switch (nombre) {
60
+ // case 0: unite = 'zéro'; break;
61
+ case 1: unite = 'un'; break;
62
+ case 2: unite = 'deux'; break;
63
+ case 3: unite = 'trois'; break;
64
+ case 4: unite = 'quatre'; break;
65
+ case 5: unite = 'cinq'; break;
66
+ case 6: unite = 'six'; break;
67
+ case 7: unite = 'sept'; break;
68
+ case 8: unite = 'huit'; break;
69
+ case 9: unite = 'neuf'; break;
70
+ default: unite = 'zéro'; break;
71
+ }// fin switch
72
+ return unite;
73
+ }
74
+
75
+ function getDizaine(nombre: number):string {
76
+ let dizaine;
77
+ switch (nombre) {
78
+ // case 10: dizaine = 'dix'; break;
79
+ case 11: dizaine = 'onze'; break;
80
+ case 12: dizaine = 'douze'; break;
81
+ case 13: dizaine = 'treize'; break;
82
+ case 14: dizaine = 'quatorze'; break;
83
+ case 15: dizaine = 'quinze'; break;
84
+ case 16: dizaine = 'seize'; break;
85
+ case 17: dizaine = 'dix-sept'; break;
86
+ case 18: dizaine = 'dix-huit'; break;
87
+ case 19: dizaine = 'dix-neuf'; break;
88
+ case 20: dizaine = 'vingt'; break;
89
+ case 30: dizaine = 'trente'; break;
90
+ case 40: dizaine = 'quarante'; break;
91
+ case 50: dizaine = 'cinquante'; break;
92
+ case 60: dizaine = 'soixante'; break;
93
+ case 70: dizaine = 'soixante-dix'; break;
94
+ case 80: dizaine = 'quatre-vingt'; break;
95
+ case 90: dizaine = 'quatre-vingt-dix'; break;
96
+ default: dizaine = 'dix'; break;
97
+ }// fin switch
98
+ return dizaine;
99
+ }//-----------------------------------------------------------------------
100
+
101
+ export function convertNumberToLetter(nombre: number): string {
102
+ let quotient: number; let reste: number;
103
+ let numberToLetter = '';
104
+
105
+ if (nombre.toString().replace(/ /gi, '').length > 15) return 'dépassement de capacité';
106
+ if (Number.isNaN(nombre.toString().replace(/ /gi, ''))) return 'Nombre non valide';
107
+
108
+ const nb = parseFloat(nombre.toString().replace(/ /gi, ''));
109
+ if (Math.ceil(nb) !== nb) return 'Nombre avec virgule non géré.';
110
+
111
+ const n = nb.toString().length;
112
+ switch (n) {
113
+ // case 1: numberToLetter = getUnite(nb); break;
114
+ case 2: if (nb > 19) {
115
+ quotient = Math.floor(nb / 10);
116
+ reste = nb % 10;
117
+ if (nb < 71 || (nb > 79 && nb < 91)) {
118
+ if (reste === 0) numberToLetter = getDizaine(quotient * 10);
119
+ if (reste === 1) numberToLetter = `${getDizaine(quotient * 10)}-et-${getUnite(reste)}`;
120
+ if (reste > 1) numberToLetter = `${getDizaine(quotient * 10)}-${getUnite(reste)}`;
121
+ } else numberToLetter = `${getDizaine((quotient - 1) * 10)}-${getDizaine(10 + reste)}`;
122
+ } else numberToLetter = getDizaine(nb);
123
+ break;
124
+ case 3: quotient = Math.floor(nb / 100);
125
+ reste = nb % 100;
126
+ if (quotient === 1 && reste === 0) numberToLetter = 'cent';
127
+ if (quotient === 1 && reste !== 0) numberToLetter = `${'cent '}${convertNumberToLetter(reste)}`;
128
+ if (quotient > 1 && reste === 0) numberToLetter = `${getUnite(quotient)} cents`;
129
+ if (quotient > 1 && reste !== 0) numberToLetter = `${getUnite(quotient)} cent ${convertNumberToLetter(reste)}`;
130
+ break;
131
+ case 4: quotient = Math.floor(nb / 1000);
132
+ reste = nb - quotient * 1000;
133
+ if (quotient === 1 && reste === 0) numberToLetter = 'mille';
134
+ if (quotient === 1 && reste !== 0) numberToLetter = `${'mille '}${convertNumberToLetter(reste)}`;
135
+ if (quotient > 1 && reste === 0) numberToLetter = `${convertNumberToLetter(quotient)} mille`;
136
+ if (quotient > 1 && reste !== 0) numberToLetter = `${convertNumberToLetter(quotient)} mille ${convertNumberToLetter(reste)}`;
137
+ break;
138
+ case 5: quotient = Math.floor(nb / 1000);
139
+ reste = nb - quotient * 1000;
140
+ if (quotient === 1 && reste === 0) numberToLetter = 'mille';
141
+ if (quotient === 1 && reste !== 0) numberToLetter = `${'mille '}${convertNumberToLetter(reste)}`;
142
+ if (quotient > 1 && reste === 0) numberToLetter = `${convertNumberToLetter(quotient)} mille`;
143
+ if (quotient > 1 && reste !== 0) numberToLetter = `${convertNumberToLetter(quotient)} mille ${convertNumberToLetter(reste)}`;
144
+ break;
145
+ case 6: quotient = Math.floor(nb / 1000);
146
+ reste = nb - quotient * 1000;
147
+ if (quotient === 1 && reste === 0) numberToLetter = 'mille';
148
+ if (quotient === 1 && reste !== 0) numberToLetter = `${'mille '}${convertNumberToLetter(reste)}`;
149
+ if (quotient > 1 && reste === 0) numberToLetter = `${convertNumberToLetter(quotient)} mille`;
150
+ if (quotient > 1 && reste !== 0) numberToLetter = `${convertNumberToLetter(quotient)} mille ${convertNumberToLetter(reste)}`;
151
+ break;
152
+ case 7: quotient = Math.floor(nb / 1000000);
153
+ reste = nb % 1000000;
154
+ if (quotient === 1 && reste === 0) numberToLetter = 'un million';
155
+ if (quotient === 1 && reste !== 0) numberToLetter = `${'un million '}${convertNumberToLetter(reste)}`;
156
+ if (quotient > 1 && reste === 0) numberToLetter = `${convertNumberToLetter(quotient)} millions`;
157
+ if (quotient > 1 && reste !== 0) numberToLetter = `${convertNumberToLetter(quotient)} millions ${convertNumberToLetter(reste)}`;
158
+ break;
159
+ case 8: quotient = Math.floor(nb / 1000000);
160
+ reste = nb % 1000000;
161
+ if (quotient === 1 && reste === 0) numberToLetter = 'un million';
162
+ if (quotient === 1 && reste !== 0) numberToLetter = `${'un million '}${convertNumberToLetter(reste)}`;
163
+ if (quotient > 1 && reste === 0) numberToLetter = `${convertNumberToLetter(quotient)} millions`;
164
+ if (quotient > 1 && reste !== 0) numberToLetter = `${convertNumberToLetter(quotient)} millions ${convertNumberToLetter(reste)}`;
165
+ break;
166
+ case 9: quotient = Math.floor(nb / 1000000);
167
+ reste = nb % 1000000;
168
+ if (quotient === 1 && reste === 0) numberToLetter = 'un million';
169
+ if (quotient === 1 && reste !== 0) numberToLetter = `${'un million '}${convertNumberToLetter(reste)}`;
170
+ if (quotient > 1 && reste === 0) numberToLetter = `${convertNumberToLetter(quotient)} millions`;
171
+ if (quotient > 1 && reste !== 0) numberToLetter = `${convertNumberToLetter(quotient)} millions ${convertNumberToLetter(reste)}`;
172
+ break;
173
+ case 10: quotient = Math.floor(nb / 1000000000);
174
+ reste = nb - quotient * 1000000000;
175
+ if (quotient === 1 && reste === 0) numberToLetter = 'un milliard';
176
+ if (quotient === 1 && reste !== 0) numberToLetter = `${'un milliard '}${convertNumberToLetter(reste)}`;
177
+ if (quotient > 1 && reste === 0) numberToLetter = `${convertNumberToLetter(quotient)} milliards`;
178
+ if (quotient > 1 && reste !== 0) numberToLetter = `${convertNumberToLetter(quotient)} milliards ${convertNumberToLetter(reste)}`;
179
+ break;
180
+ case 11: quotient = Math.floor(nb / 1000000000);
181
+ reste = nb - quotient * 1000000000;
182
+ if (quotient === 1 && reste === 0) numberToLetter = 'un milliard';
183
+ if (quotient === 1 && reste !== 0) numberToLetter = `${'un milliard '}${convertNumberToLetter(reste)}`;
184
+ if (quotient > 1 && reste === 0) numberToLetter = `${convertNumberToLetter(quotient)} milliards`;
185
+ if (quotient > 1 && reste !== 0) numberToLetter = `${convertNumberToLetter(quotient)} milliards ${convertNumberToLetter(reste)}`;
186
+ break;
187
+ case 12: quotient = Math.floor(nb / 1000000000);
188
+ reste = nb - quotient * 1000000000;
189
+ if (quotient === 1 && reste === 0) numberToLetter = 'un milliard';
190
+ if (quotient === 1 && reste !== 0) numberToLetter = `${'un milliard '}${convertNumberToLetter(reste)}`;
191
+ if (quotient > 1 && reste === 0) numberToLetter = `${convertNumberToLetter(quotient)} milliards`;
192
+ if (quotient > 1 && reste !== 0) numberToLetter = `${convertNumberToLetter(quotient)} milliards ${convertNumberToLetter(reste)}`;
193
+ break;
194
+ case 13: quotient = Math.floor(nb / 1000000000000);
195
+ reste = nb - quotient * 1000000000000;
196
+ if (quotient === 1 && reste === 0) numberToLetter = 'un billion';
197
+ if (quotient === 1 && reste !== 0) numberToLetter = `${'un billion '}${convertNumberToLetter(reste)}`;
198
+ if (quotient > 1 && reste === 0) numberToLetter = `${convertNumberToLetter(quotient)} billions`;
199
+ if (quotient > 1 && reste !== 0) numberToLetter = `${convertNumberToLetter(quotient)} billions ${convertNumberToLetter(reste)}`;
200
+ break;
201
+ case 14: quotient = Math.floor(nb / 1000000000000);
202
+ reste = nb - quotient * 1000000000000;
203
+ if (quotient === 1 && reste === 0) numberToLetter = 'un billion';
204
+ if (quotient === 1 && reste !== 0) numberToLetter = `${'un billion '}${convertNumberToLetter(reste)}`;
205
+ if (quotient > 1 && reste === 0) numberToLetter = `${convertNumberToLetter(quotient)} billions`;
206
+ if (quotient > 1 && reste !== 0) numberToLetter = `${convertNumberToLetter(quotient)} billions ${convertNumberToLetter(reste)}`;
207
+ break;
208
+ case 15: quotient = Math.floor(nb / 1000000000000);
209
+ reste = nb - quotient * 1000000000000;
210
+ if (quotient === 1 && reste === 0) numberToLetter = 'un billion';
211
+ if (quotient === 1 && reste !== 0) numberToLetter = `${'un billion '}${convertNumberToLetter(reste)}`;
212
+ if (quotient > 1 && reste === 0) numberToLetter = `${convertNumberToLetter(quotient)} billions`;
213
+ if (quotient > 1 && reste !== 0) numberToLetter = `${convertNumberToLetter(quotient)} billions ${convertNumberToLetter(reste)}`;
214
+ break;
215
+ default: numberToLetter = getUnite(nb); break;
216
+ } // fin switch
217
+ /* respect de l'accord de quatre-vingt */
218
+ if (numberToLetter.substr(numberToLetter.length - 'quatre-vingt'.length, 'quatre-vingt'.length) === 'quatre-vingt') numberToLetter += 's';
219
+
220
+ return numberToLetter;
50
221
  }