@silexpert/core 1.3.160 → 1.3.161

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.
Files changed (70) hide show
  1. package/dist/cjs/api/resources/GeneralLedger.d.ts +2 -1
  2. package/dist/cjs/api/resources/GeneralLedger.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/GeneralLedger.js +9 -0
  4. package/dist/cjs/api/resources/GeneralLedger.js.map +1 -1
  5. package/dist/cjs/types/Interface/api/brevo/EmailSendOptions.dto.js +12 -12
  6. package/dist/cjs/types/Interface/api/brevo/EmailSendOptions.dto.js.map +1 -1
  7. package/dist/cjs/types/Interface/api/generalLedger/IGeneralLedgerAccountingEntry.d.ts +1 -0
  8. package/dist/cjs/types/Interface/api/generalLedger/IGeneralLedgerAccountingEntry.d.ts.map +1 -1
  9. package/dist/cjs/types/Interface/api/generalLedger/IGeneralLedgerAccountingEntry.js.map +1 -1
  10. package/dist/cjs/types/Interface/api/generalLedger/IGeneralLedgerThirdParty.d.ts +1 -0
  11. package/dist/cjs/types/Interface/api/generalLedger/IGeneralLedgerThirdParty.d.ts.map +1 -1
  12. package/dist/cjs/types/Interface/api/generalLedger/IGeneralLedgerThirdParty.js.map +1 -1
  13. package/dist/cjs/types/Interface/api/generalLedger/QueryGeneralLedgerAuxiliary.d.ts +9 -0
  14. package/dist/cjs/types/Interface/api/generalLedger/QueryGeneralLedgerAuxiliary.d.ts.map +1 -1
  15. package/dist/cjs/types/Interface/api/generalLedger/QueryGeneralLedgerAuxiliary.js +30 -1
  16. package/dist/cjs/types/Interface/api/generalLedger/QueryGeneralLedgerAuxiliary.js.map +1 -1
  17. package/dist/cjs/types/Interface/api/revenueMovement.d.ts +10 -9
  18. package/dist/cjs/types/Interface/api/revenueMovement.d.ts.map +1 -1
  19. package/dist/cjs/types/Interface/api/revenueMovement.js +272 -0
  20. package/dist/cjs/types/Interface/api/revenueMovement.js.map +1 -1
  21. package/dist/cjs/types/Interface/api/revenueSnapshotGenerate.d.ts +0 -1
  22. package/dist/cjs/types/Interface/api/revenueSnapshotGenerate.d.ts.map +1 -1
  23. package/dist/cjs/types/Interface/api/revenueSnapshotGenerate.js +4 -13
  24. package/dist/cjs/types/Interface/api/revenueSnapshotGenerate.js.map +1 -1
  25. package/dist/cjs/types/Interface/models/IImmobilization.d.ts +1 -0
  26. package/dist/cjs/types/Interface/models/IImmobilization.d.ts.map +1 -1
  27. package/dist/cjs/types/Interface/models/IImmobilization.js.map +1 -1
  28. package/dist/cjs/utils/prestation.d.ts.map +1 -1
  29. package/dist/cjs/utils/prestation.js +9 -4
  30. package/dist/cjs/utils/prestation.js.map +1 -1
  31. package/dist/mjs/api/resources/GeneralLedger.d.ts +2 -1
  32. package/dist/mjs/api/resources/GeneralLedger.d.ts.map +1 -1
  33. package/dist/mjs/api/resources/GeneralLedger.js +9 -0
  34. package/dist/mjs/api/resources/GeneralLedger.js.map +1 -1
  35. package/dist/mjs/types/Interface/api/brevo/EmailSendOptions.dto.js +1 -1
  36. package/dist/mjs/types/Interface/api/brevo/EmailSendOptions.dto.js.map +1 -1
  37. package/dist/mjs/types/Interface/api/generalLedger/IGeneralLedgerAccountingEntry.d.ts +1 -0
  38. package/dist/mjs/types/Interface/api/generalLedger/IGeneralLedgerAccountingEntry.d.ts.map +1 -1
  39. package/dist/mjs/types/Interface/api/generalLedger/IGeneralLedgerAccountingEntry.js.map +1 -1
  40. package/dist/mjs/types/Interface/api/generalLedger/IGeneralLedgerThirdParty.d.ts +1 -0
  41. package/dist/mjs/types/Interface/api/generalLedger/IGeneralLedgerThirdParty.d.ts.map +1 -1
  42. package/dist/mjs/types/Interface/api/generalLedger/IGeneralLedgerThirdParty.js.map +1 -1
  43. package/dist/mjs/types/Interface/api/generalLedger/QueryGeneralLedgerAuxiliary.d.ts +9 -0
  44. package/dist/mjs/types/Interface/api/generalLedger/QueryGeneralLedgerAuxiliary.d.ts.map +1 -1
  45. package/dist/mjs/types/Interface/api/generalLedger/QueryGeneralLedgerAuxiliary.js +34 -1
  46. package/dist/mjs/types/Interface/api/generalLedger/QueryGeneralLedgerAuxiliary.js.map +1 -1
  47. package/dist/mjs/types/Interface/api/revenueMovement.d.ts +10 -9
  48. package/dist/mjs/types/Interface/api/revenueMovement.d.ts.map +1 -1
  49. package/dist/mjs/types/Interface/api/revenueMovement.js +303 -1
  50. package/dist/mjs/types/Interface/api/revenueMovement.js.map +1 -1
  51. package/dist/mjs/types/Interface/api/revenueSnapshotGenerate.d.ts +0 -1
  52. package/dist/mjs/types/Interface/api/revenueSnapshotGenerate.d.ts.map +1 -1
  53. package/dist/mjs/types/Interface/api/revenueSnapshotGenerate.js +13 -16
  54. package/dist/mjs/types/Interface/api/revenueSnapshotGenerate.js.map +1 -1
  55. package/dist/mjs/types/Interface/models/IImmobilization.d.ts +1 -0
  56. package/dist/mjs/types/Interface/models/IImmobilization.d.ts.map +1 -1
  57. package/dist/mjs/types/Interface/models/IImmobilization.js.map +1 -1
  58. package/dist/mjs/utils/prestation.d.ts.map +1 -1
  59. package/dist/mjs/utils/prestation.js +3 -1
  60. package/dist/mjs/utils/prestation.js.map +1 -1
  61. package/package.json +1 -1
  62. package/ts/api/resources/GeneralLedger.ts +11 -0
  63. package/ts/types/Interface/api/brevo/EmailSendOptions.dto.ts +1 -1
  64. package/ts/types/Interface/api/generalLedger/IGeneralLedgerAccountingEntry.ts +1 -0
  65. package/ts/types/Interface/api/generalLedger/IGeneralLedgerThirdParty.ts +1 -0
  66. package/ts/types/Interface/api/generalLedger/QueryGeneralLedgerAuxiliary.ts +26 -1
  67. package/ts/types/Interface/api/revenueMovement.ts +153 -9
  68. package/ts/types/Interface/api/revenueSnapshotGenerate.ts +13 -13
  69. package/ts/types/Interface/models/IImmobilization.ts +1 -0
  70. package/ts/utils/prestation.ts +3 -1
