@silexpert/core 1.1.381 → 1.1.383
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/AccountingFiles.d.ts +2 -2
- package/dist/cjs/api/resources/AccountingFiles.d.ts.map +1 -1
- package/dist/cjs/api/resources/AccountingFiles.js.map +1 -1
- package/dist/cjs/api/resources/BankAccount.d.ts +2 -1
- package/dist/cjs/api/resources/BankAccount.d.ts.map +1 -1
- package/dist/cjs/api/resources/BankAccount.js +3 -0
- package/dist/cjs/api/resources/BankAccount.js.map +1 -1
- package/dist/cjs/types/Enum/ConstitutionState.d.ts +2 -1
- package/dist/cjs/types/Enum/ConstitutionState.d.ts.map +1 -1
- package/dist/cjs/types/Enum/ConstitutionState.js +7 -0
- package/dist/cjs/types/Enum/ConstitutionState.js.map +1 -1
- package/dist/cjs/types/Enum/EstimateInvoice.d.ts +14 -0
- package/dist/cjs/types/Enum/EstimateInvoice.d.ts.map +1 -1
- package/dist/cjs/types/Enum/EstimateInvoice.js +22 -1
- package/dist/cjs/types/Enum/EstimateInvoice.js.map +1 -1
- package/dist/cjs/types/Enum/TaskResponseType.d.ts.map +1 -1
- package/dist/cjs/types/Enum/TaskResponseType.js +11 -0
- package/dist/cjs/types/Enum/TaskResponseType.js.map +1 -1
- package/dist/cjs/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts +10 -0
- package/dist/cjs/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/accountingFiles/queryAccountingFiles.js +49 -1
- package/dist/cjs/types/Interface/api/accountingFiles/queryAccountingFiles.js.map +1 -1
- package/dist/cjs/types/Interface/api/revision/Query.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/revision/Query.js.map +1 -1
- package/dist/cjs/types/Interface/api/terminationList/CreateTerminationList.d.ts +1 -0
- package/dist/cjs/types/Interface/api/terminationList/CreateTerminationList.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/terminationList/CreateTerminationList.js +7 -0
- package/dist/cjs/types/Interface/api/terminationList/CreateTerminationList.js.map +1 -1
- package/dist/cjs/types/Interface/api/thirdParty/CreateThirdPartyForm.d.ts +2 -1
- package/dist/cjs/types/Interface/api/thirdParty/CreateThirdPartyForm.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/thirdParty/CreateThirdPartyForm.js +5 -0
- package/dist/cjs/types/Interface/api/thirdParty/CreateThirdPartyForm.js.map +1 -1
- package/dist/cjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.d.ts +2 -1
- package/dist/cjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.js +5 -0
- package/dist/cjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.js.map +1 -1
- package/dist/cjs/types/Interface/models/IThirdParty.d.ts +2 -0
- package/dist/cjs/types/Interface/models/IThirdParty.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IThirdParty.js.map +1 -1
- package/dist/cjs/utils/prestation.d.ts +7 -0
- package/dist/cjs/utils/prestation.d.ts.map +1 -1
- package/dist/cjs/utils/prestation.js +11 -1
- package/dist/cjs/utils/prestation.js.map +1 -1
- package/dist/mjs/api/resources/AccountingFiles.d.ts +2 -2
- package/dist/mjs/api/resources/AccountingFiles.d.ts.map +1 -1
- package/dist/mjs/api/resources/AccountingFiles.js.map +1 -1
- package/dist/mjs/api/resources/BankAccount.d.ts +2 -1
- package/dist/mjs/api/resources/BankAccount.d.ts.map +1 -1
- package/dist/mjs/api/resources/BankAccount.js +3 -0
- package/dist/mjs/api/resources/BankAccount.js.map +1 -1
- package/dist/mjs/types/Enum/ConstitutionState.d.ts +2 -1
- package/dist/mjs/types/Enum/ConstitutionState.d.ts.map +1 -1
- package/dist/mjs/types/Enum/ConstitutionState.js +7 -0
- package/dist/mjs/types/Enum/ConstitutionState.js.map +1 -1
- package/dist/mjs/types/Enum/EstimateInvoice.d.ts +14 -0
- package/dist/mjs/types/Enum/EstimateInvoice.d.ts.map +1 -1
- package/dist/mjs/types/Enum/EstimateInvoice.js +21 -0
- package/dist/mjs/types/Enum/EstimateInvoice.js.map +1 -1
- package/dist/mjs/types/Enum/TaskResponseType.d.ts.map +1 -1
- package/dist/mjs/types/Enum/TaskResponseType.js +11 -0
- package/dist/mjs/types/Enum/TaskResponseType.js.map +1 -1
- package/dist/mjs/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts +10 -0
- package/dist/mjs/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/accountingFiles/queryAccountingFiles.js +56 -1
- package/dist/mjs/types/Interface/api/accountingFiles/queryAccountingFiles.js.map +1 -1
- package/dist/mjs/types/Interface/api/revision/Query.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/revision/Query.js.map +1 -1
- package/dist/mjs/types/Interface/api/terminationList/CreateTerminationList.d.ts +1 -0
- package/dist/mjs/types/Interface/api/terminationList/CreateTerminationList.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/terminationList/CreateTerminationList.js +8 -0
- package/dist/mjs/types/Interface/api/terminationList/CreateTerminationList.js.map +1 -1
- package/dist/mjs/types/Interface/api/thirdParty/CreateThirdPartyForm.d.ts +2 -1
- package/dist/mjs/types/Interface/api/thirdParty/CreateThirdPartyForm.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/thirdParty/CreateThirdPartyForm.js +6 -0
- package/dist/mjs/types/Interface/api/thirdParty/CreateThirdPartyForm.js.map +1 -1
- package/dist/mjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.d.ts +2 -1
- package/dist/mjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.js +6 -0
- package/dist/mjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.js.map +1 -1
- package/dist/mjs/types/Interface/models/IThirdParty.d.ts +2 -0
- package/dist/mjs/types/Interface/models/IThirdParty.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IThirdParty.js.map +1 -1
- package/dist/mjs/utils/prestation.d.ts +7 -0
- package/dist/mjs/utils/prestation.d.ts.map +1 -1
- package/dist/mjs/utils/prestation.js +9 -0
- package/dist/mjs/utils/prestation.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/AccountingFiles.ts +2 -2
- package/ts/api/resources/BankAccount.ts +5 -1
- package/ts/types/Enum/ConstitutionState.ts +7 -1
- package/ts/types/Enum/EstimateInvoice.ts +22 -0
- package/ts/types/Enum/TaskResponseType.ts +11 -0
- package/ts/types/Interface/api/accountingFiles/queryAccountingFiles.ts +42 -0
- package/ts/types/Interface/api/revision/Query.ts +113 -113
- package/ts/types/Interface/api/terminationList/CreateTerminationList.ts +6 -0
- package/ts/types/Interface/api/thirdParty/CreateThirdPartyForm.ts +5 -1
- package/ts/types/Interface/api/thirdParty/UpdateThirdPartyForm.ts +5 -1
- package/ts/types/Interface/models/IThirdParty.ts +2 -0
- package/ts/utils/prestation.ts +11 -0
package/ts/utils/prestation.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IExercice, IPrestation, IPrestationList } from '../types';
|
|
2
|
+
import { Vat } from '../types/Enum/Vat';
|
|
2
3
|
import { getTaxesIncludedAmount } from './vat/utils';
|
|
3
4
|
import { intersection } from './noLodash';
|
|
4
5
|
import { PrestationDetail, PrestationType } from '../types/Enum/PrestationType';
|
|
@@ -139,6 +140,16 @@ const calculateScoringOfPrestation = (idPrestationType: PrestationType, prestati
|
|
|
139
140
|
return numberPoint;
|
|
140
141
|
};
|
|
141
142
|
|
|
143
|
+
export const calculateMonthlyAmount = (params: { monthlyPrice: number, monthNumber: number, monthOffer: number, idVatForInternalInvoicing?: number | null, returnTaxesIncludedValue?: boolean }): number =>{
|
|
144
|
+
const { monthlyPrice, monthNumber, monthOffer, idVatForInternalInvoicing, returnTaxesIncludedValue = true } = params;
|
|
145
|
+
|
|
146
|
+
if (!idVatForInternalInvoicing && returnTaxesIncludedValue) throw new Error('Taux de TVA manquant pour calculer le montant TTC');
|
|
147
|
+
|
|
148
|
+
if (!idVatForInternalInvoicing || !returnTaxesIncludedValue) return monthlyPrice * (monthNumber - monthOffer);
|
|
149
|
+
|
|
150
|
+
return monthlyPrice * (monthNumber - monthOffer) * (1 + (Object.values(Vat).find(el => el.id === idVatForInternalInvoicing).value / 100));
|
|
151
|
+
};
|
|
152
|
+
|
|
142
153
|
export const getPriceGrid = (idTypeBrand: number, idPrestationList: number): priceGrid | undefined => {
|
|
143
154
|
let currentBrandPriceGrid: priceGridBrand | undefined;
|
|
144
155
|
let currentPriceGrid: priceGrid | undefined;
|