@silexpert/core 1.1.318 → 1.1.320
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/resources/CalendarEvent.d.ts +2 -1
- package/dist/cjs/api/resources/CalendarEvent.d.ts.map +1 -1
- package/dist/cjs/api/resources/CalendarEvent.js +3 -0
- package/dist/cjs/api/resources/CalendarEvent.js.map +1 -1
- package/dist/cjs/api/resources/UserTimeSlot.d.ts +1 -0
- package/dist/cjs/api/resources/UserTimeSlot.d.ts.map +1 -1
- package/dist/cjs/api/resources/UserTimeSlot.js +3 -0
- package/dist/cjs/api/resources/UserTimeSlot.js.map +1 -1
- package/dist/cjs/types/Enum/CommercialOfferType.js +7 -7
- package/dist/cjs/types/Enum/CommercialOfferType.js.map +1 -1
- package/dist/cjs/types/Enum/GeneralThirdParty.d.ts.map +1 -1
- package/dist/cjs/types/Enum/GeneralThirdParty.js +2 -0
- package/dist/cjs/types/Enum/GeneralThirdParty.js.map +1 -1
- package/dist/cjs/types/Enum/MissionAcceptation.d.ts.map +1 -1
- package/dist/cjs/types/Enum/MissionAcceptation.js +1 -0
- package/dist/cjs/types/Enum/MissionAcceptation.js.map +1 -1
- package/dist/cjs/types/Enum/TimeCounterType.d.ts +44 -0
- package/dist/cjs/types/Enum/TimeCounterType.d.ts.map +1 -1
- package/dist/cjs/types/Enum/TimeCounterType.js +44 -0
- package/dist/cjs/types/Enum/TimeCounterType.js.map +1 -1
- package/dist/cjs/types/Enum/TimeSlot.d.ts +2 -1
- package/dist/cjs/types/Enum/TimeSlot.d.ts.map +1 -1
- package/dist/cjs/types/Enum/TimeSlot.js +10 -0
- package/dist/cjs/types/Enum/TimeSlot.js.map +1 -1
- package/dist/cjs/types/Interface/api/accountingEntry/Create.d.ts +2 -1
- package/dist/cjs/types/Interface/api/accountingEntry/Create.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/accountingEntry/Create.js +8 -1
- package/dist/cjs/types/Interface/api/accountingEntry/Create.js.map +1 -1
- package/dist/cjs/types/Interface/api/calendarEvent/countCalendarEvent.d.ts +7 -0
- package/dist/cjs/types/Interface/api/calendarEvent/countCalendarEvent.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/calendarEvent/countCalendarEvent.js +38 -0
- package/dist/cjs/types/Interface/api/calendarEvent/countCalendarEvent.js.map +1 -0
- package/dist/cjs/types/Interface/api/payment/CreateNotifyCustomerInvoice.d.ts +0 -4
- package/dist/cjs/types/Interface/api/payment/CreateNotifyCustomerInvoice.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/payment/CreateNotifyCustomerInvoice.js +1 -18
- package/dist/cjs/types/Interface/api/payment/CreateNotifyCustomerInvoice.js.map +1 -1
- package/dist/cjs/types/Interface/api/registration/CreateRegistration.d.ts +12 -11
- package/dist/cjs/types/Interface/api/registration/CreateRegistration.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/registration/CreateRegistration.js +4 -0
- package/dist/cjs/types/Interface/api/registration/CreateRegistration.js.map +1 -1
- package/dist/cjs/types/Interface/api/revision/Read.d.ts +2 -1
- package/dist/cjs/types/Interface/api/revision/Read.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/revision/Read.js.map +1 -1
- package/dist/cjs/types/Interface/models/IStatistic.d.ts +1 -1
- package/dist/cjs/types/Interface/models/IStatistic.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IStatistic.js.map +1 -1
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/utils/payment.d.ts.map +1 -1
- package/dist/cjs/utils/payment.js +11 -7
- package/dist/cjs/utils/payment.js.map +1 -1
- package/dist/mjs/api/resources/CalendarEvent.d.ts +2 -1
- package/dist/mjs/api/resources/CalendarEvent.d.ts.map +1 -1
- package/dist/mjs/api/resources/CalendarEvent.js +4 -0
- package/dist/mjs/api/resources/CalendarEvent.js.map +1 -1
- package/dist/mjs/api/resources/UserTimeSlot.d.ts +1 -0
- package/dist/mjs/api/resources/UserTimeSlot.d.ts.map +1 -1
- package/dist/mjs/api/resources/UserTimeSlot.js +5 -0
- package/dist/mjs/api/resources/UserTimeSlot.js.map +1 -1
- package/dist/mjs/types/Enum/CommercialOfferType.js +7 -7
- package/dist/mjs/types/Enum/CommercialOfferType.js.map +1 -1
- package/dist/mjs/types/Enum/GeneralThirdParty.d.ts.map +1 -1
- package/dist/mjs/types/Enum/GeneralThirdParty.js +2 -0
- package/dist/mjs/types/Enum/GeneralThirdParty.js.map +1 -1
- package/dist/mjs/types/Enum/MissionAcceptation.d.ts.map +1 -1
- package/dist/mjs/types/Enum/MissionAcceptation.js +1 -0
- package/dist/mjs/types/Enum/MissionAcceptation.js.map +1 -1
- package/dist/mjs/types/Enum/TimeCounterType.d.ts +44 -0
- package/dist/mjs/types/Enum/TimeCounterType.d.ts.map +1 -1
- package/dist/mjs/types/Enum/TimeCounterType.js +44 -0
- package/dist/mjs/types/Enum/TimeCounterType.js.map +1 -1
- package/dist/mjs/types/Enum/TimeSlot.d.ts +2 -1
- package/dist/mjs/types/Enum/TimeSlot.d.ts.map +1 -1
- package/dist/mjs/types/Enum/TimeSlot.js +10 -0
- package/dist/mjs/types/Enum/TimeSlot.js.map +1 -1
- package/dist/mjs/types/Interface/api/accountingEntry/Create.d.ts +2 -1
- package/dist/mjs/types/Interface/api/accountingEntry/Create.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/accountingEntry/Create.js +9 -1
- package/dist/mjs/types/Interface/api/accountingEntry/Create.js.map +1 -1
- package/dist/mjs/types/Interface/api/calendarEvent/countCalendarEvent.d.ts +7 -0
- package/dist/mjs/types/Interface/api/calendarEvent/countCalendarEvent.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/calendarEvent/countCalendarEvent.js +38 -0
- package/dist/mjs/types/Interface/api/calendarEvent/countCalendarEvent.js.map +1 -0
- package/dist/mjs/types/Interface/api/payment/CreateNotifyCustomerInvoice.d.ts +0 -4
- package/dist/mjs/types/Interface/api/payment/CreateNotifyCustomerInvoice.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/payment/CreateNotifyCustomerInvoice.js +1 -19
- package/dist/mjs/types/Interface/api/payment/CreateNotifyCustomerInvoice.js.map +1 -1
- package/dist/mjs/types/Interface/api/registration/CreateRegistration.d.ts +12 -11
- package/dist/mjs/types/Interface/api/registration/CreateRegistration.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/registration/CreateRegistration.js +5 -0
- package/dist/mjs/types/Interface/api/registration/CreateRegistration.js.map +1 -1
- package/dist/mjs/types/Interface/api/revision/Read.d.ts +2 -1
- package/dist/mjs/types/Interface/api/revision/Read.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/revision/Read.js.map +1 -1
- package/dist/mjs/types/Interface/models/IStatistic.d.ts +1 -1
- package/dist/mjs/types/Interface/models/IStatistic.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IStatistic.js.map +1 -1
- package/dist/mjs/types/index.d.ts +1 -0
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +1 -0
- package/dist/mjs/types/index.js.map +1 -1
- package/dist/mjs/utils/payment.d.ts.map +1 -1
- package/dist/mjs/utils/payment.js +11 -7
- package/dist/mjs/utils/payment.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/CalendarEvent.ts +6 -0
- package/ts/api/resources/UserTimeSlot.ts +6 -0
- package/ts/types/Enum/CommercialOfferType.ts +7 -7
- package/ts/types/Enum/GeneralThirdParty.ts +2 -0
- package/ts/types/Enum/MissionAcceptation.ts +1 -0
- package/ts/types/Enum/TimeCounterType.ts +44 -0
- package/ts/types/Enum/TimeSlot.ts +10 -0
- package/ts/types/Interface/api/accountingEntry/Create.ts +8 -2
- package/ts/types/Interface/api/calendarEvent/countCalendarEvent.ts +20 -0
- package/ts/types/Interface/api/payment/CreateNotifyCustomerInvoice.ts +1 -15
- package/ts/types/Interface/api/registration/CreateRegistration.ts +14 -11
- package/ts/types/Interface/api/revision/Read.ts +2 -0
- package/ts/types/Interface/models/IStatistic.ts +1 -1
- package/ts/types/index.ts +1 -0
- package/ts/utils/payment.ts +12 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../ts/utils/payment.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAgD,aAAa,EAAe,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAC5H,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAOtE;;;;;;;;;GASG;AACH,MAAM,0BAA0B,GAAG,CAAC,QAAoB,EAAE,QAAoE,CAAC,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,CAAC,EAAsB,EAAE;IACzM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,IAAI,KAAK,CAAC,CAAC;IAChH,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,IAAI,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC;IAC3J,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,IAAI,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,CAAC,CAAC;IACjK,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,mBAAmB,EAAE,eA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vE,uDAAuD;IACvD,mCAAmC,IAAI,uBAAuB,CAAC;IAE/D,MAAM,aAAa,GAAG,mCAAmC,GAAG,4BAA4B,CAAC;IAEzF,yCAAyC;IACzC,IAAI,CAAC,YAAY,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEpC,OAAO,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC;QACjE,IAAI,MAAM,GAAG,aAAa,CAAC;QAE3B,iDAAiD;QACjD,yGAAyG;QACzG,uDAAuD;QACvD,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QAExD,YAAY,CAAC,IAAI,CAAC;YAChB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG;YACtC,WAAW,EAAE,WAAW;YACxB,YAAY;YACZ,eAAe,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE;YAC9C,WAAW,EAAE,eAAe;SAC7B,CAAC,CAAC;QACH,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7E,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,OAAO,EACL,0BAA0B,EAAE,qBAAqB,GAClD,CAAC","sourcesContent":["'use strict';\n\nimport { IPayment, IRegulation, ParamsForPaymentsAuto, PaymentMethod, PaymentAuto, getTaxesIncludedAmount } from '../types';\nimport * as dayjs from 'dayjs';\nimport { PartialExercicePrestationExpress } from '../types/Interface/api/payment/Util';\nimport { getApplicationFeesAmount, getPriceGrid } from './prestation';\n\ninterface PaymentsWithList extends IPayment {\n type: 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther',\n listPayments: IPayment[]\n}\n\n/**\n * A partir d'une liste de payment (avec include jusqu'à prestationList, \n * avec en attributs 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther')\n * permet de récupérer uniquement le premier paiement de chaque type \n * et les autres payments dans listPayments\n * avec possibilité de filtrer avec le tableau de filtres\n * @param payments \n * @param types \n * @returns \n */\nconst groupPaymentsByServiceType = (payments: IPayment[], types: ('isComptable' | 'isJuridique' | 'isSocial' | 'isOther')[] = ['isComptable', 'isJuridique', 'isSocial', 'isOther']): PaymentsWithList[] => {\n const prestaComptable = payments.filter((el) => el?.paymentsPrestations?.prestationsList?.isComptable ?? false);\n const prestaSocial = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isSocial);\n const prestaJuridique = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isJuridique);\n const prestaOther = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && !el?.paymentsPrestations?.prestationsList?.isJuridique && !el?.paymentsPrestations?.prestationsList?.isSocial);\n \n const societyPayment: PaymentsWithList[] = [];\n if (prestaComptable.length && types.includes('isComptable')) {\n societyPayment.push({\n ...prestaComptable[0], // Données de base\n type: 'isComptable',\n listPayments: prestaComptable,\n });\n }\n if (prestaSocial.length && types.includes('isSocial')) {\n societyPayment.push({\n ...prestaSocial[0], // Données de base\n type: 'isSocial',\n listPayments: prestaSocial,\n });\n }\n if (prestaJuridique.length && types.includes('isJuridique')) {\n societyPayment.push({\n ...prestaJuridique[0], // Données de base\n type: 'isJuridique',\n listPayments: prestaJuridique,\n });\n }\n if (prestaOther.length && types.includes('isOther')) {\n societyPayment.push({\n ...prestaOther[0], // Données de base\n type: 'isOther',\n listPayments: prestaOther,\n });\n }\n return societyPayment;\n};\n\nconst calculateFees = (amount: number, goToClient: Date, paymentDate: Date):number => {\n const yearlyPriceIncreasing = 1.0275;\n\n const oneYearLessIfIn3LastMonthsOfYear = dayjs(goToClient).month() >= 9 ? 1 : 0;\n\n if (dayjs(paymentDate).year() - dayjs().year() > 0) {\n const nbYearsMore = dayjs(paymentDate).year() - dayjs().year() - oneYearLessIfIn3LastMonthsOfYear;\n // on applique X fois l'augmentation\n // ex. : si on lance l'appel en 2024, et qu'on génére un paiement pour 2026, on applique 2 fois l'augmentation\n // soit amount * yearlyPriceIncreasing * yearlyPriceIncreasing\n // soit amount * yearlyPriceIncreasing ^ nbYearsMore\n amount = amount * Math.pow(yearlyPriceIncreasing, nbYearsMore);\n }\n return amount;\n};\n\n/**\n// * @param {number} firstPaymentAmount - amount of the first payment (first regulation of the customer)\n * @param {Date} firstExerciceNonExpresssEndDate - end date of the first exercice non express\n * @param {number} idPrestation - prestation id\n * @param {number} idLegalForm - legal form id of the society\n * @param {boolean} isWithApplicationFees - if the prestation has application fees to paid\n * @param {IPrestationList} prestationList - type of prestation (hidden: 0, isCatalog: 1, isComptable: 1)\n * @param {number} idVat - vat id of society linked\n * @param {number} yearlyAmountNonExpress - yearly amount of non express prestation (HT)\n * @param {number} nextYearlyAmountNonExpress - yearly amount of non express prestation for next years (HT)\n * @param {PartialExercicePrestationExpress[]} listPartialExercicePrestationExpress - list of exercicePrestation linked to idPrestation -> used to get express\n * @param {IRegulation[]} listRegulations - list of regulations linked to idPrestation (TTC)\n * @param {Date} recoveryDate - date of recovery of the society\n * @returns { IPayment[] } list of payment to create for billing auto, after each presta go to onBoarding\n */\nconst calculatePaymentsAuto = (params: ParamsForPaymentsAuto):PaymentAuto[] => {\n const { idTypeBrand, goToClient, isWithApplicationFees, firstExerciceNonExpresssEndDate, idPrestation, idLegalForm, prestationList, idVat, yearlyAmountNonExpress, nextYearlyAmountNonExpress, listPartialExercicePrestationExpress, listRegulations, recoveryDate } = params;\n let initializedPaymentDate = dayjs().endOf('month').diff(dayjs(), 'day') < 3/* || dayjs().date() >= 15 */\n ? dayjs().add(2, 'month').startOf('month').toDate()\n : dayjs().add(1, 'month').startOf('month').toDate();\n \n //Si date de reprise, alors on initialise à cette date\n if (recoveryDate && dayjs(recoveryDate).isAfter(dayjs(), 'month')) {\n initializedPaymentDate = dayjs(recoveryDate).startOf('month').toDate();\n }\n\n // On récupère la grille tarifaire pour savoir si les tarifs sont HT ou TTC \n // et pour connaitre le montant du coût de l'app\n if (!prestationList.id) throw new Error('idPrestationList manquant');\n const priceGrid = getPriceGrid(idTypeBrand, prestationList.id);\n if (!priceGrid) throw new Error('Impossible de trouver la grille tarifaire correspondante');\n const { applicationCost, priceWithTaxesIncluded } = priceGrid;\n const applicationCostTotalTTC = (priceWithTaxesIncluded ? applicationCost : getTaxesIncludedAmount(applicationCost, idVat)) * 12;\n const applicationFeesAmountTTC = getApplicationFeesAmount(idLegalForm, idVat);\n\n if (prestationList?.isCatalog || !prestationList?.isComptable) throw new Error('Ce type de prestation ne correspond pas aux conditions attendues.');\n if (listPartialExercicePrestationExpress.length && listPartialExercicePrestationExpress?.some((ep: PartialExercicePrestationExpress) => !ep?.startDate)) throw new Error('Start date of some exercice are missing');\n\n const nbExoExpress = listPartialExercicePrestationExpress.length;\n const listPayments:PaymentAuto[] = [];\n\n // on récupère le/les premiers réglements effectués, non alloués\n // const isApplicationFeesAlreadyPaid = false;\n const sumRegulations = listRegulations.reduce((acc: number, r:IRegulation) => {\n //Si la regulation est rattachée à un paymentExpectation, on récupère le détail\n // et on ne prend que les frais de dossier (applicationFee) + le montant de la compta (accountingFee)\n \n // Commenté temporairement :\n // Pour l'instant, on ne prend plus en compte les paymentExpectation :\n // On part du principe que si isWithApplicationFees = true, alors les regulations contiennent les frais de dossier\n // sinon, ils sont offerts et n'apparaissent pas\n /* if (r.paymentsExpectation?.payload) {\n const payload = JSON.parse(r.paymentsExpectation?.payload);\n if (+payload?.applicationFee > 0) {\n isApplicationFeesAlreadyPaid = true;\n acc += +payload?.applicationFee;\n }\n if (+payload?.accountingFee > 0) acc += +payload?.accountingFee;\n return acc;\n } else {\n return acc + r.amount - r.amountUsed;\n } */\n return acc + r.amount - r.amountUsed;\n }, 0);\n let remainingAmount = -sumRegulations; //TTC\n let paymentDate = initializedPaymentDate;\n\n //On order les exercicePrestation par startDate ASC et id ASC\n listPartialExercicePrestationExpress.sort((a, b) => {\n const aStartDate = a?.startDate as Date;\n const bStartDate = b?.startDate as Date;\n return dayjs(aStartDate).diff(bStartDate);\n });\n\n // Si les frais de dossiers sont facturés, on ajoute un paiement sur le mois en cours\n if (isWithApplicationFees) {\n listPayments.push({\n amount: applicationFeesAmountTTC, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: listPartialExercicePrestationExpress?.length ? listPartialExercicePrestationExpress[0].endDate : firstExerciceNonExpresssEndDate,\n comment: 'Frais de dossier',\n });\n remainingAmount += applicationFeesAmountTTC;\n }\n \n // =========================\n // EXPRESS\n // =========================\n listPartialExercicePrestationExpress.forEach((exercicePrestation:PartialExercicePrestationExpress, indexEP: number) => {\n const remainingBeforeThisExo = remainingAmount;\n\n remainingAmount += !priceWithTaxesIncluded \n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat) \n : exercicePrestation.totalAmount; //TTC\n \n \n // Si le premier règlement couvre le coût de cet exercicePrestation, \n // on créé un paiement pour cet exo et on passe au suivant\n if (remainingAmount <= 0) {\n listPayments.push({\n amount: Math.round(100 * (!priceWithTaxesIncluded \n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat) \n : exercicePrestation.totalAmount)) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n return;\n } else if (remainingBeforeThisExo < 0 && remainingAmount > 0) {\n // Si le paiement couvre une partie du paiement, on créé un paiement pour cette partie lié à l'exo \n listPayments.push({\n amount: Math.round(100 * -remainingBeforeThisExo) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n }\n \n //express : on étale en countExpressMonthlyPayment (nb de mensualités)\n let remainingAmountByExercicePrestation = remainingAmount; //TTC\n let countExpressMonthlyPayment = exercicePrestation?.countExpressMonthlyPayment ?? 3; //TTC\n //Si un premier règlement est généré avec le montant des regulations, on le considère comme une mensualité (unioquement pour le premier express et la première mensualité)\n if (indexEP === 0 && sumRegulations > 0) countExpressMonthlyPayment -= 1;\n\n const monthlyAmount = remainingAmountByExercicePrestation / countExpressMonthlyPayment; //TTC\n for (let index = 1; index <= countExpressMonthlyPayment; index++) {\n // On arrondis les 11 premières mensualités, mais on récupère le reste pour la dernière mensualité, pour éviter les centimes perdus en arrondis\n // et on applique le taux de tva de la société\n const amount = index < countExpressMonthlyPayment ? monthlyAmount : remainingAmountByExercicePrestation; //TTC\n \n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n remainingAmountByExercicePrestation -= monthlyAmount; \n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n remainingAmount = 0;\n });\n\n // =========================\n // NON EXPRESS\n // =========================\n // on lisse sur le nb de mois restants (avec au minimum 3 mensualités)\n // Si un seul exo express, alors on met les paiements de l'exo actuel en parallèle\n // sinon, ils sont à la suite des express\n if (nbExoExpress <= 1) paymentDate = initializedPaymentDate;\n let exerciceEndDate = dayjs(firstExerciceNonExpresssEndDate).toDate();\n\n let hasGeneratedWholeYear = false;\n let isFirstNonExpress = true;\n \n //On génère des paiements jusqu'à ce qu'un exercice soit entier (12 mois), non express\n while (!hasGeneratedWholeYear) {\n \n //On compte le nb de mois restants entre la date à laquelle le paiement va être créé et la date de fin d'exercice\n let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));\n if (countMonthsBeforeExerciceEnd < 3) countMonthsBeforeExerciceEnd = 3;\n\n const exoAmount = isFirstNonExpress ? yearlyAmountNonExpress : nextYearlyAmountNonExpress;\n const remainingBeforeThisExo = remainingAmount;\n remainingAmount += priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat);\n\n // Si le premier règlement couvre le coût de cet exercicePrestation, \n // on créé un paiement pour cet exo et on passe au suivant\n if (remainingAmount <= 0) {\n listPayments.push({\n amount: Math.round(100 * (priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat))) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n exerciceEndDate = dayjs(exerciceEndDate).startOf('month').add(1, 'year').endOf('month').toDate();\n continue;\n } else if (remainingBeforeThisExo < 0 && remainingAmount > 0) {\n // Si le paiement couvre une partie du paiement, on créé un paiement pour cette partie lié à l'exo \n listPayments.push({\n amount: Math.round(100 * -remainingBeforeThisExo) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n }\n\n let remainingAmountByExercicePrestation = remainingAmount;\n\n // - frais d'application dès les second exo non express\n if (!isFirstNonExpress) remainingAmountByExercicePrestation += applicationCostTotalTTC;\n\n const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd; //TTC\n\n if (monthlyAmount > 0) {\n for (let index = 1; index <= countMonthsBeforeExerciceEnd; index++) {\n let amount = index < countMonthsBeforeExerciceEnd ? monthlyAmount : remainingAmountByExercicePrestation;\n \n // Si besoin, on applique les frais nécessaires :\n // - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)\n amount = calculateFees(amount, goToClient, paymentDate);\n \n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n remainingAmountByExercicePrestation -= monthlyAmount; \n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n exerciceEndDate = dayjs(exerciceEndDate).startOf('month').add(1, 'year').endOf('month').toDate();\n }\n remainingAmount = 0;\n if (countMonthsBeforeExerciceEnd === 12) hasGeneratedWholeYear = true;\n isFirstNonExpress = false;\n }\n\n remainingAmount = 0;\n\n // =========================\n // JUSQU'EN DECEMBRE\n // =========================\n // On applique le taux de tva de la société, si besoin, selon la grille tarifaire\n remainingAmount += priceWithTaxesIncluded ? nextYearlyAmountNonExpress : getTaxesIncludedAmount(nextYearlyAmountNonExpress, idVat);\n\n let remainingAmountByExercicePrestation = remainingAmount;\n //On compte le nb de mois restants entre la date à laquelle le paiement va être créé et la date de fin d'exercice\n let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));\n if (countMonthsBeforeExerciceEnd < 3) countMonthsBeforeExerciceEnd = 3;\n\n // - frais d'application dès les second exo non express\n remainingAmountByExercicePrestation += applicationCostTotalTTC;\n \n const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd;\n \n // Si aucun paiement généré, on stoppe là\n if (!listPayments.length) return [];\n\n while (dayjs(listPayments.slice(-1)[0].datePayment).month() < 11) {\n let amount = monthlyAmount;\n\n // Si besoin, on applique les frais nécessaires :\n // - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)\n // - frais d'application dès les second exo non express\n amount = calculateFees(amount, goToClient, paymentDate);\n\n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n\n return listPayments;\n};\n\nexport {\n groupPaymentsByServiceType, calculatePaymentsAuto,\n};"]}
|
|
1
|
+
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../ts/utils/payment.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAgD,aAAa,EAAe,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAC5H,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAOtE;;;;;;;;;GASG;AACH,MAAM,0BAA0B,GAAG,CAAC,QAAoB,EAAE,QAAoE,CAAC,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,CAAC,EAAsB,EAAE;IACzM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,IAAI,KAAK,CAAC,CAAC;IAChH,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,IAAI,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC;IAC3J,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,IAAI,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,CAAC,CAAC;IACjK,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WA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W,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IACvG,IAAI,4BAA4B,GAAG,CAAC;QAAE,4BAA4B,GAAG,CAAC,CAAC;IAEvE,uDAAuD;IACvD,mCAAmC,IAAI,uBAAuB,CAAC;IAE/D,MAAM,aAAa,GAAG,mCAAmC,GAAG,4BAA4B,CAAC;IAEzF,yCAAyC;IACzC,IAAI,CAAC,YAAY,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEpC,OAAO,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC;QACjE,IAAI,MAAM,GAAG,aAAa,CAAC;QAE3B,iDAAiD;QACjD,yGAAyG;QACzG,uDAAuD;QACvD,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QAExD,YAAY,CAAC,IAAI,CAAC;YAChB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG;YACtC,WAAW,EAAE,WAAW;YACxB,YAAY;YACZ,eAAe,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE;YAC9C,WAAW,EAAE,eAAe;SAC7B,CAAC,CAAC;QACH,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7E,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,OAAO,EACL,0BAA0B,EAAE,qBAAqB,GAClD,CAAC","sourcesContent":["'use strict';\n\nimport { IPayment, IRegulation, ParamsForPaymentsAuto, PaymentMethod, PaymentAuto, getTaxesIncludedAmount } from '../types';\nimport * as dayjs from 'dayjs';\nimport { PartialExercicePrestationExpress } from '../types/Interface/api/payment/Util';\nimport { getApplicationFeesAmount, getPriceGrid } from './prestation';\n\ninterface PaymentsWithList extends IPayment {\n type: 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther',\n listPayments: IPayment[]\n}\n\n/**\n * A partir d'une liste de payment (avec include jusqu'à prestationList, \n * avec en attributs 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther')\n * permet de récupérer uniquement le premier paiement de chaque type \n * et les autres payments dans listPayments\n * avec possibilité de filtrer avec le tableau de filtres\n * @param payments \n * @param types \n * @returns \n */\nconst groupPaymentsByServiceType = (payments: IPayment[], types: ('isComptable' | 'isJuridique' | 'isSocial' | 'isOther')[] = ['isComptable', 'isJuridique', 'isSocial', 'isOther']): PaymentsWithList[] => {\n const prestaComptable = payments.filter((el) => el?.paymentsPrestations?.prestationsList?.isComptable ?? false);\n const prestaSocial = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isSocial);\n const prestaJuridique = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isJuridique);\n const prestaOther = payments.filter((el) => !el?.paymentsPrestations?.prestationsList?.isComptable && !el?.paymentsPrestations?.prestationsList?.isJuridique && !el?.paymentsPrestations?.prestationsList?.isSocial);\n \n const societyPayment: PaymentsWithList[] = [];\n if (prestaComptable.length && types.includes('isComptable')) {\n societyPayment.push({\n ...prestaComptable[0], // Données de base\n type: 'isComptable',\n listPayments: prestaComptable,\n });\n }\n if (prestaSocial.length && types.includes('isSocial')) {\n societyPayment.push({\n ...prestaSocial[0], // Données de base\n type: 'isSocial',\n listPayments: prestaSocial,\n });\n }\n if (prestaJuridique.length && types.includes('isJuridique')) {\n societyPayment.push({\n ...prestaJuridique[0], // Données de base\n type: 'isJuridique',\n listPayments: prestaJuridique,\n });\n }\n if (prestaOther.length && types.includes('isOther')) {\n societyPayment.push({\n ...prestaOther[0], // Données de base\n type: 'isOther',\n listPayments: prestaOther,\n });\n }\n return societyPayment;\n};\n\nconst calculateFees = (amount: number, goToClient: Date, paymentDate: Date):number => {\n const yearlyPriceIncreasing = 1.0275;\n\n const oneYearLessIfIn3LastMonthsOfYear = dayjs(goToClient).month() >= 9 ? 1 : 0;\n\n if (dayjs(paymentDate).year() - dayjs().year() > 0) {\n const nbYearsMore = dayjs(paymentDate).year() - dayjs().year() - oneYearLessIfIn3LastMonthsOfYear;\n // on applique X fois l'augmentation\n // ex. : si on lance l'appel en 2024, et qu'on génére un paiement pour 2026, on applique 2 fois l'augmentation\n // soit amount * yearlyPriceIncreasing * yearlyPriceIncreasing\n // soit amount * yearlyPriceIncreasing ^ nbYearsMore\n amount = amount * Math.pow(yearlyPriceIncreasing, nbYearsMore);\n }\n return amount;\n};\n\n/**\n// * @param {number} firstPaymentAmount - amount of the first payment (first regulation of the customer)\n * @param {Date} firstExerciceNonExpresssEndDate - end date of the first exercice non express\n * @param {number} idPrestation - prestation id\n * @param {number} idLegalForm - legal form id of the society\n * @param {boolean} isWithApplicationFees - if the prestation has application fees to paid\n * @param {IPrestationList} prestationList - type of prestation (hidden: 0, isCatalog: 1, isComptable: 1)\n * @param {number} idVat - vat id of society linked\n * @param {number} yearlyAmountNonExpress - yearly amount of non express prestation (HT)\n * @param {number} nextYearlyAmountNonExpress - yearly amount of non express prestation for next years (HT)\n * @param {PartialExercicePrestationExpress[]} listPartialExercicePrestationExpress - list of exercicePrestation linked to idPrestation -> used to get express\n * @param {IRegulation[]} listRegulations - list of regulations linked to idPrestation (TTC)\n * @param {Date} recoveryDate - date of recovery of the society\n * @returns { IPayment[] } list of payment to create for billing auto, after each presta go to onBoarding\n */\nconst calculatePaymentsAuto = (params: ParamsForPaymentsAuto):PaymentAuto[] => {\n const { idTypeBrand, goToClient, isWithApplicationFees, firstExerciceNonExpresssEndDate, idPrestation, idLegalForm, prestationList, idVat, yearlyAmountNonExpress, nextYearlyAmountNonExpress, listPartialExercicePrestationExpress, listRegulations, recoveryDate } = params;\n \n if (!yearlyAmountNonExpress) throw new Error('Le montant annuel des prestations non express ne peut pas être nul.');\n\n let initializedPaymentDate = dayjs().endOf('month').diff(dayjs(), 'day') < 3/* || dayjs().date() >= 15 */\n ? dayjs().add(2, 'month').startOf('month').toDate()\n : dayjs().add(1, 'month').startOf('month').toDate();\n \n //Si date de reprise, alors on initialise à cette date\n if (recoveryDate && dayjs(recoveryDate).isAfter(dayjs(), 'month')) {\n initializedPaymentDate = dayjs(recoveryDate).startOf('month').toDate();\n }\n\n // On récupère la grille tarifaire pour savoir si les tarifs sont HT ou TTC \n // et pour connaitre le montant du coût de l'app\n if (!prestationList.id) throw new Error('idPrestationList manquant');\n const priceGrid = getPriceGrid(idTypeBrand, prestationList.id);\n if (!priceGrid) throw new Error('Impossible de trouver la grille tarifaire correspondante');\n const { applicationCost, priceWithTaxesIncluded } = priceGrid;\n const applicationCostTotalTTC = (priceWithTaxesIncluded ? applicationCost : getTaxesIncludedAmount(applicationCost, idVat)) * 12;\n const applicationFeesAmountTTC = getApplicationFeesAmount(idLegalForm, idVat);\n\n if (prestationList?.isCatalog || !prestationList?.isComptable) throw new Error('Ce type de prestation ne correspond pas aux conditions attendues.');\n if (listPartialExercicePrestationExpress.length && listPartialExercicePrestationExpress?.some((ep: PartialExercicePrestationExpress) => !ep?.startDate)) throw new Error('Start date of some exercice are missing');\n\n const nbExoExpress = listPartialExercicePrestationExpress.length;\n const listPayments:PaymentAuto[] = [];\n\n // on récupère le/les premiers réglements effectués, non alloués\n // const isApplicationFeesAlreadyPaid = false;\n const sumRegulations = listRegulations.reduce((acc: number, r:IRegulation) => {\n //Si la regulation est rattachée à un paymentExpectation, on récupère le détail\n // et on ne prend que les frais de dossier (applicationFee) + le montant de la compta (accountingFee)\n \n // Commenté temporairement :\n // Pour l'instant, on ne prend plus en compte les paymentExpectation :\n // On part du principe que si isWithApplicationFees = true, alors les regulations contiennent les frais de dossier\n // sinon, ils sont offerts et n'apparaissent pas\n /* if (r.paymentsExpectation?.payload) {\n const payload = JSON.parse(r.paymentsExpectation?.payload);\n if (+payload?.applicationFee > 0) {\n isApplicationFeesAlreadyPaid = true;\n acc += +payload?.applicationFee;\n }\n if (+payload?.accountingFee > 0) acc += +payload?.accountingFee;\n return acc;\n } else {\n return acc + r.amount - r.amountUsed;\n } */\n return acc + r.amount - r.amountUsed;\n }, 0);\n let remainingAmount = -sumRegulations; //TTC\n let paymentDate = initializedPaymentDate;\n\n //On order les exercicePrestation par startDate ASC et id ASC\n listPartialExercicePrestationExpress.sort((a, b) => {\n const aStartDate = a?.startDate as Date;\n const bStartDate = b?.startDate as Date;\n return dayjs(aStartDate).diff(bStartDate);\n });\n\n // Si les frais de dossiers sont facturés, on ajoute un paiement sur le mois en cours\n if (isWithApplicationFees) {\n listPayments.push({\n amount: applicationFeesAmountTTC, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: listPartialExercicePrestationExpress?.length ? listPartialExercicePrestationExpress[0].endDate : firstExerciceNonExpresssEndDate,\n comment: 'Frais de dossier',\n });\n remainingAmount += applicationFeesAmountTTC;\n }\n \n // =========================\n // EXPRESS\n // =========================\n listPartialExercicePrestationExpress.forEach((exercicePrestation:PartialExercicePrestationExpress, indexEP: number) => {\n const remainingBeforeThisExo = remainingAmount;\n\n remainingAmount += !priceWithTaxesIncluded \n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat) \n : exercicePrestation.totalAmount; //TTC\n \n \n // Si le premier règlement couvre le coût de cet exercicePrestation, \n // on créé un paiement pour cet exo et on passe au suivant\n if (remainingAmount <= 0) {\n listPayments.push({\n amount: Math.round(100 * (!priceWithTaxesIncluded \n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat) \n : exercicePrestation.totalAmount)) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n return;\n } else if (remainingBeforeThisExo < 0 && remainingAmount > 0) {\n // Si le paiement couvre une partie du paiement, on créé un paiement pour cette partie lié à l'exo \n listPayments.push({\n amount: Math.round(100 * -remainingBeforeThisExo) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n }\n \n //express : on étale en countExpressMonthlyPayment (nb de mensualités)\n let remainingAmountByExercicePrestation = remainingAmount; //TTC\n let countExpressMonthlyPayment = exercicePrestation?.countExpressMonthlyPayment ?? 3; //TTC\n //Si un premier règlement est généré avec le montant des regulations, on le considère comme une mensualité (unioquement pour le premier express et la première mensualité)\n if (indexEP === 0 && sumRegulations > 0) countExpressMonthlyPayment -= 1;\n\n const monthlyAmount = remainingAmountByExercicePrestation / countExpressMonthlyPayment; //TTC\n for (let index = 1; index <= countExpressMonthlyPayment; index++) {\n // On arrondis les 11 premières mensualités, mais on récupère le reste pour la dernière mensualité, pour éviter les centimes perdus en arrondis\n // et on applique le taux de tva de la société\n const amount = index < countExpressMonthlyPayment ? monthlyAmount : remainingAmountByExercicePrestation; //TTC\n \n // On évite les paiements de moins d'0,01 € (pour les paymentsExpectations ayant une différence de 1 cents)\n if (amount >= 0.005)\n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exercicePrestation.endDate,\n });\n remainingAmountByExercicePrestation -= monthlyAmount; \n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n remainingAmount = 0;\n });\n\n // =========================\n // NON EXPRESS\n // =========================\n // on lisse sur le nb de mois restants (avec au minimum 3 mensualités)\n // Si un seul exo express, alors on met les paiements de l'exo actuel en parallèle\n // sinon, ils sont à la suite des express\n if (nbExoExpress <= 1) paymentDate = initializedPaymentDate;\n let exerciceEndDate = dayjs(firstExerciceNonExpresssEndDate).toDate();\n\n let hasGeneratedWholeYear = false;\n let isFirstNonExpress = true;\n \n //On génère des paiements jusqu'à ce qu'un exercice soit entier (12 mois), non express\n while (!hasGeneratedWholeYear) {\n \n //On compte le nb de mois restants entre la date à laquelle le paiement va être créé et la date de fin d'exercice\n let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));\n if (countMonthsBeforeExerciceEnd < 3) countMonthsBeforeExerciceEnd = 3;\n\n const exoAmount = isFirstNonExpress ? yearlyAmountNonExpress : nextYearlyAmountNonExpress;\n const remainingBeforeThisExo = remainingAmount;\n remainingAmount += priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat);\n\n // Si le premier règlement couvre le coût de cet exercicePrestation, \n // on créé un paiement pour cet exo et on passe au suivant\n if (remainingAmount <= 0) {\n listPayments.push({\n amount: Math.round(100 * (priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat))) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n exerciceEndDate = dayjs(exerciceEndDate).startOf('month').add(1, 'year').endOf('month').toDate();\n continue;\n } else if (remainingBeforeThisExo < 0 && remainingAmount > 0) {\n // Si le paiement couvre une partie du paiement, on créé un paiement pour cette partie lié à l'exo \n listPayments.push({\n amount: Math.round(100 * -remainingBeforeThisExo) / 100, //TTC\n isPaid: true,\n datePayment: dayjs().toDate(),\n idPrestation,\n idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n }\n\n let remainingAmountByExercicePrestation = remainingAmount;\n\n // - frais d'application dès les second exo non express\n if (!isFirstNonExpress) remainingAmountByExercicePrestation += applicationCostTotalTTC;\n\n const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd; //TTC\n\n if (monthlyAmount > 0) {\n for (let index = 1; index <= countMonthsBeforeExerciceEnd; index++) {\n let amount = index < countMonthsBeforeExerciceEnd ? monthlyAmount : remainingAmountByExercicePrestation;\n \n // Si besoin, on applique les frais nécessaires :\n // - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)\n amount = calculateFees(amount, goToClient, paymentDate);\n \n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n remainingAmountByExercicePrestation -= monthlyAmount; \n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n exerciceEndDate = dayjs(exerciceEndDate).startOf('month').add(1, 'year').endOf('month').toDate();\n }\n remainingAmount = 0;\n if (countMonthsBeforeExerciceEnd === 12) hasGeneratedWholeYear = true;\n isFirstNonExpress = false;\n }\n\n remainingAmount = 0;\n\n // =========================\n // JUSQU'EN DECEMBRE\n // =========================\n // On applique le taux de tva de la société, si besoin, selon la grille tarifaire\n remainingAmount += priceWithTaxesIncluded ? nextYearlyAmountNonExpress : getTaxesIncludedAmount(nextYearlyAmountNonExpress, idVat);\n\n let remainingAmountByExercicePrestation = remainingAmount;\n //On compte le nb de mois restants entre la date à laquelle le paiement va être créé et la date de fin d'exercice\n let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));\n if (countMonthsBeforeExerciceEnd < 3) countMonthsBeforeExerciceEnd = 3;\n\n // - frais d'application dès les second exo non express\n remainingAmountByExercicePrestation += applicationCostTotalTTC;\n \n const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd;\n \n // Si aucun paiement généré, on stoppe là\n if (!listPayments.length) return [];\n\n while (dayjs(listPayments.slice(-1)[0].datePayment).month() < 11) {\n let amount = monthlyAmount;\n\n // Si besoin, on applique les frais nécessaires :\n // - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)\n // - frais d'application dès les second exo non express\n amount = calculateFees(amount, goToClient, paymentDate);\n\n listPayments.push({\n amount: Math.round(100 * amount) / 100,\n datePayment: paymentDate,\n idPrestation,\n idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,\n closingDate: exerciceEndDate,\n });\n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n }\n\n return listPayments;\n};\n\nexport {\n groupPaymentsByServiceType, calculatePaymentsAuto,\n};"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.320",
|
|
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,5 +1,6 @@
|
|
|
1
1
|
import { CancelToken } from 'axios';
|
|
2
2
|
import {
|
|
3
|
+
CountCalendarEvent,
|
|
3
4
|
CreateCalendarEventForUsers, GetAllCalendarEvent, GetLastInvalidateEvent, ICalendarEvent, ICalendarEventUser, QueryCalendarEvent, QueryCalendarEventCall, ReadAllCalendarEvent, ReadCalendarEventCall, UpdateCalendarEvent, VerifyCalendarEvent,
|
|
4
5
|
} from '../../types';
|
|
5
6
|
import { Resource } from '../Resource';
|
|
@@ -25,6 +26,11 @@ export class CalendarEvent extends Resource {
|
|
|
25
26
|
return this.axios.$get('/calendar-events/all', { ...(cancelToken ? { cancelToken } : {}), params });
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
count(params: CountCalendarEvent, signal?: AbortSignal): Promise<number> {
|
|
30
|
+
return this.axios.$get('/calendar-events/count', { params,
|
|
31
|
+
...(signal ? { signal } : {}) });
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
calculateRealtimeEvent(params: GetAllCalendarEvent): Promise<number> {
|
|
29
35
|
return this.axios.$get('/calendar-events/calculate-realtime-event', { params });
|
|
30
36
|
}
|
|
@@ -10,6 +10,12 @@ export class UserTimeSlot extends Resource {
|
|
|
10
10
|
return this.axios.$post('users-time-slots', payload);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
public update(id: number, params: Partial<IUserTimeSlot>): Promise<IUserTimeSlot> {
|
|
14
|
+
return this.axios.$put(`users-time-slots/${id}`, {
|
|
15
|
+
...params,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
public delete(id: number): Promise<IUserTimeSlot> {
|
|
14
20
|
return this.axios.$delete(`users-time-slots/${id}`);
|
|
15
21
|
}
|
|
@@ -34,7 +34,7 @@ export const CommercialOfferTypeDetail = {
|
|
|
34
34
|
RECOVERY_MONTH : {
|
|
35
35
|
id: 1,
|
|
36
36
|
label: '% de reprise sur les mois',
|
|
37
|
-
text: '%value% %
|
|
37
|
+
text: '%value% % offerts sur les mois de reprise, valable jusqu\'au %dateEnd%.',
|
|
38
38
|
amountType: CommercialOfferAmountType.PERCENTAGE,
|
|
39
39
|
idPrestationList: [],
|
|
40
40
|
isComptable: true,
|
|
@@ -43,8 +43,8 @@ export const CommercialOfferTypeDetail = {
|
|
|
43
43
|
},
|
|
44
44
|
MONTH_OFFERED : {
|
|
45
45
|
id: 2,
|
|
46
|
-
label: 'Nb de mois
|
|
47
|
-
text: '%value% mois
|
|
46
|
+
label: 'Nb de mois offerts',
|
|
47
|
+
text: '%value% mois offerts, valable jusqu\'au %dateEnd%.',
|
|
48
48
|
amountType: CommercialOfferAmountType.MONTH,
|
|
49
49
|
idPrestationList: [],
|
|
50
50
|
isComptable: true,
|
|
@@ -53,8 +53,8 @@ export const CommercialOfferTypeDetail = {
|
|
|
53
53
|
},
|
|
54
54
|
AMOUNT_OFFERED : {
|
|
55
55
|
id: 3,
|
|
56
|
-
label: 'Montant
|
|
57
|
-
text: '%value% euros
|
|
56
|
+
label: 'Montant offerts',
|
|
57
|
+
text: '%value% euros offerts, valable jusqu\'au %dateEnd%.',
|
|
58
58
|
amountType: CommercialOfferAmountType.MONEY,
|
|
59
59
|
idPrestationList: [],
|
|
60
60
|
isComptable: true,
|
|
@@ -83,8 +83,8 @@ export const CommercialOfferTypeDetail = {
|
|
|
83
83
|
},
|
|
84
84
|
PERCENTAGE_OFFERED : {
|
|
85
85
|
id: 6,
|
|
86
|
-
label: '%
|
|
87
|
-
text: '%value% %
|
|
86
|
+
label: '% offerts',
|
|
87
|
+
text: '%value% % offerts sur l\'année, valable jusqu\'au %dateEnd%.',
|
|
88
88
|
amountType: CommercialOfferAmountType.PERCENTAGE,
|
|
89
89
|
idPrestationList: [],
|
|
90
90
|
isComptable: null,
|
|
@@ -97,6 +97,8 @@ export const generalThirdParties: GeneralThirdParty[] = [
|
|
|
97
97
|
{ company:'SUBWAY', idAccount:58383, number:'625300' },
|
|
98
98
|
{ company:'NORAUTO', idAccount:58379, number:'615210' },
|
|
99
99
|
{ company:'RED BY SFR', idAccount:123, number:'626200' },
|
|
100
|
+
{ company:'FREE', idAccount:123, number:'626200' },
|
|
101
|
+
{ company:'FREE MOBILE', idAccount:123, number:'626200' },
|
|
100
102
|
{ company:'SUMUP', idAccount:126, number:'627100' },
|
|
101
103
|
{ company:'REXEL', idAccount:27586, number:'218300' },
|
|
102
104
|
{ company:'GRAND FRAIS', idAccount:117, number:'625100' },
|
|
@@ -7,6 +7,7 @@ export const TimeCounterType = {
|
|
|
7
7
|
aberrantTime: 60,
|
|
8
8
|
limitedRoles: [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.DATA_OFFICER],
|
|
9
9
|
color: 'fire',
|
|
10
|
+
isOverlappable: false,
|
|
10
11
|
},
|
|
11
12
|
VAT: {
|
|
12
13
|
id: 2,
|
|
@@ -14,6 +15,7 @@ export const TimeCounterType = {
|
|
|
14
15
|
aberrantTime: 60,
|
|
15
16
|
limitedRoles: [Role.MANAGER, Role.EXPERT_ACCOUNTANT, Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.DATA_OFFICER],
|
|
16
17
|
color: 'iris',
|
|
18
|
+
isOverlappable: true,
|
|
17
19
|
},
|
|
18
20
|
REVISION: {
|
|
19
21
|
id: 3,
|
|
@@ -21,6 +23,7 @@ export const TimeCounterType = {
|
|
|
21
23
|
aberrantTime: 120,
|
|
22
24
|
limitedRoles: [Role.MANAGER, Role.EXPERT_ACCOUNTANT, Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.DATA_OFFICER],
|
|
23
25
|
color: 'bubblegum-light',
|
|
26
|
+
isOverlappable: true,
|
|
24
27
|
},
|
|
25
28
|
FOLDER_REVIEW: {
|
|
26
29
|
id: 4,
|
|
@@ -28,6 +31,7 @@ export const TimeCounterType = {
|
|
|
28
31
|
aberrantTime: 60,
|
|
29
32
|
limitedRoles: [Role.MANAGER, Role.EXPERT_ACCOUNTANT, Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.DATA_OFFICER],
|
|
30
33
|
color: 'cerulean',
|
|
34
|
+
isOverlappable: true,
|
|
31
35
|
},
|
|
32
36
|
REPORTING: {
|
|
33
37
|
id: 5,
|
|
@@ -35,6 +39,7 @@ export const TimeCounterType = {
|
|
|
35
39
|
aberrantTime: 60,
|
|
36
40
|
limitedRoles: [Role.CUSTOMER_SUCCESS, Role.ON_BOARDER, Role.TERMINATION, Role.LITIGE],
|
|
37
41
|
color: 'lipstick-dark',
|
|
42
|
+
isOverlappable: true,
|
|
38
43
|
},
|
|
39
44
|
SYNCHRONISATION: {
|
|
40
45
|
id: 6,
|
|
@@ -42,6 +47,7 @@ export const TimeCounterType = {
|
|
|
42
47
|
aberrantTime: 30,
|
|
43
48
|
limitedRoles: [Role.CUSTOMER_SUCCESS, Role.ON_BOARDER, Role.TERMINATION, Role.LITIGE],
|
|
44
49
|
color: 'orange-dark',
|
|
50
|
+
isOverlappable: true,
|
|
45
51
|
},
|
|
46
52
|
UNDER_SUPERVISION: {
|
|
47
53
|
id: 7,
|
|
@@ -49,6 +55,7 @@ export const TimeCounterType = {
|
|
|
49
55
|
aberrantTime: 45,
|
|
50
56
|
limitedRoles: null,
|
|
51
57
|
color: 'orange-dark',
|
|
58
|
+
isOverlappable: true,
|
|
52
59
|
},
|
|
53
60
|
CLIENT_CONTACT: {
|
|
54
61
|
id: 8,
|
|
@@ -56,6 +63,7 @@ export const TimeCounterType = {
|
|
|
56
63
|
aberrantTime: 20,
|
|
57
64
|
limitedRoles: null,
|
|
58
65
|
color: 'orange-light',
|
|
66
|
+
isOverlappable: false,
|
|
59
67
|
},
|
|
60
68
|
MEETING: {
|
|
61
69
|
id: 9,
|
|
@@ -63,6 +71,7 @@ export const TimeCounterType = {
|
|
|
63
71
|
aberrantTime: 20,
|
|
64
72
|
limitedRoles: null,
|
|
65
73
|
color: 'fern-dark',
|
|
74
|
+
isOverlappable: false,
|
|
66
75
|
},
|
|
67
76
|
FORMATION: {
|
|
68
77
|
id: 10,
|
|
@@ -70,6 +79,7 @@ export const TimeCounterType = {
|
|
|
70
79
|
aberrantTime: 20,
|
|
71
80
|
limitedRoles: null,
|
|
72
81
|
color: 'fern',
|
|
82
|
+
isOverlappable: false,
|
|
73
83
|
},
|
|
74
84
|
FORECAST: {
|
|
75
85
|
id: 11,
|
|
@@ -77,6 +87,7 @@ export const TimeCounterType = {
|
|
|
77
87
|
aberrantTime: 20,
|
|
78
88
|
limitedRoles: [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.DATA_OFFICER],
|
|
79
89
|
color: 'cerulean-light',
|
|
90
|
+
isOverlappable: true,
|
|
80
91
|
},
|
|
81
92
|
CERTIFICATE: {
|
|
82
93
|
id: 12,
|
|
@@ -84,6 +95,7 @@ export const TimeCounterType = {
|
|
|
84
95
|
aberrantTime: 20,
|
|
85
96
|
limitedRoles: [Role.CUSTOMER_SUCCESS, Role.ON_BOARDER, Role.TERMINATION, Role.LITIGE],
|
|
86
97
|
color: 'pink-salmon',
|
|
98
|
+
isOverlappable: true,
|
|
87
99
|
},
|
|
88
100
|
COMPLEMENTARY_MISSION: {
|
|
89
101
|
id: 13,
|
|
@@ -91,6 +103,7 @@ export const TimeCounterType = {
|
|
|
91
103
|
aberrantTime: 20,
|
|
92
104
|
limitedRoles: [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.DATA_OFFICER],
|
|
93
105
|
color: 'cerulean-light',
|
|
106
|
+
isOverlappable: true,
|
|
94
107
|
},
|
|
95
108
|
ORGANISATION: {
|
|
96
109
|
id: 14,
|
|
@@ -98,6 +111,7 @@ export const TimeCounterType = {
|
|
|
98
111
|
aberrantTime: 20,
|
|
99
112
|
limitedRoles: null,
|
|
100
113
|
color: 'fern-light',
|
|
114
|
+
isOverlappable: false,
|
|
101
115
|
},
|
|
102
116
|
INTERNAL_ADVICE: {
|
|
103
117
|
id: 15,
|
|
@@ -105,6 +119,7 @@ export const TimeCounterType = {
|
|
|
105
119
|
aberrantTime: 20,
|
|
106
120
|
limitedRoles: null,
|
|
107
121
|
color: 'fern-light',
|
|
122
|
+
isOverlappable: true,
|
|
108
123
|
},
|
|
109
124
|
LAB: {
|
|
110
125
|
id: 16,
|
|
@@ -112,6 +127,7 @@ export const TimeCounterType = {
|
|
|
112
127
|
aberrantTime: 20,
|
|
113
128
|
limitedRoles: [Role.EXPERT_ACCOUNTANT],
|
|
114
129
|
color: 'fire',
|
|
130
|
+
isOverlappable: true,
|
|
115
131
|
},
|
|
116
132
|
SUPERVISION: {
|
|
117
133
|
id: 17,
|
|
@@ -119,6 +135,7 @@ export const TimeCounterType = {
|
|
|
119
135
|
aberrantTime: 20,
|
|
120
136
|
limitedRoles: [Role.EXPERT_ACCOUNTANT, Role.MANAGER],
|
|
121
137
|
color: 'bubblegum-dark',
|
|
138
|
+
isOverlappable: true,
|
|
122
139
|
},
|
|
123
140
|
MAIL_PROCESSING: {
|
|
124
141
|
id: 18,
|
|
@@ -126,6 +143,7 @@ export const TimeCounterType = {
|
|
|
126
143
|
aberrantTime: 20,
|
|
127
144
|
limitedRoles: [Role.CUSTOMER_SUCCESS, Role.ON_BOARDER, Role.TERMINATION, Role.LITIGE],
|
|
128
145
|
color: 'pink-salmon',
|
|
146
|
+
isOverlappable: true,
|
|
129
147
|
},
|
|
130
148
|
SUPPORT_PROCESSING: {
|
|
131
149
|
id: 19,
|
|
@@ -133,6 +151,7 @@ export const TimeCounterType = {
|
|
|
133
151
|
aberrantTime: 20,
|
|
134
152
|
limitedRoles: [Role.CUSTOMER_SUCCESS, Role.ON_BOARDER, Role.TERMINATION, Role.LITIGE],
|
|
135
153
|
color: 'error',
|
|
154
|
+
isOverlappable: true,
|
|
136
155
|
},
|
|
137
156
|
BILAN: {
|
|
138
157
|
id: 20,
|
|
@@ -140,6 +159,7 @@ export const TimeCounterType = {
|
|
|
140
159
|
aberrantTime: 120,
|
|
141
160
|
limitedRoles: [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.DATA_OFFICER, Role.EXPERT_ACCOUNTANT],
|
|
142
161
|
color: 'cerulean-dark',
|
|
162
|
+
isOverlappable: true,
|
|
143
163
|
},
|
|
144
164
|
PAYSLIP: {
|
|
145
165
|
id: 21,
|
|
@@ -147,6 +167,7 @@ export const TimeCounterType = {
|
|
|
147
167
|
aberrantTime: 30,
|
|
148
168
|
limitedRoles: [Role.SOCIAL],
|
|
149
169
|
color: 'guacamole',
|
|
170
|
+
isOverlappable: true,
|
|
150
171
|
},
|
|
151
172
|
SOCIAL_PARAMETER: {
|
|
152
173
|
id: 22,
|
|
@@ -154,6 +175,7 @@ export const TimeCounterType = {
|
|
|
154
175
|
aberrantTime: 40,
|
|
155
176
|
limitedRoles: [Role.SOCIAL],
|
|
156
177
|
color: 'guacamole',
|
|
178
|
+
isOverlappable: true,
|
|
157
179
|
},
|
|
158
180
|
WORK_CONTRACT: {
|
|
159
181
|
id: 23,
|
|
@@ -161,6 +183,7 @@ export const TimeCounterType = {
|
|
|
161
183
|
aberrantTime: 60,
|
|
162
184
|
limitedRoles: [Role.SOCIAL],
|
|
163
185
|
color: 'guacamole',
|
|
186
|
+
isOverlappable: true,
|
|
164
187
|
},
|
|
165
188
|
DPAE: {
|
|
166
189
|
id: 24,
|
|
@@ -168,6 +191,7 @@ export const TimeCounterType = {
|
|
|
168
191
|
aberrantTime: 25,
|
|
169
192
|
limitedRoles: [Role.SOCIAL],
|
|
170
193
|
color: 'guacamole',
|
|
194
|
+
isOverlappable: true,
|
|
171
195
|
},
|
|
172
196
|
FACTURATION: {
|
|
173
197
|
id: 25,
|
|
@@ -175,6 +199,7 @@ export const TimeCounterType = {
|
|
|
175
199
|
aberrantTime: 180,
|
|
176
200
|
limitedRoles: null,
|
|
177
201
|
color: 'success',
|
|
202
|
+
isOverlappable: true,
|
|
178
203
|
},
|
|
179
204
|
LEGAL_DOCUMENT: {
|
|
180
205
|
id: 26,
|
|
@@ -182,6 +207,7 @@ export const TimeCounterType = {
|
|
|
182
207
|
aberrantTime: 30,
|
|
183
208
|
limitedRoles: [Role.JURIDIC],
|
|
184
209
|
color: 'caramel',
|
|
210
|
+
isOverlappable: true,
|
|
185
211
|
},
|
|
186
212
|
INFOGREFFE: {
|
|
187
213
|
id: 27,
|
|
@@ -189,6 +215,7 @@ export const TimeCounterType = {
|
|
|
189
215
|
aberrantTime: 15,
|
|
190
216
|
limitedRoles: [Role.JURIDIC],
|
|
191
217
|
color: 'caramel',
|
|
218
|
+
isOverlappable: true,
|
|
192
219
|
},
|
|
193
220
|
APPOINTMENT: {
|
|
194
221
|
id: 28,
|
|
@@ -196,6 +223,7 @@ export const TimeCounterType = {
|
|
|
196
223
|
aberrantTime: 15,
|
|
197
224
|
limitedRoles: null,
|
|
198
225
|
color: 'orange-light',
|
|
226
|
+
isOverlappable: false,
|
|
199
227
|
},
|
|
200
228
|
PHYSIC_UPKEEP: {
|
|
201
229
|
id: 29,
|
|
@@ -203,6 +231,7 @@ export const TimeCounterType = {
|
|
|
203
231
|
aberrantTime: 30,
|
|
204
232
|
limitedRoles: null,
|
|
205
233
|
color: 'success',
|
|
234
|
+
isOverlappable: false,
|
|
206
235
|
},
|
|
207
236
|
VISIO_UPKEEP: {
|
|
208
237
|
id: 30,
|
|
@@ -210,6 +239,7 @@ export const TimeCounterType = {
|
|
|
210
239
|
aberrantTime: 30,
|
|
211
240
|
limitedRoles: null,
|
|
212
241
|
color: 'success',
|
|
242
|
+
isOverlappable: false,
|
|
213
243
|
},
|
|
214
244
|
PREQUALIF_TEL: {
|
|
215
245
|
id: 31,
|
|
@@ -217,6 +247,7 @@ export const TimeCounterType = {
|
|
|
217
247
|
aberrantTime: 30,
|
|
218
248
|
limitedRoles: null,
|
|
219
249
|
color: 'success',
|
|
250
|
+
isOverlappable: false,
|
|
220
251
|
},
|
|
221
252
|
HUMAN_RESSOURCES_POINT: {
|
|
222
253
|
id: 32,
|
|
@@ -224,6 +255,7 @@ export const TimeCounterType = {
|
|
|
224
255
|
aberrantTime: 30,
|
|
225
256
|
limitedRoles: null,
|
|
226
257
|
color: 'cerulean',
|
|
258
|
+
isOverlappable: false,
|
|
227
259
|
},
|
|
228
260
|
ADMINISTRATIV: {
|
|
229
261
|
id: 33,
|
|
@@ -231,6 +263,7 @@ export const TimeCounterType = {
|
|
|
231
263
|
aberrantTime: 30,
|
|
232
264
|
limitedRoles: null,
|
|
233
265
|
color: 'iris',
|
|
266
|
+
isOverlappable: true,
|
|
234
267
|
},
|
|
235
268
|
INTEGRATION_DAY: {
|
|
236
269
|
id: 34,
|
|
@@ -238,6 +271,7 @@ export const TimeCounterType = {
|
|
|
238
271
|
aberrantTime: 30,
|
|
239
272
|
limitedRoles: null,
|
|
240
273
|
color: 'orange',
|
|
274
|
+
isOverlappable: false,
|
|
241
275
|
},
|
|
242
276
|
COMMERCIAL_MISSION: {
|
|
243
277
|
id: 35,
|
|
@@ -245,6 +279,7 @@ export const TimeCounterType = {
|
|
|
245
279
|
aberrantTime: 60,
|
|
246
280
|
limitedRoles: null,
|
|
247
281
|
color: 'error',
|
|
282
|
+
isOverlappable: true,
|
|
248
283
|
},
|
|
249
284
|
INTERNAL_CONTROL: {
|
|
250
285
|
id: 36,
|
|
@@ -252,6 +287,7 @@ export const TimeCounterType = {
|
|
|
252
287
|
aberrantTime: 480,
|
|
253
288
|
limitedRoles: [Role.CUSTOMER_SUCCESS, Role.ON_BOARDER, Role.TERMINATION, Role.LITIGE],
|
|
254
289
|
color: 'grey-dark',
|
|
290
|
+
isOverlappable: true,
|
|
255
291
|
},
|
|
256
292
|
CALENDLY: {
|
|
257
293
|
id: 37,
|
|
@@ -259,6 +295,7 @@ export const TimeCounterType = {
|
|
|
259
295
|
aberrantTime: 480,
|
|
260
296
|
limitedRoles: null,
|
|
261
297
|
color: 'fern-dark',
|
|
298
|
+
isOverlappable: false,
|
|
262
299
|
},
|
|
263
300
|
CONNECTION: {
|
|
264
301
|
id: 38,
|
|
@@ -266,6 +303,7 @@ export const TimeCounterType = {
|
|
|
266
303
|
aberrantTime: 15,
|
|
267
304
|
limitedRoles: null,
|
|
268
305
|
color: 'success',
|
|
306
|
+
isOverlappable: true,
|
|
269
307
|
},
|
|
270
308
|
RECRUITMENT_MISSIONS: {
|
|
271
309
|
id: 39,
|
|
@@ -273,6 +311,7 @@ export const TimeCounterType = {
|
|
|
273
311
|
aberrantTime: 15,
|
|
274
312
|
limitedRoles: [Role.HUMAN_RESSOURCES],
|
|
275
313
|
color: 'orange',
|
|
314
|
+
isOverlappable: false,
|
|
276
315
|
},
|
|
277
316
|
UNPAID_TERMINATIONS: {
|
|
278
317
|
id: 40,
|
|
@@ -280,6 +319,7 @@ export const TimeCounterType = {
|
|
|
280
319
|
aberrantTime: 15,
|
|
281
320
|
limitedRoles: [Role.CUSTOMER_SUCCESS],
|
|
282
321
|
color: 'error',
|
|
322
|
+
isOverlappable: true,
|
|
283
323
|
},
|
|
284
324
|
RELAUCH: {
|
|
285
325
|
id: 41,
|
|
@@ -287,6 +327,7 @@ export const TimeCounterType = {
|
|
|
287
327
|
aberrantTime: 15,
|
|
288
328
|
limitedRoles: [Role.COMMERCIAL, Role.FACTURATION],
|
|
289
329
|
color: 'success',
|
|
330
|
+
isOverlappable: true,
|
|
290
331
|
},
|
|
291
332
|
UNPAID_RELAUCH: {
|
|
292
333
|
id: 42,
|
|
@@ -294,6 +335,7 @@ export const TimeCounterType = {
|
|
|
294
335
|
aberrantTime: 15,
|
|
295
336
|
limitedRoles: [Role.FACTURATION],
|
|
296
337
|
color: 'orange',
|
|
338
|
+
isOverlappable: true,
|
|
297
339
|
},
|
|
298
340
|
SUPERVISION_VERIFICATION: {
|
|
299
341
|
id: 43,
|
|
@@ -301,6 +343,7 @@ export const TimeCounterType = {
|
|
|
301
343
|
aberrantTime: 15,
|
|
302
344
|
limitedRoles: [Role.FACTURATION],
|
|
303
345
|
color: 'guacamole',
|
|
346
|
+
isOverlappable: true,
|
|
304
347
|
},
|
|
305
348
|
MAILS: {
|
|
306
349
|
id: 44,
|
|
@@ -308,5 +351,6 @@ export const TimeCounterType = {
|
|
|
308
351
|
aberrantTime: 15,
|
|
309
352
|
limitedRoles: [Role.FACTURATION],
|
|
310
353
|
color: 'guacamole',
|
|
354
|
+
isOverlappable: true,
|
|
311
355
|
},
|
|
312
356
|
};
|
|
@@ -11,6 +11,7 @@ export enum TimeSlot {
|
|
|
11
11
|
ACCOUNTING_RDV = 7,
|
|
12
12
|
BILLING = 8,
|
|
13
13
|
SALES = 9,
|
|
14
|
+
APPOINTMENT = 10,
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export type TimeSlotDetailType = {
|
|
@@ -105,4 +106,13 @@ export const TimeSlotDetail:TimeSlotDetailType[] = [
|
|
|
105
106
|
forWholeService: false,
|
|
106
107
|
idTimeCounterType: TimeCounterType.CALENDLY.id,
|
|
107
108
|
},
|
|
109
|
+
{
|
|
110
|
+
id: TimeSlot.APPOINTMENT,
|
|
111
|
+
name: 'Rdv',
|
|
112
|
+
internalName: 'Rdv',
|
|
113
|
+
duration: 20,
|
|
114
|
+
idRole: [Role.ACCOUNTANT, Role.COMMERCIAL, Role.SOCIAL, Role.JURIDIC, Role.EXPERT_ACCOUNTANT, Role.FACTURATION, Role.LITIGE],
|
|
115
|
+
forWholeService: false,
|
|
116
|
+
idTimeCounterType: TimeCounterType.CALENDLY.id,
|
|
117
|
+
},
|
|
108
118
|
];
|
|
@@ -12,9 +12,15 @@ export class CreateManualEntry {
|
|
|
12
12
|
@IsNumber()
|
|
13
13
|
credit: number;
|
|
14
14
|
|
|
15
|
-
@
|
|
15
|
+
@ApiPropertyOptional()
|
|
16
|
+
@IsOptional()
|
|
17
|
+
@IsNumber()
|
|
18
|
+
idAccount?: number;
|
|
19
|
+
|
|
20
|
+
@ApiPropertyOptional()
|
|
21
|
+
@IsOptional()
|
|
16
22
|
@IsNumber()
|
|
17
|
-
|
|
23
|
+
idThirdParty?: number;
|
|
18
24
|
|
|
19
25
|
@ApiProperty()
|
|
20
26
|
@IsString()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IsDate, IsInt } from 'class-validator';
|
|
2
|
+
import { ApiProperty } from '../../../../utils';
|
|
3
|
+
|
|
4
|
+
export class CountCalendarEvent {
|
|
5
|
+
@ApiProperty()
|
|
6
|
+
@IsInt()
|
|
7
|
+
idUser: number;
|
|
8
|
+
|
|
9
|
+
@ApiProperty()
|
|
10
|
+
@IsDate()
|
|
11
|
+
startDate: Date;
|
|
12
|
+
|
|
13
|
+
@ApiProperty()
|
|
14
|
+
@IsDate()
|
|
15
|
+
endDate: Date;
|
|
16
|
+
|
|
17
|
+
@ApiProperty()
|
|
18
|
+
@IsInt()
|
|
19
|
+
idTimeCounterType: number;
|
|
20
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IsArray, IsDefined, IsInt
|
|
1
|
+
import { IsArray, IsDefined, IsInt } from 'class-validator';
|
|
2
2
|
import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
|
|
3
3
|
|
|
4
4
|
export class CreateNotifyCustomerInvoice {
|
|
@@ -18,18 +18,4 @@ export class CreateNotifyCustomerInvoice {
|
|
|
18
18
|
|
|
19
19
|
@ApiPropertyOptional()
|
|
20
20
|
idSociety?: number;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export class CreateFixBillingCompanyName {
|
|
24
|
-
@IsDefined()
|
|
25
|
-
@ApiPropertyOptional()
|
|
26
|
-
@IsOptional()
|
|
27
|
-
@IsInt()
|
|
28
|
-
idSociety?: number;
|
|
29
|
-
|
|
30
|
-
@IsDefined()
|
|
31
|
-
@ApiProperty({ default: 50 })
|
|
32
|
-
@IsOptional()
|
|
33
|
-
@IsInt()
|
|
34
|
-
limit: number;
|
|
35
21
|
}
|