@silexpert/core 1.1.343 → 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.
- package/dist/cjs/api/resources/Loan.d.ts +9 -11
- package/dist/cjs/api/resources/Loan.d.ts.map +1 -1
- package/dist/cjs/api/resources/Loan.js +23 -17
- package/dist/cjs/api/resources/Loan.js.map +1 -1
- package/dist/cjs/types/Enum/TimeSlot.d.ts +4 -2
- package/dist/cjs/types/Enum/TimeSlot.d.ts.map +1 -1
- package/dist/cjs/types/Enum/TimeSlot.js +11 -22
- package/dist/cjs/types/Enum/TimeSlot.js.map +1 -1
- package/dist/cjs/types/Interface/api/bankAccount/Query.d.ts +1 -0
- package/dist/cjs/types/Interface/api/bankAccount/Query.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/bankAccount/Query.js +7 -0
- package/dist/cjs/types/Interface/api/bankAccount/Query.js.map +1 -1
- package/dist/cjs/types/Interface/api/exercice/ReadExercice.d.ts +7 -0
- package/dist/cjs/types/Interface/api/exercice/ReadExercice.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/exercice/ReadExercice.js +3 -0
- package/dist/cjs/types/Interface/api/exercice/ReadExercice.js.map +1 -0
- package/dist/cjs/types/Interface/api/loan/CreateLoan.d.ts +13 -2
- package/dist/cjs/types/Interface/api/loan/CreateLoan.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/loan/CreateLoan.js +53 -3
- package/dist/cjs/types/Interface/api/loan/CreateLoan.js.map +1 -1
- package/dist/cjs/types/Interface/api/loan/ReadLoan.d.ts +10 -0
- package/dist/cjs/types/Interface/api/loan/ReadLoan.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/loan/ReadLoan.js +3 -0
- package/dist/cjs/types/Interface/api/loan/ReadLoan.js.map +1 -0
- package/dist/cjs/types/Interface/api/loan/UpdateLoan.d.ts +0 -6
- package/dist/cjs/types/Interface/api/loan/UpdateLoan.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/loan/UpdateLoan.js +2 -36
- package/dist/cjs/types/Interface/api/loan/UpdateLoan.js.map +1 -1
- package/dist/cjs/types/Interface/models/ILoan.d.ts +7 -0
- package/dist/cjs/types/Interface/models/ILoan.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/ILoan.js.map +1 -1
- package/dist/cjs/types/Interface/models/ILoanEarlyRepayment.d.ts +12 -0
- package/dist/cjs/types/Interface/models/ILoanEarlyRepayment.d.ts.map +1 -0
- package/dist/cjs/types/Interface/models/ILoanEarlyRepayment.js +3 -0
- package/dist/cjs/types/Interface/models/ILoanEarlyRepayment.js.map +1 -0
- package/dist/cjs/types/index.d.ts +3 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +3 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/utils/payment.d.ts.map +1 -1
- package/dist/cjs/utils/payment.js +5 -1
- package/dist/cjs/utils/payment.js.map +1 -1
- package/dist/cjs/utils/prestation.js +1 -1
- package/dist/cjs/utils/prestation.js.map +1 -1
- package/dist/mjs/api/resources/Loan.d.ts +9 -11
- package/dist/mjs/api/resources/Loan.d.ts.map +1 -1
- package/dist/mjs/api/resources/Loan.js +23 -17
- package/dist/mjs/api/resources/Loan.js.map +1 -1
- package/dist/mjs/types/Enum/TimeSlot.d.ts +4 -2
- package/dist/mjs/types/Enum/TimeSlot.d.ts.map +1 -1
- package/dist/mjs/types/Enum/TimeSlot.js +5 -16
- package/dist/mjs/types/Enum/TimeSlot.js.map +1 -1
- package/dist/mjs/types/Interface/api/bankAccount/Query.d.ts +1 -0
- package/dist/mjs/types/Interface/api/bankAccount/Query.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/bankAccount/Query.js +8 -0
- package/dist/mjs/types/Interface/api/bankAccount/Query.js.map +1 -1
- package/dist/mjs/types/Interface/api/exercice/ReadExercice.d.ts +7 -0
- package/dist/mjs/types/Interface/api/exercice/ReadExercice.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/exercice/ReadExercice.js +2 -0
- package/dist/mjs/types/Interface/api/exercice/ReadExercice.js.map +1 -0
- package/dist/mjs/types/Interface/api/loan/CreateLoan.d.ts +13 -2
- package/dist/mjs/types/Interface/api/loan/CreateLoan.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/loan/CreateLoan.js +61 -3
- package/dist/mjs/types/Interface/api/loan/CreateLoan.js.map +1 -1
- package/dist/mjs/types/Interface/api/loan/ReadLoan.d.ts +10 -0
- package/dist/mjs/types/Interface/api/loan/ReadLoan.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/loan/ReadLoan.js +2 -0
- package/dist/mjs/types/Interface/api/loan/ReadLoan.js.map +1 -0
- package/dist/mjs/types/Interface/api/loan/UpdateLoan.d.ts +0 -6
- package/dist/mjs/types/Interface/api/loan/UpdateLoan.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/loan/UpdateLoan.js +3 -43
- package/dist/mjs/types/Interface/api/loan/UpdateLoan.js.map +1 -1
- package/dist/mjs/types/Interface/models/ILoan.d.ts +7 -0
- package/dist/mjs/types/Interface/models/ILoan.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/ILoan.js.map +1 -1
- package/dist/mjs/types/Interface/models/ILoanEarlyRepayment.d.ts +12 -0
- package/dist/mjs/types/Interface/models/ILoanEarlyRepayment.d.ts.map +1 -0
- package/dist/mjs/types/Interface/models/ILoanEarlyRepayment.js +2 -0
- package/dist/mjs/types/Interface/models/ILoanEarlyRepayment.js.map +1 -0
- package/dist/mjs/types/index.d.ts +3 -0
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +3 -0
- package/dist/mjs/types/index.js.map +1 -1
- package/dist/mjs/utils/payment.d.ts.map +1 -1
- package/dist/mjs/utils/payment.js +5 -1
- package/dist/mjs/utils/payment.js.map +1 -1
- package/dist/mjs/utils/prestation.js +1 -1
- package/dist/mjs/utils/prestation.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Loan.ts +28 -21
- package/ts/types/Enum/TimeSlot.ts +9 -17
- package/ts/types/Interface/api/bankAccount/Query.ts +6 -0
- package/ts/types/Interface/api/exercice/ReadExercice.ts +6 -0
- package/ts/types/Interface/api/loan/CreateLoan.ts +45 -5
- package/ts/types/Interface/api/loan/ReadLoan.ts +9 -0
- package/ts/types/Interface/api/loan/UpdateLoan.ts +3 -31
- package/ts/types/Interface/models/ILoan.ts +7 -0
- package/ts/types/Interface/models/ILoanEarlyRepayment.ts +13 -0
- package/ts/types/index.ts +3 -0
- package/ts/utils/payment.ts +6 -1
- package/ts/utils/prestation.ts +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IsOptional, IsString } from 'class-validator';
|
|
2
2
|
import { ApiPropertyOptional } from '../../../../utils';
|
|
3
3
|
|
|
4
4
|
export class UpdateLoanForm {
|
|
5
5
|
@ApiPropertyOptional()
|
|
6
|
+
@IsString()
|
|
7
|
+
@IsOptional()
|
|
6
8
|
name?: string;
|
|
7
9
|
|
|
8
10
|
@ApiPropertyOptional()
|
|
@@ -14,34 +16,4 @@ export class UpdateLoanForm {
|
|
|
14
16
|
@IsString()
|
|
15
17
|
@IsOptional()
|
|
16
18
|
number?: string;
|
|
17
|
-
|
|
18
|
-
@ApiPropertyOptional()
|
|
19
|
-
@IsNumber()
|
|
20
|
-
@IsOptional()
|
|
21
|
-
amount?: number;
|
|
22
|
-
|
|
23
|
-
@ApiPropertyOptional()
|
|
24
|
-
@IsNumber()
|
|
25
|
-
@IsOptional()
|
|
26
|
-
assetBeforeExercice?: number;
|
|
27
|
-
|
|
28
|
-
@ApiPropertyOptional()
|
|
29
|
-
@IsNumber()
|
|
30
|
-
@IsOptional()
|
|
31
|
-
assetAfterExercice?: number;
|
|
32
|
-
|
|
33
|
-
@ApiPropertyOptional()
|
|
34
|
-
@IsNumber()
|
|
35
|
-
@IsOptional()
|
|
36
|
-
idExercice?: number;
|
|
37
|
-
|
|
38
|
-
@ApiPropertyOptional()
|
|
39
|
-
@IsNumber()
|
|
40
|
-
@IsOptional()
|
|
41
|
-
monthDuration?: number;
|
|
42
|
-
|
|
43
|
-
@ApiPropertyOptional()
|
|
44
|
-
@IsNumber()
|
|
45
|
-
@IsOptional()
|
|
46
|
-
rate?: number;
|
|
47
19
|
}
|
|
@@ -2,6 +2,7 @@ import { ISociety } from './ISociety';
|
|
|
2
2
|
import { IExercice } from './IExercice';
|
|
3
3
|
import { IAccount } from './IAccount';
|
|
4
4
|
import { ILoanFile } from './ILoanFile';
|
|
5
|
+
import { ILoanEarlyRepayment } from './ILoanEarlyRepayment';
|
|
5
6
|
|
|
6
7
|
export interface ILoan {
|
|
7
8
|
id?: number;
|
|
@@ -14,6 +15,11 @@ export interface ILoan {
|
|
|
14
15
|
assetAfterExercice: number;
|
|
15
16
|
monthDuration?: number;
|
|
16
17
|
rate?: number;
|
|
18
|
+
annuity: number | null;
|
|
19
|
+
unlockDate: Date | null;
|
|
20
|
+
firstDueDate: Date | null;
|
|
21
|
+
commission: number | null;
|
|
22
|
+
insurance: number | null;
|
|
17
23
|
idExercice: number;
|
|
18
24
|
idSociety: number;
|
|
19
25
|
idAccountRefund: number;
|
|
@@ -33,4 +39,5 @@ export interface ILoan {
|
|
|
33
39
|
accountCommission?: IAccount;
|
|
34
40
|
accountReleaseLoanCapital?: IAccount;
|
|
35
41
|
loanFiles?: ILoanFile[];
|
|
42
|
+
earlyRepayments?: ILoanEarlyRepayment[];
|
|
36
43
|
}
|
package/ts/types/index.ts
CHANGED
|
@@ -333,6 +333,7 @@ export * from './Interface/models/IExpertAnnuary';
|
|
|
333
333
|
export * from './Interface/models/IUserTimeSlot';
|
|
334
334
|
export * from './Interface/models/ICompanyCreationForm';
|
|
335
335
|
export * from './Interface/models/IAnnotation';
|
|
336
|
+
export * from './Interface/models/ILoanEarlyRepayment';
|
|
336
337
|
|
|
337
338
|
|
|
338
339
|
// Schemas
|
|
@@ -544,6 +545,7 @@ export * from './Enum/Contest';
|
|
|
544
545
|
export * from './Enum/LetterResponseType';
|
|
545
546
|
|
|
546
547
|
// Interfaces API
|
|
548
|
+
export * from './Interface/api/exercice/ReadExercice';
|
|
547
549
|
export * from './Interface/api/kilometricAllowance/ReadKilometricAllowance';
|
|
548
550
|
export * from './Interface/api/cashAndExpense/Query';
|
|
549
551
|
export * from './Interface/api/cerfa/das2';
|
|
@@ -814,6 +816,7 @@ export * from './Interface/api/promoCode/UpdatePromoCode';
|
|
|
814
816
|
export * from './Interface/api/promoCode/CreatePromoCode';
|
|
815
817
|
export * from './Interface/api/balanceBankAccount/CreateBudgetBalanceBankAccount';
|
|
816
818
|
export * from './Interface/api/loan/CreateLoan';
|
|
819
|
+
export * from './Interface/api/loan/ReadLoan';
|
|
817
820
|
export * from './Interface/api/stock/StocksType';
|
|
818
821
|
export * from './Interface/api/lettering/QueryRegroupLettering';
|
|
819
822
|
// export * from './Interface/api/stock/StockEntries';
|
package/ts/utils/payment.ts
CHANGED
|
@@ -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 ?
|
|
256
|
+
const exoAmount = isFirstNonExpress ? yearlyAmountNonExpressClone : nextYearlyAmountNonExpress;
|
|
252
257
|
const remainingBeforeThisExo = remainingAmount;
|
|
253
258
|
remainingAmount += priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat);
|
|
254
259
|
|
package/ts/utils/prestation.ts
CHANGED
|
@@ -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.
|
|
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);
|