@silexpert/core 1.1.326 → 1.1.328
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.
- package/dist/cjs/types/Enum/TimeSlot.js +13 -13
- package/dist/cjs/types/Enum/TimeSlot.js.map +1 -1
- package/dist/cjs/types/Interface/api/userTimeSlot/QueryUserTimeSlot.js +1 -1
- package/dist/cjs/types/Interface/api/userTimeSlot/QueryUserTimeSlot.js.map +1 -1
- package/dist/cjs/utils/payment.d.ts.map +1 -1
- package/dist/cjs/utils/payment.js +1 -0
- package/dist/cjs/utils/payment.js.map +1 -1
- package/dist/mjs/types/Enum/TimeSlot.js +13 -13
- package/dist/mjs/types/Enum/TimeSlot.js.map +1 -1
- package/dist/mjs/types/Interface/api/userTimeSlot/QueryUserTimeSlot.js +1 -1
- package/dist/mjs/types/Interface/api/userTimeSlot/QueryUserTimeSlot.js.map +1 -1
- package/dist/mjs/utils/payment.d.ts.map +1 -1
- package/dist/mjs/utils/payment.js +1 -0
- package/dist/mjs/utils/payment.js.map +1 -1
- package/package.json +1 -1
- package/ts/types/Enum/TimeSlot.ts +13 -13
- package/ts/types/Interface/api/userTimeSlot/QueryUserTimeSlot.ts +1 -1
- package/ts/utils/payment.ts +1 -0
|
@@ -47,7 +47,7 @@ exports.TimeSlotDetail = [
|
|
|
47
47
|
{
|
|
48
48
|
id: TimeSlot.ONBOARDING,
|
|
49
49
|
name: 'OnBoarding',
|
|
50
|
-
internalName: 'OnBoarding',
|
|
50
|
+
internalName: 'Rdv OnBoarding',
|
|
51
51
|
duration: 45,
|
|
52
52
|
idRole: [Role_1.Role.ON_BOARDER],
|
|
53
53
|
forWholeService: true,
|
|
@@ -65,23 +65,23 @@ exports.TimeSlotDetail = [
|
|
|
65
65
|
{
|
|
66
66
|
id: TimeSlot.BILAN,
|
|
67
67
|
name: 'Questions concernant mon bilan',
|
|
68
|
-
internalName: '
|
|
68
|
+
internalName: 'Rdv bilan',
|
|
69
69
|
category: (_a = exports.TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)) === null || _a === void 0 ? void 0 : _a.name,
|
|
70
70
|
duration: 30,
|
|
71
71
|
idRole: [Role_1.Role.ACCOUNTANT],
|
|
72
72
|
forWholeService: false,
|
|
73
|
-
idTimeCounterType: TimeCounterType_1.TimeCounterType.
|
|
73
|
+
idTimeCounterType: TimeCounterType_1.TimeCounterType.CALENDLY.id,
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
id: TimeSlot.TVA,
|
|
77
77
|
name: 'Questions concernant ma TVA',
|
|
78
|
-
internalName: '
|
|
78
|
+
internalName: 'Rdv TVA',
|
|
79
79
|
category: (_b = exports.TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)) === null || _b === void 0 ? void 0 : _b.name,
|
|
80
80
|
duration: 30,
|
|
81
81
|
idRole: [Role_1.Role.ACCOUNTANT],
|
|
82
82
|
idRoleExcluded: [Role_1.Role.MANAGER],
|
|
83
83
|
forWholeService: false,
|
|
84
|
-
idTimeCounterType: TimeCounterType_1.TimeCounterType.
|
|
84
|
+
idTimeCounterType: TimeCounterType_1.TimeCounterType.CALENDLY.id,
|
|
85
85
|
},
|
|
86
86
|
// {
|
|
87
87
|
// id: TimeSlot.TVA_MANAGER,
|
|
@@ -103,7 +103,7 @@ exports.TimeSlotDetail = [
|
|
|
103
103
|
{
|
|
104
104
|
id: TimeSlot.ACCOUNTING_RDV,
|
|
105
105
|
name: 'Conseils',
|
|
106
|
-
internalName: 'Conseils',
|
|
106
|
+
internalName: 'Rdv Conseils',
|
|
107
107
|
category: (_c = exports.TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)) === null || _c === void 0 ? void 0 : _c.name,
|
|
108
108
|
duration: 30,
|
|
109
109
|
idRole: [Role_1.Role.ACCOUNTANT],
|
|
@@ -114,7 +114,7 @@ exports.TimeSlotDetail = [
|
|
|
114
114
|
{
|
|
115
115
|
id: TimeSlot.BILLING,
|
|
116
116
|
name: 'Questions concernant ma facturation',
|
|
117
|
-
internalName: '
|
|
117
|
+
internalName: 'Rdv facturation',
|
|
118
118
|
duration: 30,
|
|
119
119
|
category: (_d = exports.TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)) === null || _d === void 0 ? void 0 : _d.name,
|
|
120
120
|
idRole: [Role_1.Role.FACTURATION],
|
|
@@ -142,7 +142,7 @@ exports.TimeSlotDetail = [
|
|
|
142
142
|
{
|
|
143
143
|
id: TimeSlot.SUPPORTING_CREATION_OF_SOCIETY,
|
|
144
144
|
name: 'Accompagnement pour la création de mon entreprise',
|
|
145
|
-
internalName: '
|
|
145
|
+
internalName: 'Rdv création',
|
|
146
146
|
category: (_e = exports.TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)) === null || _e === void 0 ? void 0 : _e.name,
|
|
147
147
|
duration: 30,
|
|
148
148
|
idRole: [Role_1.Role.JURIDIC],
|
|
@@ -152,7 +152,7 @@ exports.TimeSlotDetail = [
|
|
|
152
152
|
{
|
|
153
153
|
id: TimeSlot.APPROVAL_FINANCIAL_STATEMENTS_AND_DISTRIBUTE_DIVIDENDS,
|
|
154
154
|
name: 'Approuver les comptes et/ou distribuer des dividendes',
|
|
155
|
-
internalName: '
|
|
155
|
+
internalName: 'Rdv juridique',
|
|
156
156
|
category: (_f = exports.TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)) === null || _f === void 0 ? void 0 : _f.name,
|
|
157
157
|
duration: 30,
|
|
158
158
|
idRole: [Role_1.Role.JURIDIC],
|
|
@@ -162,7 +162,7 @@ exports.TimeSlotDetail = [
|
|
|
162
162
|
{
|
|
163
163
|
id: TimeSlot.EDIT_SOCIETY,
|
|
164
164
|
name: 'Modifier mon entreprise',
|
|
165
|
-
internalName: '
|
|
165
|
+
internalName: 'Rdv juridique',
|
|
166
166
|
category: (_g = exports.TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)) === null || _g === void 0 ? void 0 : _g.name,
|
|
167
167
|
duration: 30,
|
|
168
168
|
idRole: [Role_1.Role.JURIDIC],
|
|
@@ -172,7 +172,7 @@ exports.TimeSlotDetail = [
|
|
|
172
172
|
{
|
|
173
173
|
id: TimeSlot.CLOSE_SOCIETY,
|
|
174
174
|
name: 'Fermer mon entreprise',
|
|
175
|
-
internalName: '
|
|
175
|
+
internalName: 'Rdv juridique',
|
|
176
176
|
category: (_h = exports.TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)) === null || _h === void 0 ? void 0 : _h.name,
|
|
177
177
|
duration: 30,
|
|
178
178
|
idRole: [Role_1.Role.JURIDIC],
|
|
@@ -182,7 +182,7 @@ exports.TimeSlotDetail = [
|
|
|
182
182
|
{
|
|
183
183
|
id: TimeSlot.TAX_ADVICE_OR_COMPLEX_LEGAL_ARRANGEMENTS,
|
|
184
184
|
name: 'Conseils fiscaux ou montages juridiques complexes',
|
|
185
|
-
internalName: '
|
|
185
|
+
internalName: 'Rdv juridique',
|
|
186
186
|
category: (_j = exports.TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)) === null || _j === void 0 ? void 0 : _j.name,
|
|
187
187
|
duration: 60,
|
|
188
188
|
idRole: [Role_1.Role.JURIDIC, Role_1.Role.DIRECTOR],
|
|
@@ -192,7 +192,7 @@ exports.TimeSlotDetail = [
|
|
|
192
192
|
{
|
|
193
193
|
id: TimeSlot.FIX_UNPAID,
|
|
194
194
|
name: 'Régulariser un paiement',
|
|
195
|
-
internalName: '
|
|
195
|
+
internalName: 'Rdv impayés',
|
|
196
196
|
duration: 30,
|
|
197
197
|
category: (_k = exports.TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)) === null || _k === void 0 ? void 0 : _k.name,
|
|
198
198
|
idRole: [Role_1.Role.FACTURATION],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeSlot.js","sourceRoot":"","sources":["../../../../ts/types/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AC,EAAE,KAAK,gBAAgB,CAAC,OAAO,CAAC,0CAAE,IAAI;QACnF,MAAM,EAAC,CAAC,WAAI,CAAC,WAAW,CAAC;QACzB,eAAe,EAAE,IAAI;QACrB,iBAAiB,EAAE,iCAAe,CAAC,QAAQ,CAAC,EAAE;KAC/C;CACF,CAAC","sourcesContent":["import { Role } from './Role';\nimport { TimeCounterType } from './TimeCounterType';\n\nexport enum TimeSlot {\n ONBOARDING = 1,\n ONBOARDING_SHORT = 2,\n BILAN = 3,\n TVA = 4,\n TVA_MANAGER = 5,\n BALANCESHEET_OR_TIP = 6,\n ACCOUNTING_RDV = 7,\n BILLING = 8,\n SALES = 9,\n APPOINTMENT = 10,\n SUPPORTING_CREATION_OF_SOCIETY = 11,\n APPROVAL_FINANCIAL_STATEMENTS_AND_DISTRIBUTE_DIVIDENDS = 12,\n EDIT_SOCIETY = 13,\n CLOSE_SOCIETY = 14,\n TAX_ADVICE_OR_COMPLEX_LEGAL_ARRANGEMENTS = 15,\n FIX_UNPAID = 16,\n}\nexport enum TimeSlotCategory {\n ACCOUNTING = 1,\n JURIDIC = 2,\n BILLING = 3,\n}\n\nexport type TimeSlotDetailType = {\n id: number;\n name: string;\n internalName: string;\n category?: string,\n duration: number;\n idRole: number[];\n forWholeService?: boolean\n idRoleExcluded?: number[];\n idTimeCounterType: number;\n};\nexport type TimeSlotCategoryDetailType = {\n id: number;\n name: string;\n};\n\nexport const TimeSlotCategoryDetail:TimeSlotCategoryDetailType[] = [\n {\n id: TimeSlotCategory.ACCOUNTING,\n name: 'Comptable',\n },\n {\n id: TimeSlotCategory.JURIDIC,\n name: 'Juridique',\n },\n {\n id: TimeSlotCategory.BILLING,\n name: 'Facturation',\n },\n];\n\nexport const TimeSlotDetail:TimeSlotDetailType[] = [\n {\n id: TimeSlot.ONBOARDING,\n name: 'OnBoarding',\n internalName: 'OnBoarding',\n duration: 45,\n idRole: [Role.ON_BOARDER],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.ONBOARDING.id,\n },\n {\n id: TimeSlot.ONBOARDING_SHORT,\n name: 'OnBoarding court',\n internalName: 'Rdv OnBoarding',\n duration: 45,\n idRole: [Role.ON_BOARDER],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.ONBOARDING.id,\n },\n {\n id: TimeSlot.BILAN,\n name: 'Questions concernant mon bilan',\n internalName: 'Questions concernant mon bilan',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,\n duration: 30,\n idRole: [Role.ACCOUNTANT],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.BILAN.id,\n },\n {\n id: TimeSlot.TVA,\n name: 'Questions concernant ma TVA',\n internalName: 'Questions concernant ma TVA',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,\n duration: 30,\n idRole:[Role.ACCOUNTANT],\n idRoleExcluded:[Role.MANAGER],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.VAT.id,\n },\n // {\n // id: TimeSlot.TVA_MANAGER,\n // name: 'Tva',\n // internalName: 'Tva Manager',\n // duration: 15,\n // idRole:[Role.ACCOUNTANT, Role.MANAGER],\n // forWholeService: false,\n // },\n // {\n // id: TimeSlot.BALANCESHEET_OR_TIP,\n // name: 'Bilan ou Conseil',\n // internalName: 'Bilan ou Conseil',\n // duration: 30,\n // idRole:[Role.ACCOUNTANT],\n // idRoleExcluded:[Role.MANAGER],\n // forWholeService: false,\n // },\n {\n id: TimeSlot.ACCOUNTING_RDV,\n name: 'Conseils',\n internalName: 'Conseils',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,\n duration: 30,\n idRole:[Role.ACCOUNTANT],\n idRoleExcluded:[Role.MANAGER],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.BILLING,\n name: 'Questions concernant ma facturation',\n internalName: 'Questions concernant ma facturation',\n duration: 30,\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)?.name,\n idRole:[Role.FACTURATION],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.SALES,\n name: 'Rdv commercial',\n internalName: 'Rdv Commercial',\n duration: 20,\n idRole:[Role.COMMERCIAL],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.APPOINTMENT, //TODO: à commenter ? remplacé par idType 7 ?\n name: 'Rdv',\n internalName: 'Rdv',\n duration: 20,\n idRole: [Role.ACCOUNTANT, Role.COMMERCIAL, Role.SOCIAL, Role.JURIDIC, Role.EXPERT_ACCOUNTANT, Role.FACTURATION, Role.LITIGE],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.SUPPORTING_CREATION_OF_SOCIETY,\n name: 'Accompagnement pour la création de mon entreprise',\n internalName: 'Accompagnement pour la création de mon entreprise',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.APPROVAL_FINANCIAL_STATEMENTS_AND_DISTRIBUTE_DIVIDENDS,\n name: 'Approuver les comptes et/ou distribuer des dividendes',\n internalName: 'Approuver les comptes et/ou distribuer des dividendes',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.EDIT_SOCIETY,\n name: 'Modifier mon entreprise',\n internalName: 'Modifier mon entreprise',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.CLOSE_SOCIETY,\n name: 'Fermer mon entreprise',\n internalName: 'Fermer mon entreprise',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.TAX_ADVICE_OR_COMPLEX_LEGAL_ARRANGEMENTS,\n name: 'Conseils fiscaux ou montages juridiques complexes',\n internalName: 'Conseils fiscaux ou montages juridiques complexes',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 60, \n idRole: [Role.JURIDIC, Role.DIRECTOR],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.FIX_UNPAID,\n name: 'Régulariser un paiement',\n internalName: 'Régulariser un paiement',\n duration: 30,\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)?.name,\n idRole:[Role.FACTURATION],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n];"]}
|
|
1
|
+
{"version":3,"file":"TimeSlot.js","sourceRoot":"","sources":["../../../../ts/types/Enum/TimeSlot.ts"],"names":[],"mappings":";;;;AAAA,iCAA8B;AAC9B,uDAAoD;AAEpD,IAAY,QAiBX;AAjBD,WAAY,QAAQ;IAClB,mDAAc,CAAA;IACd,+DAAoB,CAAA;IACpB,yCAAS,CAAA;IACT,qCAAO,CAAA;IACP,qDAAe,CAAA;IACf,qEAAuB,CAAA;IACvB,2DAAkB,CAAA;IAClB,6CAAW,CAAA;IACX,yCAAS,CAAA;IACT,sDAAgB,CAAA;IAChB,4FAAmC,CAAA;IACnC,4IAA2D,CAAA;IAC3D,wDAAiB,CAAA;IACjB,0DAAkB,CAAA;IAClB,gHAA6C,CAAA;IAC7C,oDAAe,CAAA;AACjB,CAAC,EAjBW,QAAQ,wBAAR,QAAQ,QAiBnB;AACD,IAAY,gBA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EAAE,CAAC,WAAI,CAAC,OAAO,CAAC;QACtB,eAAe,EAAE,KAAK;QACtB,iBAAiB,EAAE,iCAAe,CAAC,QAAQ,CAAC,EAAE;KAC/C;IACD;QACE,EAAE,EAAE,QAAQ,CAAC,wCAAwC;QACrD,IAAI,EAAE,mDAAmD;QACzD,YAAY,EAAE,eAAe;QAC7B,QAAQ,EAAE,MAAA,8BAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,gBAAgB,CAAC,OAAO,CAAC,0CAAE,IAAI;QACnF,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,CAAC,WAAI,CAAC,OAAO,EAAE,WAAI,CAAC,QAAQ,CAAC;QACrC,eAAe,EAAE,IAAI;QACrB,iBAAiB,EAAE,iCAAe,CAAC,QAAQ,CAAC,EAAE;KAC/C;IACD;QACE,EAAE,EAAE,QAAQ,CAAC,UAAU;QACvB,IAAI,EAAE,yBAAyB;QAC/B,YAAY,EAAE,aAAa;QAC3B,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,MAAA,8BAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,gBAAgB,CAAC,OAAO,CAAC,0CAAE,IAAI;QACnF,MAAM,EAAC,CAAC,WAAI,CAAC,WAAW,CAAC;QACzB,eAAe,EAAE,IAAI;QACrB,iBAAiB,EAAE,iCAAe,CAAC,QAAQ,CAAC,EAAE;KAC/C;CACF,CAAC","sourcesContent":["import { Role } from './Role';\nimport { TimeCounterType } from './TimeCounterType';\n\nexport enum TimeSlot {\n ONBOARDING = 1,\n ONBOARDING_SHORT = 2,\n BILAN = 3,\n TVA = 4,\n TVA_MANAGER = 5,\n BALANCESHEET_OR_TIP = 6,\n ACCOUNTING_RDV = 7,\n BILLING = 8,\n SALES = 9,\n APPOINTMENT = 10,\n SUPPORTING_CREATION_OF_SOCIETY = 11,\n APPROVAL_FINANCIAL_STATEMENTS_AND_DISTRIBUTE_DIVIDENDS = 12,\n EDIT_SOCIETY = 13,\n CLOSE_SOCIETY = 14,\n TAX_ADVICE_OR_COMPLEX_LEGAL_ARRANGEMENTS = 15,\n FIX_UNPAID = 16,\n}\nexport enum TimeSlotCategory {\n ACCOUNTING = 1,\n JURIDIC = 2,\n BILLING = 3,\n}\n\nexport type TimeSlotDetailType = {\n id: number;\n name: string;\n internalName: string;\n category?: string,\n duration: number;\n idRole: number[];\n forWholeService?: boolean\n idRoleExcluded?: number[];\n idTimeCounterType: number;\n};\nexport type TimeSlotCategoryDetailType = {\n id: number;\n name: string;\n};\n\nexport const TimeSlotCategoryDetail:TimeSlotCategoryDetailType[] = [\n {\n id: TimeSlotCategory.ACCOUNTING,\n name: 'Comptable',\n },\n {\n id: TimeSlotCategory.JURIDIC,\n name: 'Juridique',\n },\n {\n id: TimeSlotCategory.BILLING,\n name: 'Facturation',\n },\n];\n\nexport const TimeSlotDetail:TimeSlotDetailType[] = [\n {\n id: TimeSlot.ONBOARDING,\n name: 'OnBoarding',\n internalName: 'Rdv OnBoarding',\n duration: 45,\n idRole: [Role.ON_BOARDER],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.ONBOARDING.id,\n },\n {\n id: TimeSlot.ONBOARDING_SHORT,\n name: 'OnBoarding court',\n internalName: 'Rdv OnBoarding',\n duration: 45,\n idRole: [Role.ON_BOARDER],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.ONBOARDING.id,\n },\n {\n id: TimeSlot.BILAN,\n name: 'Questions concernant mon bilan',\n internalName: 'Rdv bilan',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,\n duration: 30,\n idRole: [Role.ACCOUNTANT],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.TVA,\n name: 'Questions concernant ma TVA',\n internalName: 'Rdv TVA',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,\n duration: 30,\n idRole:[Role.ACCOUNTANT],\n idRoleExcluded:[Role.MANAGER],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n // {\n // id: TimeSlot.TVA_MANAGER,\n // name: 'Tva',\n // internalName: 'Tva Manager',\n // duration: 15,\n // idRole:[Role.ACCOUNTANT, Role.MANAGER],\n // forWholeService: false,\n // },\n // {\n // id: TimeSlot.BALANCESHEET_OR_TIP,\n // name: 'Bilan ou Conseil',\n // internalName: 'Bilan ou Conseil',\n // duration: 30,\n // idRole:[Role.ACCOUNTANT],\n // idRoleExcluded:[Role.MANAGER],\n // forWholeService: false,\n // },\n {\n id: TimeSlot.ACCOUNTING_RDV,\n name: 'Conseils',\n internalName: 'Rdv Conseils',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,\n duration: 30,\n idRole:[Role.ACCOUNTANT],\n idRoleExcluded:[Role.MANAGER],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.BILLING,\n name: 'Questions concernant ma facturation',\n internalName: 'Rdv facturation',\n duration: 30,\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)?.name,\n idRole:[Role.FACTURATION],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.SALES,\n name: 'Rdv commercial',\n internalName: 'Rdv Commercial',\n duration: 20,\n idRole:[Role.COMMERCIAL],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.APPOINTMENT, //TODO: à commenter ? remplacé par idType 7 ?\n name: 'Rdv',\n internalName: 'Rdv',\n duration: 20,\n idRole: [Role.ACCOUNTANT, Role.COMMERCIAL, Role.SOCIAL, Role.JURIDIC, Role.EXPERT_ACCOUNTANT, Role.FACTURATION, Role.LITIGE],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.SUPPORTING_CREATION_OF_SOCIETY,\n name: 'Accompagnement pour la création de mon entreprise',\n internalName: 'Rdv création',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.APPROVAL_FINANCIAL_STATEMENTS_AND_DISTRIBUTE_DIVIDENDS,\n name: 'Approuver les comptes et/ou distribuer des dividendes',\n internalName: 'Rdv juridique',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.EDIT_SOCIETY,\n name: 'Modifier mon entreprise',\n internalName: 'Rdv juridique',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.CLOSE_SOCIETY,\n name: 'Fermer mon entreprise',\n internalName: 'Rdv juridique',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.TAX_ADVICE_OR_COMPLEX_LEGAL_ARRANGEMENTS,\n name: 'Conseils fiscaux ou montages juridiques complexes',\n internalName: 'Rdv juridique',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 60, \n idRole: [Role.JURIDIC, Role.DIRECTOR],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.FIX_UNPAID,\n name: 'Régulariser un paiement',\n internalName: 'Rdv impayés',\n duration: 30,\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)?.name,\n idRole:[Role.FACTURATION],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n];"]}
|
|
@@ -18,7 +18,7 @@ exports.QueryUserTimeSlot = QueryUserTimeSlot;
|
|
|
18
18
|
__decorate([
|
|
19
19
|
(0, utils_1.ApiPropertyOptional)(),
|
|
20
20
|
(0, class_validator_1.IsOptional)(),
|
|
21
|
-
(0, class_validator_1.IsInt)(),
|
|
21
|
+
(0, class_validator_1.IsInt)({ each: true }),
|
|
22
22
|
__metadata("design:type", Number)
|
|
23
23
|
], QueryUserTimeSlot.prototype, "idUser", void 0);
|
|
24
24
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryUserTimeSlot.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/userTimeSlot/QueryUserTimeSlot.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAoD;AACpD,6CAAwD;AAExD,MAAa,iBAAiB;CAU7B;AAVD,8CAUC;AANG;IAHD,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,
|
|
1
|
+
{"version":3,"file":"QueryUserTimeSlot.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/userTimeSlot/QueryUserTimeSlot.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAoD;AACpD,6CAAwD;AAExD,MAAa,iBAAiB;CAU7B;AAVD,8CAUC;AANG;IAHD,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;iDACJ;AAKhB;IAHD,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;;iDACU","sourcesContent":["import { IsInt, IsOptional } from 'class-validator';\nimport { ApiPropertyOptional } from '../../../../utils';\n\nexport class QueryUserTimeSlot {\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt({ each: true })\n idUser?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n idType?: number;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../ts/utils/payment.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAe,qBAAqB,EAAiB,WAAW,EAA0B,MAAM,UAAU,CAAC;AAK5H,UAAU,gBAAiB,SAAQ,QAAQ;IACzC,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7D,YAAY,EAAE,QAAQ,EAAE,CAAA;CACzB;AAED;;;;;;;;;GASG;AACH,QAAA,MAAM,0BAA0B,aAAc,QAAQ,EAAE,UAAS,CAAC,aAAa,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC,EAAE,KAA2D,gBAAgB,EAoCrM,CAAC;AAkBF;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,qBAAqB,WAAY,qBAAqB,KAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../ts/utils/payment.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAe,qBAAqB,EAAiB,WAAW,EAA0B,MAAM,UAAU,CAAC;AAK5H,UAAU,gBAAiB,SAAQ,QAAQ;IACzC,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7D,YAAY,EAAE,QAAQ,EAAE,CAAA;CACzB;AAED;;;;;;;;;GASG;AACH,QAAA,MAAM,0BAA0B,aAAc,QAAQ,EAAE,UAAS,CAAC,aAAa,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC,EAAE,KAA2D,gBAAgB,EAoCrM,CAAC;AAkBF;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,qBAAqB,WAAY,qBAAqB,KAAE,WAAW,EAoQxE,CAAC;AAEF,OAAO,EACL,0BAA0B,EAAE,qBAAqB,GAClD,CAAC"}
|
|
@@ -132,6 +132,7 @@ const calculatePaymentsAuto = (params) => {
|
|
|
132
132
|
closingDate: (listPartialExercicePrestationExpress === null || listPartialExercicePrestationExpress === void 0 ? void 0 : listPartialExercicePrestationExpress.length) ? listPartialExercicePrestationExpress[0].endDate : firstExerciceNonExpresssEndDate,
|
|
133
133
|
comment: 'Frais de dossier',
|
|
134
134
|
});
|
|
135
|
+
remainingAmount += applicationFeesAmountTTC;
|
|
135
136
|
}
|
|
136
137
|
// =========================
|
|
137
138
|
// EXPRESS
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../ts/utils/payment.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAEb,oCAA4H;AAC5H,+BAA+B;AAE/B,6CAAsE;AAOtE;;;;;;;;;GASG;AACH,MAAM,0BAA0B,GAAG,CAAC,QAAoB,EAAE,QAAoE,CAAC,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,CAAC,EAAsB,EAAE;IACzM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,mBAAC,OAAA,MAAA,MAAA,MAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,mBAAmB,0CAAE,eAAe,0CAAE,WAAW,mCAAI,KAAK,CAAA,EAAA,CAAC,CAAC;IAChH,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAC,OAAA,CAAC,CAAA,MAAA,MAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,mBAAmB,0CAAE,eAAe,0CAAE,WAAW,CAAA,KAAI,MAAA,MAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,mBAAmB,0CAAE,eAAe,0CAAE,QAAQ,CAAA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AC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC;QACjE,IAAI,MAAM,GAAG,aAAa,CAAC;QAE3B,iDAAiD;QACjD,yGAAyG;QACzG,uDAAuD;QACvD,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QAExD,YAAY,CAAC,IAAI,CAAC;YAChB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG;YACtC,WAAW,EAAE,WAAW;YACxB,YAAY;YACZ,eAAe,EAAE,qBAAa,CAAC,YAAY,CAAC,EAAE;YAC9C,WAAW,EAAE,eAAe;SAC7B,CAAC,CAAC;QACH,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7E,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAG4B,sDAAqB","sourcesContent":["'use strict';\n\nimport { IPayment, IRegulation, ParamsForPaymentsAuto, PaymentMethod, PaymentAuto, getTaxesIncludedAmount } from '../types';\nimport * as dayjs from 'dayjs';\nimport { PartialExercicePrestationExpress } from '../types/Interface/api/payment/Util';\nimport { getApplicationFeesAmount, getPriceGrid } from './prestation';\n\ninterface PaymentsWithList extends IPayment {\n type: 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther',\n listPayments: IPayment[]\n}\n\n/**\n * A partir d'une liste de payment (avec include jusqu'à prestationList, \n * avec en attributs 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther')\n * permet de récupérer uniquement le premier paiement de chaque type \n * et les autres payments dans listPayments\n * avec possibilité de filtrer avec le tableau de filtres\n * @param payments \n * @param types \n * @returns \n */\nconst groupPaymentsByServiceType = (payments: IPayment[], types: ('isComptable' | 'isJuridique' | 'isSocial' | 'isOther')[] = ['isComptable', 'isJuridique', 'isSocial', 'isOther']): PaymentsWithList[] => {\n const prestaComptable = payments.filter((el) => el?.paymentsPrestations?.prestationsList?.isComptable ?? false);\n const prestaSocial = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isSocial);\n const prestaJuridique = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isJuridique);\n const prestaOther = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && !el?.paymentsPrestations?.prestationsList?.isJuridique && !el?.paymentsPrestations?.prestationsList?.isSocial);\n \n const societyPayment: PaymentsWithList[] = [];\n if (prestaComptable.length && types.includes('isComptable')) {\n societyPayment.push({\n ...prestaComptable[0], // Données de base\n type: 'isComptable',\n listPayments: prestaComptable,\n });\n }\n if (prestaSocial.length && types.includes('isSocial')) {\n societyPayment.push({\n ...prestaSocial[0], // Données de base\n type: 'isSocial',\n listPayments: prestaSocial,\n });\n }\n if (prestaJuridique.length && types.includes('isJuridique')) {\n societyPayment.push({\n ...prestaJuridique[0], // Données de base\n type: 'isJuridique',\n listPayments: prestaJuridique,\n });\n }\n if (prestaOther.length && types.includes('isOther')) {\n societyPayment.push({\n ...prestaOther[0], // Données de base\n type: 'isOther',\n listPayments: prestaOther,\n });\n }\n return societyPayment;\n};\n\nconst calculateFees = (amount: number, goToClient: Date, paymentDate: Date):number => {\n const yearlyPriceIncreasing = 1.0275;\n\n const oneYearLessIfIn3LastMonthsOfYear = dayjs(goToClient).month() >= 9 ? 1 : 0;\n\n if (dayjs(paymentDate).year() - dayjs().year() > 0) {\n const nbYearsMore = dayjs(paymentDate).year() - dayjs().year() - oneYearLessIfIn3LastMonthsOfYear;\n // on applique X fois l'augmentation\n // ex. : si on lance l'appel en 2024, et qu'on génére un paiement pour 2026, on applique 2 fois l'augmentation\n // soit amount * yearlyPriceIncreasing * yearlyPriceIncreasing\n // soit amount * yearlyPriceIncreasing ^ nbYearsMore\n amount = amount * Math.pow(yearlyPriceIncreasing, nbYearsMore);\n }\n return amount;\n};\n\n/**\n// * @param {number} firstPaymentAmount - amount of the first payment (first regulation of the customer)\n * @param {Date} firstExerciceNonExpresssEndDate - end date of the first exercice non express\n * @param {number} idPrestation - prestation id\n * @param {number} idLegalForm - legal form id of the society\n * @param {boolean} isWithApplicationFees - if the prestation has application fees to paid\n * @param {IPrestationList} prestationList - type of prestation (hidden: 0, isCatalog: 1, isComptable: 1)\n * @param {number} idVat - vat id of society linked\n * @param {number} yearlyAmountNonExpress - yearly amount of non express prestation (HT)\n * @param {number} nextYearlyAmountNonExpress - yearly amount of non express prestation for next years (HT)\n * @param {PartialExercicePrestationExpress[]} listPartialExercicePrestationExpress - list of exercicePrestation linked to idPrestation -> used to get express\n * @param {IRegulation[]} listRegulations - list of regulations linked to idPrestation (TTC)\n * @param {Date} recoveryDate - date of recovery of the society\n * @returns { IPayment[] } list of payment to create for billing auto, after each presta go to onBoarding\n */\nconst calculatePaymentsAuto = (params: ParamsForPaymentsAuto):PaymentAuto[] => {\n const { idTypeBrand, goToClient, isWithApplicationFees, firstExerciceNonExpresssEndDate, idPrestation, idLegalForm, prestationList, idVat, yearlyAmountNonExpress, nextYearlyAmountNonExpress, listPartialExercicePrestationExpress, listRegulations, recoveryDate } = params;\n \n if (!yearlyAmountNonExpress) throw new Error('Le montant annuel des prestations non express ne peut pas être nul.');\n\n let initializedPaymentDate = dayjs().endOf('month').diff(dayjs(), 'day') < 3/* || dayjs().date() >= 15 */\n ? dayjs().add(2, 'month').startOf('month').toDate()\n : dayjs().add(1, 'month').startOf('month').toDate();\n \n //Si date de reprise, alors on initialise à cette date\n if (recoveryDate && dayjs(recoveryDate).isAfter(dayjs(), 'month')) {\n initializedPaymentDate = dayjs(recoveryDate).startOf('month').toDate();\n }\n\n // On récupère la grille tarifaire pour savoir si les tarifs sont HT ou TTC \n // et pour connaitre le montant du coût de l'app\n if (!prestationList.id) throw new Error('idPrestationList manquant');\n const priceGrid = getPriceGrid(idTypeBrand, prestationList.id);\n if (!priceGrid) throw new Error('Impossible de trouver la grille tarifaire correspondante');\n const { applicationCost, priceWithTaxesIncluded } = priceGrid;\n const applicationCostTotalTTC = (priceWithTaxesIncluded ? applicationCost : getTaxesIncludedAmount(applicationCost, idVat)) * 12;\n const applicationFeesAmountTTC = getApplicationFeesAmount(idLegalForm, idVat);\n\n if (prestationList?.isCatalog || !prestationList?.isComptable) throw new Error('Ce type de prestation ne correspond pas aux conditions attendues.');\n if (listPartialExercicePrestationExpress.length && listPartialExercicePrestationExpress?.some((ep: PartialExercicePrestationExpress) => !ep?.startDate)) throw new Error('Start date of some exercice are missing');\n\n const nbExoExpress = listPartialExercicePrestationExpress.length;\n const listPayments:PaymentAuto[] = [];\n\n // on récupère le/les premiers réglements effectués, non alloués\n // const isApplicationFeesAlreadyPaid = false;\n const sumRegulations = listRegulations.reduce((acc: number, r:IRegulation) => {\n //Si la regulation est rattachée à un paymentExpectation, on récupère le détail\n // et on ne prend que les frais de dossier (applicationFee) + le montant de la compta (accountingFee)\n \n // Commenté temporairement :\n // Pour l'instant, on ne prend plus en compte les paymentExpectation :\n // On part du principe que si isWithApplicationFees = true, alors les regulations contiennent les frais de dossier\n // sinon, ils sont offerts et n'apparaissent pas\n /* if (r.paymentsExpectation?.payload) {\n const payload = JSON.parse(r.paymentsExpectation?.payload);\n if (+payload?.applicationFee > 0) {\n isApplicationFeesAlreadyPaid = true;\n acc += +payload?.applicationFee;\n }\n if (+payload?.accountingFee > 0) acc += +payload?.accountingFee;\n return acc;\n } else {\n return acc + r.amount - r.amountUsed;\n } */\n return acc + r.amount - r.amountUsed;\n }, 0);\n let remainingAmount = -sumRegulations; //TTC\n let paymentDate = initializedPaymentDate;\n\n //On order les exercicePrestation par startDate ASC et id ASC\n listPartialExercicePrestationExpress.sort((a, b) => {\n const aStartDate = a?.startDate as Date;\n const bStartDate = b?.startDate as Date;\n return dayjs(aStartDate).diff(bStartDate);\n });\n\n // Si les frais de dossiers sont facturés, on ajoute un paiement sur le mois en cours\n if (isWithApplicationFees) {\n listPayments.push({\n amount: applicationFeesAmountTTC, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: listPartialExercicePrestationExpress?.length ? listPartialExercicePrestationExpress[0].endDate : firstExerciceNonExpresssEndDate,\n comment: 'Frais de dossier',\n });\n }\n \n // =========================\n // EXPRESS\n // =========================\n listPartialExercicePrestationExpress.forEach((exercicePrestation:PartialExercicePrestationExpress, indexEP: number) => {\n const remainingBeforeThisExo = remainingAmount;\n\n remainingAmount += !priceWithTaxesIncluded \n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat) \n : exercicePrestation.totalAmount; //TTC\n \n \n // Si le premier règlement couvre le coût de cet exercicePrestation, \n // on créé un paiement pour cet exo et on passe au suivant\n if (remainingAmount <= 0) {\n listPayments.push({\n amount: Math.round(100 * (!priceWithTaxesIncluded \n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat) \n : exercicePrestation.totalAmount)) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n return;\n } else if (remainingBeforeThisExo < 0 && remainingAmount > 0) {\n // Si le paiement couvre une partie du paiement, on créé un paiement pour cette partie lié à l'exo \n listPayments.push({\n amount: Math.round(100 * -remainingBeforeThisExo) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n }\n \n //express : on étale en countExpressMonthlyPayment (nb de mensualités)\n let remainingAmountByExercicePrestation = remainingAmount; //TTC\n let countExpressMonthlyPayment = exercicePrestation?.countExpressMonthlyPayment ?? 3; //TTC\n //Si un premier règlement est généré avec le montant des regulations, on le considère comme une mensualité (unioquement pour le premier express et la première mensualité)\n if (indexEP === 0 && sumRegulations > 0) countExpressMonthlyPayment -= 1;\n\n const monthlyAmount = remainingAmountByExercicePrestation / countExpressMonthlyPayment; //TTC\n for (let index = 1; index <= countExpressMonthlyPayment; index++) {\n // On arrondis les 11 premières mensualités, mais on récupère le reste pour la dernière mensualité, pour éviter les centimes perdus en arrondis\n // et on applique le taux de tva de la société\n const amount = index < countExpressMonthlyPayment ? monthlyAmount : remainingAmountByExercicePrestation; //TTC\n \n // On évite les paiements de moins d'0,01 € (pour les paymentsExpectations ayant une différence de 1 cents)\n if (amount >= 0.005)\n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n remainingAmountByExercicePrestation -= monthlyAmount; \n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n remainingAmount = 0;\n });\n\n // =========================\n // NON EXPRESS\n // =========================\n // on lisse sur le nb de mois restants (avec au minimum 3 mensualités)\n // Si un seul exo express, alors on met les paiements de l'exo actuel en parallèle\n // sinon, ils sont à la suite des express\n if (nbExoExpress <= 1) paymentDate = initializedPaymentDate;\n let exerciceEndDate = dayjs(firstExerciceNonExpresssEndDate).toDate();\n\n let hasGeneratedWholeYear = false;\n let isFirstNonExpress = true;\n \n //On génère des paiements jusqu'à ce qu'un exercice soit entier (12 mois), non express\n while (!hasGeneratedWholeYear) {\n \n //On compte le nb de mois restants entre la date à laquelle le paiement va être créé et la date de fin d'exercice\n let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));\n if (countMonthsBeforeExerciceEnd < 3) countMonthsBeforeExerciceEnd = 3;\n\n const exoAmount = isFirstNonExpress ? yearlyAmountNonExpress : nextYearlyAmountNonExpress;\n const remainingBeforeThisExo = remainingAmount;\n remainingAmount += priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat);\n\n // Si le premier règlement couvre le coût de cet exercicePrestation, \n // on créé un paiement pour cet exo et on passe au suivant\n if (remainingAmount <= 0) {\n listPayments.push({\n amount: Math.round(100 * (priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat))) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n exerciceEndDate = dayjs(exerciceEndDate).startOf('month').add(1, 'year').endOf('month').toDate();\n continue;\n } else if (remainingBeforeThisExo < 0 && remainingAmount > 0) {\n // Si le paiement couvre une partie du paiement, on créé un paiement pour cette partie lié à l'exo \n listPayments.push({\n amount: Math.round(100 * -remainingBeforeThisExo) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n }\n\n let remainingAmountByExercicePrestation = remainingAmount;\n\n // - frais d'application dès les second exo non express\n if (!isFirstNonExpress) remainingAmountByExercicePrestation += applicationCostTotalTTC;\n\n const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd; //TTC\n\n if (monthlyAmount > 0) {\n for (let index = 1; index <= countMonthsBeforeExerciceEnd; index++) {\n let amount = index < countMonthsBeforeExerciceEnd ? monthlyAmount : remainingAmountByExercicePrestation;\n \n // Si besoin, on applique les frais nécessaires :\n // - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)\n amount = calculateFees(amount, goToClient, paymentDate);\n \n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n remainingAmountByExercicePrestation -= monthlyAmount; \n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n exerciceEndDate = dayjs(exerciceEndDate).startOf('month').add(1, 'year').endOf('month').toDate();\n }\n remainingAmount = 0;\n if (countMonthsBeforeExerciceEnd === 12) hasGeneratedWholeYear = true;\n isFirstNonExpress = false;\n }\n\n remainingAmount = 0;\n\n // =========================\n // JUSQU'EN DECEMBRE\n // =========================\n // On applique le taux de tva de la société, si besoin, selon la grille tarifaire\n remainingAmount += priceWithTaxesIncluded ? nextYearlyAmountNonExpress : getTaxesIncludedAmount(nextYearlyAmountNonExpress, idVat);\n\n let remainingAmountByExercicePrestation = remainingAmount;\n //On compte le nb de mois restants entre la date à laquelle le paiement va être créé et la date de fin d'exercice\n let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));\n if (countMonthsBeforeExerciceEnd < 3) countMonthsBeforeExerciceEnd = 3;\n\n // - frais d'application dès les second exo non express\n remainingAmountByExercicePrestation += applicationCostTotalTTC;\n \n const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd;\n \n // Si aucun paiement généré, on stoppe là\n if (!listPayments.length) return [];\n\n while (dayjs(listPayments.slice(-1)[0].datePayment).month() < 11) {\n let amount = monthlyAmount;\n\n // Si besoin, on applique les frais nécessaires :\n // - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)\n // - frais d'application dès les second exo non express\n amount = calculateFees(amount, goToClient, paymentDate);\n\n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n\n return listPayments;\n};\n\nexport {\n groupPaymentsByServiceType, calculatePaymentsAuto,\n};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,qBAAa,CAAC,YAAY,CAAC,EAAE;YAC9C,WAAW,EAAE,eAAe;SAC7B,CAAC,CAAC;QACH,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7E,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAG4B,sDAAqB","sourcesContent":["'use strict';\n\nimport { IPayment, IRegulation, ParamsForPaymentsAuto, PaymentMethod, PaymentAuto, getTaxesIncludedAmount } from '../types';\nimport * as dayjs from 'dayjs';\nimport { PartialExercicePrestationExpress } from '../types/Interface/api/payment/Util';\nimport { getApplicationFeesAmount, getPriceGrid } from './prestation';\n\ninterface PaymentsWithList extends IPayment {\n type: 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther',\n listPayments: IPayment[]\n}\n\n/**\n * A partir d'une liste de payment (avec include jusqu'à prestationList, \n * avec en attributs 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther')\n * permet de récupérer uniquement le premier paiement de chaque type \n * et les autres payments dans listPayments\n * avec possibilité de filtrer avec le tableau de filtres\n * @param payments \n * @param types \n * @returns \n */\nconst groupPaymentsByServiceType = (payments: IPayment[], types: ('isComptable' | 'isJuridique' | 'isSocial' | 'isOther')[] = ['isComptable', 'isJuridique', 'isSocial', 'isOther']): PaymentsWithList[] => {\n const prestaComptable = payments.filter((el) => el?.paymentsPrestations?.prestationsList?.isComptable ?? false);\n const prestaSocial = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isSocial);\n const prestaJuridique = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isJuridique);\n const prestaOther = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && !el?.paymentsPrestations?.prestationsList?.isJuridique && !el?.paymentsPrestations?.prestationsList?.isSocial);\n \n const societyPayment: PaymentsWithList[] = [];\n if (prestaComptable.length && types.includes('isComptable')) {\n societyPayment.push({\n ...prestaComptable[0], // Données de base\n type: 'isComptable',\n listPayments: prestaComptable,\n });\n }\n if (prestaSocial.length && types.includes('isSocial')) {\n societyPayment.push({\n ...prestaSocial[0], // Données de base\n type: 'isSocial',\n listPayments: prestaSocial,\n });\n }\n if (prestaJuridique.length && types.includes('isJuridique')) {\n societyPayment.push({\n ...prestaJuridique[0], // Données de base\n type: 'isJuridique',\n listPayments: prestaJuridique,\n });\n }\n if (prestaOther.length && types.includes('isOther')) {\n societyPayment.push({\n ...prestaOther[0], // Données de base\n type: 'isOther',\n listPayments: prestaOther,\n });\n }\n return societyPayment;\n};\n\nconst calculateFees = (amount: number, goToClient: Date, paymentDate: Date):number => {\n const yearlyPriceIncreasing = 1.0275;\n\n const oneYearLessIfIn3LastMonthsOfYear = dayjs(goToClient).month() >= 9 ? 1 : 0;\n\n if (dayjs(paymentDate).year() - dayjs().year() > 0) {\n const nbYearsMore = dayjs(paymentDate).year() - dayjs().year() - oneYearLessIfIn3LastMonthsOfYear;\n // on applique X fois l'augmentation\n // ex. : si on lance l'appel en 2024, et qu'on génére un paiement pour 2026, on applique 2 fois l'augmentation\n // soit amount * yearlyPriceIncreasing * yearlyPriceIncreasing\n // soit amount * yearlyPriceIncreasing ^ nbYearsMore\n amount = amount * Math.pow(yearlyPriceIncreasing, nbYearsMore);\n }\n return amount;\n};\n\n/**\n// * @param {number} firstPaymentAmount - amount of the first payment (first regulation of the customer)\n * @param {Date} firstExerciceNonExpresssEndDate - end date of the first exercice non express\n * @param {number} idPrestation - prestation id\n * @param {number} idLegalForm - legal form id of the society\n * @param {boolean} isWithApplicationFees - if the prestation has application fees to paid\n * @param {IPrestationList} prestationList - type of prestation (hidden: 0, isCatalog: 1, isComptable: 1)\n * @param {number} idVat - vat id of society linked\n * @param {number} yearlyAmountNonExpress - yearly amount of non express prestation (HT)\n * @param {number} nextYearlyAmountNonExpress - yearly amount of non express prestation for next years (HT)\n * @param {PartialExercicePrestationExpress[]} listPartialExercicePrestationExpress - list of exercicePrestation linked to idPrestation -> used to get express\n * @param {IRegulation[]} listRegulations - list of regulations linked to idPrestation (TTC)\n * @param {Date} recoveryDate - date of recovery of the society\n * @returns { IPayment[] } list of payment to create for billing auto, after each presta go to onBoarding\n */\nconst calculatePaymentsAuto = (params: ParamsForPaymentsAuto):PaymentAuto[] => {\n const { idTypeBrand, goToClient, isWithApplicationFees, firstExerciceNonExpresssEndDate, idPrestation, idLegalForm, prestationList, idVat, yearlyAmountNonExpress, nextYearlyAmountNonExpress, listPartialExercicePrestationExpress, listRegulations, recoveryDate } = params;\n \n if (!yearlyAmountNonExpress) throw new Error('Le montant annuel des prestations non express ne peut pas être nul.');\n\n let initializedPaymentDate = dayjs().endOf('month').diff(dayjs(), 'day') < 3/* || dayjs().date() >= 15 */\n ? dayjs().add(2, 'month').startOf('month').toDate()\n : dayjs().add(1, 'month').startOf('month').toDate();\n \n //Si date de reprise, alors on initialise à cette date\n if (recoveryDate && dayjs(recoveryDate).isAfter(dayjs(), 'month')) {\n initializedPaymentDate = dayjs(recoveryDate).startOf('month').toDate();\n }\n\n // On récupère la grille tarifaire pour savoir si les tarifs sont HT ou TTC \n // et pour connaitre le montant du coût de l'app\n if (!prestationList.id) throw new Error('idPrestationList manquant');\n const priceGrid = getPriceGrid(idTypeBrand, prestationList.id);\n if (!priceGrid) throw new Error('Impossible de trouver la grille tarifaire correspondante');\n const { applicationCost, priceWithTaxesIncluded } = priceGrid;\n const applicationCostTotalTTC = (priceWithTaxesIncluded ? applicationCost : getTaxesIncludedAmount(applicationCost, idVat)) * 12;\n const applicationFeesAmountTTC = getApplicationFeesAmount(idLegalForm, idVat);\n\n if (prestationList?.isCatalog || !prestationList?.isComptable) throw new Error('Ce type de prestation ne correspond pas aux conditions attendues.');\n if (listPartialExercicePrestationExpress.length && listPartialExercicePrestationExpress?.some((ep: PartialExercicePrestationExpress) => !ep?.startDate)) throw new Error('Start date of some exercice are missing');\n\n const nbExoExpress = listPartialExercicePrestationExpress.length;\n const listPayments:PaymentAuto[] = [];\n\n // on récupère le/les premiers réglements effectués, non alloués\n // const isApplicationFeesAlreadyPaid = false;\n const sumRegulations = listRegulations.reduce((acc: number, r:IRegulation) => {\n //Si la regulation est rattachée à un paymentExpectation, on récupère le détail\n // et on ne prend que les frais de dossier (applicationFee) + le montant de la compta (accountingFee)\n \n // Commenté temporairement :\n // Pour l'instant, on ne prend plus en compte les paymentExpectation :\n // On part du principe que si isWithApplicationFees = true, alors les regulations contiennent les frais de dossier\n // sinon, ils sont offerts et n'apparaissent pas\n /* if (r.paymentsExpectation?.payload) {\n const payload = JSON.parse(r.paymentsExpectation?.payload);\n if (+payload?.applicationFee > 0) {\n isApplicationFeesAlreadyPaid = true;\n acc += +payload?.applicationFee;\n }\n if (+payload?.accountingFee > 0) acc += +payload?.accountingFee;\n return acc;\n } else {\n return acc + r.amount - r.amountUsed;\n } */\n return acc + r.amount - r.amountUsed;\n }, 0);\n let remainingAmount = -sumRegulations; //TTC\n let paymentDate = initializedPaymentDate;\n\n //On order les exercicePrestation par startDate ASC et id ASC\n listPartialExercicePrestationExpress.sort((a, b) => {\n const aStartDate = a?.startDate as Date;\n const bStartDate = b?.startDate as Date;\n return dayjs(aStartDate).diff(bStartDate);\n });\n\n // Si les frais de dossiers sont facturés, on ajoute un paiement sur le mois en cours\n if (isWithApplicationFees) {\n listPayments.push({\n amount: applicationFeesAmountTTC, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: listPartialExercicePrestationExpress?.length ? listPartialExercicePrestationExpress[0].endDate : firstExerciceNonExpresssEndDate,\n comment: 'Frais de dossier',\n });\n remainingAmount += applicationFeesAmountTTC;\n }\n \n // =========================\n // EXPRESS\n // =========================\n listPartialExercicePrestationExpress.forEach((exercicePrestation:PartialExercicePrestationExpress, indexEP: number) => {\n const remainingBeforeThisExo = remainingAmount;\n\n remainingAmount += !priceWithTaxesIncluded \n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat) \n : exercicePrestation.totalAmount; //TTC\n \n \n // Si le premier règlement couvre le coût de cet exercicePrestation, \n // on créé un paiement pour cet exo et on passe au suivant\n if (remainingAmount <= 0) {\n listPayments.push({\n amount: Math.round(100 * (!priceWithTaxesIncluded \n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat) \n : exercicePrestation.totalAmount)) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n return;\n } else if (remainingBeforeThisExo < 0 && remainingAmount > 0) {\n // Si le paiement couvre une partie du paiement, on créé un paiement pour cette partie lié à l'exo \n listPayments.push({\n amount: Math.round(100 * -remainingBeforeThisExo) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n }\n \n //express : on étale en countExpressMonthlyPayment (nb de mensualités)\n let remainingAmountByExercicePrestation = remainingAmount; //TTC\n let countExpressMonthlyPayment = exercicePrestation?.countExpressMonthlyPayment ?? 3; //TTC\n //Si un premier règlement est généré avec le montant des regulations, on le considère comme une mensualité (unioquement pour le premier express et la première mensualité)\n if (indexEP === 0 && sumRegulations > 0) countExpressMonthlyPayment -= 1;\n\n const monthlyAmount = remainingAmountByExercicePrestation / countExpressMonthlyPayment; //TTC\n for (let index = 1; index <= countExpressMonthlyPayment; index++) {\n // On arrondis les 11 premières mensualités, mais on récupère le reste pour la dernière mensualité, pour éviter les centimes perdus en arrondis\n // et on applique le taux de tva de la société\n const amount = index < countExpressMonthlyPayment ? monthlyAmount : remainingAmountByExercicePrestation; //TTC\n \n // On évite les paiements de moins d'0,01 € (pour les paymentsExpectations ayant une différence de 1 cents)\n if (amount >= 0.005)\n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n remainingAmountByExercicePrestation -= monthlyAmount; \n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n remainingAmount = 0;\n });\n\n // =========================\n // NON EXPRESS\n // =========================\n // on lisse sur le nb de mois restants (avec au minimum 3 mensualités)\n // Si un seul exo express, alors on met les paiements de l'exo actuel en parallèle\n // sinon, ils sont à la suite des express\n if (nbExoExpress <= 1) paymentDate = initializedPaymentDate;\n let exerciceEndDate = dayjs(firstExerciceNonExpresssEndDate).toDate();\n\n let hasGeneratedWholeYear = false;\n let isFirstNonExpress = true;\n \n //On génère des paiements jusqu'à ce qu'un exercice soit entier (12 mois), non express\n while (!hasGeneratedWholeYear) {\n \n //On compte le nb de mois restants entre la date à laquelle le paiement va être créé et la date de fin d'exercice\n let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));\n if (countMonthsBeforeExerciceEnd < 3) countMonthsBeforeExerciceEnd = 3;\n\n const exoAmount = isFirstNonExpress ? yearlyAmountNonExpress : nextYearlyAmountNonExpress;\n const remainingBeforeThisExo = remainingAmount;\n remainingAmount += priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat);\n\n // Si le premier règlement couvre le coût de cet exercicePrestation, \n // on créé un paiement pour cet exo et on passe au suivant\n if (remainingAmount <= 0) {\n listPayments.push({\n amount: Math.round(100 * (priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat))) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n exerciceEndDate = dayjs(exerciceEndDate).startOf('month').add(1, 'year').endOf('month').toDate();\n continue;\n } else if (remainingBeforeThisExo < 0 && remainingAmount > 0) {\n // Si le paiement couvre une partie du paiement, on créé un paiement pour cette partie lié à l'exo \n listPayments.push({\n amount: Math.round(100 * -remainingBeforeThisExo) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n }\n\n let remainingAmountByExercicePrestation = remainingAmount;\n\n // - frais d'application dès les second exo non express\n if (!isFirstNonExpress) remainingAmountByExercicePrestation += applicationCostTotalTTC;\n\n const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd; //TTC\n\n if (monthlyAmount > 0) {\n for (let index = 1; index <= countMonthsBeforeExerciceEnd; index++) {\n let amount = index < countMonthsBeforeExerciceEnd ? monthlyAmount : remainingAmountByExercicePrestation;\n \n // Si besoin, on applique les frais nécessaires :\n // - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)\n amount = calculateFees(amount, goToClient, paymentDate);\n \n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n remainingAmountByExercicePrestation -= monthlyAmount; \n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n exerciceEndDate = dayjs(exerciceEndDate).startOf('month').add(1, 'year').endOf('month').toDate();\n }\n remainingAmount = 0;\n if (countMonthsBeforeExerciceEnd === 12) hasGeneratedWholeYear = true;\n isFirstNonExpress = false;\n }\n\n remainingAmount = 0;\n\n // =========================\n // JUSQU'EN DECEMBRE\n // =========================\n // On applique le taux de tva de la société, si besoin, selon la grille tarifaire\n remainingAmount += priceWithTaxesIncluded ? nextYearlyAmountNonExpress : getTaxesIncludedAmount(nextYearlyAmountNonExpress, idVat);\n\n let remainingAmountByExercicePrestation = remainingAmount;\n //On compte le nb de mois restants entre la date à laquelle le paiement va être créé et la date de fin d'exercice\n let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));\n if (countMonthsBeforeExerciceEnd < 3) countMonthsBeforeExerciceEnd = 3;\n\n // - frais d'application dès les second exo non express\n remainingAmountByExercicePrestation += applicationCostTotalTTC;\n \n const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd;\n \n // Si aucun paiement généré, on stoppe là\n if (!listPayments.length) return [];\n\n while (dayjs(listPayments.slice(-1)[0].datePayment).month() < 11) {\n let amount = monthlyAmount;\n\n // Si besoin, on applique les frais nécessaires :\n // - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)\n // - frais d'application dès les second exo non express\n amount = calculateFees(amount, goToClient, paymentDate);\n\n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n\n return listPayments;\n};\n\nexport {\n groupPaymentsByServiceType, calculatePaymentsAuto,\n};"]}
|
|
@@ -43,7 +43,7 @@ export const TimeSlotDetail = [
|
|
|
43
43
|
{
|
|
44
44
|
id: TimeSlot.ONBOARDING,
|
|
45
45
|
name: 'OnBoarding',
|
|
46
|
-
internalName: 'OnBoarding',
|
|
46
|
+
internalName: 'Rdv OnBoarding',
|
|
47
47
|
duration: 45,
|
|
48
48
|
idRole: [Role.ON_BOARDER],
|
|
49
49
|
forWholeService: true,
|
|
@@ -61,23 +61,23 @@ export const TimeSlotDetail = [
|
|
|
61
61
|
{
|
|
62
62
|
id: TimeSlot.BILAN,
|
|
63
63
|
name: 'Questions concernant mon bilan',
|
|
64
|
-
internalName: '
|
|
64
|
+
internalName: 'Rdv bilan',
|
|
65
65
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,
|
|
66
66
|
duration: 30,
|
|
67
67
|
idRole: [Role.ACCOUNTANT],
|
|
68
68
|
forWholeService: false,
|
|
69
|
-
idTimeCounterType: TimeCounterType.
|
|
69
|
+
idTimeCounterType: TimeCounterType.CALENDLY.id,
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
id: TimeSlot.TVA,
|
|
73
73
|
name: 'Questions concernant ma TVA',
|
|
74
|
-
internalName: '
|
|
74
|
+
internalName: 'Rdv TVA',
|
|
75
75
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,
|
|
76
76
|
duration: 30,
|
|
77
77
|
idRole: [Role.ACCOUNTANT],
|
|
78
78
|
idRoleExcluded: [Role.MANAGER],
|
|
79
79
|
forWholeService: false,
|
|
80
|
-
idTimeCounterType: TimeCounterType.
|
|
80
|
+
idTimeCounterType: TimeCounterType.CALENDLY.id,
|
|
81
81
|
},
|
|
82
82
|
// {
|
|
83
83
|
// id: TimeSlot.TVA_MANAGER,
|
|
@@ -99,7 +99,7 @@ export const TimeSlotDetail = [
|
|
|
99
99
|
{
|
|
100
100
|
id: TimeSlot.ACCOUNTING_RDV,
|
|
101
101
|
name: 'Conseils',
|
|
102
|
-
internalName: 'Conseils',
|
|
102
|
+
internalName: 'Rdv Conseils',
|
|
103
103
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,
|
|
104
104
|
duration: 30,
|
|
105
105
|
idRole: [Role.ACCOUNTANT],
|
|
@@ -110,7 +110,7 @@ export const TimeSlotDetail = [
|
|
|
110
110
|
{
|
|
111
111
|
id: TimeSlot.BILLING,
|
|
112
112
|
name: 'Questions concernant ma facturation',
|
|
113
|
-
internalName: '
|
|
113
|
+
internalName: 'Rdv facturation',
|
|
114
114
|
duration: 30,
|
|
115
115
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)?.name,
|
|
116
116
|
idRole: [Role.FACTURATION],
|
|
@@ -138,7 +138,7 @@ export const TimeSlotDetail = [
|
|
|
138
138
|
{
|
|
139
139
|
id: TimeSlot.SUPPORTING_CREATION_OF_SOCIETY,
|
|
140
140
|
name: 'Accompagnement pour la création de mon entreprise',
|
|
141
|
-
internalName: '
|
|
141
|
+
internalName: 'Rdv création',
|
|
142
142
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,
|
|
143
143
|
duration: 30,
|
|
144
144
|
idRole: [Role.JURIDIC],
|
|
@@ -148,7 +148,7 @@ export const TimeSlotDetail = [
|
|
|
148
148
|
{
|
|
149
149
|
id: TimeSlot.APPROVAL_FINANCIAL_STATEMENTS_AND_DISTRIBUTE_DIVIDENDS,
|
|
150
150
|
name: 'Approuver les comptes et/ou distribuer des dividendes',
|
|
151
|
-
internalName: '
|
|
151
|
+
internalName: 'Rdv juridique',
|
|
152
152
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,
|
|
153
153
|
duration: 30,
|
|
154
154
|
idRole: [Role.JURIDIC],
|
|
@@ -158,7 +158,7 @@ export const TimeSlotDetail = [
|
|
|
158
158
|
{
|
|
159
159
|
id: TimeSlot.EDIT_SOCIETY,
|
|
160
160
|
name: 'Modifier mon entreprise',
|
|
161
|
-
internalName: '
|
|
161
|
+
internalName: 'Rdv juridique',
|
|
162
162
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,
|
|
163
163
|
duration: 30,
|
|
164
164
|
idRole: [Role.JURIDIC],
|
|
@@ -168,7 +168,7 @@ export const TimeSlotDetail = [
|
|
|
168
168
|
{
|
|
169
169
|
id: TimeSlot.CLOSE_SOCIETY,
|
|
170
170
|
name: 'Fermer mon entreprise',
|
|
171
|
-
internalName: '
|
|
171
|
+
internalName: 'Rdv juridique',
|
|
172
172
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,
|
|
173
173
|
duration: 30,
|
|
174
174
|
idRole: [Role.JURIDIC],
|
|
@@ -178,7 +178,7 @@ export const TimeSlotDetail = [
|
|
|
178
178
|
{
|
|
179
179
|
id: TimeSlot.TAX_ADVICE_OR_COMPLEX_LEGAL_ARRANGEMENTS,
|
|
180
180
|
name: 'Conseils fiscaux ou montages juridiques complexes',
|
|
181
|
-
internalName: '
|
|
181
|
+
internalName: 'Rdv juridique',
|
|
182
182
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,
|
|
183
183
|
duration: 60,
|
|
184
184
|
idRole: [Role.JURIDIC, Role.DIRECTOR],
|
|
@@ -188,7 +188,7 @@ export const TimeSlotDetail = [
|
|
|
188
188
|
{
|
|
189
189
|
id: TimeSlot.FIX_UNPAID,
|
|
190
190
|
name: 'Régulariser un paiement',
|
|
191
|
-
internalName: '
|
|
191
|
+
internalName: 'Rdv impayés',
|
|
192
192
|
duration: 30,
|
|
193
193
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)?.name,
|
|
194
194
|
idRole: [Role.FACTURATION],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeSlot.js","sourceRoot":"","sources":["../../../../ts/types/Enum/TimeSlot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,CAAN,IAAY,QAiBX;AAjBD,WAAY,QAAQ;IAClB,mDAAc,CAAA;IACd,+DAAoB,CAAA;IACpB,yCAAS,CAAA;IACT,qCAAO,CAAA;IACP,qDAAe,CAAA;IACf,qEAAuB,CAAA;IACvB,2DAAkB,CAAA;IAClB,6CAAW,CAAA;IACX,yCAAS,CAAA;IACT,sDAAgB,CAAA;IA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E,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,gBAAgB,CAAC,OAAO,CAAC,EAAE,IAAI;QACnF,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;QACtB,eAAe,EAAE,KAAK;QACtB,iBAAiB,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAE;KAC/C;IACD;QACE,EAAE,EAAE,QAAQ,CAAC,wCAAwC;QACrD,IAAI,EAAE,mDAAmD;QACzD,YAAY,EAAE,mDAAmD;QACjE,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,gBAAgB,CAAC,OAAO,CAAC,EAAE,IAAI;QACnF,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC;QACrC,eAAe,EAAE,IAAI;QACrB,iBAAiB,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAE;KAC/C;IACD;QACE,EAAE,EAAE,QAAQ,CAAC,UAAU;QACvB,IAAI,EAAE,yBAAyB;QAC/B,YAAY,EAAE,yBAAyB;QACvC,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,gBAAgB,CAAC,OAAO,CAAC,EAAE,IAAI;QACnF,MAAM,EAAC,CAAC,IAAI,CAAC,WAAW,CAAC;QACzB,eAAe,EAAE,IAAI;QACrB,iBAAiB,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAE;KAC/C;CACF,CAAC","sourcesContent":["import { Role } from './Role';\nimport { TimeCounterType } from './TimeCounterType';\n\nexport enum TimeSlot {\n ONBOARDING = 1,\n ONBOARDING_SHORT = 2,\n BILAN = 3,\n TVA = 4,\n TVA_MANAGER = 5,\n BALANCESHEET_OR_TIP = 6,\n ACCOUNTING_RDV = 7,\n BILLING = 8,\n SALES = 9,\n APPOINTMENT = 10,\n SUPPORTING_CREATION_OF_SOCIETY = 11,\n APPROVAL_FINANCIAL_STATEMENTS_AND_DISTRIBUTE_DIVIDENDS = 12,\n EDIT_SOCIETY = 13,\n CLOSE_SOCIETY = 14,\n TAX_ADVICE_OR_COMPLEX_LEGAL_ARRANGEMENTS = 15,\n FIX_UNPAID = 16,\n}\nexport enum TimeSlotCategory {\n ACCOUNTING = 1,\n JURIDIC = 2,\n BILLING = 3,\n}\n\nexport type TimeSlotDetailType = {\n id: number;\n name: string;\n internalName: string;\n category?: string,\n duration: number;\n idRole: number[];\n forWholeService?: boolean\n idRoleExcluded?: number[];\n idTimeCounterType: number;\n};\nexport type TimeSlotCategoryDetailType = {\n id: number;\n name: string;\n};\n\nexport const TimeSlotCategoryDetail:TimeSlotCategoryDetailType[] = [\n {\n id: TimeSlotCategory.ACCOUNTING,\n name: 'Comptable',\n },\n {\n id: TimeSlotCategory.JURIDIC,\n name: 'Juridique',\n },\n {\n id: TimeSlotCategory.BILLING,\n name: 'Facturation',\n },\n];\n\nexport const TimeSlotDetail:TimeSlotDetailType[] = [\n {\n id: TimeSlot.ONBOARDING,\n name: 'OnBoarding',\n internalName: 'OnBoarding',\n duration: 45,\n idRole: [Role.ON_BOARDER],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.ONBOARDING.id,\n },\n {\n id: TimeSlot.ONBOARDING_SHORT,\n name: 'OnBoarding court',\n internalName: 'Rdv OnBoarding',\n duration: 45,\n idRole: [Role.ON_BOARDER],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.ONBOARDING.id,\n },\n {\n id: TimeSlot.BILAN,\n name: 'Questions concernant mon bilan',\n internalName: 'Questions concernant mon bilan',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,\n duration: 30,\n idRole: [Role.ACCOUNTANT],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.BILAN.id,\n },\n {\n id: TimeSlot.TVA,\n name: 'Questions concernant ma TVA',\n internalName: 'Questions concernant ma TVA',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,\n duration: 30,\n idRole:[Role.ACCOUNTANT],\n idRoleExcluded:[Role.MANAGER],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.VAT.id,\n },\n // {\n // id: TimeSlot.TVA_MANAGER,\n // name: 'Tva',\n // internalName: 'Tva Manager',\n // duration: 15,\n // idRole:[Role.ACCOUNTANT, Role.MANAGER],\n // forWholeService: false,\n // },\n // {\n // id: TimeSlot.BALANCESHEET_OR_TIP,\n // name: 'Bilan ou Conseil',\n // internalName: 'Bilan ou Conseil',\n // duration: 30,\n // idRole:[Role.ACCOUNTANT],\n // idRoleExcluded:[Role.MANAGER],\n // forWholeService: false,\n // },\n {\n id: TimeSlot.ACCOUNTING_RDV,\n name: 'Conseils',\n internalName: 'Conseils',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,\n duration: 30,\n idRole:[Role.ACCOUNTANT],\n idRoleExcluded:[Role.MANAGER],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.BILLING,\n name: 'Questions concernant ma facturation',\n internalName: 'Questions concernant ma facturation',\n duration: 30,\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)?.name,\n idRole:[Role.FACTURATION],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.SALES,\n name: 'Rdv commercial',\n internalName: 'Rdv Commercial',\n duration: 20,\n idRole:[Role.COMMERCIAL],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.APPOINTMENT, //TODO: à commenter ? remplacé par idType 7 ?\n name: 'Rdv',\n internalName: 'Rdv',\n duration: 20,\n idRole: [Role.ACCOUNTANT, Role.COMMERCIAL, Role.SOCIAL, Role.JURIDIC, Role.EXPERT_ACCOUNTANT, Role.FACTURATION, Role.LITIGE],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.SUPPORTING_CREATION_OF_SOCIETY,\n name: 'Accompagnement pour la création de mon entreprise',\n internalName: 'Accompagnement pour la création de mon entreprise',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.APPROVAL_FINANCIAL_STATEMENTS_AND_DISTRIBUTE_DIVIDENDS,\n name: 'Approuver les comptes et/ou distribuer des dividendes',\n internalName: 'Approuver les comptes et/ou distribuer des dividendes',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.EDIT_SOCIETY,\n name: 'Modifier mon entreprise',\n internalName: 'Modifier mon entreprise',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.CLOSE_SOCIETY,\n name: 'Fermer mon entreprise',\n internalName: 'Fermer mon entreprise',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.TAX_ADVICE_OR_COMPLEX_LEGAL_ARRANGEMENTS,\n name: 'Conseils fiscaux ou montages juridiques complexes',\n internalName: 'Conseils fiscaux ou montages juridiques complexes',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 60, \n idRole: [Role.JURIDIC, Role.DIRECTOR],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.FIX_UNPAID,\n name: 'Régulariser un paiement',\n internalName: 'Régulariser un paiement',\n duration: 30,\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)?.name,\n idRole:[Role.FACTURATION],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n];"]}
|
|
1
|
+
{"version":3,"file":"TimeSlot.js","sourceRoot":"","sources":["../../../../ts/types/Enum/TimeSlot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,CAAN,IAAY,QAiBX;AAjBD,WAAY,QAAQ;IAClB,mDAAc,CAAA;IACd,+DAAoB,CAAA;IACpB,yCAAS,CAAA;IACT,qCAAO,CAAA;IACP,qDAAe,CAAA;IACf,qEAAuB,CAAA;IACvB,2DAAkB,CAAA;IAClB,6CAAW,CAAA;IACX,yCAAS,CAAA;IACT,sDAAgB,CAAA;IAChB,4FAAmC,CAAA;IACnC,4IAA2D,CAAA;IAC3D,wDAAiB,CAAA;IACjB,0DAAkB,CAAA;IAClB,gHAA6C,CAAA;IAC7C,oDAAe,CAAA;AACjB,CAAC,EAjBW,QAAQ,KAAR,QAAQ,QAiBnB;AACD,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,mEAAc,CAAA;IACd,6DAAW,CAAA;IACX,6DAAW,CAAA;AACb,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAkBD,MAAM,CAAC,MAAM,sBAAsB,GAAgC;IACjE;QACE,EAAE,EAAE,gBAAgB,CAAC,UAAU;QAC/B,IAAI,EAAE,WAAW;KAClB;IACD;QACE,EAAE,EAA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AgB,CAAC,OAAO,CAAC,EAAE,IAAI;QACnF,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC;QACrC,eAAe,EAAE,IAAI;QACrB,iBAAiB,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAE;KAC/C;IACD;QACE,EAAE,EAAE,QAAQ,CAAC,UAAU;QACvB,IAAI,EAAE,yBAAyB;QAC/B,YAAY,EAAE,aAAa;QAC3B,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,gBAAgB,CAAC,OAAO,CAAC,EAAE,IAAI;QACnF,MAAM,EAAC,CAAC,IAAI,CAAC,WAAW,CAAC;QACzB,eAAe,EAAE,IAAI;QACrB,iBAAiB,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAE;KAC/C;CACF,CAAC","sourcesContent":["import { Role } from './Role';\nimport { TimeCounterType } from './TimeCounterType';\n\nexport enum TimeSlot {\n ONBOARDING = 1,\n ONBOARDING_SHORT = 2,\n BILAN = 3,\n TVA = 4,\n TVA_MANAGER = 5,\n BALANCESHEET_OR_TIP = 6,\n ACCOUNTING_RDV = 7,\n BILLING = 8,\n SALES = 9,\n APPOINTMENT = 10,\n SUPPORTING_CREATION_OF_SOCIETY = 11,\n APPROVAL_FINANCIAL_STATEMENTS_AND_DISTRIBUTE_DIVIDENDS = 12,\n EDIT_SOCIETY = 13,\n CLOSE_SOCIETY = 14,\n TAX_ADVICE_OR_COMPLEX_LEGAL_ARRANGEMENTS = 15,\n FIX_UNPAID = 16,\n}\nexport enum TimeSlotCategory {\n ACCOUNTING = 1,\n JURIDIC = 2,\n BILLING = 3,\n}\n\nexport type TimeSlotDetailType = {\n id: number;\n name: string;\n internalName: string;\n category?: string,\n duration: number;\n idRole: number[];\n forWholeService?: boolean\n idRoleExcluded?: number[];\n idTimeCounterType: number;\n};\nexport type TimeSlotCategoryDetailType = {\n id: number;\n name: string;\n};\n\nexport const TimeSlotCategoryDetail:TimeSlotCategoryDetailType[] = [\n {\n id: TimeSlotCategory.ACCOUNTING,\n name: 'Comptable',\n },\n {\n id: TimeSlotCategory.JURIDIC,\n name: 'Juridique',\n },\n {\n id: TimeSlotCategory.BILLING,\n name: 'Facturation',\n },\n];\n\nexport const TimeSlotDetail:TimeSlotDetailType[] = [\n {\n id: TimeSlot.ONBOARDING,\n name: 'OnBoarding',\n internalName: 'Rdv OnBoarding',\n duration: 45,\n idRole: [Role.ON_BOARDER],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.ONBOARDING.id,\n },\n {\n id: TimeSlot.ONBOARDING_SHORT,\n name: 'OnBoarding court',\n internalName: 'Rdv OnBoarding',\n duration: 45,\n idRole: [Role.ON_BOARDER],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.ONBOARDING.id,\n },\n {\n id: TimeSlot.BILAN,\n name: 'Questions concernant mon bilan',\n internalName: 'Rdv bilan',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,\n duration: 30,\n idRole: [Role.ACCOUNTANT],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.TVA,\n name: 'Questions concernant ma TVA',\n internalName: 'Rdv TVA',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,\n duration: 30,\n idRole:[Role.ACCOUNTANT],\n idRoleExcluded:[Role.MANAGER],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n // {\n // id: TimeSlot.TVA_MANAGER,\n // name: 'Tva',\n // internalName: 'Tva Manager',\n // duration: 15,\n // idRole:[Role.ACCOUNTANT, Role.MANAGER],\n // forWholeService: false,\n // },\n // {\n // id: TimeSlot.BALANCESHEET_OR_TIP,\n // name: 'Bilan ou Conseil',\n // internalName: 'Bilan ou Conseil',\n // duration: 30,\n // idRole:[Role.ACCOUNTANT],\n // idRoleExcluded:[Role.MANAGER],\n // forWholeService: false,\n // },\n {\n id: TimeSlot.ACCOUNTING_RDV,\n name: 'Conseils',\n internalName: 'Rdv Conseils',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,\n duration: 30,\n idRole:[Role.ACCOUNTANT],\n idRoleExcluded:[Role.MANAGER],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.BILLING,\n name: 'Questions concernant ma facturation',\n internalName: 'Rdv facturation',\n duration: 30,\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)?.name,\n idRole:[Role.FACTURATION],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.SALES,\n name: 'Rdv commercial',\n internalName: 'Rdv Commercial',\n duration: 20,\n idRole:[Role.COMMERCIAL],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.APPOINTMENT, //TODO: à commenter ? remplacé par idType 7 ?\n name: 'Rdv',\n internalName: 'Rdv',\n duration: 20,\n idRole: [Role.ACCOUNTANT, Role.COMMERCIAL, Role.SOCIAL, Role.JURIDIC, Role.EXPERT_ACCOUNTANT, Role.FACTURATION, Role.LITIGE],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.SUPPORTING_CREATION_OF_SOCIETY,\n name: 'Accompagnement pour la création de mon entreprise',\n internalName: 'Rdv création',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.APPROVAL_FINANCIAL_STATEMENTS_AND_DISTRIBUTE_DIVIDENDS,\n name: 'Approuver les comptes et/ou distribuer des dividendes',\n internalName: 'Rdv juridique',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.EDIT_SOCIETY,\n name: 'Modifier mon entreprise',\n internalName: 'Rdv juridique',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.CLOSE_SOCIETY,\n name: 'Fermer mon entreprise',\n internalName: 'Rdv juridique',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 30,\n idRole: [Role.JURIDIC],\n forWholeService: false,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.TAX_ADVICE_OR_COMPLEX_LEGAL_ARRANGEMENTS,\n name: 'Conseils fiscaux ou montages juridiques complexes',\n internalName: 'Rdv juridique',\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,\n duration: 60, \n idRole: [Role.JURIDIC, Role.DIRECTOR],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n {\n id: TimeSlot.FIX_UNPAID,\n name: 'Régulariser un paiement',\n internalName: 'Rdv impayés',\n duration: 30,\n category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)?.name,\n idRole:[Role.FACTURATION],\n forWholeService: true,\n idTimeCounterType: TimeCounterType.CALENDLY.id,\n },\n];"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryUserTimeSlot.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/userTimeSlot/QueryUserTimeSlot.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,OAAO,iBAAiB;IAI1B,MAAM,CAAU;IAKhB,MAAM,CAAU;CACnB;AANG;IAHD,mBAAmB,EAAE;IACrB,UAAU,EAAE;IACZ,KAAK,EAAE;;
|
|
1
|
+
{"version":3,"file":"QueryUserTimeSlot.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/userTimeSlot/QueryUserTimeSlot.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,OAAO,iBAAiB;IAI1B,MAAM,CAAU;IAKhB,MAAM,CAAU;CACnB;AANG;IAHD,mBAAmB,EAAE;IACrB,UAAU,EAAE;IACZ,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;iDACJ;AAKhB;IAHD,mBAAmB,EAAE;IACrB,UAAU,EAAE;IACZ,KAAK,EAAE;;iDACU","sourcesContent":["import { IsInt, IsOptional } from 'class-validator';\nimport { ApiPropertyOptional } from '../../../../utils';\n\nexport class QueryUserTimeSlot {\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt({ each: true })\n idUser?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n idType?: number;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../ts/utils/payment.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAe,qBAAqB,EAAiB,WAAW,EAA0B,MAAM,UAAU,CAAC;AAK5H,UAAU,gBAAiB,SAAQ,QAAQ;IACzC,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7D,YAAY,EAAE,QAAQ,EAAE,CAAA;CACzB;AAED;;;;;;;;;GASG;AACH,QAAA,MAAM,0BAA0B,aAAc,QAAQ,EAAE,UAAS,CAAC,aAAa,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC,EAAE,KAA2D,gBAAgB,EAoCrM,CAAC;AAkBF;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,qBAAqB,WAAY,qBAAqB,KAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../ts/utils/payment.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAe,qBAAqB,EAAiB,WAAW,EAA0B,MAAM,UAAU,CAAC;AAK5H,UAAU,gBAAiB,SAAQ,QAAQ;IACzC,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7D,YAAY,EAAE,QAAQ,EAAE,CAAA;CACzB;AAED;;;;;;;;;GASG;AACH,QAAA,MAAM,0BAA0B,aAAc,QAAQ,EAAE,UAAS,CAAC,aAAa,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC,EAAE,KAA2D,gBAAgB,EAoCrM,CAAC;AAkBF;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,qBAAqB,WAAY,qBAAqB,KAAE,WAAW,EAoQxE,CAAC;AAEF,OAAO,EACL,0BAA0B,EAAE,qBAAqB,GAClD,CAAC"}
|
|
@@ -144,6 +144,7 @@ const calculatePaymentsAuto = (params) => {
|
|
|
144
144
|
closingDate: listPartialExercicePrestationExpress?.length ? listPartialExercicePrestationExpress[0].endDate : firstExerciceNonExpresssEndDate,
|
|
145
145
|
comment: 'Frais de dossier',
|
|
146
146
|
});
|
|
147
|
+
remainingAmount += applicationFeesAmountTTC;
|
|
147
148
|
}
|
|
148
149
|
// =========================
|
|
149
150
|
// EXPRESS
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../ts/utils/payment.ts"],"names":[],"mappings":"AA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O,EAAE,CAAC;IAEpC,OAAO,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC;QACjE,IAAI,MAAM,GAAG,aAAa,CAAC;QAE3B,iDAAiD;QACjD,yGAAyG;QACzG,uDAAuD;QACvD,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QAExD,YAAY,CAAC,IAAI,CAAC;YAChB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG;YACtC,WAAW,EAAE,WAAW;YACxB,YAAY;YACZ,eAAe,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE;YAC9C,WAAW,EAAE,eAAe;SAC7B,CAAC,CAAC;QACH,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7E,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,OAAO,EACL,0BAA0B,EAAE,qBAAqB,GAClD,CAAC","sourcesContent":["'use strict';\n\nimport { IPayment, IRegulation, ParamsForPaymentsAuto, PaymentMethod, PaymentAuto, getTaxesIncludedAmount } from '../types';\nimport * as dayjs from 'dayjs';\nimport { PartialExercicePrestationExpress } from '../types/Interface/api/payment/Util';\nimport { getApplicationFeesAmount, getPriceGrid } from './prestation';\n\ninterface PaymentsWithList extends IPayment {\n type: 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther',\n listPayments: IPayment[]\n}\n\n/**\n * A partir d'une liste de payment (avec include jusqu'à prestationList, \n * avec en attributs 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther')\n * permet de récupérer uniquement le premier paiement de chaque type \n * et les autres payments dans listPayments\n * avec possibilité de filtrer avec le tableau de filtres\n * @param payments \n * @param types \n * @returns \n */\nconst groupPaymentsByServiceType = (payments: IPayment[], types: ('isComptable' | 'isJuridique' | 'isSocial' | 'isOther')[] = ['isComptable', 'isJuridique', 'isSocial', 'isOther']): PaymentsWithList[] => {\n const prestaComptable = payments.filter((el) => el?.paymentsPrestations?.prestationsList?.isComptable ?? false);\n const prestaSocial = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isSocial);\n const prestaJuridique = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isJuridique);\n const prestaOther = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && !el?.paymentsPrestations?.prestationsList?.isJuridique && !el?.paymentsPrestations?.prestationsList?.isSocial);\n \n const societyPayment: PaymentsWithList[] = [];\n if (prestaComptable.length && types.includes('isComptable')) {\n societyPayment.push({\n ...prestaComptable[0], // Données de base\n type: 'isComptable',\n listPayments: prestaComptable,\n });\n }\n if (prestaSocial.length && types.includes('isSocial')) {\n societyPayment.push({\n ...prestaSocial[0], // Données de base\n type: 'isSocial',\n listPayments: prestaSocial,\n });\n }\n if (prestaJuridique.length && types.includes('isJuridique')) {\n societyPayment.push({\n ...prestaJuridique[0], // Données de base\n type: 'isJuridique',\n listPayments: prestaJuridique,\n });\n }\n if (prestaOther.length && types.includes('isOther')) {\n societyPayment.push({\n ...prestaOther[0], // Données de base\n type: 'isOther',\n listPayments: prestaOther,\n });\n }\n return societyPayment;\n};\n\nconst calculateFees = (amount: number, goToClient: Date, paymentDate: Date):number => {\n const yearlyPriceIncreasing = 1.0275;\n\n const oneYearLessIfIn3LastMonthsOfYear = dayjs(goToClient).month() >= 9 ? 1 : 0;\n\n if (dayjs(paymentDate).year() - dayjs().year() > 0) {\n const nbYearsMore = dayjs(paymentDate).year() - dayjs().year() - oneYearLessIfIn3LastMonthsOfYear;\n // on applique X fois l'augmentation\n // ex. : si on lance l'appel en 2024, et qu'on génére un paiement pour 2026, on applique 2 fois l'augmentation\n // soit amount * yearlyPriceIncreasing * yearlyPriceIncreasing\n // soit amount * yearlyPriceIncreasing ^ nbYearsMore\n amount = amount * Math.pow(yearlyPriceIncreasing, nbYearsMore);\n }\n return amount;\n};\n\n/**\n// * @param {number} firstPaymentAmount - amount of the first payment (first regulation of the customer)\n * @param {Date} firstExerciceNonExpresssEndDate - end date of the first exercice non express\n * @param {number} idPrestation - prestation id\n * @param {number} idLegalForm - legal form id of the society\n * @param {boolean} isWithApplicationFees - if the prestation has application fees to paid\n * @param {IPrestationList} prestationList - type of prestation (hidden: 0, isCatalog: 1, isComptable: 1)\n * @param {number} idVat - vat id of society linked\n * @param {number} yearlyAmountNonExpress - yearly amount of non express prestation (HT)\n * @param {number} nextYearlyAmountNonExpress - yearly amount of non express prestation for next years (HT)\n * @param {PartialExercicePrestationExpress[]} listPartialExercicePrestationExpress - list of exercicePrestation linked to idPrestation -> used to get express\n * @param {IRegulation[]} listRegulations - list of regulations linked to idPrestation (TTC)\n * @param {Date} recoveryDate - date of recovery of the society\n * @returns { IPayment[] } list of payment to create for billing auto, after each presta go to onBoarding\n */\nconst calculatePaymentsAuto = (params: ParamsForPaymentsAuto):PaymentAuto[] => {\n const { idTypeBrand, goToClient, isWithApplicationFees, firstExerciceNonExpresssEndDate, idPrestation, idLegalForm, prestationList, idVat, yearlyAmountNonExpress, nextYearlyAmountNonExpress, listPartialExercicePrestationExpress, listRegulations, recoveryDate } = params;\n \n if (!yearlyAmountNonExpress) throw new Error('Le montant annuel des prestations non express ne peut pas être nul.');\n\n let initializedPaymentDate = dayjs().endOf('month').diff(dayjs(), 'day') < 3/* || dayjs().date() >= 15 */\n ? dayjs().add(2, 'month').startOf('month').toDate()\n : dayjs().add(1, 'month').startOf('month').toDate();\n \n //Si date de reprise, alors on initialise à cette date\n if (recoveryDate && dayjs(recoveryDate).isAfter(dayjs(), 'month')) {\n initializedPaymentDate = dayjs(recoveryDate).startOf('month').toDate();\n }\n\n // On récupère la grille tarifaire pour savoir si les tarifs sont HT ou TTC \n // et pour connaitre le montant du coût de l'app\n if (!prestationList.id) throw new Error('idPrestationList manquant');\n const priceGrid = getPriceGrid(idTypeBrand, prestationList.id);\n if (!priceGrid) throw new Error('Impossible de trouver la grille tarifaire correspondante');\n const { applicationCost, priceWithTaxesIncluded } = priceGrid;\n const applicationCostTotalTTC = (priceWithTaxesIncluded ? applicationCost : getTaxesIncludedAmount(applicationCost, idVat)) * 12;\n const applicationFeesAmountTTC = getApplicationFeesAmount(idLegalForm, idVat);\n\n if (prestationList?.isCatalog || !prestationList?.isComptable) throw new Error('Ce type de prestation ne correspond pas aux conditions attendues.');\n if (listPartialExercicePrestationExpress.length && listPartialExercicePrestationExpress?.some((ep: PartialExercicePrestationExpress) => !ep?.startDate)) throw new Error('Start date of some exercice are missing');\n\n const nbExoExpress = listPartialExercicePrestationExpress.length;\n const listPayments:PaymentAuto[] = [];\n\n // on récupère le/les premiers réglements effectués, non alloués\n // const isApplicationFeesAlreadyPaid = false;\n const sumRegulations = listRegulations.reduce((acc: number, r:IRegulation) => {\n //Si la regulation est rattachée à un paymentExpectation, on récupère le détail\n // et on ne prend que les frais de dossier (applicationFee) + le montant de la compta (accountingFee)\n \n // Commenté temporairement :\n // Pour l'instant, on ne prend plus en compte les paymentExpectation :\n // On part du principe que si isWithApplicationFees = true, alors les regulations contiennent les frais de dossier\n // sinon, ils sont offerts et n'apparaissent pas\n /* if (r.paymentsExpectation?.payload) {\n const payload = JSON.parse(r.paymentsExpectation?.payload);\n if (+payload?.applicationFee > 0) {\n isApplicationFeesAlreadyPaid = true;\n acc += +payload?.applicationFee;\n }\n if (+payload?.accountingFee > 0) acc += +payload?.accountingFee;\n return acc;\n } else {\n return acc + r.amount - r.amountUsed;\n } */\n return acc + r.amount - r.amountUsed;\n }, 0);\n let remainingAmount = -sumRegulations; //TTC\n let paymentDate = initializedPaymentDate;\n\n //On order les exercicePrestation par startDate ASC et id ASC\n listPartialExercicePrestationExpress.sort((a, b) => {\n const aStartDate = a?.startDate as Date;\n const bStartDate = b?.startDate as Date;\n return dayjs(aStartDate).diff(bStartDate);\n });\n\n // Si les frais de dossiers sont facturés, on ajoute un paiement sur le mois en cours\n if (isWithApplicationFees) {\n listPayments.push({\n amount: applicationFeesAmountTTC, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: listPartialExercicePrestationExpress?.length ? listPartialExercicePrestationExpress[0].endDate : firstExerciceNonExpresssEndDate,\n comment: 'Frais de dossier',\n });\n }\n \n // =========================\n // EXPRESS\n // =========================\n listPartialExercicePrestationExpress.forEach((exercicePrestation:PartialExercicePrestationExpress, indexEP: number) => {\n const remainingBeforeThisExo = remainingAmount;\n\n remainingAmount += !priceWithTaxesIncluded \n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat) \n : exercicePrestation.totalAmount; //TTC\n \n \n // Si le premier règlement couvre le coût de cet exercicePrestation, \n // on créé un paiement pour cet exo et on passe au suivant\n if (remainingAmount <= 0) {\n listPayments.push({\n amount: Math.round(100 * (!priceWithTaxesIncluded \n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat) \n : exercicePrestation.totalAmount)) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n return;\n } else if (remainingBeforeThisExo < 0 && remainingAmount > 0) {\n // Si le paiement couvre une partie du paiement, on créé un paiement pour cette partie lié à l'exo \n listPayments.push({\n amount: Math.round(100 * -remainingBeforeThisExo) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n }\n \n //express : on étale en countExpressMonthlyPayment (nb de mensualités)\n let remainingAmountByExercicePrestation = remainingAmount; //TTC\n let countExpressMonthlyPayment = exercicePrestation?.countExpressMonthlyPayment ?? 3; //TTC\n //Si un premier règlement est généré avec le montant des regulations, on le considère comme une mensualité (unioquement pour le premier express et la première mensualité)\n if (indexEP === 0 && sumRegulations > 0) countExpressMonthlyPayment -= 1;\n\n const monthlyAmount = remainingAmountByExercicePrestation / countExpressMonthlyPayment; //TTC\n for (let index = 1; index <= countExpressMonthlyPayment; index++) {\n // On arrondis les 11 premières mensualités, mais on récupère le reste pour la dernière mensualité, pour éviter les centimes perdus en arrondis\n // et on applique le taux de tva de la société\n const amount = index < countExpressMonthlyPayment ? monthlyAmount : remainingAmountByExercicePrestation; //TTC\n \n // On évite les paiements de moins d'0,01 € (pour les paymentsExpectations ayant une différence de 1 cents)\n if (amount >= 0.005)\n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n remainingAmountByExercicePrestation -= monthlyAmount; \n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n remainingAmount = 0;\n });\n\n // =========================\n // NON EXPRESS\n // =========================\n // on lisse sur le nb de mois restants (avec au minimum 3 mensualités)\n // Si un seul exo express, alors on met les paiements de l'exo actuel en parallèle\n // sinon, ils sont à la suite des express\n if (nbExoExpress <= 1) paymentDate = initializedPaymentDate;\n let exerciceEndDate = dayjs(firstExerciceNonExpresssEndDate).toDate();\n\n let hasGeneratedWholeYear = false;\n let isFirstNonExpress = true;\n \n //On génère des paiements jusqu'à ce qu'un exercice soit entier (12 mois), non express\n while (!hasGeneratedWholeYear) {\n \n //On compte le nb de mois restants entre la date à laquelle le paiement va être créé et la date de fin d'exercice\n let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));\n if (countMonthsBeforeExerciceEnd < 3) countMonthsBeforeExerciceEnd = 3;\n\n const exoAmount = isFirstNonExpress ? yearlyAmountNonExpress : nextYearlyAmountNonExpress;\n const remainingBeforeThisExo = remainingAmount;\n remainingAmount += priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat);\n\n // Si le premier règlement couvre le coût de cet exercicePrestation, \n // on créé un paiement pour cet exo et on passe au suivant\n if (remainingAmount <= 0) {\n listPayments.push({\n amount: Math.round(100 * (priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat))) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n exerciceEndDate = dayjs(exerciceEndDate).startOf('month').add(1, 'year').endOf('month').toDate();\n continue;\n } else if (remainingBeforeThisExo < 0 && remainingAmount > 0) {\n // Si le paiement couvre une partie du paiement, on créé un paiement pour cette partie lié à l'exo \n listPayments.push({\n amount: Math.round(100 * -remainingBeforeThisExo) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n }\n\n let remainingAmountByExercicePrestation = remainingAmount;\n\n // - frais d'application dès les second exo non express\n if (!isFirstNonExpress) remainingAmountByExercicePrestation += applicationCostTotalTTC;\n\n const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd; //TTC\n\n if (monthlyAmount > 0) {\n for (let index = 1; index <= countMonthsBeforeExerciceEnd; index++) {\n let amount = index < countMonthsBeforeExerciceEnd ? monthlyAmount : remainingAmountByExercicePrestation;\n \n // Si besoin, on applique les frais nécessaires :\n // - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)\n amount = calculateFees(amount, goToClient, paymentDate);\n \n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n remainingAmountByExercicePrestation -= monthlyAmount; \n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n exerciceEndDate = dayjs(exerciceEndDate).startOf('month').add(1, 'year').endOf('month').toDate();\n }\n remainingAmount = 0;\n if (countMonthsBeforeExerciceEnd === 12) hasGeneratedWholeYear = true;\n isFirstNonExpress = false;\n }\n\n remainingAmount = 0;\n\n // =========================\n // JUSQU'EN DECEMBRE\n // =========================\n // On applique le taux de tva de la société, si besoin, selon la grille tarifaire\n remainingAmount += priceWithTaxesIncluded ? nextYearlyAmountNonExpress : getTaxesIncludedAmount(nextYearlyAmountNonExpress, idVat);\n\n let remainingAmountByExercicePrestation = remainingAmount;\n //On compte le nb de mois restants entre la date à laquelle le paiement va être créé et la date de fin d'exercice\n let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));\n if (countMonthsBeforeExerciceEnd < 3) countMonthsBeforeExerciceEnd = 3;\n\n // - frais d'application dès les second exo non express\n remainingAmountByExercicePrestation += applicationCostTotalTTC;\n \n const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd;\n \n // Si aucun paiement généré, on stoppe là\n if (!listPayments.length) return [];\n\n while (dayjs(listPayments.slice(-1)[0].datePayment).month() < 11) {\n let amount = monthlyAmount;\n\n // Si besoin, on applique les frais nécessaires :\n // - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)\n // - frais d'application dès les second exo non express\n amount = calculateFees(amount, goToClient, paymentDate);\n\n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n\n return listPayments;\n};\n\nexport {\n groupPaymentsByServiceType, calculatePaymentsAuto,\n};"]}
|
|
1
|
+
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../ts/utils/payment.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAgD,aAAa,EAAe,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAC5H,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAOtE;;;;;;;;;GASG;AACH,MAAM,0BAA0B,GAAG,CAAC,QAAoB,EAAE,QAAoE,CAAC,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,CAAC,EAAsB,EAAE;IACzM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,IAAI,KAAK,CAAC,CAAC;IAChH,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,IAAI,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC;IAC3J,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,IAAI,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,CAAC,CAAC;IACjK,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,IAAI,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WA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,4BAA4B,GAAG,CAAC;QAAE,4BAA4B,GAAG,CAAC,CAAC;IAEvE,uDAAuD;IACvD,mCAAmC,IAAI,uBAAuB,CAAC;IAE/D,MAAM,aAAa,GAAG,mCAAmC,GAAG,4BAA4B,CAAC;IAEzF,yCAAyC;IACzC,IAAI,CAAC,YAAY,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEpC,OAAO,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC;QACjE,IAAI,MAAM,GAAG,aAAa,CAAC;QAE3B,iDAAiD;QACjD,yGAAyG;QACzG,uDAAuD;QACvD,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QAExD,YAAY,CAAC,IAAI,CAAC;YAChB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG;YACtC,WAAW,EAAE,WAAW;YACxB,YAAY;YACZ,eAAe,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE;YAC9C,WAAW,EAAE,eAAe;SAC7B,CAAC,CAAC;QACH,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7E,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,OAAO,EACL,0BAA0B,EAAE,qBAAqB,GAClD,CAAC","sourcesContent":["'use strict';\n\nimport { IPayment, IRegulation, ParamsForPaymentsAuto, PaymentMethod, PaymentAuto, getTaxesIncludedAmount } from '../types';\nimport * as dayjs from 'dayjs';\nimport { PartialExercicePrestationExpress } from '../types/Interface/api/payment/Util';\nimport { getApplicationFeesAmount, getPriceGrid } from './prestation';\n\ninterface PaymentsWithList extends IPayment {\n type: 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther',\n listPayments: IPayment[]\n}\n\n/**\n * A partir d'une liste de payment (avec include jusqu'à prestationList, \n * avec en attributs 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther')\n * permet de récupérer uniquement le premier paiement de chaque type \n * et les autres payments dans listPayments\n * avec possibilité de filtrer avec le tableau de filtres\n * @param payments \n * @param types \n * @returns \n */\nconst groupPaymentsByServiceType = (payments: IPayment[], types: ('isComptable' | 'isJuridique' | 'isSocial' | 'isOther')[] = ['isComptable', 'isJuridique', 'isSocial', 'isOther']): PaymentsWithList[] => {\n const prestaComptable = payments.filter((el) => el?.paymentsPrestations?.prestationsList?.isComptable ?? false);\n const prestaSocial = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isSocial);\n const prestaJuridique = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isJuridique);\n const prestaOther = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && !el?.paymentsPrestations?.prestationsList?.isJuridique && !el?.paymentsPrestations?.prestationsList?.isSocial);\n \n const societyPayment: PaymentsWithList[] = [];\n if (prestaComptable.length && types.includes('isComptable')) {\n societyPayment.push({\n ...prestaComptable[0], // Données de base\n type: 'isComptable',\n listPayments: prestaComptable,\n });\n }\n if (prestaSocial.length && types.includes('isSocial')) {\n societyPayment.push({\n ...prestaSocial[0], // Données de base\n type: 'isSocial',\n listPayments: prestaSocial,\n });\n }\n if (prestaJuridique.length && types.includes('isJuridique')) {\n societyPayment.push({\n ...prestaJuridique[0], // Données de base\n type: 'isJuridique',\n listPayments: prestaJuridique,\n });\n }\n if (prestaOther.length && types.includes('isOther')) {\n societyPayment.push({\n ...prestaOther[0], // Données de base\n type: 'isOther',\n listPayments: prestaOther,\n });\n }\n return societyPayment;\n};\n\nconst calculateFees = (amount: number, goToClient: Date, paymentDate: Date):number => {\n const yearlyPriceIncreasing = 1.0275;\n\n const oneYearLessIfIn3LastMonthsOfYear = dayjs(goToClient).month() >= 9 ? 1 : 0;\n\n if (dayjs(paymentDate).year() - dayjs().year() > 0) {\n const nbYearsMore = dayjs(paymentDate).year() - dayjs().year() - oneYearLessIfIn3LastMonthsOfYear;\n // on applique X fois l'augmentation\n // ex. : si on lance l'appel en 2024, et qu'on génére un paiement pour 2026, on applique 2 fois l'augmentation\n // soit amount * yearlyPriceIncreasing * yearlyPriceIncreasing\n // soit amount * yearlyPriceIncreasing ^ nbYearsMore\n amount = amount * Math.pow(yearlyPriceIncreasing, nbYearsMore);\n }\n return amount;\n};\n\n/**\n// * @param {number} firstPaymentAmount - amount of the first payment (first regulation of the customer)\n * @param {Date} firstExerciceNonExpresssEndDate - end date of the first exercice non express\n * @param {number} idPrestation - prestation id\n * @param {number} idLegalForm - legal form id of the society\n * @param {boolean} isWithApplicationFees - if the prestation has application fees to paid\n * @param {IPrestationList} prestationList - type of prestation (hidden: 0, isCatalog: 1, isComptable: 1)\n * @param {number} idVat - vat id of society linked\n * @param {number} yearlyAmountNonExpress - yearly amount of non express prestation (HT)\n * @param {number} nextYearlyAmountNonExpress - yearly amount of non express prestation for next years (HT)\n * @param {PartialExercicePrestationExpress[]} listPartialExercicePrestationExpress - list of exercicePrestation linked to idPrestation -> used to get express\n * @param {IRegulation[]} listRegulations - list of regulations linked to idPrestation (TTC)\n * @param {Date} recoveryDate - date of recovery of the society\n * @returns { IPayment[] } list of payment to create for billing auto, after each presta go to onBoarding\n */\nconst calculatePaymentsAuto = (params: ParamsForPaymentsAuto):PaymentAuto[] => {\n const { idTypeBrand, goToClient, isWithApplicationFees, firstExerciceNonExpresssEndDate, idPrestation, idLegalForm, prestationList, idVat, yearlyAmountNonExpress, nextYearlyAmountNonExpress, listPartialExercicePrestationExpress, listRegulations, recoveryDate } = params;\n \n if (!yearlyAmountNonExpress) throw new Error('Le montant annuel des prestations non express ne peut pas être nul.');\n\n let initializedPaymentDate = dayjs().endOf('month').diff(dayjs(), 'day') < 3/* || dayjs().date() >= 15 */\n ? dayjs().add(2, 'month').startOf('month').toDate()\n : dayjs().add(1, 'month').startOf('month').toDate();\n \n //Si date de reprise, alors on initialise à cette date\n if (recoveryDate && dayjs(recoveryDate).isAfter(dayjs(), 'month')) {\n initializedPaymentDate = dayjs(recoveryDate).startOf('month').toDate();\n }\n\n // On récupère la grille tarifaire pour savoir si les tarifs sont HT ou TTC \n // et pour connaitre le montant du coût de l'app\n if (!prestationList.id) throw new Error('idPrestationList manquant');\n const priceGrid = getPriceGrid(idTypeBrand, prestationList.id);\n if (!priceGrid) throw new Error('Impossible de trouver la grille tarifaire correspondante');\n const { applicationCost, priceWithTaxesIncluded } = priceGrid;\n const applicationCostTotalTTC = (priceWithTaxesIncluded ? applicationCost : getTaxesIncludedAmount(applicationCost, idVat)) * 12;\n const applicationFeesAmountTTC = getApplicationFeesAmount(idLegalForm, idVat);\n\n if (prestationList?.isCatalog || !prestationList?.isComptable) throw new Error('Ce type de prestation ne correspond pas aux conditions attendues.');\n if (listPartialExercicePrestationExpress.length && listPartialExercicePrestationExpress?.some((ep: PartialExercicePrestationExpress) => !ep?.startDate)) throw new Error('Start date of some exercice are missing');\n\n const nbExoExpress = listPartialExercicePrestationExpress.length;\n const listPayments:PaymentAuto[] = [];\n\n // on récupère le/les premiers réglements effectués, non alloués\n // const isApplicationFeesAlreadyPaid = false;\n const sumRegulations = listRegulations.reduce((acc: number, r:IRegulation) => {\n //Si la regulation est rattachée à un paymentExpectation, on récupère le détail\n // et on ne prend que les frais de dossier (applicationFee) + le montant de la compta (accountingFee)\n \n // Commenté temporairement :\n // Pour l'instant, on ne prend plus en compte les paymentExpectation :\n // On part du principe que si isWithApplicationFees = true, alors les regulations contiennent les frais de dossier\n // sinon, ils sont offerts et n'apparaissent pas\n /* if (r.paymentsExpectation?.payload) {\n const payload = JSON.parse(r.paymentsExpectation?.payload);\n if (+payload?.applicationFee > 0) {\n isApplicationFeesAlreadyPaid = true;\n acc += +payload?.applicationFee;\n }\n if (+payload?.accountingFee > 0) acc += +payload?.accountingFee;\n return acc;\n } else {\n return acc + r.amount - r.amountUsed;\n } */\n return acc + r.amount - r.amountUsed;\n }, 0);\n let remainingAmount = -sumRegulations; //TTC\n let paymentDate = initializedPaymentDate;\n\n //On order les exercicePrestation par startDate ASC et id ASC\n listPartialExercicePrestationExpress.sort((a, b) => {\n const aStartDate = a?.startDate as Date;\n const bStartDate = b?.startDate as Date;\n return dayjs(aStartDate).diff(bStartDate);\n });\n\n // Si les frais de dossiers sont facturés, on ajoute un paiement sur le mois en cours\n if (isWithApplicationFees) {\n listPayments.push({\n amount: applicationFeesAmountTTC, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: listPartialExercicePrestationExpress?.length ? listPartialExercicePrestationExpress[0].endDate : firstExerciceNonExpresssEndDate,\n comment: 'Frais de dossier',\n });\n remainingAmount += applicationFeesAmountTTC;\n }\n \n // =========================\n // EXPRESS\n // =========================\n listPartialExercicePrestationExpress.forEach((exercicePrestation:PartialExercicePrestationExpress, indexEP: number) => {\n const remainingBeforeThisExo = remainingAmount;\n\n remainingAmount += !priceWithTaxesIncluded \n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat) \n : exercicePrestation.totalAmount; //TTC\n \n \n // Si le premier règlement couvre le coût de cet exercicePrestation, \n // on créé un paiement pour cet exo et on passe au suivant\n if (remainingAmount <= 0) {\n listPayments.push({\n amount: Math.round(100 * (!priceWithTaxesIncluded \n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat) \n : exercicePrestation.totalAmount)) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n return;\n } else if (remainingBeforeThisExo < 0 && remainingAmount > 0) {\n // Si le paiement couvre une partie du paiement, on créé un paiement pour cette partie lié à l'exo \n listPayments.push({\n amount: Math.round(100 * -remainingBeforeThisExo) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n }\n \n //express : on étale en countExpressMonthlyPayment (nb de mensualités)\n let remainingAmountByExercicePrestation = remainingAmount; //TTC\n let countExpressMonthlyPayment = exercicePrestation?.countExpressMonthlyPayment ?? 3; //TTC\n //Si un premier règlement est généré avec le montant des regulations, on le considère comme une mensualité (unioquement pour le premier express et la première mensualité)\n if (indexEP === 0 && sumRegulations > 0) countExpressMonthlyPayment -= 1;\n\n const monthlyAmount = remainingAmountByExercicePrestation / countExpressMonthlyPayment; //TTC\n for (let index = 1; index <= countExpressMonthlyPayment; index++) {\n // On arrondis les 11 premières mensualités, mais on récupère le reste pour la dernière mensualité, pour éviter les centimes perdus en arrondis\n // et on applique le taux de tva de la société\n const amount = index < countExpressMonthlyPayment ? monthlyAmount : remainingAmountByExercicePrestation; //TTC\n \n // On évite les paiements de moins d'0,01 € (pour les paymentsExpectations ayant une différence de 1 cents)\n if (amount >= 0.005)\n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n remainingAmountByExercicePrestation -= monthlyAmount; \n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n remainingAmount = 0;\n });\n\n // =========================\n // NON EXPRESS\n // =========================\n // on lisse sur le nb de mois restants (avec au minimum 3 mensualités)\n // Si un seul exo express, alors on met les paiements de l'exo actuel en parallèle\n // sinon, ils sont à la suite des express\n if (nbExoExpress <= 1) paymentDate = initializedPaymentDate;\n let exerciceEndDate = dayjs(firstExerciceNonExpresssEndDate).toDate();\n\n let hasGeneratedWholeYear = false;\n let isFirstNonExpress = true;\n \n //On génère des paiements jusqu'à ce qu'un exercice soit entier (12 mois), non express\n while (!hasGeneratedWholeYear) {\n \n //On compte le nb de mois restants entre la date à laquelle le paiement va être créé et la date de fin d'exercice\n let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));\n if (countMonthsBeforeExerciceEnd < 3) countMonthsBeforeExerciceEnd = 3;\n\n const exoAmount = isFirstNonExpress ? yearlyAmountNonExpress : nextYearlyAmountNonExpress;\n const remainingBeforeThisExo = remainingAmount;\n remainingAmount += priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat);\n\n // Si le premier règlement couvre le coût de cet exercicePrestation, \n // on créé un paiement pour cet exo et on passe au suivant\n if (remainingAmount <= 0) {\n listPayments.push({\n amount: Math.round(100 * (priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat))) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n exerciceEndDate = dayjs(exerciceEndDate).startOf('month').add(1, 'year').endOf('month').toDate();\n continue;\n } else if (remainingBeforeThisExo < 0 && remainingAmount > 0) {\n // Si le paiement couvre une partie du paiement, on créé un paiement pour cette partie lié à l'exo \n listPayments.push({\n amount: Math.round(100 * -remainingBeforeThisExo) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n }\n\n let remainingAmountByExercicePrestation = remainingAmount;\n\n // - frais d'application dès les second exo non express\n if (!isFirstNonExpress) remainingAmountByExercicePrestation += applicationCostTotalTTC;\n\n const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd; //TTC\n\n if (monthlyAmount > 0) {\n for (let index = 1; index <= countMonthsBeforeExerciceEnd; index++) {\n let amount = index < countMonthsBeforeExerciceEnd ? monthlyAmount : remainingAmountByExercicePrestation;\n \n // Si besoin, on applique les frais nécessaires :\n // - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)\n amount = calculateFees(amount, goToClient, paymentDate);\n \n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n remainingAmountByExercicePrestation -= monthlyAmount; \n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n exerciceEndDate = dayjs(exerciceEndDate).startOf('month').add(1, 'year').endOf('month').toDate();\n }\n remainingAmount = 0;\n if (countMonthsBeforeExerciceEnd === 12) hasGeneratedWholeYear = true;\n isFirstNonExpress = false;\n }\n\n remainingAmount = 0;\n\n // =========================\n // JUSQU'EN DECEMBRE\n // =========================\n // On applique le taux de tva de la société, si besoin, selon la grille tarifaire\n remainingAmount += priceWithTaxesIncluded ? nextYearlyAmountNonExpress : getTaxesIncludedAmount(nextYearlyAmountNonExpress, idVat);\n\n let remainingAmountByExercicePrestation = remainingAmount;\n //On compte le nb de mois restants entre la date à laquelle le paiement va être créé et la date de fin d'exercice\n let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));\n if (countMonthsBeforeExerciceEnd < 3) countMonthsBeforeExerciceEnd = 3;\n\n // - frais d'application dès les second exo non express\n remainingAmountByExercicePrestation += applicationCostTotalTTC;\n \n const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd;\n \n // Si aucun paiement généré, on stoppe là\n if (!listPayments.length) return [];\n\n while (dayjs(listPayments.slice(-1)[0].datePayment).month() < 11) {\n let amount = monthlyAmount;\n\n // Si besoin, on applique les frais nécessaires :\n // - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)\n // - frais d'application dès les second exo non express\n amount = calculateFees(amount, goToClient, paymentDate);\n\n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n\n return listPayments;\n};\n\nexport {\n groupPaymentsByServiceType, calculatePaymentsAuto,\n};"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.328",
|
|
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",
|
|
@@ -60,7 +60,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
|
|
|
60
60
|
{
|
|
61
61
|
id: TimeSlot.ONBOARDING,
|
|
62
62
|
name: 'OnBoarding',
|
|
63
|
-
internalName: 'OnBoarding',
|
|
63
|
+
internalName: 'Rdv OnBoarding',
|
|
64
64
|
duration: 45,
|
|
65
65
|
idRole: [Role.ON_BOARDER],
|
|
66
66
|
forWholeService: true,
|
|
@@ -78,23 +78,23 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
|
|
|
78
78
|
{
|
|
79
79
|
id: TimeSlot.BILAN,
|
|
80
80
|
name: 'Questions concernant mon bilan',
|
|
81
|
-
internalName: '
|
|
81
|
+
internalName: 'Rdv bilan',
|
|
82
82
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,
|
|
83
83
|
duration: 30,
|
|
84
84
|
idRole: [Role.ACCOUNTANT],
|
|
85
85
|
forWholeService: false,
|
|
86
|
-
idTimeCounterType: TimeCounterType.
|
|
86
|
+
idTimeCounterType: TimeCounterType.CALENDLY.id,
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
id: TimeSlot.TVA,
|
|
90
90
|
name: 'Questions concernant ma TVA',
|
|
91
|
-
internalName: '
|
|
91
|
+
internalName: 'Rdv TVA',
|
|
92
92
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,
|
|
93
93
|
duration: 30,
|
|
94
94
|
idRole:[Role.ACCOUNTANT],
|
|
95
95
|
idRoleExcluded:[Role.MANAGER],
|
|
96
96
|
forWholeService: false,
|
|
97
|
-
idTimeCounterType: TimeCounterType.
|
|
97
|
+
idTimeCounterType: TimeCounterType.CALENDLY.id,
|
|
98
98
|
},
|
|
99
99
|
// {
|
|
100
100
|
// id: TimeSlot.TVA_MANAGER,
|
|
@@ -116,7 +116,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
|
|
|
116
116
|
{
|
|
117
117
|
id: TimeSlot.ACCOUNTING_RDV,
|
|
118
118
|
name: 'Conseils',
|
|
119
|
-
internalName: 'Conseils',
|
|
119
|
+
internalName: 'Rdv Conseils',
|
|
120
120
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,
|
|
121
121
|
duration: 30,
|
|
122
122
|
idRole:[Role.ACCOUNTANT],
|
|
@@ -127,7 +127,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
|
|
|
127
127
|
{
|
|
128
128
|
id: TimeSlot.BILLING,
|
|
129
129
|
name: 'Questions concernant ma facturation',
|
|
130
|
-
internalName: '
|
|
130
|
+
internalName: 'Rdv facturation',
|
|
131
131
|
duration: 30,
|
|
132
132
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)?.name,
|
|
133
133
|
idRole:[Role.FACTURATION],
|
|
@@ -155,7 +155,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
|
|
|
155
155
|
{
|
|
156
156
|
id: TimeSlot.SUPPORTING_CREATION_OF_SOCIETY,
|
|
157
157
|
name: 'Accompagnement pour la création de mon entreprise',
|
|
158
|
-
internalName: '
|
|
158
|
+
internalName: 'Rdv création',
|
|
159
159
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,
|
|
160
160
|
duration: 30,
|
|
161
161
|
idRole: [Role.JURIDIC],
|
|
@@ -165,7 +165,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
|
|
|
165
165
|
{
|
|
166
166
|
id: TimeSlot.APPROVAL_FINANCIAL_STATEMENTS_AND_DISTRIBUTE_DIVIDENDS,
|
|
167
167
|
name: 'Approuver les comptes et/ou distribuer des dividendes',
|
|
168
|
-
internalName: '
|
|
168
|
+
internalName: 'Rdv juridique',
|
|
169
169
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,
|
|
170
170
|
duration: 30,
|
|
171
171
|
idRole: [Role.JURIDIC],
|
|
@@ -175,7 +175,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
|
|
|
175
175
|
{
|
|
176
176
|
id: TimeSlot.EDIT_SOCIETY,
|
|
177
177
|
name: 'Modifier mon entreprise',
|
|
178
|
-
internalName: '
|
|
178
|
+
internalName: 'Rdv juridique',
|
|
179
179
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,
|
|
180
180
|
duration: 30,
|
|
181
181
|
idRole: [Role.JURIDIC],
|
|
@@ -185,7 +185,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
|
|
|
185
185
|
{
|
|
186
186
|
id: TimeSlot.CLOSE_SOCIETY,
|
|
187
187
|
name: 'Fermer mon entreprise',
|
|
188
|
-
internalName: '
|
|
188
|
+
internalName: 'Rdv juridique',
|
|
189
189
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,
|
|
190
190
|
duration: 30,
|
|
191
191
|
idRole: [Role.JURIDIC],
|
|
@@ -195,7 +195,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
|
|
|
195
195
|
{
|
|
196
196
|
id: TimeSlot.TAX_ADVICE_OR_COMPLEX_LEGAL_ARRANGEMENTS,
|
|
197
197
|
name: 'Conseils fiscaux ou montages juridiques complexes',
|
|
198
|
-
internalName: '
|
|
198
|
+
internalName: 'Rdv juridique',
|
|
199
199
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,
|
|
200
200
|
duration: 60,
|
|
201
201
|
idRole: [Role.JURIDIC, Role.DIRECTOR],
|
|
@@ -205,7 +205,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
|
|
|
205
205
|
{
|
|
206
206
|
id: TimeSlot.FIX_UNPAID,
|
|
207
207
|
name: 'Régulariser un paiement',
|
|
208
|
-
internalName: '
|
|
208
|
+
internalName: 'Rdv impayés',
|
|
209
209
|
duration: 30,
|
|
210
210
|
category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.BILLING)?.name,
|
|
211
211
|
idRole:[Role.FACTURATION],
|
package/ts/utils/payment.ts
CHANGED
|
@@ -162,6 +162,7 @@ const calculatePaymentsAuto = (params: ParamsForPaymentsAuto):PaymentAuto[] => {
|
|
|
162
162
|
closingDate: listPartialExercicePrestationExpress?.length ? listPartialExercicePrestationExpress[0].endDate : firstExerciceNonExpresssEndDate,
|
|
163
163
|
comment: 'Frais de dossier',
|
|
164
164
|
});
|
|
165
|
+
remainingAmount += applicationFeesAmountTTC;
|
|
165
166
|
}
|
|
166
167
|
|
|
167
168
|
// =========================
|