@@ -1 +1 @@
1
- {"version":3,"file":"prestation.js","sourceRoot":"","sources":["../../../ts/utils/prestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,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A4B,EAAE;IACzF,IAAI,oDAAoD,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAAE,OAAO,UAAU,CAAC;IACvG,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,4BAA4B,EAC5B,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,qCAAqC,EACrC,wBAAwB,EACxB,2BAA2B,GAC5B,CAAC","sourcesContent":["import { IExercice, IPrestation, IPrestationList } from '../types';\nimport { Vat } from '../types/Enum/Vat';\nimport { getTaxesIncludedAmount } from './vat/utils';\nimport { intersection } from './noLodash';\nimport {\n ClementineSubscriptionAccountancySoftwarePrestations,\n PrestationDetail,\n PrestationType,\n} from '../types/Enum/PrestationType';\nimport { LegalFormTypeEnum } from '../types/Enum/LegalForm';\nimport { PrestationOptionType, PrestationOption } from '../types/Enum/PrestationOption';\nimport { PriceGridClementine } from '../types/Enum/PriceGridClementine';\nimport { PriceGridPourcentage } from '../types/Enum/PriceGridPourcentage';\nimport { PriceGridLegalstart } from '../types/Enum/PriceGridLegalstart';\nimport { PriceGridStatutsExpress } from '../types/Enum/PriceGridStatutsExpress';\nimport { ClosingType } from '../types/Enum/ClosingType';\nimport { getBrandNameByNodeEnv } from './brands';\nimport * as dayjs from 'dayjs';\nimport { exerciceNumber } from './exercice';\n\ntype priceGridBrand = {\n idTypeBrand: number;\n price: priceGrid[];\n};\n\ntype priceGrid = {\n idPrestationList: number[];\n priceWithTaxesIncluded: boolean;\n applicationCost: number;\n monthlyNbr?: monthlyNbr[];\n exerciceNbr?: exerciceNbr[];\n turnoverCreatedYear?: turnover[];\n turnoverPastYear?: turnover[];\n turnoverMonthly?: turnover[];\n turnoverYearly?: turnover[];\n employee?: employee[];\n partner?: employee[];\n properties?: propertie[];\n vatRegimeMonthly?: vatRegime[];\n vatRegimeYearly?: vatRegime[];\n taxSystem?: taxSystem[];\n legalForm?: legalForm[];\n employeeByLegalForm?: employeeByLegalForm[];\n};\n\ntype monthlyNbr = {\n minimum: number;\n maximum: number;\n value: number;\n closingType: number[];\n};\n\ntype exerciceNbr = {\n minimum: number;\n maximum: number;\n price: number;\n};\n\ntype turnover = {\n turnoverValue: number;\n price: number;\n};\n\ntype legalForm = {\n idLegalForm: number;\n price: number;\n};\n\ntype employee = {\n amountMinimum: number;\n amountMaximum: number;\n price: number;\n};\n\ntype employeeByLegalForm = {\n idLegalForm: number;\n price: number;\n};\n\ntype propertie = {\n amount: number;\n price: number;\n};\n\ntype vatRegime = {\n type: number;\n price: number;\n};\n\ntype taxSystem = {\n id: number;\n price: number;\n};\n\nconst isOtherAccountingMissions = (idPrestationList: number): boolean =>\n [\n PrestationType.PREVISIONNEL,\n PrestationType.BILAN_INTERMEDIAIRE,\n PrestationType.AVANCE_OU_ABANDON_COMPTE_COURANT_ASSOCIE,\n PrestationType.AUTRE_MISSION_COMPTABLE,\n PrestationType.TVS,\n PrestationType.ETUDE_FISCALE,\n PrestationType.BILAN_PREVISIONNEL,\n ].includes(idPrestationList);\n\nconst isOtherJuridicalMissions = (isJuridique: boolean, isCatalog: boolean, idPrestationList: number): boolean =>\n idPrestationList !== PrestationType.GESTION_JURIDIQUE && isCatalog && isJuridique;\n\nconst isOtherSocialMission = (idPrestationList: number): boolean =>\n idPrestationList === PrestationType.AUTRE_MISSION_SOCIALE_HORS_PAIE;\n\nconst isAdditionalPresta = (hidden: boolean, isCatalog: boolean): boolean => !hidden && isCatalog;\n\nconst isOnlyPrevi = (idPrestationList: number[]): boolean =>\n !idPrestationList.filter(\n (idPL: number) =>\n ![PrestationType.PREVISIONNEL, PrestationType.BILAN_PREVISIONNEL, PrestationType.PV_AG].includes(idPL),\n ).length;\n\nconst isOnlySocial = (idPrestationList: number[]): boolean =>\n !idPrestationList.filter((idPL: number) => ![PrestationType.FRUCTUPAIE, PrestationType.SOCIAL].includes(idPL)).length;\n\nconst isOnlyJuridic = (idPrestationList: number[]): boolean =>\n !idPrestationList.filter((idPL: number) => ![PrestationType.GESTION_JURIDIQUE].includes(idPL)).length;\n\nconst isCreation = (idPrestationList: number[]): boolean =>\n !!intersection(idPrestationList, [\n PrestationType.CREATION_SOCIETE,\n PrestationType.STATUTS_FREE,\n PrestationType.STATUTS_OPTION_1,\n PrestationType.STATUTS_OPTION_2,\n PrestationType.STATUTS_OPTION_AE,\n ]).length;\n\nconst isFromStatutsExpress = (idPrestationList: number[]): boolean =>\n !idPrestationList.filter(\n (idPL: number) =>\n ![\n PrestationType.STATUTS_FREE,\n PrestationType.STATUTS_OPTION_1,\n PrestationType.STATUTS_OPTION_2,\n PrestationType.STATUTS_OPTION_AE,\n ].includes(idPL),\n ).length;\n\nconst isExpress = (idPrestationList: number): boolean => {\n const prestationDetailValues = Object.values(PrestationDetail) as any;\n const prestaList = prestationDetailValues.find((pr: any) => pr.id === idPrestationList);\n return !!prestaList.isBack;\n};\n\nconst isConsultingHour = (idPrestationList: number[]): boolean =>\n !!intersection(idPrestationList, [PrestationType.CONSULTING_HOUR]).length;\n\nconst isSoftwarePrestation = (idPrestationList: number[]): boolean =>\n !!intersection(idPrestationList, [PrestationType.STEERING, PrestationType.VAT, PrestationType.BALANCESHEET])\n .length; /* &&\n idPrestationList.length === 1 */ // Commenté car si un client résilie un software pour un utre software, condition non prise en charge\n\nconst calculateScoringOfPrestation = (\n idPrestationType: PrestationType,\n prestations: IPrestation[],\n currentIdPrestation: number,\n): number => {\n const prestationsSignedPaid = prestations.filter(\n (prestation) =>\n prestation.paid &&\n prestation.signed &&\n prestation.terminationList === null &&\n prestation.id !== currentIdPrestation,\n );\n\n const currentPrestation = prestations.find(\n (el) => el.idPrestationList === idPrestationType && el.terminationList === null,\n );\n\n // SPECIAL CASE:\n // If current prestation is a software prestation\n // and the current prestation is an annual payment, return 0 point\n if (\n isSoftwarePrestation([idPrestationType]) &&\n currentPrestation?.exercices?.length &&\n //@ts-expect-error\n (currentPrestation?.exercices[0].ExercicePrestation?.totalPrestation < 80 ||\n //@ts-expect-error\n currentPrestation?.exercices[0].ExercicePrestation?.monthNumber !== 1)\n ) {\n return 0;\n }\n\n // Get the list of prestations that are half price\n const prestationHalfPriceList = Object.values(PrestationDetail).filter(\n (p) =>\n p.isComptable &&\n !p.isCatalog &&\n p.id &&\n ![PrestationType.BALANCESHEET, PrestationType.VAT, PrestationType.STEERING].includes(p.id),\n );\n const prestationHalfPriceIds = prestationHalfPriceList.map((t) => t.id);\n\n // Get the number of points for the new prestation\n const prestaDetails = Object.values(PrestationDetail).find((prestaDetail) => prestaDetail.id === idPrestationType);\n let numberPoint = prestaDetails?.point || 0;\n\n // For each back exercices, add 100 points\n // -> for new prestations only\n if (\n [\n PrestationType.EXPERTISE,\n PrestationType.SUPPORT,\n PrestationType.PREMIUM,\n PrestationType.CUSTOM_MADE,\n PrestationType.GESTION_IMMO,\n PrestationType.EI,\n PrestationType.MICRO,\n ].includes(idPrestationType) &&\n currentPrestation?.exercices?.length &&\n currentPrestation?.exercices.find((el) => el.isBack)\n ) {\n numberPoint += (currentPrestation?.exercices.filter((el) => el.isBack).length ?? 1) * 100;\n }\n\n // Get list of prestations that are already done\n // and check if one of them is in the list of prestations that are half price\n const prestationsExistIds = prestationsSignedPaid.map((prestation) => prestation.idPrestationList);\n const prestationHalfPriceAlreadyDoneIds = prestationsExistIds.filter((id) => prestationHalfPriceIds.includes(id));\n\n // If one of the prestations already done is in the list of prestations that are half price and if the idPrestationType is in prestationHalfPriceIds, return 50% of points\n if (prestationHalfPriceAlreadyDoneIds.length && prestationHalfPriceIds.includes(idPrestationType))\n return Math.floor(numberPoint * 0.3);\n\n return numberPoint;\n};\n\nexport const calculateMonthlyAmount = (params: {\n monthlyPrice: number;\n monthNumber: number;\n monthOffer: number;\n idVatForInternalInvoicing?: number | null;\n returnTaxesIncludedValue?: boolean;\n}): number => {\n const { monthlyPrice, monthNumber, monthOffer, idVatForInternalInvoicing, returnTaxesIncludedValue = true } = params;\n\n if (!idVatForInternalInvoicing && returnTaxesIncludedValue)\n throw new Error('Taux de TVA manquant pour calculer le montant TTC');\n\n if (!idVatForInternalInvoicing || !returnTaxesIncludedValue) return monthlyPrice * (monthNumber - monthOffer);\n\n return (\n monthlyPrice *\n (monthNumber - monthOffer) *\n (1 + Object.values(Vat).find((el) => el.id === idVatForInternalInvoicing).value / 100)\n );\n};\n\nexport const getPriceGrid = (idTypeBrand: number, idPrestationList: number): priceGrid | undefined => {\n let currentBrandPriceGrid: priceGridBrand | undefined;\n let currentPriceGrid: priceGrid | undefined;\n\n const currentEnvName = getBrandNameByNodeEnv(process.env.NODE_ENV);\n const listEnvEnum = {\n PriceGridClementine,\n PriceGridPourcentage,\n PriceGridLegalstart,\n PriceGridStatutsExpress,\n };\n // @ts-ignore\n const currentPriceGridFile: priceGridBrand[] = listEnvEnum[`PriceGrid${currentEnvName}`];\n if (currentPriceGridFile)\n currentBrandPriceGrid = currentPriceGridFile.find(\n (priceGrid: priceGridBrand) => priceGrid.idTypeBrand === idTypeBrand,\n );\n if (currentBrandPriceGrid)\n currentPriceGrid = currentBrandPriceGrid?.price.find((price: priceGrid) =>\n price.idPrestationList.includes(idPrestationList),\n );\n return currentPriceGrid;\n};\n\nconst calculatePrestationPriceWithPriceGrid = (\n idPrestationList: number,\n endDate: string,\n NbrMonth: number /* Nbr de mois dans l'exercice */,\n turnover: number,\n rentsNumber: number,\n employeesNumber: number,\n associatesNumber: number,\n idTypeBrand: number,\n idVatRegime: number,\n pastBalanceSheet: boolean,\n isYearly: boolean /* Prestation annuel ou mensuel */,\n totalMonth: number /* Nbr de moiis offer */,\n idTaxSystem: number,\n idLegalForm: number,\n exerciceNbr: number,\n balanceSheetOffered: number = 0 /* montant du bilan offer */,\n): {\n totalPrestation: number;\n reduceMonth: number;\n canBeCreated: boolean;\n monthNbr: number;\n price: number;\n} => {\n let totalPrestation: number = 0;\n let reduceMonth: number = 0;\n let monthNbr: number = NbrMonth;\n let yearlyPrice: number | undefined;\n let finalMonthlyPrice: number | undefined;\n const canBeCreated: boolean = true;\n let recalculateMonthly: boolean = false;\n\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n\n if (currentPriceGrid) {\n let monthlyPrice: number | undefined;\n let vatRegimePrice: number | undefined;\n let taxSystemPrice: number | undefined;\n\n /* Gestion du régime de TVA */\n if (currentPriceGrid.vatRegimeMonthly && !isYearly)\n vatRegimePrice = currentPriceGrid.vatRegimeMonthly?.find((regime) => regime.type === idVatRegime)?.price;\n else if (currentPriceGrid.vatRegimeYearly && isYearly)\n vatRegimePrice = currentPriceGrid.vatRegimeYearly?.find((regime) => regime.type === idVatRegime)?.price;\n\n /* Gestion du Régime d'imposition */\n if (currentPriceGrid.taxSystem && idTaxSystem)\n taxSystemPrice = currentPriceGrid.taxSystem?.find((tax) => tax.id === idTaxSystem)?.price;\n\n /* Gestion des montants */\n /* Récupératioin des prix mensuels */\n if (currentPriceGrid.turnoverMonthly && !isYearly)\n monthlyPrice = currentPriceGrid.turnoverMonthly?.find((turn) => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.properties)\n monthlyPrice = currentPriceGrid.properties?.find((property) => property.amount === rentsNumber)?.price;\n else if (currentPriceGrid.employee) {\n monthlyPrice = currentPriceGrid.employee?.find(\n (emp) => emp.amountMinimum <= employeesNumber && emp.amountMaximum >= employeesNumber,\n )?.price;\n monthlyPrice = monthlyPrice ? monthlyPrice * employeesNumber : 0;\n } else if (currentPriceGrid.employeeByLegalForm) {\n monthlyPrice = currentPriceGrid.employeeByLegalForm?.find((emp) => emp.idLegalForm === idLegalForm)?.price;\n monthlyPrice = monthlyPrice ? monthlyPrice * employeesNumber : 0;\n /* Récupération des prix annuels */\n } else if (currentPriceGrid.turnoverYearly && isYearly)\n yearlyPrice = currentPriceGrid.turnoverYearly?.find((turn) => turnover < turn.turnoverValue)?.price;\n else if (!pastBalanceSheet && currentPriceGrid.turnoverCreatedYear)\n yearlyPrice = currentPriceGrid.turnoverCreatedYear?.find((turn) => turnover < turn.turnoverValue)?.price;\n else if (pastBalanceSheet && currentPriceGrid.turnoverPastYear)\n yearlyPrice = currentPriceGrid.turnoverPastYear?.find((turn) => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.partner)\n yearlyPrice = currentPriceGrid.partner?.find(\n (part) => part.amountMinimum <= associatesNumber && part.amountMaximum >= associatesNumber,\n )?.price;\n else if (currentPriceGrid.legalForm)\n yearlyPrice = currentPriceGrid.legalForm?.find((form) => form.idLegalForm === idLegalForm)?.price;\n else if (currentPriceGrid.exerciceNbr)\n yearlyPrice = currentPriceGrid.exerciceNbr?.find(\n (el) => el.minimum <= exerciceNbr && exerciceNbr <= el.maximum,\n )?.price;\n /* Calcul du prix mensuel final */\n finalMonthlyPrice =\n (monthlyPrice ? monthlyPrice : 0) + (vatRegimePrice ? vatRegimePrice : 0) + (taxSystemPrice ? taxSystemPrice : 0);\n\n /* Gestion des mois */\n let cloturedPast: boolean = false;\n if (dayjs(endDate, 'YYYY-MM-DD').subtract(15, 'day').isBefore(dayjs())) cloturedPast = true;\n let monthlyNbrList: monthlyNbr[] | undefined;\n let monthlyNbr: monthlyNbr | undefined;\n if (currentPriceGrid.monthlyNbr) {\n monthlyNbrList = currentPriceGrid.monthlyNbr?.filter((el) =>\n el.closingType.includes(cloturedPast ? ClosingType.OUTDATED : ClosingType.IN_PROGRESS),\n );\n if (monthlyNbrList) {\n monthlyNbr = monthlyNbrList.find((el) => el.minimum <= monthNbr && monthNbr <= el.maximum);\n if (monthlyNbr) {\n monthNbr = monthlyNbr.value;\n }\n }\n }\n\n /* Gestion des offres, mois offer */\n if (totalMonth > 0) {\n if (isYearly) {\n yearlyPrice = (10 - totalMonth) * (yearlyPrice ? yearlyPrice / 10 : 0);\n } else {\n monthNbr = monthNbr - totalMonth;\n }\n }\n\n /* Calcul du nombre de mois soustraient */\n reduceMonth = monthNbr === NbrMonth - totalMonth ? totalMonth : 0;\n\n /* Gestion des offres, bilan offer */\n if (balanceSheetOffered > 0) {\n yearlyPrice = undefined;\n recalculateMonthly = false;\n finalMonthlyPrice = balanceSheetOffered / monthNbr;\n }\n\n /* Prix Final */\n totalPrestation = yearlyPrice ? yearlyPrice : finalMonthlyPrice * monthNbr;\n }\n return {\n totalPrestation,\n reduceMonth,\n canBeCreated,\n monthNbr: yearlyPrice ? 0 : recalculateMonthly ? NbrMonth : monthNbr,\n price: yearlyPrice\n ? yearlyPrice\n : recalculateMonthly\n ? totalPrestation / monthNbr\n : finalMonthlyPrice\n ? finalMonthlyPrice\n : 0,\n };\n};\n\nconst calculatePrestationPriceWithPrestationList = (prestationList: IPrestationList): number => {\n let totalPrestation: number = 0;\n\n totalPrestation = prestationList?.price || 0;\n\n return totalPrestation;\n};\n\n/**\n * From idLegalForm, get application fees amount (without taxes included if no idVat passed, or with taxes included calculated by given idVat)\n * @param idLegalForm\n * @param idVat\n * @returns amount of application fees, without taxes included\n * @deprecated Application fees are not charged anymore\n */\nconst getApplicationFeesAmount = (idLegalForm: number, idVat?: number) => {\n let applicationFeesAmount = 50;\n if (idLegalForm === LegalFormTypeEnum.SCI) applicationFeesAmount = 150;\n\n //Sans tva, on envoie le montant HT\n if (!idVat) return applicationFeesAmount;\n\n //Avec tva, on envoie le montant TTC\n return getTaxesIncludedAmount(applicationFeesAmount, idVat);\n};\n\nconst calculatePrestationPrice = (\n idPrestationList: number,\n prestationList: IPrestationList,\n endDate: string,\n NbrMonth: number /* Nbr de mois dans l'exercice */,\n turnover: number,\n rentsNumber: number,\n employeesNumber: number,\n associatesNumber: number,\n idTypeBrand: number,\n idVatRegime: number,\n pastBalanceSheet: boolean,\n optionsList: number[],\n totalPercentage: number /* total pourcentage offer (%) */,\n totalAmount: number /* total montant offer (€) */,\n totalMonth: number /* total mois offer (mois) */,\n isWithApplicationFees: boolean /* frais de dossier */,\n idTaxSystem: number,\n idLegalForm: number,\n isYearly: boolean = false /* prestation annuel ou mensuel */,\n isSubPrestation: boolean = false,\n balanceSheetOffered: number = 0,\n exerciceList: IExercice[] = [],\n): {\n totalPrestation: number;\n reduceMonth: number;\n canBeCreated: boolean;\n calculDetail: string;\n monthlyPrice: string;\n price: number;\n} => {\n let totalPrestation: number = 0;\n let reduceMonth: number = 0;\n let canBeCreated: boolean = true;\n let monthNbr: number = 0;\n let price: number = 0;\n let totalWithReduce: {\n totalPrestation: number;\n reduceMonth: number;\n canBeCreated: boolean;\n monthNbr: number;\n price: number;\n } = { totalPrestation: 0, reduceMonth: 0, canBeCreated: true, monthNbr: 0, price: 0 };\n\n /* Gestion du prix en fonction de la prestation */\n if (\n [\n PrestationType.COMPTA_PRO,\n PrestationType.COMPTA_PRO_EXPRESS,\n PrestationType.COMPTA_ENTREPRISE,\n PrestationType.COMPTA_ENTREPRISE_EXPRESS,\n PrestationType.COMPTA_SCI,\n PrestationType.COMPTA_SCI_EXPRESS,\n PrestationType.BILAN_PREVISIONNEL,\n PrestationType.COMPTA_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS,\n PrestationType.COMPTA_POURCENTAGE,\n PrestationType.COMPTA_POURCENTAGE_EXPRESS,\n PrestationType.SOCIAL,\n PrestationType.GESTION_JURIDIQUE,\n PrestationType.COMPTA_PRO_COMPTASTART,\n PrestationType.COMPTA_PRO_COMPTASTART_EXPRESS,\n PrestationType.COMPTA_EI_KLEMS,\n PrestationType.COMPTA_EI_KLEMS_EXPRESS,\n PrestationType.COMPTA_MICRO_KLEMS,\n PrestationType.COMPTA_MICRO_KLEMS_EXPRESS,\n PrestationType.COMPTA_LOUEUR_MEUBLE_NON_PRO_KLEMS,\n PrestationType.COMPTA_LOUEUR_MEUBLE_NON_PRO_KLEMS_EXPRESS,\n PrestationType.STATUTS_OPTION_2,\n PrestationType.EXPERTISE,\n PrestationType.SUPPORT,\n PrestationType.PREMIUM,\n PrestationType.CUSTOM_MADE,\n PrestationType.EI,\n PrestationType.MICRO,\n PrestationType.GESTION_IMMO,\n ].includes(idPrestationList)\n ) {\n let exerciceNbr: number = 0;\n if (exerciceList.length) exerciceNbr = exerciceNumber(dayjs(endDate, 'YYYY-MM-DD').toDate(), exerciceList);\n totalWithReduce = calculatePrestationPriceWithPriceGrid(\n idPrestationList,\n endDate,\n NbrMonth,\n turnover,\n rentsNumber,\n employeesNumber,\n associatesNumber,\n idTypeBrand,\n idVatRegime,\n pastBalanceSheet,\n isYearly,\n totalMonth,\n idTaxSystem,\n idLegalForm,\n exerciceNbr,\n balanceSheetOffered,\n );\n totalPrestation = totalWithReduce.totalPrestation;\n reduceMonth = totalWithReduce.reduceMonth;\n canBeCreated = totalWithReduce.canBeCreated;\n monthNbr = totalWithReduce.monthNbr;\n price = totalWithReduce.price;\n } else {\n totalPrestation = calculatePrestationPriceWithPrestationList(prestationList);\n if ([PrestationType.CREATION_SOCIETE].includes(idPrestationList) && !isSubPrestation) {\n // totalPrestation += 50;\n // La création est offerte désormais\n // inutile d'ajouter les frais de greffe et d'annonce légale,\n // car ne compte pas dans le calcul pour les sales\n }\n }\n /* Gestion des offres */\n /* Offre montant offer */\n if (totalAmount > 0) totalPrestation = totalPrestation - totalAmount;\n /* Offre pourcentage offer */\n if (totalPercentage > 0) totalPrestation = totalPrestation - totalPrestation * (totalPercentage / 100);\n /* Gesstioin du prix minimum acceptable pour la prestation */\n if (prestationList && prestationList.minimumPrice && totalPrestation < prestationList.minimumPrice)\n totalPrestation = prestationList.minimumPrice;\n /* Gestion des options */\n let OptionTotalPrice: number = 0;\n if (optionsList.length) {\n optionsList.forEach((optionId) => {\n const optionPrice: number | undefined = Object.values(PrestationOption).find(\n (option) => option.id === optionId,\n )?.price;\n if (optionPrice) OptionTotalPrice += optionPrice;\n });\n }\n totalPrestation += OptionTotalPrice ? OptionTotalPrice : 0;\n /* Gestion des frais de dossier */\n // if (isWithApplicationFees) {\n // const applicationFeesAmount = getApplicationFeesAmount(idLegalForm);\n // totalPrestation += applicationFeesAmount;\n // }\n\n const calculDetail = `${monthNbr > 0 ? monthNbr + ' mois x ' + Math.round(price * 100) / 100 + '€' : Math.round(price * 100) / 100 + '€'} ${totalAmount > 0 ? '- ' + totalAmount + '€' : ''} ${totalPercentage > 0 ? '- ' + totalPercentage + '%' : ''} ${isWithApplicationFees ? '+ 50€' : ''}`;\n\n return {\n totalPrestation,\n reduceMonth,\n canBeCreated,\n calculDetail,\n monthlyPrice: monthNbr > 0 ? Math.round(price * 100) / 100 + '€/mois' : Math.round(price * 100) / 100 + '€',\n price,\n };\n};\n\nconst getPrestationOptions = (idPrestationList: number): PrestationOptionType[] => {\n const PrestationOptionList: PrestationOptionType[] = Object.values(PrestationOption).filter((option) =>\n option.brand.includes(getBrandNameByNodeEnv(process.env.NODE_ENV)),\n );\n return PrestationOptionList.filter((option) => option.prestationList.includes(idPrestationList));\n};\n\nconst isAbleToUpdatePrice = (\n idTypeBrand: number,\n idPrestationList: number,\n turnover: number,\n pastBalanceSheet: boolean,\n): boolean => {\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n if (currentPriceGrid) {\n if (\n [\n PrestationType.COMPTA_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS,\n ].includes(idPrestationList) &&\n // @ts-ignore: error after prettier formatting\n currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 2].turnoverValue < turnover\n )\n return true;\n else if (\n [PrestationType.COMPTA_POURCENTAGE, PrestationType.COMPTA_POURCENTAGE_EXPRESS].includes(idPrestationList) &&\n // @ts-ignore: error after prettier formatting\n currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 1].turnoverValue < turnover\n )\n return true;\n else if (\n [PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) &&\n !pastBalanceSheet &&\n // @ts-ignore: error after prettier formatting\n currentPriceGrid.turnoverCreatedYear[currentPriceGrid.turnoverCreatedYear.length - 1].turnoverValue < turnover\n )\n return true;\n else if (\n [PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) &&\n pastBalanceSheet &&\n // @ts-ignore: error after prettier formatting\n currentPriceGrid.turnoverPastYear[currentPriceGrid.turnoverPastYear.length - 1].turnoverValue < turnover\n )\n return true;\n else return false;\n }\n return false;\n};\n\nconst idPrestationListToOfferType = (idPrestationList: number): 'software' | 'expertise' => {\n if (ClementineSubscriptionAccountancySoftwarePrestations.includes(idPrestationList)) return 'software';\n return 'expertise';\n};\n\nexport {\n isOtherAccountingMissions,\n isOtherJuridicalMissions,\n isAdditionalPresta,\n isOtherSocialMission,\n isOnlyPrevi,\n isOnlySocial,\n isOnlyJuridic,\n isCreation,\n isFromStatutsExpress,\n isExpress,\n isConsultingHour,\n isSoftwarePrestation,\n calculateScoringOfPrestation,\n calculatePrestationPrice,\n getPrestationOptions,\n isAbleToUpdatePrice,\n calculatePrestationPriceWithPriceGrid,\n getApplicationFeesAmount,\n idPrestationListToOfferType,\n};\n"]}
1
+ {"version":3,"file":"prestation.js","sourceRoot":"","sources":["../../../ts/utils/prestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EACL,oDAAoD,EACpD,gBAAgB,EAChB,cAAc,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAwB,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACxF,OA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,EACZ,aAAa,EACb,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,4BAA4B,EAC5B,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,qCAAqC,EACrC,wBAAwB,EACxB,2BAA2B,GAC5B,CAAC","sourcesContent":["import { IExercice, IPrestation, IPrestationList } from '../types';\nimport { Vat } from '../types/Enum/Vat';\nimport { ReasonTerminationType } from '../types/Enum/ReasonTerminationType';\nimport { getTaxesIncludedAmount } from './vat/utils';\nimport { intersection } from './noLodash';\nimport {\n ClementineSubscriptionAccountancySoftwarePrestations,\n PrestationDetail,\n PrestationType,\n} from '../types/Enum/PrestationType';\nimport { LegalFormTypeEnum } from '../types/Enum/LegalForm';\nimport { PrestationOptionType, PrestationOption } from '../types/Enum/PrestationOption';\nimport { PriceGridClementine } from '../types/Enum/PriceGridClementine';\nimport { PriceGridPourcentage } from '../types/Enum/PriceGridPourcentage';\nimport { PriceGridLegalstart } from '../types/Enum/PriceGridLegalstart';\nimport { PriceGridStatutsExpress } from '../types/Enum/PriceGridStatutsExpress';\nimport { ClosingType } from '../types/Enum/ClosingType';\nimport { getBrandNameByNodeEnv } from './brands';\nimport * as dayjs from 'dayjs';\nimport { exerciceNumber } from './exercice';\n\ntype priceGridBrand = {\n idTypeBrand: number;\n price: priceGrid[];\n};\n\ntype priceGrid = {\n idPrestationList: number[];\n priceWithTaxesIncluded: boolean;\n applicationCost: number;\n monthlyNbr?: monthlyNbr[];\n exerciceNbr?: exerciceNbr[];\n turnoverCreatedYear?: turnover[];\n turnoverPastYear?: turnover[];\n turnoverMonthly?: turnover[];\n turnoverYearly?: turnover[];\n employee?: employee[];\n partner?: employee[];\n properties?: propertie[];\n vatRegimeMonthly?: vatRegime[];\n vatRegimeYearly?: vatRegime[];\n taxSystem?: taxSystem[];\n legalForm?: legalForm[];\n employeeByLegalForm?: employeeByLegalForm[];\n};\n\ntype monthlyNbr = {\n minimum: number;\n maximum: number;\n value: number;\n closingType: number[];\n};\n\ntype exerciceNbr = {\n minimum: number;\n maximum: number;\n price: number;\n};\n\ntype turnover = {\n turnoverValue: number;\n price: number;\n};\n\ntype legalForm = {\n idLegalForm: number;\n price: number;\n};\n\ntype employee = {\n amountMinimum: number;\n amountMaximum: number;\n price: number;\n};\n\ntype employeeByLegalForm = {\n idLegalForm: number;\n price: number;\n};\n\ntype propertie = {\n amount: number;\n price: number;\n};\n\ntype vatRegime = {\n type: number;\n price: number;\n};\n\ntype taxSystem = {\n id: number;\n price: number;\n};\n\nconst isOtherAccountingMissions = (idPrestationList: number): boolean =>\n [\n PrestationType.PREVISIONNEL,\n PrestationType.BILAN_INTERMEDIAIRE,\n PrestationType.AVANCE_OU_ABANDON_COMPTE_COURANT_ASSOCIE,\n PrestationType.AUTRE_MISSION_COMPTABLE,\n PrestationType.TVS,\n PrestationType.ETUDE_FISCALE,\n PrestationType.BILAN_PREVISIONNEL,\n ].includes(idPrestationList);\n\nconst isOtherJuridicalMissions = (isJuridique: boolean, isCatalog: boolean, idPrestationList: number): boolean =>\n idPrestationList !== PrestationType.GESTION_JURIDIQUE && isCatalog && isJuridique;\n\nconst isOtherSocialMission = (idPrestationList: number): boolean =>\n idPrestationList === PrestationType.AUTRE_MISSION_SOCIALE_HORS_PAIE;\n\nconst isAdditionalPresta = (hidden: boolean, isCatalog: boolean): boolean => !hidden && isCatalog;\n\nconst isOnlyPrevi = (idPrestationList: number[]): boolean =>\n !idPrestationList.filter(\n (idPL: number) =>\n ![PrestationType.PREVISIONNEL, PrestationType.BILAN_PREVISIONNEL, PrestationType.PV_AG].includes(idPL),\n ).length;\n\nconst isOnlySocial = (idPrestationList: number[]): boolean =>\n !idPrestationList.filter((idPL: number) => ![PrestationType.FRUCTUPAIE, PrestationType.SOCIAL].includes(idPL)).length;\n\nconst isOnlyJuridic = (idPrestationList: number[]): boolean =>\n !idPrestationList.filter((idPL: number) => ![PrestationType.GESTION_JURIDIQUE].includes(idPL)).length;\n\nconst isCreation = (idPrestationList: number[]): boolean =>\n !!intersection(idPrestationList, [\n PrestationType.CREATION_SOCIETE,\n PrestationType.STATUTS_FREE,\n PrestationType.STATUTS_OPTION_1,\n PrestationType.STATUTS_OPTION_2,\n PrestationType.STATUTS_OPTION_AE,\n ]).length;\n\nconst isFromStatutsExpress = (idPrestationList: number[]): boolean =>\n !idPrestationList.filter(\n (idPL: number) =>\n ![\n PrestationType.STATUTS_FREE,\n PrestationType.STATUTS_OPTION_1,\n PrestationType.STATUTS_OPTION_2,\n PrestationType.STATUTS_OPTION_AE,\n ].includes(idPL),\n ).length;\n\nconst isExpress = (idPrestationList: number): boolean => {\n const prestationDetailValues = Object.values(PrestationDetail) as any;\n const prestaList = prestationDetailValues.find((pr: any) => pr.id === idPrestationList);\n return !!prestaList.isBack;\n};\n\nconst isConsultingHour = (idPrestationList: number[]): boolean =>\n !!intersection(idPrestationList, [PrestationType.CONSULTING_HOUR]).length;\n\nconst isSoftwarePrestation = (idPrestationList: number[]): boolean =>\n !!intersection(idPrestationList, [PrestationType.STEERING, PrestationType.VAT, PrestationType.BALANCESHEET])\n .length; /* &&\n idPrestationList.length === 1 */ // Commenté car si un client résilie un software pour un utre software, condition non prise en charge\n\nconst calculateScoringOfPrestation = (\n idPrestationType: PrestationType,\n prestations: IPrestation[],\n currentIdPrestation: number,\n): number => {\n const prestationsSignedPaid = prestations.filter(\n (prestation) =>\n prestation.paid &&\n prestation.signed &&\n (prestation.terminationList === null ||\n prestation.terminationList?.idReasonTermination?.includes(ReasonTerminationType.CHANGES_NEW_OFFERS)) &&\n prestation.id !== currentIdPrestation,\n );\n\n const currentPrestation = prestations.find(\n (el) => el.idPrestationList === idPrestationType && el.terminationList === null,\n );\n\n // SPECIAL CASE:\n // If current prestation is a software prestation\n // and the current prestation is an annual payment, return 0 point\n if (\n isSoftwarePrestation([idPrestationType]) &&\n currentPrestation?.exercices?.length &&\n //@ts-expect-error\n (currentPrestation?.exercices[0].ExercicePrestation?.totalPrestation < 80 ||\n //@ts-expect-error\n currentPrestation?.exercices[0].ExercicePrestation?.monthNumber !== 1)\n ) {\n return 0;\n }\n\n // Get the list of prestations that are half price\n const prestationHalfPriceList = Object.values(PrestationDetail).filter(\n (p) =>\n p.isComptable &&\n !p.isCatalog &&\n p.id &&\n ![PrestationType.BALANCESHEET, PrestationType.VAT, PrestationType.STEERING].includes(p.id),\n );\n const prestationHalfPriceIds = prestationHalfPriceList.map((t) => t.id);\n\n // Get the number of points for the new prestation\n const prestaDetails = Object.values(PrestationDetail).find((prestaDetail) => prestaDetail.id === idPrestationType);\n let numberPoint = prestaDetails?.point || 0;\n\n // For each back exercices, add 100 points\n // -> for new prestations only\n if (\n [\n PrestationType.EXPERTISE,\n PrestationType.SUPPORT,\n PrestationType.PREMIUM,\n PrestationType.CUSTOM_MADE,\n PrestationType.GESTION_IMMO,\n PrestationType.EI,\n PrestationType.MICRO,\n ].includes(idPrestationType) &&\n currentPrestation?.exercices?.length &&\n currentPrestation?.exercices.find((el) => el.isBack)\n ) {\n numberPoint += (currentPrestation?.exercices.filter((el) => el.isBack).length ?? 1) * 100;\n }\n\n // Get list of prestations that are already done\n // and check if one of them is in the list of prestations that are half price\n const prestationsExistIds = prestationsSignedPaid.map((prestation) => prestation.idPrestationList);\n const prestationHalfPriceAlreadyDoneIds = prestationsExistIds.filter((id) => prestationHalfPriceIds.includes(id));\n\n // If one of the prestations already done is in the list of prestations that are half price and if the idPrestationType is in prestationHalfPriceIds, return 50% of points\n if (prestationHalfPriceAlreadyDoneIds.length && prestationHalfPriceIds.includes(idPrestationType))\n return Math.floor(numberPoint * 0.3);\n\n return numberPoint;\n};\n\nexport const calculateMonthlyAmount = (params: {\n monthlyPrice: number;\n monthNumber: number;\n monthOffer: number;\n idVatForInternalInvoicing?: number | null;\n returnTaxesIncludedValue?: boolean;\n}): number => {\n const { monthlyPrice, monthNumber, monthOffer, idVatForInternalInvoicing, returnTaxesIncludedValue = true } = params;\n\n if (!idVatForInternalInvoicing && returnTaxesIncludedValue)\n throw new Error('Taux de TVA manquant pour calculer le montant TTC');\n\n if (!idVatForInternalInvoicing || !returnTaxesIncludedValue) return monthlyPrice * (monthNumber - monthOffer);\n\n return (\n monthlyPrice *\n (monthNumber - monthOffer) *\n (1 + Object.values(Vat).find((el) => el.id === idVatForInternalInvoicing).value / 100)\n );\n};\n\nexport const getPriceGrid = (idTypeBrand: number, idPrestationList: number): priceGrid | undefined => {\n let currentBrandPriceGrid: priceGridBrand | undefined;\n let currentPriceGrid: priceGrid | undefined;\n\n const currentEnvName = getBrandNameByNodeEnv(process.env.NODE_ENV);\n const listEnvEnum = {\n PriceGridClementine,\n PriceGridPourcentage,\n PriceGridLegalstart,\n PriceGridStatutsExpress,\n };\n // @ts-ignore\n const currentPriceGridFile: priceGridBrand[] = listEnvEnum[`PriceGrid${currentEnvName}`];\n if (currentPriceGridFile)\n currentBrandPriceGrid = currentPriceGridFile.find(\n (priceGrid: priceGridBrand) => priceGrid.idTypeBrand === idTypeBrand,\n );\n if (currentBrandPriceGrid)\n currentPriceGrid = currentBrandPriceGrid?.price.find((price: priceGrid) =>\n price.idPrestationList.includes(idPrestationList),\n );\n return currentPriceGrid;\n};\n\nconst calculatePrestationPriceWithPriceGrid = (\n idPrestationList: number,\n endDate: string,\n NbrMonth: number /* Nbr de mois dans l'exercice */,\n turnover: number,\n rentsNumber: number,\n employeesNumber: number,\n associatesNumber: number,\n idTypeBrand: number,\n idVatRegime: number,\n pastBalanceSheet: boolean,\n isYearly: boolean /* Prestation annuel ou mensuel */,\n totalMonth: number /* Nbr de moiis offer */,\n idTaxSystem: number,\n idLegalForm: number,\n exerciceNbr: number,\n balanceSheetOffered: number = 0 /* montant du bilan offer */,\n): {\n totalPrestation: number;\n reduceMonth: number;\n canBeCreated: boolean;\n monthNbr: number;\n price: number;\n} => {\n let totalPrestation: number = 0;\n let reduceMonth: number = 0;\n let monthNbr: number = NbrMonth;\n let yearlyPrice: number | undefined;\n let finalMonthlyPrice: number | undefined;\n const canBeCreated: boolean = true;\n let recalculateMonthly: boolean = false;\n\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n\n if (currentPriceGrid) {\n let monthlyPrice: number | undefined;\n let vatRegimePrice: number | undefined;\n let taxSystemPrice: number | undefined;\n\n /* Gestion du régime de TVA */\n if (currentPriceGrid.vatRegimeMonthly && !isYearly)\n vatRegimePrice = currentPriceGrid.vatRegimeMonthly?.find((regime) => regime.type === idVatRegime)?.price;\n else if (currentPriceGrid.vatRegimeYearly && isYearly)\n vatRegimePrice = currentPriceGrid.vatRegimeYearly?.find((regime) => regime.type === idVatRegime)?.price;\n\n /* Gestion du Régime d'imposition */\n if (currentPriceGrid.taxSystem && idTaxSystem)\n taxSystemPrice = currentPriceGrid.taxSystem?.find((tax) => tax.id === idTaxSystem)?.price;\n\n /* Gestion des montants */\n /* Récupératioin des prix mensuels */\n if (currentPriceGrid.turnoverMonthly && !isYearly)\n monthlyPrice = currentPriceGrid.turnoverMonthly?.find((turn) => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.properties)\n monthlyPrice = currentPriceGrid.properties?.find((property) => property.amount === rentsNumber)?.price;\n else if (currentPriceGrid.employee) {\n monthlyPrice = currentPriceGrid.employee?.find(\n (emp) => emp.amountMinimum <= employeesNumber && emp.amountMaximum >= employeesNumber,\n )?.price;\n monthlyPrice = monthlyPrice ? monthlyPrice * employeesNumber : 0;\n } else if (currentPriceGrid.employeeByLegalForm) {\n monthlyPrice = currentPriceGrid.employeeByLegalForm?.find((emp) => emp.idLegalForm === idLegalForm)?.price;\n monthlyPrice = monthlyPrice ? monthlyPrice * employeesNumber : 0;\n /* Récupération des prix annuels */\n } else if (currentPriceGrid.turnoverYearly && isYearly)\n yearlyPrice = currentPriceGrid.turnoverYearly?.find((turn) => turnover < turn.turnoverValue)?.price;\n else if (!pastBalanceSheet && currentPriceGrid.turnoverCreatedYear)\n yearlyPrice = currentPriceGrid.turnoverCreatedYear?.find((turn) => turnover < turn.turnoverValue)?.price;\n else if (pastBalanceSheet && currentPriceGrid.turnoverPastYear)\n yearlyPrice = currentPriceGrid.turnoverPastYear?.find((turn) => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.partner)\n yearlyPrice = currentPriceGrid.partner?.find(\n (part) => part.amountMinimum <= associatesNumber && part.amountMaximum >= associatesNumber,\n )?.price;\n else if (currentPriceGrid.legalForm)\n yearlyPrice = currentPriceGrid.legalForm?.find((form) => form.idLegalForm === idLegalForm)?.price;\n else if (currentPriceGrid.exerciceNbr)\n yearlyPrice = currentPriceGrid.exerciceNbr?.find(\n (el) => el.minimum <= exerciceNbr && exerciceNbr <= el.maximum,\n )?.price;\n /* Calcul du prix mensuel final */\n finalMonthlyPrice =\n (monthlyPrice ? monthlyPrice : 0) + (vatRegimePrice ? vatRegimePrice : 0) + (taxSystemPrice ? taxSystemPrice : 0);\n\n /* Gestion des mois */\n let cloturedPast: boolean = false;\n if (dayjs(endDate, 'YYYY-MM-DD').subtract(15, 'day').isBefore(dayjs())) cloturedPast = true;\n let monthlyNbrList: monthlyNbr[] | undefined;\n let monthlyNbr: monthlyNbr | undefined;\n if (currentPriceGrid.monthlyNbr) {\n monthlyNbrList = currentPriceGrid.monthlyNbr?.filter((el) =>\n el.closingType.includes(cloturedPast ? ClosingType.OUTDATED : ClosingType.IN_PROGRESS),\n );\n if (monthlyNbrList) {\n monthlyNbr = monthlyNbrList.find((el) => el.minimum <= monthNbr && monthNbr <= el.maximum);\n if (monthlyNbr) {\n monthNbr = monthlyNbr.value;\n }\n }\n }\n\n /* Gestion des offres, mois offer */\n if (totalMonth > 0) {\n if (isYearly) {\n yearlyPrice = (10 - totalMonth) * (yearlyPrice ? yearlyPrice / 10 : 0);\n } else {\n monthNbr = monthNbr - totalMonth;\n }\n }\n\n /* Calcul du nombre de mois soustraient */\n reduceMonth = monthNbr === NbrMonth - totalMonth ? totalMonth : 0;\n\n /* Gestion des offres, bilan offer */\n if (balanceSheetOffered > 0) {\n yearlyPrice = undefined;\n recalculateMonthly = false;\n finalMonthlyPrice = balanceSheetOffered / monthNbr;\n }\n\n /* Prix Final */\n totalPrestation = yearlyPrice ? yearlyPrice : finalMonthlyPrice * monthNbr;\n }\n return {\n totalPrestation,\n reduceMonth,\n canBeCreated,\n monthNbr: yearlyPrice ? 0 : recalculateMonthly ? NbrMonth : monthNbr,\n price: yearlyPrice\n ? yearlyPrice\n : recalculateMonthly\n ? totalPrestation / monthNbr\n : finalMonthlyPrice\n ? finalMonthlyPrice\n : 0,\n };\n};\n\nconst calculatePrestationPriceWithPrestationList = (prestationList: IPrestationList): number => {\n let totalPrestation: number = 0;\n\n totalPrestation = prestationList?.price || 0;\n\n return totalPrestation;\n};\n\n/**\n * From idLegalForm, get application fees amount (without taxes included if no idVat passed, or with taxes included calculated by given idVat)\n * @param idLegalForm\n * @param idVat\n * @returns amount of application fees, without taxes included\n * @deprecated Application fees are not charged anymore\n */\nconst getApplicationFeesAmount = (idLegalForm: number, idVat?: number) => {\n let applicationFeesAmount = 50;\n if (idLegalForm === LegalFormTypeEnum.SCI) applicationFeesAmount = 150;\n\n //Sans tva, on envoie le montant HT\n if (!idVat) return applicationFeesAmount;\n\n //Avec tva, on envoie le montant TTC\n return getTaxesIncludedAmount(applicationFeesAmount, idVat);\n};\n\nconst calculatePrestationPrice = (\n idPrestationList: number,\n prestationList: IPrestationList,\n endDate: string,\n NbrMonth: number /* Nbr de mois dans l'exercice */,\n turnover: number,\n rentsNumber: number,\n employeesNumber: number,\n associatesNumber: number,\n idTypeBrand: number,\n idVatRegime: number,\n pastBalanceSheet: boolean,\n optionsList: number[],\n totalPercentage: number /* total pourcentage offer (%) */,\n totalAmount: number /* total montant offer (€) */,\n totalMonth: number /* total mois offer (mois) */,\n isWithApplicationFees: boolean /* frais de dossier */,\n idTaxSystem: number,\n idLegalForm: number,\n isYearly: boolean = false /* prestation annuel ou mensuel */,\n isSubPrestation: boolean = false,\n balanceSheetOffered: number = 0,\n exerciceList: IExercice[] = [],\n): {\n totalPrestation: number;\n reduceMonth: number;\n canBeCreated: boolean;\n calculDetail: string;\n monthlyPrice: string;\n price: number;\n} => {\n let totalPrestation: number = 0;\n let reduceMonth: number = 0;\n let canBeCreated: boolean = true;\n let monthNbr: number = 0;\n let price: number = 0;\n let totalWithReduce: {\n totalPrestation: number;\n reduceMonth: number;\n canBeCreated: boolean;\n monthNbr: number;\n price: number;\n } = { totalPrestation: 0, reduceMonth: 0, canBeCreated: true, monthNbr: 0, price: 0 };\n\n /* Gestion du prix en fonction de la prestation */\n if (\n [\n PrestationType.COMPTA_PRO,\n PrestationType.COMPTA_PRO_EXPRESS,\n PrestationType.COMPTA_ENTREPRISE,\n PrestationType.COMPTA_ENTREPRISE_EXPRESS,\n PrestationType.COMPTA_SCI,\n PrestationType.COMPTA_SCI_EXPRESS,\n PrestationType.BILAN_PREVISIONNEL,\n PrestationType.COMPTA_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS,\n PrestationType.COMPTA_POURCENTAGE,\n PrestationType.COMPTA_POURCENTAGE_EXPRESS,\n PrestationType.SOCIAL,\n PrestationType.GESTION_JURIDIQUE,\n PrestationType.COMPTA_PRO_COMPTASTART,\n PrestationType.COMPTA_PRO_COMPTASTART_EXPRESS,\n PrestationType.COMPTA_EI_KLEMS,\n PrestationType.COMPTA_EI_KLEMS_EXPRESS,\n PrestationType.COMPTA_MICRO_KLEMS,\n PrestationType.COMPTA_MICRO_KLEMS_EXPRESS,\n PrestationType.COMPTA_LOUEUR_MEUBLE_NON_PRO_KLEMS,\n PrestationType.COMPTA_LOUEUR_MEUBLE_NON_PRO_KLEMS_EXPRESS,\n PrestationType.STATUTS_OPTION_2,\n PrestationType.EXPERTISE,\n PrestationType.SUPPORT,\n PrestationType.PREMIUM,\n PrestationType.CUSTOM_MADE,\n PrestationType.EI,\n PrestationType.MICRO,\n PrestationType.GESTION_IMMO,\n ].includes(idPrestationList)\n ) {\n let exerciceNbr: number = 0;\n if (exerciceList.length) exerciceNbr = exerciceNumber(dayjs(endDate, 'YYYY-MM-DD').toDate(), exerciceList);\n totalWithReduce = calculatePrestationPriceWithPriceGrid(\n idPrestationList,\n endDate,\n NbrMonth,\n turnover,\n rentsNumber,\n employeesNumber,\n associatesNumber,\n idTypeBrand,\n idVatRegime,\n pastBalanceSheet,\n isYearly,\n totalMonth,\n idTaxSystem,\n idLegalForm,\n exerciceNbr,\n balanceSheetOffered,\n );\n totalPrestation = totalWithReduce.totalPrestation;\n reduceMonth = totalWithReduce.reduceMonth;\n canBeCreated = totalWithReduce.canBeCreated;\n monthNbr = totalWithReduce.monthNbr;\n price = totalWithReduce.price;\n } else {\n totalPrestation = calculatePrestationPriceWithPrestationList(prestationList);\n if ([PrestationType.CREATION_SOCIETE].includes(idPrestationList) && !isSubPrestation) {\n // totalPrestation += 50;\n // La création est offerte désormais\n // inutile d'ajouter les frais de greffe et d'annonce légale,\n // car ne compte pas dans le calcul pour les sales\n }\n }\n /* Gestion des offres */\n /* Offre montant offer */\n if (totalAmount > 0) totalPrestation = totalPrestation - totalAmount;\n /* Offre pourcentage offer */\n if (totalPercentage > 0) totalPrestation = totalPrestation - totalPrestation * (totalPercentage / 100);\n /* Gesstioin du prix minimum acceptable pour la prestation */\n if (prestationList && prestationList.minimumPrice && totalPrestation < prestationList.minimumPrice)\n totalPrestation = prestationList.minimumPrice;\n /* Gestion des options */\n let OptionTotalPrice: number = 0;\n if (optionsList.length) {\n optionsList.forEach((optionId) => {\n const optionPrice: number | undefined = Object.values(PrestationOption).find(\n (option) => option.id === optionId,\n )?.price;\n if (optionPrice) OptionTotalPrice += optionPrice;\n });\n }\n totalPrestation += OptionTotalPrice ? OptionTotalPrice : 0;\n /* Gestion des frais de dossier */\n // if (isWithApplicationFees) {\n // const applicationFeesAmount = getApplicationFeesAmount(idLegalForm);\n // totalPrestation += applicationFeesAmount;\n // }\n\n const calculDetail = `${monthNbr > 0 ? monthNbr + ' mois x ' + Math.round(price * 100) / 100 + '€' : Math.round(price * 100) / 100 + '€'} ${totalAmount > 0 ? '- ' + totalAmount + '€' : ''} ${totalPercentage > 0 ? '- ' + totalPercentage + '%' : ''} ${isWithApplicationFees ? '+ 50€' : ''}`;\n\n return {\n totalPrestation,\n reduceMonth,\n canBeCreated,\n calculDetail,\n monthlyPrice: monthNbr > 0 ? Math.round(price * 100) / 100 + '€/mois' : Math.round(price * 100) / 100 + '€',\n price,\n };\n};\n\nconst getPrestationOptions = (idPrestationList: number): PrestationOptionType[] => {\n const PrestationOptionList: PrestationOptionType[] = Object.values(PrestationOption).filter((option) =>\n option.brand.includes(getBrandNameByNodeEnv(process.env.NODE_ENV)),\n );\n return PrestationOptionList.filter((option) => option.prestationList.includes(idPrestationList));\n};\n\nconst isAbleToUpdatePrice = (\n idTypeBrand: number,\n idPrestationList: number,\n turnover: number,\n pastBalanceSheet: boolean,\n): boolean => {\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n if (currentPriceGrid) {\n if (\n [\n PrestationType.COMPTA_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS,\n ].includes(idPrestationList) &&\n // @ts-ignore: error after prettier formatting\n currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 2].turnoverValue < turnover\n )\n return true;\n else if (\n [PrestationType.COMPTA_POURCENTAGE, PrestationType.COMPTA_POURCENTAGE_EXPRESS].includes(idPrestationList) &&\n // @ts-ignore: error after prettier formatting\n currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 1].turnoverValue < turnover\n )\n return true;\n else if (\n [PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) &&\n !pastBalanceSheet &&\n // @ts-ignore: error after prettier formatting\n currentPriceGrid.turnoverCreatedYear[currentPriceGrid.turnoverCreatedYear.length - 1].turnoverValue < turnover\n )\n return true;\n else if (\n [PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) &&\n pastBalanceSheet &&\n // @ts-ignore: error after prettier formatting\n currentPriceGrid.turnoverPastYear[currentPriceGrid.turnoverPastYear.length - 1].turnoverValue < turnover\n )\n return true;\n else return false;\n }\n return false;\n};\n\nconst idPrestationListToOfferType = (idPrestationList: number): 'software' | 'expertise' => {\n if (ClementineSubscriptionAccountancySoftwarePrestations.includes(idPrestationList)) return 'software';\n return 'expertise';\n};\n\nexport {\n isOtherAccountingMissions,\n isOtherJuridicalMissions,\n isAdditionalPresta,\n isOtherSocialMission,\n isOnlyPrevi,\n isOnlySocial,\n isOnlyJuridic,\n isCreation,\n isFromStatutsExpress,\n isExpress,\n isConsultingHour,\n isSoftwarePrestation,\n calculateScoringOfPrestation,\n calculatePrestationPrice,\n getPrestationOptions,\n isAbleToUpdatePrice,\n calculatePrestationPriceWithPriceGrid,\n getApplicationFeesAmount,\n idPrestationListToOfferType,\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.3.160",
3
+ "version": "1.3.161",
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",
@@ -3,6 +3,7 @@ import {
3
3
  IGeneralLedgerAccount,
4
4
  IGeneralLedgerThirdParty,
5
5
  QueryGeneralLedgerAuxiliary,
6
+ QueryGeneralLedgerAuxiliaryPdf,
6
7
  QueryGeneralLedgerThirdParty,
7
8
  ReadGeneralLedgerSummary,
8
9
  ReadIGeneralLedgerThirdPartyPaginated,
@@ -89,4 +90,14 @@ export class GeneralLedger extends Resource {
89
90
  getThirdParty(id: number, params: QueryGeneralLedgerThirdParty): Promise<ReadIGeneralLedgerThirdPartyPaginated> {
90
91
  return this.axios.$get(`/general-ledger/third-parties/${id}`, { params });
91
92
  }
93
+
94
+ getAuxiliaryPdf(params: QueryGeneralLedgerAuxiliaryPdf): Promise<Buffer> {
95
+ return this.axios.$get('/general-ledger/auxiliary/pdf', {
96
+ params,
97
+ responseType: 'arraybuffer',
98
+ headers: {
99
+ Accept: 'application/pdf',
100
+ },
101
+ });
102
+ }
92
103
  }
@@ -1,4 +1,4 @@
1
- import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
1
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
2
2
  import { IsString, IsEmail, IsOptional, IsNumber, IsObject, ValidateIf } from 'class-validator';
3
3
 
4
4
  export class EmailSendOptionsDto {
@@ -14,4 +14,5 @@ export interface IGeneralLedgerAccountingEntry {
14
14
  exported?: Date;
15
15
  idAccountingTransaction: number;
16
16
  idBankAccount?: number;
17
+ letter?: string | null;
17
18
  }
@@ -33,6 +33,7 @@ export interface ReadGeneralLedgerSummary {
33
33
  debit: number;
34
34
  balance: number;
35
35
  identifier: string;
36
+ initialBalance: number;
36
37
  entries?: IGeneralLedgerAccountingEntry[];
37
38
  }
38
39
 
@@ -1,4 +1,4 @@
1
- import { IsBoolean, IsEnum, IsInt, IsOptional, IsString, Min, IsNumber } from 'class-validator';
1
+ import { IsBoolean, IsEnum, IsInt, IsOptional, IsString, Min, IsNumber, IsDateString } from 'class-validator';
2
2
  import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
3
3
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
4
4
  import { IsFormattedDateString } from '../../../../utils/validators/formattedDateString.validator';
@@ -49,3 +49,28 @@ export class QueryGeneralLedgerAuxiliary {
49
49
  @IsOptional()
50
50
  idThirdParty?: number;
51
51
  }
52
+
53
+ export type LetteringState = 'all' | 'only' | 'none';
54
+
55
+ export class QueryGeneralLedgerAuxiliaryPdf {
56
+ @ApiProperty()
57
+ @IsDateString()
58
+ startDate: string;
59
+
60
+ @ApiProperty()
61
+ @IsDateString()
62
+ endDate: string;
63
+
64
+ @ApiPropertyOptional()
65
+ @IsOptional()
66
+ idThirdPartyType?: ThirdPartyType;
67
+
68
+ @ApiPropertyOptional()
69
+ @IsOptional()
70
+ idThirdParty?: number[];
71
+
72
+ @ApiPropertyOptional()
73
+ @IsEnum(['all', 'only', 'none'])
74
+ @IsOptional()
75
+ lettering?: LetteringState;
76
+ }
@@ -1,51 +1,169 @@
1
+ import { IsDate, IsInt, IsOptional, IsEnum, IsNumber, IsString, IsObject, IsArray } from 'class-validator';
1
2
  import { RevenueMovementType } from '../../Enum/Revenue';
3
+ import { ApiProperty, ApiPropertyOptional } from '../../../utils';
2
4
 
3
5
  /**
4
6
  * DTO pour créer un mouvement de revenu
5
7
  */
6
- export interface ICreateRevenueMovementRequest {
8
+ export class ICreateRevenueMovementRequest {
9
+ @ApiProperty()
10
+ @IsEnum(RevenueMovementType)
7
11
  type: RevenueMovementType;
12
+
13
+ @ApiProperty()
14
+ @IsInt()
8
15
  idSociety: number;
16
+
17
+ @ApiPropertyOptional()
18
+ @IsOptional()
19
+ @IsInt()
9
20
  idExercice?: number;
21
+
22
+ @ApiPropertyOptional()
23
+ @IsOptional()
24
+ @IsInt()
10
25
  idPrestation?: number;
26
+
27
+ @ApiPropertyOptional()
28
+ @IsOptional()
29
+ @IsInt()
11
30
  idTerminationList?: number;
31
+
32
+ @ApiPropertyOptional()
33
+ @IsOptional()
34
+ @IsInt()
12
35
  idChurnMovement?: number;
36
+
37
+ @ApiProperty()
38
+ @IsInt()
13
39
  amount: number;
40
+
41
+ @ApiProperty()
42
+ @IsInt()
14
43
  mrr: number;
44
+
45
+ @ApiProperty()
46
+ @IsInt()
15
47
  arr: number;
48
+
49
+ @ApiProperty()
50
+ @IsDate()
16
51
  movementDate: Date;
52
+
53
+ @ApiPropertyOptional()
54
+ @IsOptional()
55
+ @IsString()
17
56
  description?: string;
57
+
58
+ @ApiPropertyOptional()
59
+ @IsOptional()
60
+ @IsObject()
18
61
  metadata?: Record<string, any>;
19
62
  }
20
63
 
21
64
  /**
22
65
  * DTO pour mettre à jour un mouvement de revenu
23
66
  */
24
- export interface IUpdateRevenueMovementRequest {
67
+ export class IUpdateRevenueMovementRequest {
68
+ @ApiPropertyOptional()
69
+ @IsOptional()
70
+ @IsEnum(RevenueMovementType)
25
71
  type?: RevenueMovementType;
72
+
73
+ @ApiPropertyOptional()
74
+ @IsOptional()
75
+ @IsInt()
26
76
  idTerminationList?: number;
77
+
78
+ @ApiPropertyOptional()
79
+ @IsOptional()
80
+ @IsInt()
27
81
  idChurnMovement?: number;
82
+
83
+ @ApiPropertyOptional()
84
+ @IsOptional()
85
+ @IsNumber()
28
86
  amount?: number;
87
+
88
+ @ApiPropertyOptional()
89
+ @IsOptional()
90
+ @IsInt()
29
91
  mrr?: number;
92
+
93
+ @ApiPropertyOptional()
94
+ @IsOptional()
95
+ @IsInt()
30
96
  arr?: number;
97
+
98
+ @ApiPropertyOptional()
99
+ @IsOptional()
100
+ @IsDate()
31
101
  movementDate?: Date | string;
102
+
103
+ @ApiPropertyOptional()
104
+ @IsOptional()
105
+ @IsString()
32
106
  description?: string;
107
+
108
+ @ApiPropertyOptional()
109
+ @IsOptional()
110
+ @IsObject()
33
111
  metadata?: Record<string, any>;
34
112
  }
35
113
 
36
114
  /**
37
115
  * Filtres pour récupérer les mouvements de revenu
38
116
  */
39
- export interface IGetRevenueMovementsRequest {
117
+ export class IGetRevenueMovementsRequest {
118
+ @ApiPropertyOptional()
119
+ @IsOptional()
120
+ @IsInt()
40
121
  idSociety?: number;
122
+
123
+ @ApiPropertyOptional()
124
+ @IsOptional()
125
+ @IsInt()
41
126
  idExercice?: number;
127
+
128
+ @ApiPropertyOptional()
129
+ @IsOptional()
130
+ @IsInt()
42
131
  idPrestation?: number;
132
+
133
+ @ApiPropertyOptional()
134
+ @IsOptional()
135
+ @IsInt()
43
136
  idTerminationList?: number;
137
+
138
+ @ApiPropertyOptional()
139
+ @IsOptional()
140
+ @IsInt()
44
141
  idChurnMovement?: number;
142
+
143
+ @ApiPropertyOptional()
144
+ @IsOptional()
145
+ @IsArray()
146
+ @IsEnum(RevenueMovementType, { each: true })
45
147
  type?: RevenueMovementType[];
148
+
149
+ @ApiPropertyOptional()
150
+ @IsOptional()
151
+ @IsDate()
46
152
  startDate?: Date | string;
153
+
154
+ @ApiPropertyOptional()
155
+ @IsOptional()
156
+ @IsDate()
47
157
  endDate?: Date | string;
158
+
159
+ @ApiPropertyOptional()
160
+ @IsOptional()
161
+ @IsInt()
48
162
  page?: number;
163
+
164
+ @ApiPropertyOptional()
165
+ @IsOptional()
166
+ @IsInt()
49
167
  limit?: number;
50
168
  }
51
169
 
@@ -63,25 +181,51 @@ export interface IGetRevenueMovementsResponse {
63
181
  /**
64
182
  * DTO pour générer un snapshot de revenu
65
183
  */
66
- export interface IGenerateSnapshotRequest {
184
+ export class IGenerateSnapshotRequest {
185
+ @ApiPropertyOptional()
186
+ @IsOptional()
187
+ @IsDate()
67
188
  date?: string;
189
+
190
+ @ApiPropertyOptional()
191
+ @IsOptional()
192
+ @IsInt()
68
193
  idSociety?: number;
194
+
195
+ @ApiPropertyOptional()
196
+ @IsOptional()
197
+ @IsInt()
69
198
  idExercice?: number;
70
199
  }
71
200
 
72
201
  /**
73
202
  * DTO pour générer tous les snapshots de revenu
74
203
  */
75
- export interface IGenerateAllSnapshotsRequest {
204
+ export class IGenerateAllSnapshotsRequest {
205
+ @ApiPropertyOptional()
206
+ @IsOptional()
207
+ @IsDate()
76
208
  date?: string;
77
209
  }
78
210
 
79
211
  /**
80
212
  * DTO pour gérer la rétroactivité des mouvements de revenu
81
213
  */
82
- export interface IManageRetroactivityRequest {
214
+ export class IManageRetroactivityRequest {
215
+ @ApiPropertyOptional()
216
+ @IsOptional()
217
+ @IsInt()
83
218
  idSociety: number;
219
+
220
+ @ApiPropertyOptional()
221
+ @IsOptional()
222
+ @IsInt()
84
223
  idExercice?: number;
224
+
225
+ @ApiPropertyOptional()
226
+ @IsOptional()
227
+ @IsDate()
228
+ date?: Date;
85
229
  }
86
230
 
87
231
  /**
@@ -89,9 +233,9 @@ export interface IManageRetroactivityRequest {
89
233
  */
90
234
  export interface IManageRetroactivityResponse {
91
235
  idSociety: number;
92
- idExercice: number;
93
- exerciceStartDate: Date;
94
- exerciceEndDate: Date;
236
+ idExercice: number[];
237
+ exerciceStartDate: Date[];
238
+ exerciceEndDate: Date[];
95
239
  movementsCreated: {
96
240
  bookings: number;
97
241
  churns: number;
@@ -1,5 +1,5 @@
1
- import { ApiProperty } from '../../../utils';
2
- import { IsOptional, IsString, IsNumber } from 'class-validator';
1
+ import { ApiProperty, ApiPropertyOptional } from '../../../utils';
2
+ import { IsOptional, IsString, IsNumber, IsInt } from 'class-validator';
3
3
 
4
4
  export class GenerateSnapshot {
5
5
  @ApiProperty({
@@ -22,7 +22,7 @@ export class GenerateSnapshot {
22
22
 
23
23
  @ApiProperty({
24
24
  required: false,
25
- description: "ID de l'exercice",
25
+ description: 'ID de l\'exercice',
26
26
  example: 123456,
27
27
  })
28
28
  @IsOptional()
@@ -42,20 +42,20 @@ export class GenerateAllSnapshots {
42
42
  }
43
43
 
44
44
  export class ManageRetroactivity {
45
- @ApiProperty({
46
- required: true,
47
- description: 'ID de la société',
48
- example: 60170,
49
- })
50
- @IsNumber()
51
- idSociety: number;
45
+ // @ApiProperty({
46
+ // required: true,
47
+ // description: 'ID de la société',
48
+ // example: 60170,
49
+ // })
50
+ // @IsInt()
51
+ // idSociety: number;
52
52
 
53
- @ApiProperty({
53
+ @ApiPropertyOptional({
54
54
  required: false,
55
- description: "ID de l'exercice (si non fourni, utilise l'exercice courant)",
55
+ description: 'ID de l\'exercice (si non fourni, utilise l\'exercice courant)',
56
56
  example: 123456,
57
57
  })
58
58
  @IsOptional()
59
- @IsNumber()
59
+ @IsInt()
60
60
  idExercice?: number;
61
61
  }
@@ -12,6 +12,7 @@ export interface IImmobilization {
12
12
  quantitySelled?: number;
13
13
  amountOfSellTaxIncluded?: number | null;
14
14
  sellingDate?: Date | null;
15
+ trashingDate?: Date | null;
15
16
  acquisitionDate?: Date; // si il n'y a pas d'acquisition date, c'est un acompte
16
17
  duration: number;
17
18
  provider: string;
@@ -1,5 +1,6 @@
1
1
  import { IExercice, IPrestation, IPrestationList } from '../types';
2
2
  import { Vat } from '../types/Enum/Vat';
3
+ import { ReasonTerminationType } from '../types/Enum/ReasonTerminationType';
3
4
  import { getTaxesIncludedAmount } from './vat/utils';
4
5
  import { intersection } from './noLodash';
5
6
  import {
@@ -166,7 +167,8 @@ const calculateScoringOfPrestation = (
166
167
  (prestation) =>
167
168
  prestation.paid &&
168
169
  prestation.signed &&
169
- prestation.terminationList === null &&
170
+ (prestation.terminationList === null ||
171
+ prestation.terminationList?.idReasonTermination?.includes(ReasonTerminationType.CHANGES_NEW_OFFERS)) &&
170
172
  prestation.id !== currentIdPrestation,
171
173
  );
172
174