@silexpert/core 1.3.136 → 1.3.137
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/Payment.d.ts +3 -2
- package/dist/cjs/api/resources/Payment.d.ts.map +1 -1
- package/dist/cjs/api/resources/Payment.js +3 -0
- package/dist/cjs/api/resources/Payment.js.map +1 -1
- package/dist/cjs/types/Interface/api/payment/Params.d.ts +3 -0
- package/dist/cjs/types/Interface/api/payment/Params.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/payment/Params.js +9 -1
- package/dist/cjs/types/Interface/api/payment/Params.js.map +1 -1
- package/dist/cjs/types/Interface/api/payment/Util.d.ts +0 -2
- package/dist/cjs/types/Interface/api/payment/Util.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/payment/Util.js.map +1 -1
- package/dist/cjs/types/Interface/models/IPrestation.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IPrestation.js.map +1 -1
- package/dist/cjs/utils/payment.js +54 -50
- package/dist/cjs/utils/payment.js.map +1 -1
- package/dist/cjs/utils/prestation.d.ts +1 -0
- package/dist/cjs/utils/prestation.d.ts.map +1 -1
- package/dist/cjs/utils/prestation.js +1 -0
- package/dist/cjs/utils/prestation.js.map +1 -1
- package/dist/cjs/utils/tests/payment.spec.js +33 -33
- package/dist/cjs/utils/tests/payment.spec.js.map +1 -1
- package/dist/mjs/api/resources/Payment.d.ts +3 -2
- package/dist/mjs/api/resources/Payment.d.ts.map +1 -1
- package/dist/mjs/api/resources/Payment.js +3 -0
- package/dist/mjs/api/resources/Payment.js.map +1 -1
- package/dist/mjs/types/Interface/api/payment/Params.d.ts +3 -0
- package/dist/mjs/types/Interface/api/payment/Params.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/payment/Params.js +8 -0
- package/dist/mjs/types/Interface/api/payment/Params.js.map +1 -1
- package/dist/mjs/types/Interface/api/payment/Util.d.ts +0 -2
- package/dist/mjs/types/Interface/api/payment/Util.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/payment/Util.js.map +1 -1
- package/dist/mjs/types/Interface/models/IPrestation.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IPrestation.js.map +1 -1
- package/dist/mjs/utils/payment.js +52 -48
- package/dist/mjs/utils/payment.js.map +1 -1
- package/dist/mjs/utils/prestation.d.ts +1 -0
- package/dist/mjs/utils/prestation.d.ts.map +1 -1
- package/dist/mjs/utils/prestation.js +1 -0
- package/dist/mjs/utils/prestation.js.map +1 -1
- package/dist/mjs/utils/tests/payment.spec.js +34 -34
- package/dist/mjs/utils/tests/payment.spec.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Payment.ts +6 -1
- package/ts/types/Interface/api/payment/Params.ts +5 -0
- package/ts/types/Interface/api/payment/Util.ts +2 -2
- package/ts/types/Interface/models/IPrestation.ts +1 -0
- package/ts/utils/payment.ts +49 -49
- package/ts/utils/prestation.ts +1 -0
- package/ts/utils/tests/payment.spec.ts +34 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Payment.js","sourceRoot":"","sources":["../../../../ts/api/resources/Payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Payment.js","sourceRoot":"","sources":["../../../../ts/api/resources/Payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AA+BvC,MAAM,OAAO,OAAQ,SAAQ,QAAQ;IACnC,aAAa,CAAC,KAA0B;QACtC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,EAAE;YAC3C,MAAM,EAAE,KAAK;YACb,YAAY,EAAE,aAAa;YAC3B,OAAO,EAAE;gBACP,MAAM,EAAE,iBAAiB;aAC1B;SACF,CAAC,CAAC;IACL,CAAC;IAED,qBAAqB,CAAC,KAAsB;QAC1C,OAAO,IAAI,CAAC,KAAK,C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AAC,CAAC;IAC1E,CAAC;IAED,qBAAqB,CACnB,KAAoC,EACpC,MAAmB;QAEnB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,UAAU,CAAC,iBAAyB,EAAE,OAAkC;QACtE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,sBAAsB,iBAAiB,UAAU,EAAE,OAAO,CAAC,CAAC;IACtF,CAAC;IAED,MAAM,CAAC,KAAoB,EAAE,MAAmB;QAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,OAAsB;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,WAAW,CAAC,EAAU;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC;CACF","sourcesContent":["import { Resource } from '../Resource';\nimport {\n AskProcessPaymentRecovery,\n BasePaginate,\n CreateNotifyCustomer,\n CreatePaymentRecovery,\n CreatePaymentsAutoBilling,\n IPayment,\n QueryMonthlyPayment,\n QueryPayment,\n QueryPaymentCsv,\n QueryPayments,\n QueryPaymentInvoice,\n QueryPaymentRecoveryPaginated,\n QueryPaymentRecoveryStatistic,\n QuerySocietyUnpaid,\n ReadPaid,\n ReadPaymentInvoice,\n ReadPaymentRecovery,\n ReadPaymentRecoveryClaim,\n ReadPaymentRecoveryStatistic,\n ReadStatPrestation,\n ReadStatsSocietyUnpaid,\n UpdatePayment,\n QueryStripeSubscriptionId,\n UpdatePaymentMethod,\n CreatePaymentsRebilling,\n} from '../../types';\nimport { IPaymentRecovery } from '../../types/Interface/models/IPaymentRecovery';\nimport Stripe from 'stripe';\n\nexport class Payment extends Resource {\n getMonthlyCsv(query: QueryMonthlyPayment): Promise<void> {\n return this.axios.$get('payment/monthlyCsv', {\n params: query,\n responseType: 'arraybuffer',\n headers: {\n Accept: 'application/csv',\n },\n });\n }\n\n getInternalPaymentCsv(query: QueryPaymentCsv): Promise<void> {\n return this.axios.$get('payment/internal-payment/csv', {\n params: query,\n responseType: 'arraybuffer',\n headers: {\n Accept: 'application/csv',\n },\n });\n }\n\n notifyCustomers(payload: CreateNotifyCustomer): Promise<void> {\n return this.axios.$post('payment/notify-customers', payload);\n }\n\n notifyCustomersInvoice(payload: CreateNotifyCustomer): Promise<void> {\n return this.axios.$post('payment/notify-customers-invoice', payload);\n }\n\n getPaid(payload: QueryPayment): Promise<ReadPaid> {\n return this.axios.$get('payment/paid', {\n params: payload,\n });\n }\n\n getUnpaid(payload: QueryPayment): Promise<IPayment & { unpaid: number }[]> {\n return this.axios.$get('payment/unpaid', {\n params: payload,\n });\n }\n\n /**\n * Return list of payments which could be collectables\n * @param signal\n * @returns\n */\n getAutoCollectables(signal: AbortSignal): Promise<IPayment[]> {\n return this.axios.$get('payments/auto-collectables', {\n signal,\n });\n }\n\n /**\n * Return list of payments which are collectables\n * @param signal\n * @returns\n */\n getCollectables(signal: AbortSignal): Promise<IPayment[]> {\n return this.axios.$get('payments/collectables', {\n signal,\n });\n }\n setAsCollectable(listIdPayment: number[]): Promise<IPayment[]> {\n return this.axios.$patch('payments', {\n listIdPayment,\n isCollectable: true,\n });\n }\n\n getAllPaymentMethods(params: QueryStripeSubscriptionId): Promise<string> {\n return this.axios.$get('/stripe/payments/methods', { params });\n }\n\n updatePaymentMethod(params: UpdatePaymentMethod): Promise<Stripe.PaymentMethod> {\n return this.axios.$put('/stripe/payments/methods', params);\n }\n\n getStatsPaidByPrestation(\n payload: QueryPayment,\n ): Promise<{ invoicePaymentStats: ReadStatPrestation; assetPaymentStats: ReadStatPrestation }> {\n return this.axios.$get('payment/paid-by-prestations', {\n params: payload,\n });\n }\n\n getStatsSocietyUnpaid(payload: QuerySocietyUnpaid): Promise<ReadStatsSocietyUnpaid[]> {\n return this.axios.$get('payment/societies-unpaid', {\n params: payload,\n });\n }\n\n generateForAutoBilling(payload: CreatePaymentsAutoBilling): Promise<number> {\n return this.axios.$post('payment/auto-billing', payload);\n }\n\n generateForRebilling(payload: CreatePaymentsRebilling): Promise<number> {\n return this.axios.$post('payment/rebilling', payload);\n }\n\n getAllInvoices(idExercice: number, query: QueryPaymentInvoice): Promise<ReadPaymentInvoice[]> {\n return this.axios.$get(`/exercices/${idExercice}/invoices`, { params: query });\n }\n\n createRecovery(idFile: number, payload: CreatePaymentRecovery): Promise<IPaymentRecovery> {\n return this.axios.$post(`/invoices/${idFile}/payments-recovery`, payload);\n }\n\n getRecovery(idPaymentRecovery: number): Promise<ReadPaymentRecoveryClaim> {\n return this.axios.$get(`/payments-recovery/${idPaymentRecovery}`);\n }\n\n getPaginatedRecovery(\n query: QueryPaymentRecoveryPaginated,\n signal: AbortSignal,\n ): Promise<BasePaginate<ReadPaymentRecovery>> {\n return this.axios.$get('/payments-recovery', { params: query, signal });\n }\n\n getRecoveryStatistics(\n query: QueryPaymentRecoveryStatistic,\n signal: AbortSignal,\n ): Promise<ReadPaymentRecoveryStatistic> {\n return this.axios.$get('/payments-recovery/statistics', { params: query, signal });\n }\n\n askProcess(idPaymentRecovery: number, payload: AskProcessPaymentRecovery): Promise<IPaymentRecovery> {\n return this.axios.$post(`/payments-recovery/${idPaymentRecovery}/contact`, payload);\n }\n\n getAll(query: QueryPayments, signal: AbortSignal): Promise<IPayment[]> {\n return this.axios.$get('/payments', { params: query, signal });\n }\n\n update(id: number, payload: UpdatePayment): Promise<IPayment> {\n return this.axios.$patch(`/payments/${id}`, payload);\n }\n\n delete(id: number): Promise<true> {\n return this.axios.$delete(`/payments/${id}`);\n }\n\n forceDelete(id: number): Promise<true> {\n return this.axios.$delete(`/payments/force/${id}`);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Params.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/payment/Params.ts"],"names":[],"mappings":"AAIA,qBAAa,yBAAyB;IAIpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,iBAAiB;IAG5B,aAAa,EAAE,MAAM,EAAE,CAAC;IAMxB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qBAAa,aAAa;IAIxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAKhB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,UAAU,CAAC,EAAE,MAAM,CAAC;IAKpB,eAAe,CAAC,EAAE,MAAM,CAAC;IAKzB,YAAY,CAAC,EAAE,MAAM,CAAC;IAMtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAMlB,MAAM,CAAC,EAAE,OAAO,CAAC;IAMjB,UAAU,CAAC,EAAE,OAAO,CAAC;IAMrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAM3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAM5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAK1B,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,aAAa,CAAC,EAAE,MAAM,CAAC;IAKvB,WAAW,CAAC,EAAE,IAAI,CAAC;CACpB"}
|
|
1
|
+
{"version":3,"file":"Params.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/payment/Params.ts"],"names":[],"mappings":"AAIA,qBAAa,yBAAyB;IAIpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,qBAAa,uBAAuB;IAGlC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,iBAAiB;IAG5B,aAAa,EAAE,MAAM,EAAE,CAAC;IAMxB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qBAAa,aAAa;IAIxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAKhB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,UAAU,CAAC,EAAE,MAAM,CAAC;IAKpB,eAAe,CAAC,EAAE,MAAM,CAAC;IAKzB,YAAY,CAAC,EAAE,MAAM,CAAC;IAMtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAMlB,MAAM,CAAC,EAAE,OAAO,CAAC;IAMjB,UAAU,CAAC,EAAE,OAAO,CAAC;IAMrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAM3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAM5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAK1B,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,aAAa,CAAC,EAAE,MAAM,CAAC;IAKvB,WAAW,CAAC,EAAE,IAAI,CAAC;CACpB"}
|
|
@@ -19,6 +19,14 @@ __decorate([
|
|
|
19
19
|
IsInt(),
|
|
20
20
|
__metadata("design:type", Number)
|
|
21
21
|
], CreatePaymentsAutoBilling.prototype, "idSociety", void 0);
|
|
22
|
+
export class CreatePaymentsRebilling {
|
|
23
|
+
idSociety;
|
|
24
|
+
}
|
|
25
|
+
__decorate([
|
|
26
|
+
ApiProperty(),
|
|
27
|
+
IsInt(),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], CreatePaymentsRebilling.prototype, "idSociety", void 0);
|
|
22
30
|
export class UpdateCollectable {
|
|
23
31
|
listIdPayment;
|
|
24
32
|
isCollectable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Params.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/payment/Params.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iB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AC","sourcesContent":["import { IsBoolean, IsDate, IsInt, IsNumber, IsOptional, IsString } from 'class-validator';\nimport { ApiProperty, ApiPropertyOptional } from '../../../../utils';\nimport { ToBoolean } from '../../../../utils/transforms/boolean.transform';\n\nexport class CreatePaymentsAutoBilling {\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n idSociety?: number;\n}\nexport class CreatePaymentsRebilling {\n @ApiProperty()\n @IsInt()\n idSociety: number;\n}\n\nexport class UpdateCollectable {\n @ApiProperty()\n @IsInt({ each: true })\n listIdPayment: number[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isCollectable: boolean;\n}\n\nexport class UpdatePayment {\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n amount?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n amountPayed?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n idExercice?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n idPaymentMethod?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n idPrestation?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @ToBoolean()\n @IsBoolean()\n isAsset?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @ToBoolean()\n @IsBoolean()\n isFree?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @ToBoolean()\n @IsBoolean()\n isOverpaid?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @ToBoolean()\n @IsBoolean()\n isHiddenCustomer?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @ToBoolean()\n @IsBoolean()\n noInternalInvoice?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @ToBoolean()\n @IsBoolean()\n isDebtSpreading?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n comment?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n internComment?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsDate()\n datePayment?: Date;\n}\n"]}
|
|
@@ -9,8 +9,6 @@ export interface ParamsForPaymentsAuto {
|
|
|
9
9
|
idTypeBrand: number;
|
|
10
10
|
firstExerciceNonExpresssEndDate: Date;
|
|
11
11
|
idPrestation: number;
|
|
12
|
-
idLegalForm: number;
|
|
13
|
-
isWithApplicationFees: boolean;
|
|
14
12
|
idVat: number;
|
|
15
13
|
prestationList: IPrestationList;
|
|
16
14
|
yearlyAmountNonExpress: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Util.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/payment/Util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,WAAW,gCAAgC;IAC/C,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC;CACrB;AACD,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B,EAAE,IAAI,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Util.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/payment/Util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,WAAW,gCAAgC;IAC/C,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC;CACrB;AACD,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B,EAAE,IAAI,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC;IAGrB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,eAAe,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,0BAA0B,EAAE,MAAM,CAAC;IACnC,oCAAoC,EAAE,gCAAgC,EAAE,CAAC;IACzE,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,YAAY,CAAC,EAAE,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,IAAI,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Util.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/payment/Util.ts"],"names":[],"mappings":"","sourcesContent":["import { IPrestationList, IRegulation } from '../../..';\n\nexport interface PartialExercicePrestationExpress {\n startDate: Date;\n endDate: Date;\n countExpressMonthlyPayment: number | null; // if null, non express | if not null, express\n totalAmount: number;\n}\nexport interface ParamsForPaymentsAuto {\n idTypeBrand: number;\n firstExerciceNonExpresssEndDate: Date;\n idPrestation: number;\n idLegalForm: number
|
|
1
|
+
{"version":3,"file":"Util.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/payment/Util.ts"],"names":[],"mappings":"","sourcesContent":["import { IPrestationList, IRegulation } from '../../..';\n\nexport interface PartialExercicePrestationExpress {\n startDate: Date;\n endDate: Date;\n countExpressMonthlyPayment: number | null; // if null, non express | if not null, express\n totalAmount: number;\n}\nexport interface ParamsForPaymentsAuto {\n idTypeBrand: number;\n firstExerciceNonExpresssEndDate: Date;\n idPrestation: number;\n // idLegalForm: number; // Application fees are not charged anymore\n // isWithApplicationFees: boolean;\n idVat: number;\n prestationList: IPrestationList;\n yearlyAmountNonExpress: number;\n nextYearlyAmountNonExpress: number;\n listPartialExercicePrestationExpress: PartialExercicePrestationExpress[];\n listRegulations: IRegulation[];\n recoveryDate?: Date;\n}\n\nexport interface PaymentAuto {\n amount: number;\n isPaid?: boolean;\n datePayment: Date;\n idPrestation: number;\n idPaymentMethod: number;\n closingDate: Date;\n comment?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IPrestation.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IPrestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAG9B,MAAM,WAAW,WAAW;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,wBAAwB,EAAE,OAAO,GAAG,IAAI,CAAC;IACzC,+BAA+B,EAAE,OAAO,GAAG,IAAI,CAAC;IAChD,qBAAqB,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC,IAAI,EAAE,OAAO,GAAG,IAAI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AAC;IAClC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAGxB,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC;IACxB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,CAAC;IACjC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IACpD,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,gBAAgB,CAAC,EAAE,WAAW,CAAC;IAC/B,kBAAkB,CAAC,EAAE,WAAW,CAAC;IACjC,wBAAwB,CAAC,EAAE,WAAW,CAAC;IACvC,oBAAoB,CAAC,EAAE,QAAQ,CAAC;IAChC,gCAAgC,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACzD,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC3C,eAAe,CAAC,EAAE,gBAAgB,CAAC;IACnC,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IPrestation.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IPrestation.ts"],"names":[],"mappings":"","sourcesContent":["import { IExercice } from './IExercice';\nimport { IPayment } from './IPayment';\nimport { IPrestationList } from './IPrestationList';\nimport { IPrestationComplementary } from './IPrestationComplementary';\nimport { ISociety } from './ISociety';\nimport { IExercicePrestation } from './IExercicePrestation';\nimport { ICustomerSignature } from './ICustomerSignature';\nimport { ITerminationList } from './ITerminationList';\nimport { IUser } from '../..';\n\n// prestations\nexport interface IPrestation {\n id?: number;\n numPrestation: string | null;\n statePrevi: number | null;\n archive: boolean;\n withStatuteDrafted: boolean | null;\n withCaptainContrat: boolean | null;\n withStatutesApportNature: boolean | null;\n withStatutesAutorisationTutelle: boolean | null;\n withStatutesFileAccre: boolean | null;\n paid: boolean | null;\n signed: boolean | null;\n toAdministratif: number | null;\n goToAdministratif: Date | null;\n administratifStatus: number;\n toConstitution: number;\n dateValidPrestation: Date | null;\n goToOnboarding: Date | null;\n dateLeavingOnboarding?: Date | null;\n goToClient: Date | null;\n goToFacturation?: Date | null;\n dateLeavingFacturation?: Date | null;\n scoring: number | null;\n isWithApplicationFees?: boolean;\n state: boolean;\n commentPdf: string | null;\n token: string | null;\n size: number | null;\n inProgress: number | null;\n idSociety: number;\n idPrestationList: number;\n idPrestationComplementary: number | null;\n gestionJuridique: boolean;\n idPrestationSocial: number | null;\n idPrestationJuridique: number | null;\n idPrestationCreation: number | null;\n idPrestationDeclarationIR: number | null;\n idPrestationControleFiscal: number | null;\n idOnBoarder: number | null;\n idStateAppointment: number | null;\n totalAmount?: number;\n discountAmount?: number;\n debitType?: string;\n createdAt?: Date | null;\n updatedAt?: Date | null;\n deletedAt?: Date | null;\n\n // Associations\n exercices?: IExercice[];\n prestationsPayments?: IPayment[];\n prestationsList?: IPrestationList;\n prestationsComplementary?: IPrestationComplementary;\n prestationJuridique?: IPrestation;\n prestationSocial?: IPrestation;\n prestationCreation?: IPrestation;\n prestationControleFiscal?: IPrestation;\n societiesPrestations?: ISociety;\n prestationsDetailsBeforeExercice?: IExercicePrestation[];\n customersSignatures?: ICustomerSignature[];\n terminationList?: ITerminationList;\n onBoarder?: IUser;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IPrestation.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IPrestation.ts"],"names":[],"mappings":"","sourcesContent":["import { IExercice } from './IExercice';\nimport { IPayment } from './IPayment';\nimport { IPrestationList } from './IPrestationList';\nimport { IPrestationComplementary } from './IPrestationComplementary';\nimport { ISociety } from './ISociety';\nimport { IExercicePrestation } from './IExercicePrestation';\nimport { ICustomerSignature } from './ICustomerSignature';\nimport { ITerminationList } from './ITerminationList';\nimport { IUser } from '../..';\n\n// prestations\nexport interface IPrestation {\n id?: number;\n numPrestation: string | null;\n statePrevi: number | null;\n archive: boolean;\n withStatuteDrafted: boolean | null;\n withCaptainContrat: boolean | null;\n withStatutesApportNature: boolean | null;\n withStatutesAutorisationTutelle: boolean | null;\n withStatutesFileAccre: boolean | null;\n paid: boolean | null;\n signed: boolean | null;\n toAdministratif: number | null;\n goToAdministratif: Date | null;\n administratifStatus: number;\n toConstitution: number;\n dateValidPrestation: Date | null;\n goToOnboarding: Date | null;\n dateLeavingOnboarding?: Date | null;\n goToClient: Date | null;\n goToFacturation?: Date | null;\n dateLeavingFacturation?: Date | null;\n scoring: number | null;\n // @deprecated Application fees are not charged anymore\n isWithApplicationFees?: boolean;\n state: boolean;\n commentPdf: string | null;\n token: string | null;\n size: number | null;\n inProgress: number | null;\n idSociety: number;\n idPrestationList: number;\n idPrestationComplementary: number | null;\n gestionJuridique: boolean;\n idPrestationSocial: number | null;\n idPrestationJuridique: number | null;\n idPrestationCreation: number | null;\n idPrestationDeclarationIR: number | null;\n idPrestationControleFiscal: number | null;\n idOnBoarder: number | null;\n idStateAppointment: number | null;\n totalAmount?: number;\n discountAmount?: number;\n debitType?: string;\n createdAt?: Date | null;\n updatedAt?: Date | null;\n deletedAt?: Date | null;\n\n // Associations\n exercices?: IExercice[];\n prestationsPayments?: IPayment[];\n prestationsList?: IPrestationList;\n prestationsComplementary?: IPrestationComplementary;\n prestationJuridique?: IPrestation;\n prestationSocial?: IPrestation;\n prestationCreation?: IPrestation;\n prestationControleFiscal?: IPrestation;\n societiesPrestations?: ISociety;\n prestationsDetailsBeforeExercice?: IExercicePrestation[];\n customersSignatures?: ICustomerSignature[];\n terminationList?: ITerminationList;\n onBoarder?: IUser;\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
import { PaymentMethod, getTaxesIncludedAmount, } from '../types';
|
|
3
3
|
import * as dayjs from 'dayjs';
|
|
4
|
-
import { getApplicationFeesAmount, getPriceGrid } from './prestation';
|
|
4
|
+
import { /* getApplicationFeesAmount, */ getPriceGrid } from './prestation';
|
|
5
5
|
/**
|
|
6
6
|
* A partir d'une liste de payment (avec include jusqu'à prestationList,
|
|
7
7
|
* avec en attributs 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther')
|
|
@@ -55,21 +55,21 @@ const groupPaymentsByServiceType = (payments, types = [
|
|
|
55
55
|
}
|
|
56
56
|
return societyPayment;
|
|
57
57
|
};
|
|
58
|
-
const calculateFees = (amount, paymentDate) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
};
|
|
58
|
+
// const calculateFees = (amount: number, paymentDate: Date): number => {
|
|
59
|
+
// const yearlyPriceIncreasing = 1.0275;
|
|
60
|
+
// // Commenté car en fin d'année, pour appliquer le taux d'inflation annuel,
|
|
61
|
+
// // un script enlève les 2,75€ appliqués pour appliquer le bon taux
|
|
62
|
+
// // const oneYearLessIfIn3LastMonthsOfYear = dayjs(goToClient).month() >= 9 ? 1 : 0;
|
|
63
|
+
// if (dayjs(paymentDate).year() - dayjs().year() > 0) {
|
|
64
|
+
// const nbYearsMore = dayjs(paymentDate).year() - dayjs().year(); /* - oneYearLessIfIn3LastMonthsOfYear */
|
|
65
|
+
// // on applique X fois l'augmentation
|
|
66
|
+
// // ex. : si on lance l'appel en 2024, et qu'on génére un paiement pour 2026, on applique 2 fois l'augmentation
|
|
67
|
+
// // soit amount * yearlyPriceIncreasing * yearlyPriceIncreasing
|
|
68
|
+
// // soit amount * yearlyPriceIncreasing ^ nbYearsMore
|
|
69
|
+
// amount = amount * Math.pow(yearlyPriceIncreasing, nbYearsMore);
|
|
70
|
+
// }
|
|
71
|
+
// return amount;
|
|
72
|
+
// };
|
|
73
73
|
/**
|
|
74
74
|
// * @param {number} firstPaymentAmount - amount of the first payment (first regulation of the customer)
|
|
75
75
|
* @param {Date} firstExerciceNonExpresssEndDate - end date of the first exercice non express
|
|
@@ -86,7 +86,11 @@ const calculateFees = (amount, paymentDate) => {
|
|
|
86
86
|
* @returns { IPayment[] } list of payment to create for billing auto, after each presta go to onBoarding
|
|
87
87
|
*/
|
|
88
88
|
const calculatePaymentsAuto = (params) => {
|
|
89
|
-
const { idTypeBrand,
|
|
89
|
+
const { idTypeBrand,
|
|
90
|
+
// isWithApplicationFees,
|
|
91
|
+
firstExerciceNonExpresssEndDate, idPrestation,
|
|
92
|
+
// idLegalForm,
|
|
93
|
+
prestationList, idVat, yearlyAmountNonExpress, nextYearlyAmountNonExpress, listPartialExercicePrestationExpress, listRegulations, recoveryDate, } = params;
|
|
90
94
|
if (!yearlyAmountNonExpress)
|
|
91
95
|
throw new Error('Le montant annuel des prestations non express ne peut pas être nul.');
|
|
92
96
|
// Si on est dans les 3 derniers jours du mois actuel,
|
|
@@ -108,18 +112,19 @@ const calculatePaymentsAuto = (params) => {
|
|
|
108
112
|
const priceGrid = getPriceGrid(idTypeBrand, prestationList.id);
|
|
109
113
|
if (!priceGrid)
|
|
110
114
|
throw new Error('Impossible de trouver la grille tarifaire correspondante');
|
|
111
|
-
const { applicationCost, priceWithTaxesIncluded } = priceGrid;
|
|
112
|
-
const applicationCostTotalTTC =
|
|
113
|
-
|
|
115
|
+
const { /* applicationCost, */ priceWithTaxesIncluded } = priceGrid;
|
|
116
|
+
// const applicationCostTotalTTC =
|
|
117
|
+
// (priceWithTaxesIncluded ? applicationCost : getTaxesIncludedAmount(applicationCost, idVat)) * 12;
|
|
118
|
+
// const applicationFeesAmountTTC = getApplicationFeesAmount(idLegalForm, idVat);
|
|
114
119
|
if (prestationList?.isCatalog || !prestationList?.isComptable)
|
|
115
120
|
throw new Error('Ce type de prestation ne correspond pas aux conditions attendues.');
|
|
116
121
|
if (listPartialExercicePrestationExpress.length &&
|
|
117
122
|
listPartialExercicePrestationExpress?.some((ep) => !ep?.startDate))
|
|
118
123
|
throw new Error('Start date of some exercice are missing');
|
|
119
|
-
let yearlyAmountNonExpressClone = yearlyAmountNonExpress;
|
|
120
|
-
if (isWithApplicationFees) {
|
|
121
|
-
|
|
122
|
-
}
|
|
124
|
+
// let yearlyAmountNonExpressClone = yearlyAmountNonExpress;
|
|
125
|
+
// if (isWithApplicationFees) {
|
|
126
|
+
// yearlyAmountNonExpressClone -= getApplicationFeesAmount(idLegalForm); //HT
|
|
127
|
+
// }
|
|
123
128
|
const nbExoExpress = listPartialExercicePrestationExpress.length;
|
|
124
129
|
const listPayments = [];
|
|
125
130
|
// on récupère le/les premiers réglements effectués, non alloués
|
|
@@ -153,20 +158,20 @@ const calculatePaymentsAuto = (params) => {
|
|
|
153
158
|
return dayjs(aStartDate).diff(bStartDate);
|
|
154
159
|
});
|
|
155
160
|
// Si les frais de dossiers sont facturés, on ajoute un paiement sur le mois en cours
|
|
156
|
-
if (isWithApplicationFees) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
161
|
+
// if (isWithApplicationFees) {
|
|
162
|
+
// listPayments.push({
|
|
163
|
+
// amount: applicationFeesAmountTTC, //TTC
|
|
164
|
+
// isPaid: true,
|
|
165
|
+
// datePayment: dayjs().toDate(),
|
|
166
|
+
// idPrestation,
|
|
167
|
+
// idPaymentMethod: listRegulations[0]?.idPaymentMethod ?? PaymentMethod.DIRECT_DEBIT.id,
|
|
168
|
+
// closingDate: listPartialExercicePrestationExpress?.length
|
|
169
|
+
// ? listPartialExercicePrestationExpress[0].endDate
|
|
170
|
+
// : firstExerciceNonExpresssEndDate,
|
|
171
|
+
// comment: 'Frais de dossier',
|
|
172
|
+
// });
|
|
173
|
+
// remainingAmount += applicationFeesAmountTTC;
|
|
174
|
+
// }
|
|
170
175
|
// =========================
|
|
171
176
|
// EXPRESS
|
|
172
177
|
// =========================
|
|
@@ -253,7 +258,7 @@ const calculatePaymentsAuto = (params) => {
|
|
|
253
258
|
paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();
|
|
254
259
|
continue;
|
|
255
260
|
}
|
|
256
|
-
const exoAmount = isFirstNonExpress ?
|
|
261
|
+
const exoAmount = isFirstNonExpress ? yearlyAmountNonExpress : nextYearlyAmountNonExpress;
|
|
257
262
|
const remainingBeforeThisExo = remainingAmount;
|
|
258
263
|
remainingAmount += priceWithTaxesIncluded ? exoAmount : getTaxesIncludedAmount(exoAmount, idVat);
|
|
259
264
|
// Si le premier règlement couvre le coût de cet exercicePrestation,
|
|
@@ -283,15 +288,14 @@ const calculatePaymentsAuto = (params) => {
|
|
|
283
288
|
}
|
|
284
289
|
let remainingAmountByExercicePrestation = remainingAmount;
|
|
285
290
|
// - frais d'application dès les second exo non express
|
|
286
|
-
if (!isFirstNonExpress)
|
|
287
|
-
remainingAmountByExercicePrestation += applicationCostTotalTTC;
|
|
291
|
+
// if (!isFirstNonExpress) remainingAmountByExercicePrestation += applicationCostTotalTTC;
|
|
288
292
|
const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd; //TTC
|
|
289
293
|
if (monthlyAmount > 0) {
|
|
290
294
|
for (let index = 1; index <= countMonthsBeforeExerciceEnd; index++) {
|
|
291
|
-
|
|
295
|
+
const amount = index < countMonthsBeforeExerciceEnd ? monthlyAmount : remainingAmountByExercicePrestation;
|
|
292
296
|
// Si besoin, on applique les frais nécessaires :
|
|
293
297
|
// - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)
|
|
294
|
-
amount = calculateFees(amount, paymentDate);
|
|
298
|
+
// amount = calculateFees(amount, paymentDate);
|
|
295
299
|
listPayments.push({
|
|
296
300
|
amount: Math.round(100 * amount) / 100,
|
|
297
301
|
datePayment: paymentDate,
|
|
@@ -318,25 +322,25 @@ const calculatePaymentsAuto = (params) => {
|
|
|
318
322
|
remainingAmount += priceWithTaxesIncluded
|
|
319
323
|
? nextYearlyAmountNonExpress
|
|
320
324
|
: getTaxesIncludedAmount(nextYearlyAmountNonExpress, idVat);
|
|
321
|
-
|
|
325
|
+
const remainingAmountByExercicePrestation = remainingAmount;
|
|
322
326
|
//On compte le nb de mois restants entre la date à laquelle le paiement va être créé et la date de fin d'exercice
|
|
323
327
|
let countMonthsBeforeExerciceEnd = Math.ceil(dayjs(exerciceEndDate).diff(paymentDate, 'months', true));
|
|
324
328
|
if (countMonthsBeforeExerciceEnd < 3)
|
|
325
329
|
countMonthsBeforeExerciceEnd = 3;
|
|
326
330
|
// - frais d'application dès les second exo non express
|
|
327
|
-
remainingAmountByExercicePrestation += applicationCostTotalTTC;
|
|
331
|
+
// remainingAmountByExercicePrestation += applicationCostTotalTTC;
|
|
328
332
|
const monthlyAmount = remainingAmountByExercicePrestation / countMonthsBeforeExerciceEnd;
|
|
329
333
|
// Si aucun paiement généré, on stoppe là
|
|
330
334
|
if (!listPayments.length)
|
|
331
335
|
return [];
|
|
332
336
|
while (dayjs(listPayments.slice(-1)[0].datePayment).month() < 11) {
|
|
333
|
-
|
|
337
|
+
// const amount = monthlyAmount;
|
|
334
338
|
// Si besoin, on applique les frais nécessaires :
|
|
335
339
|
// - 2,75% d'augmentation chaque année, sauf si souscriptiuon dans les 3 derniers mois de l'année civile)
|
|
336
340
|
// - frais d'application dès les second exo non express
|
|
337
|
-
amount = calculateFees(amount, paymentDate);
|
|
341
|
+
// amount = calculateFees(amount, paymentDate);
|
|
338
342
|
listPayments.push({
|
|
339
|
-
amount: Math.round(100 *
|
|
343
|
+
amount: Math.round(100 * monthlyAmount) / 100,
|
|
340
344
|
datePayment: paymentDate,
|
|
341
345
|
idPrestation,
|
|
342
346
|
idPaymentMethod: PaymentMethod.DIRECT_DEBIT.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../ts/utils/payment.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAIL,aAAa,EAEb,sBAAsB,GACvB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAQtE;;;;;;;;;GASG;AACH,MAAM,0BAA0B,GAAG,CACjC,QAAoB,EACpB,QAAoE;IAClE,aAAa;IACb,aAAa;IACb,UAAU;IACV,SAAS;CACV,EACmB,EAAE;IACtB,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,CAClC,CAAC,EAAE,EAAE,EAAE,CACL,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,IAAI,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,QAAQ,CAC/G,CAAC;IACF,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CACrC,CAAC,EAAE,EAAE,EAAE,CACL,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,IAAI,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,CAClH,CAAC;IACF,MAAM,WAAW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D;QACjD,yGAAyG;QACzG,uDAAuD;QACvD,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAE5C,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,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,CAAC","sourcesContent":["'use strict';\n\nimport {\n IPayment,\n IRegulation,\n ParamsForPaymentsAuto,\n PaymentMethod,\n PaymentAuto,\n getTaxesIncludedAmount,\n} from '../types';\nimport * as dayjs from 'dayjs';\nimport { PartialExercicePrestationExpress } from '../types/Interface/api/payment/Util';\nimport { getApplicationFeesAmount, getPriceGrid } from './prestation';\n\nexport interface PaymentsWithList extends IPayment {\n type?: 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther';\n listPayments: IPayment[];\n isYearly?: boolean;\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 = (\n payments: IPayment[],\n types: ('isComptable' | 'isJuridique' | 'isSocial' | 'isOther')[] = [\n 'isComptable',\n 'isJuridique',\n 'isSocial',\n 'isOther',\n ],\n): PaymentsWithList[] => {\n const prestaComptable = payments.filter((el) => el?.paymentsPrestations?.prestationsList?.isComptable ?? false);\n const prestaSocial = payments.filter(\n (el) =>\n !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isSocial,\n );\n const prestaJuridique = payments.filter(\n (el) =>\n !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isJuridique,\n );\n const prestaOther = payments.filter(\n (el) =>\n !el?.paymentsPrestations?.prestationsList?.isComptable &&\n !el?.paymentsPrestations?.prestationsList?.isJuridique &&\n !el?.paymentsPrestations?.prestationsList?.isSocial,\n );\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, paymentDate: Date): number => {\n const yearlyPriceIncreasing = 1.0275;\n\n // Commenté car en fin d'année, pour appliquer le taux d'inflation annuel,\n // un script enlève les 2,75€ appliqués pour appliquer le bon taux\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 {\n idTypeBrand,\n isWithApplicationFees,\n firstExerciceNonExpresssEndDate,\n idPrestation,\n idLegalForm,\n prestationList,\n idVat,\n yearlyAmountNonExpress,\n nextYearlyAmountNonExpress,\n listPartialExercicePrestationExpress,\n listRegulations,\n recoveryDate,\n } = params;\n\n if (!yearlyAmountNonExpress) throw new Error('Le montant annuel des prestations non express ne peut pas être nul.');\n\n // Si on est dans les 3 derniers jours du mois actuel,\n // on ne le compte pas et on facture à partir du début de mois suivant\n let initializedPaymentDate =\n dayjs().endOf('month').diff(dayjs(), 'day') < 3 /* || dayjs().date() >= 14 */\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 //Si jour de la date de reprise >= 14, alors on débute la facturation 1 mois plus tard\n if (dayjs(initializedPaymentDate).date() >= 14)\n initializedPaymentDate = dayjs(initializedPaymentDate).add(1, 'month').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 =\n (priceWithTaxesIncluded ? applicationCost : getTaxesIncludedAmount(applicationCost, idVat)) * 12;\n const applicationFeesAmountTTC = getApplicationFeesAmount(idLegalForm, idVat);\n\n if (prestationList?.isCatalog || !prestationList?.isComptable)\n throw new Error('Ce type de prestation ne correspond pas aux conditions attendues.');\n if (\n listPartialExercicePrestationExpress.length &&\n listPartialExercicePrestationExpress?.some((ep: PartialExercicePrestationExpress) => !ep?.startDate)\n )\n throw new Error('Start date of some exercice are missing');\n\n let yearlyAmountNonExpressClone = yearlyAmountNonExpress;\n if (isWithApplicationFees) {\n yearlyAmountNonExpressClone -= getApplicationFeesAmount(idLegalForm); //HT\n }\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;\n const bStartDate = b?.startDate;\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\n ? listPartialExercicePrestationExpress[0].endDate\n : firstExerciceNonExpresssEndDate,\n comment: 'Frais de dossier',\n });\n remainingAmount += applicationFeesAmountTTC;\n }\n\n // =========================\n // EXPRESS\n // =========================\n listPartialExercicePrestationExpress.forEach(\n (exercicePrestation: PartialExercicePrestationExpress, indexEP: number) => {\n const remainingBeforeThisExo = remainingAmount;\n\n remainingAmount += !priceWithTaxesIncluded\n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat)\n : exercicePrestation.totalAmount; //TTC\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:\n Math.round(\n 100 *\n (!priceWithTaxesIncluded\n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat)\n : exercicePrestation.totalAmount),\n ) / 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 ?? 1; //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 // =========================\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 let countNonExpressGenerated = 0;\n\n // On génère des paiements jusqu'à ce qu'un exercice soit entier (12 mois), non express\n // et qu'au moins 13 mois de paiements ont été générés depuis la date de reprise\n while (!hasGeneratedWholeYear || countNonExpressGenerated < 2) {\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 // Si un client signe un Express dans les 3 derniers mois de l'année (par exemple en décembre 2024)\n // on ne doit pas générer l'année 2025 sur 13 mois à partir du 12/24\n // mais on doit attendre le début de l'exercice concerné (ici, 01/25)\n if (countMonthsBeforeExerciceEnd > 12) {\n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n continue;\n }\n\n const exoAmount = isFirstNonExpress ? yearlyAmountNonExpressClone : 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, 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 countNonExpressGenerated += 1;\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\n ? nextYearlyAmountNonExpress\n : 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, 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 { groupPaymentsByServiceType, calculatePaymentsAuto };\n"]}
|
|
1
|
+
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../ts/utils/payment.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAIL,aAAa,EAEb,sBAAsB,GACvB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,gCAAgC,CAAC,YAAY,EAAE,MAAM,cAAc,CAAC;AAQ7E;;;;;;;;;GASG;AACH,MAAM,0BAA0B,GAAG,CACjC,QAAoB,EACpB,QAAoE;IAClE,aAAa;IACb,aAAa;IACb,UAAU;IACV,SAAS;CACV,EACmB,EAAE;IACtB,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EA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n PaymentMethod,\n PaymentAuto,\n getTaxesIncludedAmount,\n} from '../types';\nimport * as dayjs from 'dayjs';\nimport { PartialExercicePrestationExpress } from '../types/Interface/api/payment/Util';\nimport { /* getApplicationFeesAmount, */ getPriceGrid } from './prestation';\n\nexport interface PaymentsWithList extends IPayment {\n type?: 'isComptable' | 'isJuridique' | 'isSocial' | 'isOther';\n listPayments: IPayment[];\n isYearly?: boolean;\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 = (\n payments: IPayment[],\n types: ('isComptable' | 'isJuridique' | 'isSocial' | 'isOther')[] = [\n 'isComptable',\n 'isJuridique',\n 'isSocial',\n 'isOther',\n ],\n): PaymentsWithList[] => {\n const prestaComptable = payments.filter((el) => el?.paymentsPrestations?.prestationsList?.isComptable ?? false);\n const prestaSocial = payments.filter(\n (el) =>\n !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isSocial,\n );\n const prestaJuridique = payments.filter(\n (el) =>\n !el?.paymentsPrestations?.prestationsList?.isComptable && el?.paymentsPrestations?.prestationsList?.isJuridique,\n );\n const prestaOther = payments.filter(\n (el) =>\n !el?.paymentsPrestations?.prestationsList?.isComptable &&\n !el?.paymentsPrestations?.prestationsList?.isJuridique &&\n !el?.paymentsPrestations?.prestationsList?.isSocial,\n );\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\n// const calculateFees = (amount: number, paymentDate: Date): number => {\n// const yearlyPriceIncreasing = 1.0275;\n\n// // Commenté car en fin d'année, pour appliquer le taux d'inflation annuel,\n// // un script enlève les 2,75€ appliqués pour appliquer le bon taux\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 {\n idTypeBrand,\n // isWithApplicationFees,\n firstExerciceNonExpresssEndDate,\n idPrestation,\n // idLegalForm,\n prestationList,\n idVat,\n yearlyAmountNonExpress,\n nextYearlyAmountNonExpress,\n listPartialExercicePrestationExpress,\n listRegulations,\n recoveryDate,\n } = params;\n\n if (!yearlyAmountNonExpress) throw new Error('Le montant annuel des prestations non express ne peut pas être nul.');\n\n // Si on est dans les 3 derniers jours du mois actuel,\n // on ne le compte pas et on facture à partir du début de mois suivant\n let initializedPaymentDate =\n dayjs().endOf('month').diff(dayjs(), 'day') < 3 /* || dayjs().date() >= 14 */\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 //Si jour de la date de reprise >= 14, alors on débute la facturation 1 mois plus tard\n if (dayjs(initializedPaymentDate).date() >= 14)\n initializedPaymentDate = dayjs(initializedPaymentDate).add(1, 'month').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 =\n // (priceWithTaxesIncluded ? applicationCost : getTaxesIncludedAmount(applicationCost, idVat)) * 12;\n // const applicationFeesAmountTTC = getApplicationFeesAmount(idLegalForm, idVat);\n\n if (prestationList?.isCatalog || !prestationList?.isComptable)\n throw new Error('Ce type de prestation ne correspond pas aux conditions attendues.');\n if (\n listPartialExercicePrestationExpress.length &&\n listPartialExercicePrestationExpress?.some((ep: PartialExercicePrestationExpress) => !ep?.startDate)\n )\n throw new Error('Start date of some exercice are missing');\n\n // let yearlyAmountNonExpressClone = yearlyAmountNonExpress;\n // if (isWithApplicationFees) {\n // yearlyAmountNonExpressClone -= getApplicationFeesAmount(idLegalForm); //HT\n // }\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;\n const bStartDate = b?.startDate;\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\n // ? listPartialExercicePrestationExpress[0].endDate\n // : firstExerciceNonExpresssEndDate,\n // comment: 'Frais de dossier',\n // });\n // remainingAmount += applicationFeesAmountTTC;\n // }\n\n // =========================\n // EXPRESS\n // =========================\n listPartialExercicePrestationExpress.forEach(\n (exercicePrestation: PartialExercicePrestationExpress, indexEP: number) => {\n const remainingBeforeThisExo = remainingAmount;\n\n remainingAmount += !priceWithTaxesIncluded\n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat)\n : exercicePrestation.totalAmount; //TTC\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:\n Math.round(\n 100 *\n (!priceWithTaxesIncluded\n ? getTaxesIncludedAmount(exercicePrestation.totalAmount, idVat)\n : exercicePrestation.totalAmount),\n ) / 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 ?? 1; //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 // =========================\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 let countNonExpressGenerated = 0;\n\n // On génère des paiements jusqu'à ce qu'un exercice soit entier (12 mois), non express\n // et qu'au moins 13 mois de paiements ont été générés depuis la date de reprise\n while (!hasGeneratedWholeYear || countNonExpressGenerated < 2) {\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 // Si un client signe un Express dans les 3 derniers mois de l'année (par exemple en décembre 2024)\n // on ne doit pas générer l'année 2025 sur 13 mois à partir du 12/24\n // mais on doit attendre le début de l'exercice concerné (ici, 01/25)\n if (countMonthsBeforeExerciceEnd > 12) {\n paymentDate = dayjs(paymentDate).add(1, 'month').startOf('month').toDate();\n continue;\n }\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 const 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, 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 countNonExpressGenerated += 1;\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\n ? nextYearlyAmountNonExpress\n : getTaxesIncludedAmount(nextYearlyAmountNonExpress, idVat);\n\n const 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 // const 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, paymentDate);\n\n listPayments.push({\n amount: Math.round(100 * monthlyAmount) / 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 { groupPaymentsByServiceType, calculatePaymentsAuto };\n"]}
|
|
@@ -93,6 +93,7 @@ declare const calculatePrestationPriceWithPriceGrid: (idPrestationList: number,
|
|
|
93
93
|
* @param idLegalForm
|
|
94
94
|
* @param idVat
|
|
95
95
|
* @returns amount of application fees, without taxes included
|
|
96
|
+
* @deprecated Application fees are not charged anymore
|
|
96
97
|
*/
|
|
97
98
|
declare const getApplicationFeesAmount: (idLegalForm: number, idVat?: number) => number;
|
|
98
99
|
declare const calculatePrestationPrice: (idPrestationList: number, prestationList: IPrestationList, endDate: string, NbrMonth: number, turnover: number, rentsNumber: number, employeesNumber: number, associatesNumber: number, idTypeBrand: number, idVatRegime: number, pastBalanceSheet: boolean, optionsList: number[], totalPercentage: number, totalAmount: number, totalMonth: number, isWithApplicationFees: boolean, idTaxSystem: number, idLegalForm: number, isYearly?: boolean, isSubPrestation?: boolean, balanceSheetOffered?: number, exerciceList?: IExercice[]) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prestation.d.ts","sourceRoot":"","sources":["../../../ts/utils/prestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAInE,OAAO,EAGL,cAAc,EACf,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,oBAAoB,EAAoB,MAAM,gCAAgC,CAAC;AAexF,KAAK,SAAS,GAAG;IACf,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,sBAAsB,EAAE,OAAO,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAC5B,mBAAmB,CAAC,EA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iB,MAAM,EACvB,kBAAkB,MAAM,EACxB,aAAa,MAAM,EACnB,aAAa,MAAM,EACnB,kBAAkB,OAAO,EACzB,aAAa,MAAM,EAAE,EACrB,iBAAiB,MAAM,EACvB,aAAa,MAAM,EACnB,YAAY,MAAM,EAClB,uBAAuB,OAAO,EAC9B,aAAa,MAAM,EACnB,aAAa,MAAM,EACnB,WAAU,OAAe,EACzB,kBAAiB,OAAe,EAChC,sBAAqB,MAAU,EAC/B,eAAc,SAAS,EAAO,KAC7B;IACD,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CAuHf,CAAC;AAEF,QAAA,MAAM,oBAAoB,GAAI,kBAAkB,MAAM,KAAG,oBAAoB,EAK5E,CAAC;AAEF,QAAA,MAAM,mBAAmB,GACvB,aAAa,MAAM,EACnB,kBAAkB,MAAM,EACxB,UAAU,MAAM,EAChB,kBAAkB,OAAO,KACxB,OAqCF,CAAC;AAEF,QAAA,MAAM,2BAA2B,GAAI,kBAAkB,MAAM,KAAG,UAAU,GAAG,WAG5E,CAAC;AAEF,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,4BAA4B,EAC5B,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,qCAAqC,EACrC,wBAAwB,EACxB,2BAA2B,GAC5B,CAAC"}
|
|
@@ -238,6 +238,7 @@ const calculatePrestationPriceWithPrestationList = (prestationList) => {
|
|
|
238
238
|
* @param idLegalForm
|
|
239
239
|
* @param idVat
|
|
240
240
|
* @returns amount of application fees, without taxes included
|
|
241
|
+
* @deprecated Application fees are not charged anymore
|
|
241
242
|
*/
|
|
242
243
|
const getApplicationFeesAmount = (idLegalForm, idVat) => {
|
|
243
244
|
let applicationFeesAmount = 50;
|