@silexpert/core 1.1.344 → 1.1.346

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.
@@ -18,7 +18,6 @@ export enum TimeSlot {
18
18
  CLOSE_SOCIETY = 14,
19
19
  TAX_ADVICE_OR_COMPLEX_LEGAL_ARRANGEMENTS = 15,
20
20
  FIX_UNPAID = 16,
21
- POST_BILAN = 17,
22
21
  ANNUAL_FINANCIAL_STATEMENTS = 18,
23
22
  MANAGER_REVENUE = 19,
24
23
  SPECIALISED_FISCAL_QUESTIONS = 20,
@@ -33,13 +32,16 @@ export enum TimeSlotCategory {
33
32
  SPECIALISED = 4,
34
33
  }
35
34
 
35
+ /**
36
+ * @param {number[]} idRole if idRole not set, return all users except customers
37
+ */
36
38
  export type TimeSlotDetailType = {
37
39
  id: number;
38
40
  name: string;
39
41
  internalName: string;
40
42
  category?: string,
41
43
  duration: number;
42
- idRole: number[];
44
+ idRole?: number[];
43
45
  forWholeService?: boolean
44
46
  idRoleExcluded?: number[];
45
47
  idTimeCounterType: number;
@@ -99,7 +101,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
99
101
  internalName: 'Rdv bilan',
100
102
  category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,
101
103
  duration: 30,
102
- idRole: [Role.ACCOUNTANT, Role.TECHNICAL_ADVISOR],
104
+ idRole: [Role.ACCOUNTANT],
103
105
  forWholeService: false,
104
106
  idTimeCounterType: TimeCounterType.CALENDLY.id,
105
107
  },
@@ -109,7 +111,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
109
111
  internalName: 'Rdv TVA',
110
112
  category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,
111
113
  duration: 30,
112
- idRole:[Role.ACCOUNTANT, Role.TECHNICAL_ADVISOR],
114
+ idRole:[Role.ACCOUNTANT],
113
115
  idRoleExcluded:[Role.MANAGER],
114
116
  forWholeService: false,
115
117
  idTimeCounterType: TimeCounterType.CALENDLY.id,
@@ -137,7 +139,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
137
139
  internalName: 'Rdv Conseils',
138
140
  category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,
139
141
  duration: 30,
140
- idRole:[Role.ACCOUNTANT, Role.TECHNICAL_ADVISOR],
142
+ idRole:[Role.ACCOUNTANT],
141
143
  idRoleExcluded:[Role.MANAGER],
142
144
  forWholeService: false,
143
145
  idTimeCounterType: TimeCounterType.CALENDLY.id,
@@ -166,7 +168,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
166
168
  name: 'Rdv',
167
169
  internalName: 'Rdv',
168
170
  duration: 20,
169
- idRole: [Role.ACCOUNTANT, Role.COMMERCIAL, Role.SOCIAL, Role.JURIDIC, Role.EXPERT_ACCOUNTANT, Role.FACTURATION, Role.LITIGE, Role.TECHNICAL_ADVISOR],
171
+ // idRole: [Role.ACCOUNTANT, Role.COMMERCIAL, Role.SOCIAL, Role.JURIDIC, Role.EXPERT_ACCOUNTANT, Role.FACTURATION, Role.LITIGE, Role.TECHNICAL_ADVISOR],
170
172
  forWholeService: false,
171
173
  idTimeCounterType: TimeCounterType.CALENDLY.id,
172
174
  },
@@ -217,7 +219,7 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
217
219
  category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.JURIDIC)?.name,
218
220
  duration: 60,
219
221
  idRole: [Role.JURIDIC, Role.DIRECTOR],
220
- forWholeService: true,
222
+ forWholeService: false,
221
223
  idTimeCounterType: TimeCounterType.CALENDLY.id,
222
224
  },
223
225
  {
@@ -230,16 +232,6 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
230
232
  forWholeService: true,
231
233
  idTimeCounterType: TimeCounterType.CALENDLY.id,
232
234
  },
233
- {
234
- id: TimeSlot.POST_BILAN,
235
- name: 'Prise de rendez-vous rendus bilan',
236
- internalName: 'Rdv rendus bilan',
237
- category: TimeSlotCategoryDetail.find(c => c.id === TimeSlotCategory.ACCOUNTING)?.name,
238
- duration: 30,
239
- idRole: [Role.TECHNICAL_ADVISOR],
240
- forWholeService: false,
241
- idTimeCounterType: TimeCounterType.CALENDLY.id,
242
- },
243
235
  {
244
236
  id: TimeSlot.ANNUAL_FINANCIAL_STATEMENTS,
245
237
  name: 'Lecture et explication des comptes annuels',
@@ -114,6 +114,11 @@ const calculatePaymentsAuto = (params: ParamsForPaymentsAuto):PaymentAuto[] => {
114
114
 
115
115
  if (prestationList?.isCatalog || !prestationList?.isComptable) throw new Error('Ce type de prestation ne correspond pas aux conditions attendues.');
116
116
  if (listPartialExercicePrestationExpress.length && listPartialExercicePrestationExpress?.some((ep: PartialExercicePrestationExpress) => !ep?.startDate)) throw new Error('Start date of some exercice are missing');
117
+
118
+ let yearlyAmountNonExpressClone = yearlyAmountNonExpress;
119
+ if (isWithApplicationFees) {
120
+ yearlyAmountNonExpressClone -= getApplicationFeesAmount(idLegalForm); //HT
121
+ }
117
122
 
118
123
  const nbExoExpress = listPartialExercicePrestationExpress.length;
119
124
  const listPayments:PaymentAuto[] = [];
@@ -248,7 +253,7 @@ const calculatePaymentsAuto = (params: ParamsForPaymentsAuto):PaymentAuto[] => {
248
253
  let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));
249
254
  if (countMonthsBeforeExerciceEnd < 3) countMonthsBeforeExerciceEnd = 3;
250
255
 
251
- const exoAmount = isFirstNonExpress ? yearlyAmountNonExpress : nextYearlyAmountNonExpress;
256
+ const exoAmount = isFirstNonExpress ? yearlyAmountNonExpressClone : nextYearlyAmountNonExpress;
252
257
  const remainingBeforeThisExo = remainingAmount;
253
258
  remainingAmount += priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat);
254
259
 
@@ -119,7 +119,7 @@ const isExpress = (idPrestationList: number):boolean => {
119
119
  };
120
120
 
121
121
  const calculateScoringOfPrestation = (idPrestationType: PrestationType, prestations: IPrestation[]): number => {
122
- const prestationsSignedPaid = prestations.filter((prestation) => prestation.paid && prestation.signed && prestation.terminationList === null);
122
+ const prestationsSignedPaid = prestations.filter((prestation) => prestation.terminationList === null);
123
123
 
124
124
  // Get the list of prestations that are half price
125
125
  const prestationHalfPriceList = Object.values(PrestationDetail).filter((p) => p.isComptable && !p.isCatalog);