@silexpert/core 1.1.33 → 1.1.34
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/es/types/Interface/api/registration/ReadRegistration.d.ts +4 -2
- package/es/types/Interface/api/registration/ReadRegistration.d.ts.map +1 -1
- package/es/types/Interface/api/registration/ReadRegistration.js.map +1 -1
- package/es/utils/vat/3310/century23.d.ts.map +1 -1
- package/es/utils/vat/3310/century23.js +2 -2
- package/es/utils/vat/3310/century23.js.map +1 -1
- package/es/utils/vat/3517/century23.d.ts.map +1 -1
- package/es/utils/vat/3517/century23.js +8 -7
- package/es/utils/vat/3517/century23.js.map +1 -1
- package/js/types/Interface/api/registration/ReadRegistration.js.map +1 -1
- package/js/utils/vat/3310/century23.js +1 -1
- package/js/utils/vat/3310/century23.js.map +1 -1
- package/js/utils/vat/3517/century23.js +7 -6
- package/js/utils/vat/3517/century23.js.map +1 -1
- package/package.json +1 -1
- package/ts/types/Interface/api/registration/ReadRegistration.ts +4 -1
- package/ts/utils/vat/3310/century23.ts +3 -2
- package/ts/utils/vat/3517/century23.ts +8 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"century23.d.ts","sourceRoot":"","sources":["../../../../ts/utils/vat/3517/century23.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAGpF,OAAO,EAAkB,gBAAgB,EAAiB,MAAM,gBAAgB,CAAC;AAEjF,wBAAgB,4BAA4B,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,EAAE,OAAO,EAAE,qBAAqB,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"century23.d.ts","sourceRoot":"","sources":["../../../../ts/utils/vat/3517/century23.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAGpF,OAAO,EAAkB,gBAAgB,EAAiB,MAAM,gBAAgB,CAAC;AAEjF,wBAAgB,4BAA4B,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,EAAE,OAAO,EAAE,qBAAqB,GAAG,cAAc,CA8UlI;AAED,wBAAgB,oCAAoC,CAAC,IAAI,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgxCxE;AAED,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,EAwHtD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as dayjs from 'dayjs';
|
|
2
2
|
import { isDefined } from 'class-validator';
|
|
3
|
-
import { round as _round } from 'lodash';
|
|
3
|
+
import { round as _round, uniqBy } from 'lodash';
|
|
4
4
|
import { Vat } from '../../../types/Enum/Vat';
|
|
5
5
|
import { getAmountByAccountNumber, getTaxAmountByAccountNumber, textFormatting } from '../utils';
|
|
6
6
|
export function getCerfa3517Century23Payload(accountingEntries, payload) {
|
|
@@ -9,11 +9,12 @@ export function getCerfa3517Century23Payload(accountingEntries, payload) {
|
|
|
9
9
|
const shouldFillRefund = _round((_c = (_b = payload.refund) === null || _b === void 0 ? void 0 : _b.asked) !== null && _c !== void 0 ? _c : 0) > 0;
|
|
10
10
|
const isNil = payload.isNil === true;
|
|
11
11
|
const vats = Object.values(Vat);
|
|
12
|
-
const vatEntries = accountingEntries.filter((ae) => typeof ae.idVat === 'number');
|
|
12
|
+
const vatEntries = uniqBy(accountingEntries.filter((ae) => typeof ae.idVat === 'number'), 'id');
|
|
13
13
|
const withoutTaxVat = vats.filter((v) => v.value === 0).map((v) => v.id);
|
|
14
14
|
const intracomVat = vats.filter((v) => v.isVatIntracom && !v.isVatImportation).map((v) => v.id);
|
|
15
15
|
const frenchVat = vats.filter((v) => !v.isVatImportation && !v.isVatIntracom).map((v) => v.id);
|
|
16
|
-
const
|
|
16
|
+
const importationVat = vats.filter((v) => v.isVatImportation && !v.isVatIntracom).map((v) => v.id);
|
|
17
|
+
const taxedOperationsAccounts = ['701', '702', '703', '704', '705', '706', '707', '708', '472'];
|
|
17
18
|
const vatNormalRate20 = getAmountByAccountNumber(vatEntries.filter((ae) => ae.idVat === Vat.TX_20.id), taxedOperationsAccounts, 0, true);
|
|
18
19
|
const vatReducedRate5Dot5 = getAmountByAccountNumber(vatEntries.filter((ae) => ae.idVat === Vat.TX_5_5.id), taxedOperationsAccounts, 0, true);
|
|
19
20
|
const vatReducedRate10 = getAmountByAccountNumber(vatEntries.filter((ae) => ae.idVat === Vat.TX_10.id), taxedOperationsAccounts, 0, true);
|
|
@@ -24,11 +25,11 @@ export function getCerfa3517Century23Payload(accountingEntries, payload) {
|
|
|
24
25
|
const prestation2Base = getAmountByAccountNumber(prestation2Entries, presta2Accounts, 0, true);
|
|
25
26
|
const prestation2AmountOfVat = getTaxAmountByAccountNumber(prestation2Entries, presta2Accounts);
|
|
26
27
|
const saleOfImmobilization = getAmountByAccountNumber(vatEntries.filter((ae) => !withoutTaxVat.includes(ae.idVat) && frenchVat.includes(ae.idVat)), ['775'], 0, true);
|
|
27
|
-
const onInvoiceDeductible =
|
|
28
|
-
const onImmobilizationDeductible =
|
|
29
|
-
const julyAdvance = (_e = (_d = payload === null || payload === void 0 ? void 0 : payload.exerciceAdvanceRegistrations) === null || _d === void 0 ? void 0 : _d.find((a) => dayjs(a.endDate).month()
|
|
28
|
+
const onInvoiceDeductible = getTaxAmountByAccountNumber(vatEntries.filter(ae => !importationVat.includes(ae.idVat)), ['6']);
|
|
29
|
+
const onImmobilizationDeductible = getTaxAmountByAccountNumber(vatEntries, ['2']);
|
|
30
|
+
const julyAdvance = (_e = (_d = payload === null || payload === void 0 ? void 0 : payload.exerciceAdvanceRegistrations) === null || _d === void 0 ? void 0 : _d.find((a) => [5, 6].includes(dayjs(a.endDate).month()))) !== null && _e !== void 0 ? _e : null;
|
|
30
31
|
const julyAdvancePayload = (_g = (_f = julyAdvance === null || julyAdvance === void 0 ? void 0 : julyAdvance.payload) === null || _f === void 0 ? void 0 : _f.cerfa3514) !== null && _g !== void 0 ? _g : null;
|
|
31
|
-
const decemberAdvance = (_j = (_h = payload === null || payload === void 0 ? void 0 : payload.exerciceAdvanceRegistrations) === null || _h === void 0 ? void 0 : _h.find((a) => dayjs(a.endDate).month()
|
|
32
|
+
const decemberAdvance = (_j = (_h = payload === null || payload === void 0 ? void 0 : payload.exerciceAdvanceRegistrations) === null || _h === void 0 ? void 0 : _h.find((a) => [10, 11].includes(dayjs(a.endDate).month()))) !== null && _j !== void 0 ? _j : null;
|
|
32
33
|
const decemberAdvancePayload = (_l = (_k = decemberAdvance === null || decemberAdvance === void 0 ? void 0 : decemberAdvance.payload) === null || _k === void 0 ? void 0 : _k.cerfa3514) !== null && _l !== void 0 ? _l : null;
|
|
33
34
|
const data = {
|
|
34
35
|
isNil: payload.isNil === true,
|