@silexpert/core 1.1.310 → 1.1.312

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 (90) hide show
  1. package/dist/cjs/api/resources/Rating.d.ts +2 -7
  2. package/dist/cjs/api/resources/Rating.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/Rating.js +5 -7
  4. package/dist/cjs/api/resources/Rating.js.map +1 -1
  5. package/dist/cjs/types/Enum/BalanceSheet.d.ts +21 -0
  6. package/dist/cjs/types/Enum/BalanceSheet.d.ts.map +1 -1
  7. package/dist/cjs/types/Enum/BalanceSheet.js +27 -1
  8. package/dist/cjs/types/Enum/BalanceSheet.js.map +1 -1
  9. package/dist/cjs/types/Enum/Contract.d.ts +2 -1
  10. package/dist/cjs/types/Enum/Contract.d.ts.map +1 -1
  11. package/dist/cjs/types/Enum/Contract.js +2 -0
  12. package/dist/cjs/types/Enum/Contract.js.map +1 -1
  13. package/dist/cjs/types/Enum/MailAuto.d.ts +3 -1
  14. package/dist/cjs/types/Enum/MailAuto.d.ts.map +1 -1
  15. package/dist/cjs/types/Enum/MailAuto.js +2 -0
  16. package/dist/cjs/types/Enum/MailAuto.js.map +1 -1
  17. package/dist/cjs/types/Enum/PriceGridClementine.js +1 -1
  18. package/dist/cjs/types/Enum/PriceGridClementine.js.map +1 -1
  19. package/dist/cjs/types/Enum/Supervision.d.ts +0 -2
  20. package/dist/cjs/types/Enum/Supervision.d.ts.map +1 -1
  21. package/dist/cjs/types/Enum/Supervision.js +12 -12
  22. package/dist/cjs/types/Enum/Supervision.js.map +1 -1
  23. package/dist/cjs/types/Interface/api/payment/Util.d.ts +1 -0
  24. package/dist/cjs/types/Interface/api/payment/Util.d.ts.map +1 -1
  25. package/dist/cjs/types/Interface/api/payment/Util.js.map +1 -1
  26. package/dist/cjs/types/Interface/api/supervision/Query.d.ts +4 -2
  27. package/dist/cjs/types/Interface/api/supervision/Query.d.ts.map +1 -1
  28. package/dist/cjs/types/Interface/api/supervision/Query.js +20 -8
  29. package/dist/cjs/types/Interface/api/supervision/Query.js.map +1 -1
  30. package/dist/cjs/types/Interface/models/ISocialDetail.d.ts +1 -0
  31. package/dist/cjs/types/Interface/models/ISocialDetail.d.ts.map +1 -1
  32. package/dist/cjs/types/Interface/models/ISocialDetail.js.map +1 -1
  33. package/dist/cjs/utils/payment.d.ts.map +1 -1
  34. package/dist/cjs/utils/payment.js +34 -15
  35. package/dist/cjs/utils/payment.js.map +1 -1
  36. package/dist/cjs/utils/prestation.d.ts +8 -1
  37. package/dist/cjs/utils/prestation.d.ts.map +1 -1
  38. package/dist/cjs/utils/prestation.js +35 -8
  39. package/dist/cjs/utils/prestation.js.map +1 -1
  40. package/dist/mjs/api/resources/Rating.d.ts +2 -7
  41. package/dist/mjs/api/resources/Rating.d.ts.map +1 -1
  42. package/dist/mjs/api/resources/Rating.js +5 -7
  43. package/dist/mjs/api/resources/Rating.js.map +1 -1
  44. package/dist/mjs/types/Enum/BalanceSheet.d.ts +21 -0
  45. package/dist/mjs/types/Enum/BalanceSheet.d.ts.map +1 -1
  46. package/dist/mjs/types/Enum/BalanceSheet.js +26 -0
  47. package/dist/mjs/types/Enum/BalanceSheet.js.map +1 -1
  48. package/dist/mjs/types/Enum/Contract.d.ts +2 -1
  49. package/dist/mjs/types/Enum/Contract.d.ts.map +1 -1
  50. package/dist/mjs/types/Enum/Contract.js +2 -0
  51. package/dist/mjs/types/Enum/Contract.js.map +1 -1
  52. package/dist/mjs/types/Enum/MailAuto.d.ts +3 -1
  53. package/dist/mjs/types/Enum/MailAuto.d.ts.map +1 -1
  54. package/dist/mjs/types/Enum/MailAuto.js +2 -0
  55. package/dist/mjs/types/Enum/MailAuto.js.map +1 -1
  56. package/dist/mjs/types/Enum/PriceGridClementine.js +1 -1
  57. package/dist/mjs/types/Enum/PriceGridClementine.js.map +1 -1
  58. package/dist/mjs/types/Enum/Supervision.d.ts +0 -2
  59. package/dist/mjs/types/Enum/Supervision.d.ts.map +1 -1
  60. package/dist/mjs/types/Enum/Supervision.js +12 -12
  61. package/dist/mjs/types/Enum/Supervision.js.map +1 -1
  62. package/dist/mjs/types/Interface/api/payment/Util.d.ts +1 -0
  63. package/dist/mjs/types/Interface/api/payment/Util.d.ts.map +1 -1
  64. package/dist/mjs/types/Interface/api/payment/Util.js.map +1 -1
  65. package/dist/mjs/types/Interface/api/supervision/Query.d.ts +4 -2
  66. package/dist/mjs/types/Interface/api/supervision/Query.d.ts.map +1 -1
  67. package/dist/mjs/types/Interface/api/supervision/Query.js +24 -10
  68. package/dist/mjs/types/Interface/api/supervision/Query.js.map +1 -1
  69. package/dist/mjs/types/Interface/models/ISocialDetail.d.ts +1 -0
  70. package/dist/mjs/types/Interface/models/ISocialDetail.d.ts.map +1 -1
  71. package/dist/mjs/types/Interface/models/ISocialDetail.js.map +1 -1
  72. package/dist/mjs/utils/payment.d.ts.map +1 -1
  73. package/dist/mjs/utils/payment.js +35 -17
  74. package/dist/mjs/utils/payment.js.map +1 -1
  75. package/dist/mjs/utils/prestation.d.ts +8 -1
  76. package/dist/mjs/utils/prestation.d.ts.map +1 -1
  77. package/dist/mjs/utils/prestation.js +34 -8
  78. package/dist/mjs/utils/prestation.js.map +1 -1
  79. package/package.json +1 -1
  80. package/ts/api/resources/Rating.ts +6 -8
  81. package/ts/types/Enum/BalanceSheet.ts +28 -1
  82. package/ts/types/Enum/Contract.ts +2 -0
  83. package/ts/types/Enum/MailAuto.ts +2 -0
  84. package/ts/types/Enum/PriceGridClementine.ts +1 -1
  85. package/ts/types/Enum/Supervision.ts +4 -4
  86. package/ts/types/Interface/api/payment/Util.ts +1 -0
  87. package/ts/types/Interface/api/supervision/Query.ts +17 -7
  88. package/ts/types/Interface/models/ISocialDetail.ts +1 -0
  89. package/ts/utils/payment.ts +34 -17
  90. package/ts/utils/prestation.ts +43 -15
