@silexpert/core 1.1.166 → 1.1.168
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/BrandPourcentage.js +1 -1
- package/dist/cjs/types/Enum/BrandPourcentage.js.map +1 -1
- package/dist/cjs/types/Enum/Constitution.d.ts +3 -0
- package/dist/cjs/types/Enum/Constitution.d.ts.map +1 -1
- package/dist/cjs/types/Enum/Constitution.js +3 -0
- package/dist/cjs/types/Enum/Constitution.js.map +1 -1
- package/dist/cjs/types/Enum/PrestationType.js +6 -6
- package/dist/cjs/types/Enum/PrestationType.js.map +1 -1
- package/dist/cjs/types/Enum/PriceGridClementine.d.ts +9 -0
- package/dist/cjs/types/Enum/PriceGridClementine.d.ts.map +1 -1
- package/dist/cjs/types/Enum/PriceGridClementine.js +15 -0
- package/dist/cjs/types/Enum/PriceGridClementine.js.map +1 -1
- package/dist/cjs/types/Interface/models/IGedFile.d.ts +1 -0
- package/dist/cjs/types/Interface/models/IGedFile.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IGedFile.js.map +1 -1
- package/dist/cjs/utils/documents.js +1 -1
- package/dist/cjs/utils/documents.js.map +1 -1
- package/dist/cjs/utils/prestation.d.ts +1 -1
- package/dist/cjs/utils/prestation.d.ts.map +1 -1
- package/dist/cjs/utils/prestation.js +18 -14
- package/dist/cjs/utils/prestation.js.map +1 -1
- package/dist/mjs/types/Enum/BrandPourcentage.js +1 -1
- package/dist/mjs/types/Enum/BrandPourcentage.js.map +1 -1
- package/dist/mjs/types/Enum/Constitution.d.ts +3 -0
- package/dist/mjs/types/Enum/Constitution.d.ts.map +1 -1
- package/dist/mjs/types/Enum/Constitution.js +3 -0
- package/dist/mjs/types/Enum/Constitution.js.map +1 -1
- package/dist/mjs/types/Enum/PrestationType.js +6 -6
- package/dist/mjs/types/Enum/PrestationType.js.map +1 -1
- package/dist/mjs/types/Enum/PriceGridClementine.d.ts +9 -0
- package/dist/mjs/types/Enum/PriceGridClementine.d.ts.map +1 -1
- package/dist/mjs/types/Enum/PriceGridClementine.js +15 -0
- package/dist/mjs/types/Enum/PriceGridClementine.js.map +1 -1
- package/dist/mjs/types/Interface/models/IGedFile.d.ts +1 -0
- package/dist/mjs/types/Interface/models/IGedFile.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IGedFile.js.map +1 -1
- package/dist/mjs/utils/documents.js +1 -1
- package/dist/mjs/utils/documents.js.map +1 -1
- package/dist/mjs/utils/prestation.d.ts +1 -1
- package/dist/mjs/utils/prestation.d.ts.map +1 -1
- package/dist/mjs/utils/prestation.js +8 -4
- package/dist/mjs/utils/prestation.js.map +1 -1
- package/package.json +1 -1
- package/ts/types/Enum/BrandPourcentage.ts +1 -1
- package/ts/types/Enum/Constitution.ts +3 -0
- package/ts/types/Enum/PrestationType.ts +6 -6
- package/ts/types/Enum/PriceGridClementine.ts +15 -0
- package/ts/types/Interface/models/IGedFile.ts +1 -0
- package/ts/utils/documents.ts +1 -1
- package/ts/utils/prestation.ts +14 -4
package/ts/utils/prestation.ts
CHANGED
|
@@ -26,6 +26,7 @@ type priceGrid = {
|
|
|
26
26
|
properties?: propertie[],
|
|
27
27
|
vatRegimeMonthly?: vatRegime[],
|
|
28
28
|
vatRegimeYearly?: vatRegime[],
|
|
29
|
+
taxSystem?: taxSystem[],
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
type monthlyPayment = {
|
|
@@ -54,6 +55,11 @@ type vatRegime = {
|
|
|
54
55
|
price: number,
|
|
55
56
|
};
|
|
56
57
|
|
|
58
|
+
type taxSystem = {
|
|
59
|
+
id: number,
|
|
60
|
+
price: number,
|
|
61
|
+
};
|
|
62
|
+
|
|
57
63
|
const isOtherAccountingMissions = (idPrestationList: number): boolean => [
|
|
58
64
|
PrestationType.PREVISIONNEL,
|
|
59
65
|
PrestationType.BILAN_INTERMEDIAIRE,
|
|
@@ -119,7 +125,7 @@ const getPriceGrid = (idTypeBrand: number, idPrestationList: number): priceGrid
|
|
|
119
125
|
return currentPriceGrid;
|
|
120
126
|
};
|
|
121
127
|
|
|
122
|
-
const calculatePrestationPriceWithPriceGrid = (idPrestationList: number, endDate: string, NbrMonth: number, turnover: number, rentsNumber: number, employeesNumber: number, associatesNumber: number, idTypeBrand: number, idVatRegime: number, pastBalanceSheet: boolean, isYearly: boolean, totalMonth: number): { totalPrestation: number, reduceMonth: number, canBeCreated: boolean, monthNbr: number, price: number } => {
|
|
128
|
+
const calculatePrestationPriceWithPriceGrid = (idPrestationList: number, endDate: string, NbrMonth: number, turnover: number, rentsNumber: number, employeesNumber: number, associatesNumber: number, idTypeBrand: number, idVatRegime: number, pastBalanceSheet: boolean, isYearly: boolean, totalMonth: number, idTaxSystem: number): { totalPrestation: number, reduceMonth: number, canBeCreated: boolean, monthNbr: number, price: number } => {
|
|
123
129
|
let totalPrestation: number = 0;
|
|
124
130
|
let reduceMonth: number = 0;
|
|
125
131
|
let monthNbr: number = NbrMonth;
|
|
@@ -134,11 +140,15 @@ const calculatePrestationPriceWithPriceGrid = (idPrestationList: number, endDate
|
|
|
134
140
|
if (currentPriceGrid) {
|
|
135
141
|
let monthlyPrice: number | undefined;
|
|
136
142
|
let vatRegimePrice: number | undefined;
|
|
143
|
+
let taxSystemPrice: number | undefined;
|
|
137
144
|
|
|
138
145
|
/* Gestion du régime de TVA */
|
|
139
146
|
if (currentPriceGrid.vatRegimeMonthly && !isYearly) vatRegimePrice = currentPriceGrid.vatRegimeMonthly?.find(regime => regime.type === idVatRegime)?.price;
|
|
140
147
|
else if (currentPriceGrid.vatRegimeYearly && isYearly) vatRegimePrice = currentPriceGrid.vatRegimeYearly?.find(regime => regime.type === idVatRegime)?.price;
|
|
141
148
|
|
|
149
|
+
/* Gestion du Régime d'imposition */
|
|
150
|
+
if (currentPriceGrid.taxSystem && idTaxSystem) taxSystemPrice = currentPriceGrid.taxSystem?.find(tax => tax.id === idTaxSystem)?.price;
|
|
151
|
+
|
|
142
152
|
/* Gestion des montants */
|
|
143
153
|
if (currentPriceGrid.turnoverMonthly && !isYearly) monthlyPrice = currentPriceGrid.turnoverMonthly?.find(turn => turnover < turn.turnoverValue)?.price;
|
|
144
154
|
else if (currentPriceGrid.properties) monthlyPrice = currentPriceGrid.properties?.find(property => property.amount === rentsNumber)?.price;
|
|
@@ -147,7 +157,7 @@ const calculatePrestationPriceWithPriceGrid = (idPrestationList: number, endDate
|
|
|
147
157
|
else if (!pastBalanceSheet && currentPriceGrid.turnoverCreatedYear) yearlyPrice = currentPriceGrid.turnoverCreatedYear?.find(turn => turnover < turn.turnoverValue)?.price;
|
|
148
158
|
else if (pastBalanceSheet && currentPriceGrid.turnoverPastYear) yearlyPrice = currentPriceGrid.turnoverPastYear?.find(turn => turnover < turn.turnoverValue)?.price;
|
|
149
159
|
else if (currentPriceGrid.partner) yearlyPrice = currentPriceGrid.partner?.find(part => part.amountMinimum <= associatesNumber && part.amountMaximum >= associatesNumber)?.price;
|
|
150
|
-
finalMonthlyPrice = (monthlyPrice ? monthlyPrice : 0) + (vatRegimePrice ? vatRegimePrice : 0);
|
|
160
|
+
finalMonthlyPrice = (monthlyPrice ? monthlyPrice : 0) + (vatRegimePrice ? vatRegimePrice : 0) + (taxSystemPrice ? taxSystemPrice : 0);
|
|
151
161
|
|
|
152
162
|
/* Gestion des mois */
|
|
153
163
|
let cloturedPast: boolean = false;
|
|
@@ -182,7 +192,7 @@ const calculatePrestationPriceWithPrestationList = (prestationList: IPrestationL
|
|
|
182
192
|
return totalPrestation;
|
|
183
193
|
};
|
|
184
194
|
|
|
185
|
-
const calculatePrestationPrice = (idPrestationList: number, prestationList: IPrestationList, endDate: string, NbrMonth: number, turnover: number, rentsNumber: number, employeesNumber: number, associatesNumber: number, idTypeBrand: number, idVatRegime: number, pastBalanceSheet: boolean, optionsList: number[], totalPercentage: number, totalAmount: number, totalMonth: number, isWithApplicationFees: boolean, isYearly: boolean = false): { totalPrestation: number, reduceMonth: number, canBeCreated: boolean, calculDetail: string, price: number } => {
|
|
195
|
+
const calculatePrestationPrice = (idPrestationList: number, prestationList: IPrestationList, endDate: string, NbrMonth: number, turnover: number, rentsNumber: number, employeesNumber: number, associatesNumber: number, idTypeBrand: number, idVatRegime: number, pastBalanceSheet: boolean, optionsList: number[], totalPercentage: number, totalAmount: number, totalMonth: number, isWithApplicationFees: boolean, idTaxSystem: number, isYearly: boolean = false): { totalPrestation: number, reduceMonth: number, canBeCreated: boolean, calculDetail: string, price: number } => {
|
|
186
196
|
let totalPrestation: number = 0;
|
|
187
197
|
let reduceMonth: number = 0;
|
|
188
198
|
let canBeCreated: boolean = true;
|
|
@@ -211,7 +221,7 @@ const calculatePrestationPrice = (idPrestationList: number, prestationList: IPre
|
|
|
211
221
|
PrestationType.COMPTA_PRO_COMPTASTART_EXPRESS,
|
|
212
222
|
].includes(idPrestationList)
|
|
213
223
|
) {
|
|
214
|
-
totalWithReduce = calculatePrestationPriceWithPriceGrid(idPrestationList, endDate, NbrMonth, turnover, rentsNumber, employeesNumber, associatesNumber, idTypeBrand, idVatRegime, pastBalanceSheet, isYearly, totalMonth);
|
|
224
|
+
totalWithReduce = calculatePrestationPriceWithPriceGrid(idPrestationList, endDate, NbrMonth, turnover, rentsNumber, employeesNumber, associatesNumber, idTypeBrand, idVatRegime, pastBalanceSheet, isYearly, totalMonth, idTaxSystem);
|
|
215
225
|
totalPrestation = totalWithReduce.totalPrestation;
|
|
216
226
|
reduceMonth = totalWithReduce.reduceMonth;
|
|
217
227
|
canBeCreated = totalWithReduce.canBeCreated;
|