@silexpert/core 1.3.72-1 → 1.3.73
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/PaymentExpectationCustomer.d.ts +1 -4
- package/dist/cjs/api/resources/PaymentExpectationCustomer.d.ts.map +1 -1
- package/dist/cjs/api/resources/PaymentExpectationCustomer.js +0 -6
- package/dist/cjs/api/resources/PaymentExpectationCustomer.js.map +1 -1
- package/dist/cjs/api/resources/Recurrence.d.ts +2 -1
- package/dist/cjs/api/resources/Recurrence.d.ts.map +1 -1
- package/dist/cjs/api/resources/Recurrence.js +6 -0
- package/dist/cjs/api/resources/Recurrence.js.map +1 -1
- package/dist/cjs/types/Enum/PrestationType.d.ts.map +1 -1
- package/dist/cjs/types/Enum/PrestationType.js +61 -57
- package/dist/cjs/types/Enum/PrestationType.js.map +1 -1
- package/dist/cjs/types/Interface/api/recurrence/Query.d.ts +5 -0
- package/dist/cjs/types/Interface/api/recurrence/Query.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/recurrence/Query.js +27 -0
- package/dist/cjs/types/Interface/api/recurrence/Query.js.map +1 -0
- package/dist/cjs/types/Interface/api/recurrence/Read.d.ts +7 -0
- package/dist/cjs/types/Interface/api/recurrence/Read.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/recurrence/Read.js +3 -0
- package/dist/cjs/types/Interface/api/recurrence/Read.js.map +1 -0
- package/dist/cjs/types/Interface/api/society/Export.d.ts +1 -1
- package/dist/cjs/types/Interface/api/society/Export.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/society/Export.js.map +1 -1
- package/dist/cjs/types/Interface/api/society/SocietyWithStatsCaParams.d.ts +1 -2
- package/dist/cjs/types/Interface/api/society/SocietyWithStatsCaParams.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/society/SocietyWithStatsCaParams.js.map +1 -1
- package/dist/cjs/types/Interface/api/stripe/Create.d.ts +1 -6
- package/dist/cjs/types/Interface/api/stripe/Create.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/stripe/Create.js +4 -18
- package/dist/cjs/types/Interface/api/stripe/Create.js.map +1 -1
- package/dist/cjs/types/index.d.ts +2 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +2 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/utils/prestation.d.ts.map +1 -1
- package/dist/cjs/utils/prestation.js +22 -16
- package/dist/cjs/utils/prestation.js.map +1 -1
- package/dist/cjs/utils/vat/registration.d.ts +1 -0
- package/dist/cjs/utils/vat/registration.d.ts.map +1 -1
- package/dist/cjs/utils/vat/registration.js +5 -1
- package/dist/cjs/utils/vat/registration.js.map +1 -1
- package/dist/mjs/api/resources/PaymentExpectationCustomer.d.ts +1 -4
- package/dist/mjs/api/resources/PaymentExpectationCustomer.d.ts.map +1 -1
- package/dist/mjs/api/resources/PaymentExpectationCustomer.js +0 -6
- package/dist/mjs/api/resources/PaymentExpectationCustomer.js.map +1 -1
- package/dist/mjs/api/resources/Recurrence.d.ts +2 -1
- package/dist/mjs/api/resources/Recurrence.d.ts.map +1 -1
- package/dist/mjs/api/resources/Recurrence.js +6 -0
- package/dist/mjs/api/resources/Recurrence.js.map +1 -1
- package/dist/mjs/types/Enum/PrestationType.d.ts.map +1 -1
- package/dist/mjs/types/Enum/PrestationType.js +61 -57
- package/dist/mjs/types/Enum/PrestationType.js.map +1 -1
- package/dist/mjs/types/Interface/api/recurrence/Query.d.ts +5 -0
- package/dist/mjs/types/Interface/api/recurrence/Query.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/recurrence/Query.js +24 -0
- package/dist/mjs/types/Interface/api/recurrence/Query.js.map +1 -0
- package/dist/mjs/types/Interface/api/recurrence/Read.d.ts +7 -0
- package/dist/mjs/types/Interface/api/recurrence/Read.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/recurrence/Read.js +2 -0
- package/dist/mjs/types/Interface/api/recurrence/Read.js.map +1 -0
- package/dist/mjs/types/Interface/api/society/Export.d.ts +1 -1
- package/dist/mjs/types/Interface/api/society/Export.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/society/Export.js.map +1 -1
- package/dist/mjs/types/Interface/api/society/SocietyWithStatsCaParams.d.ts +1 -2
- package/dist/mjs/types/Interface/api/society/SocietyWithStatsCaParams.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/society/SocietyWithStatsCaParams.js.map +1 -1
- package/dist/mjs/types/Interface/api/stripe/Create.d.ts +1 -6
- package/dist/mjs/types/Interface/api/stripe/Create.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/stripe/Create.js +5 -18
- package/dist/mjs/types/Interface/api/stripe/Create.js.map +1 -1
- package/dist/mjs/types/index.d.ts +2 -0
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +2 -0
- package/dist/mjs/types/index.js.map +1 -1
- package/dist/mjs/utils/prestation.d.ts.map +1 -1
- package/dist/mjs/utils/prestation.js +20 -14
- package/dist/mjs/utils/prestation.js.map +1 -1
- package/dist/mjs/utils/vat/registration.d.ts +1 -0
- package/dist/mjs/utils/vat/registration.d.ts.map +1 -1
- package/dist/mjs/utils/vat/registration.js +5 -1
- package/dist/mjs/utils/vat/registration.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/PaymentExpectationCustomer.ts +0 -11
- package/ts/api/resources/Recurrence.ts +13 -1
- package/ts/types/Enum/PrestationType.ts +61 -57
- package/ts/types/Interface/api/recurrence/Query.ts +12 -0
- package/ts/types/Interface/api/recurrence/Read.ts +7 -0
- package/ts/types/Interface/api/society/Export.ts +1 -1
- package/ts/types/Interface/api/society/SocietyWithStatsCaParams.ts +1 -2
- package/ts/types/Interface/api/stripe/Create.ts +4 -15
- package/ts/types/index.ts +2 -0
- package/ts/utils/prestation.ts +22 -15
- package/ts/utils/vat/registration.ts +10 -5
|
@@ -2,9 +2,9 @@ import * as dayjs from 'dayjs';
|
|
|
2
2
|
import { isDefined } from 'class-validator';
|
|
3
3
|
import { reverse, sumBy } from 'lodash';
|
|
4
4
|
import {
|
|
5
|
+
AnyCerfa3310_Century,
|
|
5
6
|
Cerfa2571_2023,
|
|
6
7
|
Cerfa2573_2024,
|
|
7
|
-
Cerfa3310_2023,
|
|
8
8
|
Cerfa3514_2022,
|
|
9
9
|
CerfaType,
|
|
10
10
|
CustomerVatType,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
RegistrationTickState,
|
|
18
18
|
TaxType,
|
|
19
19
|
} from '../../types';
|
|
20
|
-
import {
|
|
20
|
+
import { AnyCerfa3517Century } from '../../types/Interface/api/cerfa/3517';
|
|
21
21
|
|
|
22
22
|
const waitingState: ReadRegistrationTick = {
|
|
23
23
|
state: RegistrationTickState.IN_PROGRESS,
|
|
@@ -147,9 +147,10 @@ export function getTypeAndAmountFromRegistration(registration: IRegistration): {
|
|
|
147
147
|
amount: number | null;
|
|
148
148
|
collectable: number;
|
|
149
149
|
deductible: number;
|
|
150
|
+
amountBase?: number;
|
|
150
151
|
} {
|
|
151
152
|
if (registration.idCerfaType === CerfaType.CERFA_3310) {
|
|
152
|
-
const payload = registration.payload.cerfa3310 as
|
|
153
|
+
const payload = registration.payload.cerfa3310 as AnyCerfa3310_Century;
|
|
153
154
|
const other = { collectable: payload.vat?.grossDue, deductible: payload.vat?.deductible.total };
|
|
154
155
|
if (payload?.isNil) return { type: CustomerVatType.VAT_TO_NIL, amount: 0, ...other };
|
|
155
156
|
if (payload?.toPay?.total > 0) return { type: CustomerVatType.VAT_TO_PAY, amount: payload.toPay.total, ...other };
|
|
@@ -169,8 +170,12 @@ export function getTypeAndAmountFromRegistration(registration: IRegistration): {
|
|
|
169
170
|
return { type: CustomerVatType.VAT_TO_PAY, amount: 0, ...other };
|
|
170
171
|
}
|
|
171
172
|
if (registration.idCerfaType === CerfaType.CERFA_3517) {
|
|
172
|
-
const payload = registration.payload.cerfa3517 as
|
|
173
|
-
const other = {
|
|
173
|
+
const payload = registration.payload.cerfa3517 as AnyCerfa3517Century;
|
|
174
|
+
const other = {
|
|
175
|
+
collectable: payload.other.total,
|
|
176
|
+
deductible: payload.deductible.total,
|
|
177
|
+
amountBase: payload?.total,
|
|
178
|
+
};
|
|
174
179
|
if (payload?.isNil) return { type: CustomerVatType.VAT_TO_NIL, amount: 0, ...other };
|
|
175
180
|
if (payload?.recapitulation?.toPay > 0)
|
|
176
181
|
return { type: CustomerVatType.VAT_TO_PAY, amount: payload?.recapitulation?.toPay, ...other };
|