@@ -1 +1 @@
1
- {"version":3,"file":"prestation.js","sourceRoot":"","sources":["../../../ts/utils/prestation.ts"],"names":[],"mappings":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AgB,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,aAAa,GAAG,QAAQ;YAAE,OAAO,IAAI,CAAC;;YAChN,OAAO,KAAK,CAAC;KACnB;IACD,OAAO,KAAK,CAAC;AAEf,CAAC,CAAC;AAEF,OAAO,EACL,yBAAyB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,qCAAqC,GAC/T,CAAC","sourcesContent":["import { IExercice, IPrestation, IPrestationList } from '../types';\nimport { intersection } from './noLodash';\nimport { PrestationDetail, PrestationType } 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 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].includes(idPrestationList);\n\nconst isOtherJuridicalMissions = (isJuridique:boolean, isCatalog:boolean, idPrestationList: number): boolean => idPrestationList !== PrestationType.GESTION_JURIDIQUE && isCatalog && isJuridique;\n\nconst isOtherSocialMission = (idPrestationList: number): boolean => idPrestationList === PrestationType.AUTRE_MISSION_SOCIALE_HORS_PAIE;\n\nconst isAdditionalPresta = (hidden:boolean, isCatalog:boolean): boolean => !hidden && isCatalog;\n\nconst isOnlyPrevi = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.PREVISIONNEL, PrestationType.BILAN_PREVISIONNEL, PrestationType.PV_AG].includes(idPL)).length;\n\nconst isOnlySocial = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.FRUCTUPAIE, PrestationType.SOCIAL].includes(idPL)).length;\n\nconst isOnlyJuridic = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.GESTION_JURIDIQUE].includes(idPL)).length;\n\nconst isCreation = (idPrestationList: number[]):boolean => !!intersection(idPrestationList, [PrestationType.CREATION_SOCIETE, PrestationType.STATUTS_FREE, PrestationType.STATUTS_OPTION_1, PrestationType.STATUTS_OPTION_2, PrestationType.STATUTS_OPTION_AE]).length;\n\nconst isFromStatutsExpress = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.STATUTS_FREE, PrestationType.STATUTS_OPTION_1, PrestationType.STATUTS_OPTION_2, PrestationType.STATUTS_OPTION_AE].includes(idPL)).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 calculateScoringOfPrestation = (idPrestationType: PrestationType, prestations: IPrestation[]): number => {\n const prestationsSignedPaid = prestations.filter((prestation) => prestation.paid && prestation.signed && prestation.terminationList === null);\n\n // Get the list of prestations that are half price\n const prestationHalfPriceList = Object.values(PrestationDetail).filter((p) => p.isComptable && !p.isCatalog);\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 const numberPoint = prestaDetails?.point || 0;\n\n // Get list of prestations that are already done 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)) return Math.floor(numberPoint * 0.3);\n\n return numberPoint;\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, PriceGridPourcentage, PriceGridLegalstart, PriceGridStatutsExpress,\n };\n // @ts-ignore\n const currentPriceGridFile: priceGridBrand[] = listEnvEnum[`PriceGrid${currentEnvName}`];\n if (currentPriceGridFile) currentBrandPriceGrid = currentPriceGridFile.find((priceGrid: priceGridBrand) => priceGrid.idTypeBrand === idTypeBrand);\n if (currentBrandPriceGrid) currentPriceGrid = currentBrandPriceGrid?.price.find((price: priceGrid) => price.idPrestationList.includes(idPrestationList));\n return currentPriceGrid;\n};\n\nconst calculatePrestationPriceWithPriceGrid = (\n idPrestationList: number, \n endDate: string, \n NbrMonth: number, \n turnover: number, \n rentsNumber: number, \n employeesNumber: number, \n associatesNumber: number, \n idTypeBrand: number, \n idVatRegime: number, \n pastBalanceSheet: boolean, \n isYearly: boolean, \n totalMonth: number, \n idTaxSystem: number, \n idLegalForm: number, \n exerciceNbr: number,\n balanceSheetOffered: number = 0,\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 let 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) vatRegimePrice = currentPriceGrid.vatRegimeMonthly?.find(regime => regime.type === idVatRegime)?.price;\n else if (currentPriceGrid.vatRegimeYearly && isYearly) vatRegimePrice = currentPriceGrid.vatRegimeYearly?.find(regime => regime.type === idVatRegime)?.price;\n\n /* Gestion du Régime d'imposition */\n if (currentPriceGrid.taxSystem && idTaxSystem) taxSystemPrice = currentPriceGrid.taxSystem?.find(tax => tax.id === idTaxSystem)?.price;\n\n /* Gestion des montants */\n if (currentPriceGrid.turnoverMonthly && !isYearly) monthlyPrice = currentPriceGrid.turnoverMonthly?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.properties) monthlyPrice = currentPriceGrid.properties?.find(property => property.amount === rentsNumber)?.price;\n else if (currentPriceGrid.employee) {\n monthlyPrice = currentPriceGrid.employee?.find(emp => emp.amountMinimum <= employeesNumber && emp.amountMaximum >= employeesNumber)?.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 } else if (currentPriceGrid.turnoverYearly && isYearly) yearlyPrice = currentPriceGrid.turnoverYearly?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (!pastBalanceSheet && currentPriceGrid.turnoverCreatedYear) yearlyPrice = currentPriceGrid.turnoverCreatedYear?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (pastBalanceSheet && currentPriceGrid.turnoverPastYear) yearlyPrice = currentPriceGrid.turnoverPastYear?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.partner) yearlyPrice = currentPriceGrid.partner?.find(part => part.amountMinimum <= associatesNumber && part.amountMaximum >= associatesNumber)?.price;\n else if (currentPriceGrid.legalForm) yearlyPrice = currentPriceGrid.legalForm?.find(form => form.idLegalForm === idLegalForm)?.price;\n else if (currentPriceGrid.exerciceNbr) yearlyPrice = currentPriceGrid.exerciceNbr?.find(el => el.minimum <= exerciceNbr && exerciceNbr <= el.maximum )?.price;\n finalMonthlyPrice = (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 => el.closingType.includes(cloturedPast ? ClosingType.OUTDATED : ClosingType.IN_PROGRESS));\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 if (totalMonth > 0) {\n if (monthlyNbr && ((monthNbr - totalMonth) < monthlyNbr?.minimum)) canBeCreated = false; \n monthNbr = monthNbr - totalMonth;\n recalculateMonthly = true;\n }\n\n reduceMonth = (monthNbr === NbrMonth - totalMonth ? totalMonth : 0);\n\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 { totalPrestation, reduceMonth, canBeCreated, monthNbr: yearlyPrice ? 0 : recalculateMonthly ? NbrMonth : monthNbr, price: yearlyPrice ? yearlyPrice : recalculateMonthly ? (totalPrestation / NbrMonth) : (finalMonthlyPrice ? finalMonthlyPrice : 0) };\n};\n\nconst calculatePrestationPriceWithPrestationList = (prestationList: IPrestationList): number => {\n let totalPrestation: number = 0;\n\n totalPrestation = prestationList?.price || 0;\n\n return totalPrestation;\n};\n\nconst calculatePrestationPrice = (\n idPrestationList: number, \n prestationList: IPrestationList, \n endDate: string, \n NbrMonth: number, \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, \n totalAmount: number, \n totalMonth: number, \n isWithApplicationFees: boolean, \n idTaxSystem: number, \n idLegalForm: number, \n isYearly: boolean = false,\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: { totalPrestation: number, reduceMonth: number, canBeCreated: boolean, monthNbr: number, price: number } = { 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 ].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) totalPrestation += 50;\n }\n if (totalAmount > 0) totalPrestation = totalPrestation - totalAmount;\n if (totalPercentage > 0) totalPrestation = totalPrestation - (totalPrestation * (totalPercentage / 100));\n if (prestationList.minimumPrice && totalPrestation < prestationList.minimumPrice) 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((option) => option.id === optionId)?.price;\n if (optionPrice) OptionTotalPrice += optionPrice;\n });\n }\n totalPrestation += (OptionTotalPrice ? OptionTotalPrice : 0);\n\n if (isWithApplicationFees) {\n if (idLegalForm === LegalFormTypeEnum.SCI) totalPrestation += 150;\n else totalPrestation += 50;\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 { totalPrestation, reduceMonth, canBeCreated, calculDetail, monthlyPrice: monthNbr > 0 ? (Math.round(price * 100) / 100) + '€/mois' : (Math.round(price * 100) / 100) + '€', price };\n};\n\nconst getPrestationOptions = (idPrestationList: number): PrestationOptionType[] => {\n const PrestationOptionList: PrestationOptionType[] = Object.values(PrestationOption).filter(option => option.brand.includes(getBrandNameByNodeEnv(process.env.NODE_ENV)));\n return PrestationOptionList.filter(option => option.prestationList.includes(idPrestationList));\n};\n\nconst isAbleToUpdatePrice = (idTypeBrand: number, idPrestationList: number, turnover: number, pastBalanceSheet: boolean): boolean => {\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n if (currentPriceGrid) {\n // @ts-ignore\n if ([PrestationType.COMPTA_PREMIUM, PrestationType.COMPTA_POURCENTAGE_PREMIUM, PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS].includes(idPrestationList) && currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 2].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.COMPTA_POURCENTAGE, PrestationType.COMPTA_POURCENTAGE_EXPRESS].includes(idPrestationList) && currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 1].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) && !pastBalanceSheet && currentPriceGrid.turnoverCreatedYear[currentPriceGrid.turnoverCreatedYear.length - 1].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) && pastBalanceSheet && currentPriceGrid.turnoverPastYear[currentPriceGrid.turnoverPastYear.length - 1].turnoverValue < turnover) return true;\n else return false;\n }\n return false;\n\n};\n\nexport {\n isOtherAccountingMissions, isOtherJuridicalMissions, isAdditionalPresta, isOtherSocialMission, isOnlyPrevi, isOnlySocial, isOnlyJuridic, isCreation, isFromStatutsExpress, isExpress, calculateScoringOfPrestation, calculatePrestationPrice, getPrestationOptions, isAbleToUpdatePrice, calculatePrestationPriceWithPriceGrid,\n};"]}
1
+ {"version":3,"file":"prestation.js","sourceRoot":"","sources":["../../../ts/utils/prestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAwB,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA4E5C,MAAM,yBAAyB,GAAG,CAAC,gBAAwB,EAAW,EAAE,CAAC;IACvE,cAAc,CAAC,YAAY;IAC3B,cAAc,CAAC,mBAAmB;IAClC,cAAc,CAAC,wCAAwC;IACvD,cAAc,CAAC,uBAAuB;IACtC,cAAc,CAAC,GAAG;IAClB,cAAc,CAAC,aAAa;IAC5B,cAAc,CAAC,kBAAkB;CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAEhE,MAAM,wBAAwB,GAAG,CAAC,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AAa,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,qCAAqC,EAAE,wBAAwB,GACzV,CAAC","sourcesContent":["import { IExercice, IPrestation, IPrestationList } from '../types';\nimport { getTaxesIncludedAmount } from './vat/utils';\nimport { intersection } from './noLodash';\nimport { PrestationDetail, PrestationType } 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 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].includes(idPrestationList);\n\nconst isOtherJuridicalMissions = (isJuridique:boolean, isCatalog:boolean, idPrestationList: number): boolean => idPrestationList !== PrestationType.GESTION_JURIDIQUE && isCatalog && isJuridique;\n\nconst isOtherSocialMission = (idPrestationList: number): boolean => idPrestationList === PrestationType.AUTRE_MISSION_SOCIALE_HORS_PAIE;\n\nconst isAdditionalPresta = (hidden:boolean, isCatalog:boolean): boolean => !hidden && isCatalog;\n\nconst isOnlyPrevi = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.PREVISIONNEL, PrestationType.BILAN_PREVISIONNEL, PrestationType.PV_AG].includes(idPL)).length;\n\nconst isOnlySocial = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.FRUCTUPAIE, PrestationType.SOCIAL].includes(idPL)).length;\n\nconst isOnlyJuridic = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.GESTION_JURIDIQUE].includes(idPL)).length;\n\nconst isCreation = (idPrestationList: number[]):boolean => !!intersection(idPrestationList, [PrestationType.CREATION_SOCIETE, PrestationType.STATUTS_FREE, PrestationType.STATUTS_OPTION_1, PrestationType.STATUTS_OPTION_2, PrestationType.STATUTS_OPTION_AE]).length;\n\nconst isFromStatutsExpress = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.STATUTS_FREE, PrestationType.STATUTS_OPTION_1, PrestationType.STATUTS_OPTION_2, PrestationType.STATUTS_OPTION_AE].includes(idPL)).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 calculateScoringOfPrestation = (idPrestationType: PrestationType, prestations: IPrestation[]): number => {\n const prestationsSignedPaid = prestations.filter((prestation) => prestation.paid && prestation.signed && prestation.terminationList === null);\n\n // Get the list of prestations that are half price\n const prestationHalfPriceList = Object.values(PrestationDetail).filter((p) => p.isComptable && !p.isCatalog);\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 const numberPoint = prestaDetails?.point || 0;\n\n // Get list of prestations that are already done 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)) return Math.floor(numberPoint * 0.3);\n\n return numberPoint;\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, PriceGridPourcentage, PriceGridLegalstart, PriceGridStatutsExpress,\n };\n // @ts-ignore\n const currentPriceGridFile: priceGridBrand[] = listEnvEnum[`PriceGrid${currentEnvName}`];\n if (currentPriceGridFile) currentBrandPriceGrid = currentPriceGridFile.find((priceGrid: priceGridBrand) => priceGrid.idTypeBrand === idTypeBrand);\n if (currentBrandPriceGrid) currentPriceGrid = currentBrandPriceGrid?.price.find((price: priceGrid) => price.idPrestationList.includes(idPrestationList));\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 let 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) vatRegimePrice = currentPriceGrid.vatRegimeMonthly?.find(regime => regime.type === idVatRegime)?.price;\n else if (currentPriceGrid.vatRegimeYearly && isYearly) vatRegimePrice = currentPriceGrid.vatRegimeYearly?.find(regime => regime.type === idVatRegime)?.price;\n\n /* Gestion du Régime d'imposition */\n if (currentPriceGrid.taxSystem && idTaxSystem) 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) monthlyPrice = currentPriceGrid.turnoverMonthly?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.properties) monthlyPrice = currentPriceGrid.properties?.find(property => property.amount === rentsNumber)?.price;\n else if (currentPriceGrid.employee) {\n monthlyPrice = currentPriceGrid.employee?.find(emp => emp.amountMinimum <= employeesNumber && emp.amountMaximum >= employeesNumber)?.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) yearlyPrice = currentPriceGrid.turnoverYearly?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (!pastBalanceSheet && currentPriceGrid.turnoverCreatedYear) yearlyPrice = currentPriceGrid.turnoverCreatedYear?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (pastBalanceSheet && currentPriceGrid.turnoverPastYear) yearlyPrice = currentPriceGrid.turnoverPastYear?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.partner) yearlyPrice = currentPriceGrid.partner?.find(part => part.amountMinimum <= associatesNumber && part.amountMaximum >= associatesNumber)?.price;\n else if (currentPriceGrid.legalForm) yearlyPrice = currentPriceGrid.legalForm?.find(form => form.idLegalForm === idLegalForm)?.price;\n else if (currentPriceGrid.exerciceNbr) yearlyPrice = currentPriceGrid.exerciceNbr?.find(el => el.minimum <= exerciceNbr && exerciceNbr <= el.maximum )?.price;\n /* Calcul du prix mensuel final */\n finalMonthlyPrice = (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 => el.closingType.includes(cloturedPast ? ClosingType.OUTDATED : ClosingType.IN_PROGRESS));\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 /* Gestion des offres, mois offer */\n if (totalMonth > 0) {\n if (monthlyNbr && ((monthNbr - totalMonth) < monthlyNbr?.minimum)) canBeCreated = false; \n monthNbr = monthNbr - totalMonth;\n recalculateMonthly = true;\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 { totalPrestation, reduceMonth, canBeCreated, monthNbr: yearlyPrice ? 0 : recalculateMonthly ? NbrMonth : monthNbr, price: yearlyPrice ? yearlyPrice : recalculateMonthly ? (totalPrestation / monthNbr) : (finalMonthlyPrice ? finalMonthlyPrice : 0) };\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 */\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: { totalPrestation: number, reduceMonth: number, canBeCreated: boolean, monthNbr: number, price: number } = { 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 ].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) totalPrestation += 50;\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.minimumPrice && totalPrestation < prestationList.minimumPrice) 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((option) => option.id === optionId)?.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 { totalPrestation, reduceMonth, canBeCreated, calculDetail, monthlyPrice: monthNbr > 0 ? (Math.round(price * 100) / 100) + '€/mois' : (Math.round(price * 100) / 100) + '€', price };\n};\n\nconst getPrestationOptions = (idPrestationList: number): PrestationOptionType[] => {\n const PrestationOptionList: PrestationOptionType[] = Object.values(PrestationOption).filter(option => option.brand.includes(getBrandNameByNodeEnv(process.env.NODE_ENV)));\n return PrestationOptionList.filter(option => option.prestationList.includes(idPrestationList));\n};\n\nconst isAbleToUpdatePrice = (idTypeBrand: number, idPrestationList: number, turnover: number, pastBalanceSheet: boolean): boolean => {\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n if (currentPriceGrid) {\n // @ts-ignore\n if ([PrestationType.COMPTA_PREMIUM, PrestationType.COMPTA_POURCENTAGE_PREMIUM, PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS].includes(idPrestationList) && currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 2].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.COMPTA_POURCENTAGE, PrestationType.COMPTA_POURCENTAGE_EXPRESS].includes(idPrestationList) && currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 1].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) && !pastBalanceSheet && currentPriceGrid.turnoverCreatedYear[currentPriceGrid.turnoverCreatedYear.length - 1].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) && pastBalanceSheet && currentPriceGrid.turnoverPastYear[currentPriceGrid.turnoverPastYear.length - 1].turnoverValue < turnover) return true;\n else return false;\n }\n return false;\n\n};\n\nexport {\n isOtherAccountingMissions, isOtherJuridicalMissions, isAdditionalPresta, isOtherSocialMission, isOnlyPrevi, isOnlySocial, isOnlyJuridic, isCreation, isFromStatutsExpress, isExpress, calculateScoringOfPrestation, calculatePrestationPrice, getPrestationOptions, isAbleToUpdatePrice, calculatePrestationPriceWithPriceGrid, getApplicationFeesAmount,\n};"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.1.310",
3
+ "version": "1.1.312",
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",
@@ -1,15 +1,9 @@
1
- import { CancelToken } from 'axios';
2
1
  import { Resource } from '../Resource';
3
2
  import { BasePaginate, IRating, QueryRatingPaginated } from '../../types';
4
3
 
5
4
  export class Rating extends Resource {
6
- /**
7
- * Creation d'un avis sur le clementinier qu'un client a deposé
8
- * @param { IRating } payload
9
- * @returns { IRating }
10
- */
11
- createRating(payload: IRating, cancelToken?: CancelToken): Promise<IRating> {
12
- return this.axios.$post('/ratings', payload);
5
+ createRating(payload: IRating): Promise<IRating> {
6
+ return this.axios.$post(`/societies/${payload.idSociety}/ratings`, payload);
13
7
  }
14
8
 
15
9
  /**
@@ -20,4 +14,8 @@ export class Rating extends Resource {
20
14
  public getPaginate(params: QueryRatingPaginated): Promise<BasePaginate<IRating>> {
21
15
  return this.axios.$get('/ratings/paginate', { params });
22
16
  }
17
+
18
+ public getAll(idSociety: number): Promise<IRating[]> {
19
+ return this.axios.$get(`/societies/${idSociety}/ratings`);
20
+ }
23
21
  }
@@ -804,4 +804,31 @@ export const BALANCE_SHEET_LIST_PASSIVE_DETAILS: BalanceSheetField[] = [
804
804
  total: 0,
805
805
  type: 'passive',
806
806
  },
807
- ];
807
+ ];
808
+
809
+ export const balanceSheetTotalRanges = [
810
+ {
811
+ id: 1,
812
+ label: '< 80.000 €',
813
+ lowValue: 0,
814
+ highValue: 80000,
815
+ },
816
+ {
817
+ id: 2,
818
+ label: '81.000 - 160.000 €',
819
+ lowValue: 80000,
820
+ highValue: 160000,
821
+ },
822
+ {
823
+ id: 3,
824
+ label: '161.000 - 250.000 €',
825
+ lowValue: 160000,
826
+ highValue: 250000,
827
+ },
828
+ {
829
+ id: 4,
830
+ label: '> 251.000 €',
831
+ lowValue: 250000,
832
+ highValue: 10000000,
833
+ },
834
+ ] as const;
@@ -7,6 +7,7 @@ export enum ContractTypeEnum {
7
7
  TEMPORARY_CONTRACT_USAGE = 6,
8
8
  PERMANENT_CONTRACT = 7,
9
9
  INTERNSHIP = 8,
10
+ SOCIAL_MANDATE = 9,
10
11
  }
11
12
 
12
13
  export const ContractList: Array<{ id: ContractTypeEnum; name: string; }> = [
@@ -18,4 +19,5 @@ export const ContractList: Array<{ id: ContractTypeEnum; name: string; }> = [
18
19
  { id: ContractTypeEnum.TEMPORARY_CONTRACT_USAGE, name: 'CDD usage' },
19
20
  { id: ContractTypeEnum.PERMANENT_CONTRACT, name: 'CDI' },
20
21
  { id: ContractTypeEnum.INTERNSHIP, name: 'Stage' },
22
+ { id: ContractTypeEnum.SOCIAL_MANDATE, name: 'Mandat Social' },
21
23
  ];
@@ -127,6 +127,8 @@ export enum MailAuto {
127
127
  SYNTHESIS_CUSTOMERS_REPORTING = 154,
128
128
  RESOLVE_CUSTOMERS_REPORTING = 155,
129
129
  NEW_ATTRIBUTION_ONBOARDER = 156,
130
+ EMPLOYEE_RELEASE_DOCUMENT = 157,
131
+ EMPLOYEMENT_CONTRACT = 158,
130
132
  }
131
133
 
132
134
  export enum MailAutoType {
@@ -429,7 +429,7 @@ export const PriceGridClementine = [
429
429
  {
430
430
  // Compta EI
431
431
  idPrestationList: [PrestationType.COMPTA_EI_KLEMS, PrestationType.COMPTA_EI_KLEMS_EXPRESS],
432
- priceWithTaxesIncluded: true,
432
+ priceWithTaxesIncluded: false,
433
433
  applicationCost: 0,
434
434
  turnoverMonthly: [
435
435
  {
@@ -1,7 +1,7 @@
1
1
  export enum Supervision {
2
2
  WAITING = 1,
3
- SIGNED = 3,
4
- TO_ATTEST = 6,
3
+ /* SIGNED = 3,
4
+ TO_ATTEST = 6, */
5
5
  ATTESTED = 7,
6
6
  ATTEST_REFUSED = 8,
7
7
  ATTEST_WITH_OBSERVATIONS = 9,
@@ -18,7 +18,7 @@ export const SupervisionStateList = [
18
18
  color: 'grey',
19
19
  textColor: 'grey--text',
20
20
  },
21
- {
21
+ /* {
22
22
  id: Supervision.SIGNED,
23
23
  label: 'Signé',
24
24
  color: 'green darken-1',
@@ -29,7 +29,7 @@ export const SupervisionStateList = [
29
29
  label: 'A attesté',
30
30
  color: 'yellow darken-3',
31
31
  textColor: 'yellow--text text--darken-1',
32
- },
32
+ }, */
33
33
  {
34
34
  id: Supervision.ATTESTED,
35
35
  label: 'Attesté',
@@ -28,4 +28,5 @@ export interface PaymentAuto {
28
28
  idPrestation: number;
29
29
  idPaymentMethod: number;
30
30
  closingDate: Date;
31
+ comment?: string;
31
32
  }
@@ -30,10 +30,15 @@ export class QueryPaginatedBalanceSheetSupervision extends RequiredQueryPaginate
30
30
  @IsArray()
31
31
  bankCollectingState?: number[];
32
32
 
33
+ @ApiPropertyOptional()
34
+ @IsOptional()
35
+ @IsArray()
36
+ typeBrand?: number[];
37
+
33
38
  @ApiPropertyOptional()
34
39
  @IsOptional()
35
40
  @IsInt()
36
- closingTime?: number | null;
41
+ totalRange?: number | null;
37
42
 
38
43
  @ApiPropertyOptional()
39
44
  @IsOptional()
@@ -56,12 +61,6 @@ export class QueryPaginatedBalanceSheetSupervision extends RequiredQueryPaginate
56
61
  @ToBoolean()
57
62
  isBack?: boolean | null;
58
63
 
59
- @ApiPropertyOptional()
60
- @IsOptional()
61
- @IsBoolean()
62
- @ToBoolean()
63
- displayArchive?: boolean | null;
64
-
65
64
  @ApiPropertyOptional()
66
65
  @IsOptional()
67
66
  @IsArray()
@@ -72,4 +71,15 @@ export class QueryPaginatedBalanceSheetSupervision extends RequiredQueryPaginate
72
71
  @IsInt()
73
72
  expertSelected?: number | null;
74
73
 
74
+ @ApiPropertyOptional()
75
+ @IsOptional()
76
+ @IsString()
77
+ orderBy?: string | null;
78
+
79
+ @ApiPropertyOptional()
80
+ @IsOptional()
81
+ @IsBoolean()
82
+ @ToBoolean()
83
+ descending?: boolean | null;
84
+
75
85
  }
@@ -5,6 +5,7 @@ export interface ISocialDetail {
5
5
  priceDsn: number;
6
6
  ras: boolean;
7
7
  freqCibt: number | null;
8
+ idPaymentMethod: number;
8
9
  idSociety: number;
9
10
  createdAt?: Date | null;
10
11
  updatedAt?: Date | null;
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- import { IPayment, IRegulation, ParamsForPaymentsAuto, PaymentMethod, PaymentAuto, getTaxesIncludedAmount, LegalFormTypeEnum } from '../types';
3
+ import { IPayment, IRegulation, ParamsForPaymentsAuto, PaymentMethod, PaymentAuto, getTaxesIncludedAmount } from '../types';
4
4
  import * as dayjs from 'dayjs';
5
5
  import { PartialExercicePrestationExpress } from '../types/Interface/api/payment/Util';
6
- import { getPriceGrid } from './prestation';
6
+ import { getApplicationFeesAmount, getPriceGrid } from './prestation';
7
7
 
8
8
  interface PaymentsWithList extends IPayment {
9
9
  type: 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther',
@@ -101,7 +101,7 @@ const calculatePaymentsAuto = (params: ParamsForPaymentsAuto):PaymentAuto[] => {
101
101
  if (!priceGrid) throw new Error('Impossible de trouver la grille tarifaire correspondante');
102
102
  const { applicationCost, priceWithTaxesIncluded } = priceGrid;
103
103
  const applicationCostTotalTTC = (priceWithTaxesIncluded ? applicationCost : getTaxesIncludedAmount(applicationCost, idVat)) * 12;
104
- const applicationFeesAmount = (idLegalForm === LegalFormTypeEnum.SCI) ? 150 : 50;
104
+ const applicationFeesAmountTTC = getApplicationFeesAmount(idLegalForm, idVat);
105
105
 
106
106
  if (prestationList?.isCatalog || !prestationList?.isComptable) throw new Error('Ce type de prestation ne correspond pas aux conditions attendues.');
107
107
  // if (!listRegulations?.length) throw new Error('List of regulations can not be empty');
@@ -120,6 +120,7 @@ const calculatePaymentsAuto = (params: ParamsForPaymentsAuto):PaymentAuto[] => {
120
120
  const payload = JSON.parse(r.paymentsExpectation?.payload);
121
121
  if (+payload?.applicationFee > 0) {
122
122
  isApplicationFeesAlreadyPaid = true;
123
+ acc += +payload?.applicationFee;
123
124
  }
124
125
  if (+payload?.accountingFee > 0) acc += +payload?.accountingFee;
125
126
  return acc;
@@ -140,26 +141,42 @@ const calculatePaymentsAuto = (params: ParamsForPaymentsAuto):PaymentAuto[] => {
140
141
  //On ajoute un paiement initial correspondant à la somme des régulations
141
142
  if (sumRegulations) {
142
143
  listPayments.push({
143
- amount:sumRegulations, //TTC
144
+ amount: isApplicationFeesAlreadyPaid ? sumRegulations - applicationFeesAmountTTC : sumRegulations, //TTC
144
145
  isPaid: true,
145
146
  datePayment: dayjs().toDate(),
146
147
  idPrestation,
147
- idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,
148
+ idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,
148
149
  closingDate: listPartialExercicePrestationExpress?.length ? listPartialExercicePrestationExpress[0].endDate : firstExerciceNonExpresssEndDate,
149
150
  });
150
151
  }
151
152
 
152
- // Si les frais de dossiers sont facturés et qu'ils n'ont pas déjà été payés,
153
- // on ajoute un paiement sur la première mensualité non express
154
- if (isWithApplicationFees && !isApplicationFeesAlreadyPaid) {
155
- listPayments.push({
156
- amount: getTaxesIncludedAmount(applicationFeesAmount, idVat), //TTC
157
- isPaid: false,
158
- datePayment: dayjs().startOf('month').add(1, 'month').toDate(),
159
- idPrestation,
160
- idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,
161
- closingDate: listPartialExercicePrestationExpress?.length ? listPartialExercicePrestationExpress[0].endDate : firstExerciceNonExpresssEndDate,
162
- });
153
+ // Si les frais de dossiers sont facturés ,
154
+ if (isWithApplicationFees) {
155
+ if (isApplicationFeesAlreadyPaid) {
156
+ //et qu'ils ont déjà été payés
157
+ // on ajoute un paiement sur le mois en cours
158
+ listPayments.push({
159
+ amount: applicationFeesAmountTTC, //TTC
160
+ isPaid: true,
161
+ datePayment: dayjs().toDate(),
162
+ idPrestation,
163
+ idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,
164
+ closingDate: listPartialExercicePrestationExpress?.length ? listPartialExercicePrestationExpress[0].endDate : firstExerciceNonExpresssEndDate,
165
+ comment: 'Frais de dossier',
166
+ });
167
+ } else {
168
+ //et qu'ils n'ont pas déjà été payés
169
+ // on ajoute un paiement sur la première mensualité non express
170
+ listPayments.push({
171
+ amount: applicationFeesAmountTTC, //TTC
172
+ isPaid: false,
173
+ datePayment: dayjs().startOf('month').add(1, 'month').toDate(),
174
+ idPrestation,
175
+ idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,
176
+ closingDate: listPartialExercicePrestationExpress?.length ? listPartialExercicePrestationExpress[0].endDate : firstExerciceNonExpresssEndDate,
177
+ comment: 'Frais de dossier',
178
+ });
179
+ }
163
180
  }
164
181
 
165
182
  // =========================
@@ -227,7 +244,7 @@ const calculatePaymentsAuto = (params: ParamsForPaymentsAuto):PaymentAuto[] => {
227
244
 
228
245
  // Si on a ajouté une ligne pour les applications fees, alors on les déduit du montant total
229
246
  if (isFirstNonExpress && isWithApplicationFees && !isApplicationFeesAlreadyPaid) {
230
- remainingAmount -= getTaxesIncludedAmount(applicationFeesAmount, idVat);
247
+ remainingAmount -= applicationFeesAmountTTC;
231
248
  }
232
249
 
233
250
  let remainingAmountByExercicePrestation = remainingAmount;
@@ -1,4 +1,5 @@
1
1
  import { IExercice, IPrestation, IPrestationList } from '../types';
2
+ import { getTaxesIncludedAmount } from './vat/utils';
2
3
  import { intersection } from './noLodash';
3
4
  import { PrestationDetail, PrestationType } from '../types/Enum/PrestationType';
4
5
  import { LegalFormTypeEnum } from '../types/Enum/LegalForm';
@@ -156,7 +157,7 @@ export const getPriceGrid = (idTypeBrand: number, idPrestationList: number): pri
156
157
  const calculatePrestationPriceWithPriceGrid = (
157
158
  idPrestationList: number,
158
159
  endDate: string,
159
- NbrMonth: number,
160
+ NbrMonth: number, /* Nbr de mois dans l'exercice */
160
161
  turnover: number,
161
162
  rentsNumber: number,
162
163
  employeesNumber: number,
@@ -164,12 +165,12 @@ const calculatePrestationPriceWithPriceGrid = (
164
165
  idTypeBrand: number,
165
166
  idVatRegime: number,
166
167
  pastBalanceSheet: boolean,
167
- isYearly: boolean,
168
- totalMonth: number,
168
+ isYearly: boolean, /* Prestation annuel ou mensuel */
169
+ totalMonth: number, /* Nbr de moiis offer */
169
170
  idTaxSystem: number,
170
171
  idLegalForm: number,
171
172
  exerciceNbr: number,
172
- balanceSheetOffered: number = 0,
173
+ balanceSheetOffered: number = 0, /* montant du bilan offer */
173
174
  ): {
174
175
  totalPrestation: number,
175
176
  reduceMonth: number,
@@ -201,6 +202,7 @@ const calculatePrestationPriceWithPriceGrid = (
201
202
  if (currentPriceGrid.taxSystem && idTaxSystem) taxSystemPrice = currentPriceGrid.taxSystem?.find(tax => tax.id === idTaxSystem)?.price;
202
203
 
203
204
  /* Gestion des montants */
205
+ /* Récupératioin des prix mensuels */
204
206
  if (currentPriceGrid.turnoverMonthly && !isYearly) monthlyPrice = currentPriceGrid.turnoverMonthly?.find(turn => turnover < turn.turnoverValue)?.price;
205
207
  else if (currentPriceGrid.properties) monthlyPrice = currentPriceGrid.properties?.find(property => property.amount === rentsNumber)?.price;
206
208
  else if (currentPriceGrid.employee) {
@@ -209,12 +211,14 @@ const calculatePrestationPriceWithPriceGrid = (
209
211
  } else if (currentPriceGrid.employeeByLegalForm) {
210
212
  monthlyPrice = currentPriceGrid.employeeByLegalForm?.find(emp => emp.idLegalForm === idLegalForm)?.price;
211
213
  monthlyPrice = monthlyPrice ? monthlyPrice * employeesNumber : 0;
214
+ /* Récupération des prix annuels */
212
215
  } else if (currentPriceGrid.turnoverYearly && isYearly) yearlyPrice = currentPriceGrid.turnoverYearly?.find(turn => turnover < turn.turnoverValue)?.price;
213
216
  else if (!pastBalanceSheet && currentPriceGrid.turnoverCreatedYear) yearlyPrice = currentPriceGrid.turnoverCreatedYear?.find(turn => turnover < turn.turnoverValue)?.price;
214
217
  else if (pastBalanceSheet && currentPriceGrid.turnoverPastYear) yearlyPrice = currentPriceGrid.turnoverPastYear?.find(turn => turnover < turn.turnoverValue)?.price;
215
218
  else if (currentPriceGrid.partner) yearlyPrice = currentPriceGrid.partner?.find(part => part.amountMinimum <= associatesNumber && part.amountMaximum >= associatesNumber)?.price;
216
219
  else if (currentPriceGrid.legalForm) yearlyPrice = currentPriceGrid.legalForm?.find(form => form.idLegalForm === idLegalForm)?.price;
217
220
  else if (currentPriceGrid.exerciceNbr) yearlyPrice = currentPriceGrid.exerciceNbr?.find(el => el.minimum <= exerciceNbr && exerciceNbr <= el.maximum )?.price;
221
+ /* Calcul du prix mensuel final */
218
222
  finalMonthlyPrice = (monthlyPrice ? monthlyPrice : 0) + (vatRegimePrice ? vatRegimePrice : 0) + (taxSystemPrice ? taxSystemPrice : 0);
219
223
 
220
224
  /* Gestion des mois */
@@ -231,14 +235,17 @@ const calculatePrestationPriceWithPriceGrid = (
231
235
  }
232
236
  }
233
237
  }
238
+ /* Gestion des offres, mois offer */
234
239
  if (totalMonth > 0) {
235
240
  if (monthlyNbr && ((monthNbr - totalMonth) < monthlyNbr?.minimum)) canBeCreated = false;
236
241
  monthNbr = monthNbr - totalMonth;
237
242
  recalculateMonthly = true;
238
243
  }
239
244
 
245
+ /* Calcul du nombre de mois soustraient */
240
246
  reduceMonth = (monthNbr === NbrMonth - totalMonth ? totalMonth : 0);
241
247
 
248
+ /* Gestion des offres, bilan offer */
242
249
  if (balanceSheetOffered > 0) {
243
250
  yearlyPrice = undefined;
244
251
  recalculateMonthly = false;
@@ -248,7 +255,7 @@ const calculatePrestationPriceWithPriceGrid = (
248
255
  /* Prix Final */
249
256
  totalPrestation = (yearlyPrice ? yearlyPrice : finalMonthlyPrice * monthNbr);
250
257
  }
251
- return { totalPrestation, reduceMonth, canBeCreated, monthNbr: yearlyPrice ? 0 : recalculateMonthly ? NbrMonth : monthNbr, price: yearlyPrice ? yearlyPrice : recalculateMonthly ? (totalPrestation / NbrMonth) : (finalMonthlyPrice ? finalMonthlyPrice : 0) };
258
+ return { totalPrestation, reduceMonth, canBeCreated, monthNbr: yearlyPrice ? 0 : recalculateMonthly ? NbrMonth : monthNbr, price: yearlyPrice ? yearlyPrice : recalculateMonthly ? (totalPrestation / monthNbr) : (finalMonthlyPrice ? finalMonthlyPrice : 0) };
252
259
  };
253
260
 
254
261
  const calculatePrestationPriceWithPrestationList = (prestationList: IPrestationList): number => {
@@ -259,11 +266,28 @@ const calculatePrestationPriceWithPrestationList = (prestationList: IPrestationL
259
266
  return totalPrestation;
260
267
  };
261
268
 
269
+ /**
270
+ * From idLegalForm, get application fees amount (without taxes included if no idVat passed, or with taxes included calculated by given idVat)
271
+ * @param idLegalForm
272
+ * @param idVat
273
+ * @returns amount of application fees, without taxes included
274
+ */
275
+ const getApplicationFeesAmount = (idLegalForm: number, idVat?: number) =>{
276
+ let applicationFeesAmount = 50;
277
+ if (idLegalForm === LegalFormTypeEnum.SCI) applicationFeesAmount = 150;
278
+
279
+ //Sans tva, on envoie le montant HT
280
+ if (!idVat) return applicationFeesAmount;
281
+
282
+ //Avec tva, on envoie le montant TTC
283
+ return getTaxesIncludedAmount(applicationFeesAmount, idVat);
284
+ };
285
+
262
286
  const calculatePrestationPrice = (
263
287
  idPrestationList: number,
264
288
  prestationList: IPrestationList,
265
289
  endDate: string,
266
- NbrMonth: number,
290
+ NbrMonth: number, /* Nbr de mois dans l'exercice */
267
291
  turnover: number,
268
292
  rentsNumber: number,
269
293
  employeesNumber: number,
@@ -272,13 +296,13 @@ const calculatePrestationPrice = (
272
296
  idVatRegime: number,
273
297
  pastBalanceSheet: boolean,
274
298
  optionsList: number[],
275
- totalPercentage: number,
276
- totalAmount: number,
277
- totalMonth: number,
278
- isWithApplicationFees: boolean,
299
+ totalPercentage: number, /* total pourcentage offer (%) */
300
+ totalAmount: number, /* total montant offer (€) */
301
+ totalMonth: number, /* total mois offer (mois) */
302
+ isWithApplicationFees: boolean, /* frais de dossier */
279
303
  idTaxSystem: number,
280
304
  idLegalForm: number,
281
- isYearly: boolean = false,
305
+ isYearly: boolean = false, /* prestation annuel ou mensuel */
282
306
  isSubPrestation: boolean = false,
283
307
  balanceSheetOffered: number = 0,
284
308
  exerciceList: IExercice[] = [],
@@ -354,8 +378,12 @@ const calculatePrestationPrice = (
354
378
  totalPrestation = calculatePrestationPriceWithPrestationList(prestationList);
355
379
  if ([PrestationType.CREATION_SOCIETE].includes(idPrestationList) && !isSubPrestation) totalPrestation += 50;
356
380
  }
381
+ /* Gestion des offres */
382
+ /* Offre montant offer */
357
383
  if (totalAmount > 0) totalPrestation = totalPrestation - totalAmount;
384
+ /* Offre pourcentage offer */
358
385
  if (totalPercentage > 0) totalPrestation = totalPrestation - (totalPrestation * (totalPercentage / 100));
386
+ /* Gesstioin du prix minimum acceptable pour la prestation */
359
387
  if (prestationList.minimumPrice && totalPrestation < prestationList.minimumPrice) totalPrestation = prestationList.minimumPrice;
360
388
  /* Gestion des options */
361
389
  let OptionTotalPrice: number = 0;
@@ -366,10 +394,10 @@ const calculatePrestationPrice = (
366
394
  });
367
395
  }
368
396
  totalPrestation += (OptionTotalPrice ? OptionTotalPrice : 0);
369
-
397
+ /* Gestion des frais de dossier */
370
398
  if (isWithApplicationFees) {
371
- if (idLegalForm === LegalFormTypeEnum.SCI) totalPrestation += 150;
372
- else totalPrestation += 50;
399
+ const applicationFeesAmount = getApplicationFeesAmount(idLegalForm);
400
+ totalPrestation += applicationFeesAmount;
373
401
  }
374
402
 
375
403
  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€' : ''}`;
@@ -401,5 +429,5 @@ const isAbleToUpdatePrice = (idTypeBrand: number, idPrestationList: number, turn
401
429
  };
402
430
 
403
431
  export {
404
- isOtherAccountingMissions, isOtherJuridicalMissions, isAdditionalPresta, isOtherSocialMission, isOnlyPrevi, isOnlySocial, isOnlyJuridic, isCreation, isFromStatutsExpress, isExpress, calculateScoringOfPrestation, calculatePrestationPrice, getPrestationOptions, isAbleToUpdatePrice, calculatePrestationPriceWithPriceGrid,
432
+ isOtherAccountingMissions, isOtherJuridicalMissions, isAdditionalPresta, isOtherSocialMission, isOnlyPrevi, isOnlySocial, isOnlyJuridic, isCreation, isFromStatutsExpress, isExpress, calculateScoringOfPrestation, calculatePrestationPrice, getPrestationOptions, isAbleToUpdatePrice, calculatePrestationPriceWithPriceGrid, getApplicationFeesAmount,
405
433
  };