@silexpert/core 1.1.68 → 1.1.69
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/utils/vat/3310/century23.d.ts.map +1 -1
- package/es/utils/vat/3310/century23.js +22 -1
- package/es/utils/vat/3310/century23.js.map +1 -1
- package/es/utils/vat/3517/century23.js +21 -21
- package/es/utils/vat/3517/century23.js.map +1 -1
- package/js/utils/vat/3310/century23.js +32 -0
- package/js/utils/vat/3310/century23.js.map +1 -1
- package/js/utils/vat/3517/century23.js +21 -21
- package/js/utils/vat/3517/century23.js.map +1 -1
- package/package.json +1 -1
- package/ts/utils/vat/3310/century23.ts +28 -1
- package/ts/utils/vat/3517/century23.ts +21 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.69",
|
|
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": "js/index.js",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as dayjs from 'dayjs';
|
|
2
2
|
import { isDefined } from 'class-validator';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
round as _round, flatten, uniqBy, maxBy,
|
|
5
|
+
} from 'lodash';
|
|
4
6
|
import { IAccountingEntry } from '../../../types/Interface/models/IAccountingEntry';
|
|
5
7
|
import { Cerfa3310_2023, PayloadCerfa3310_2023 } from '../../../types/Interface/api/cerfa/3310';
|
|
6
8
|
import { Vat } from '../../../types/Enum/Vat';
|
|
@@ -343,6 +345,31 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
|
|
|
343
345
|
},
|
|
344
346
|
};
|
|
345
347
|
|
|
348
|
+
const totalCadreA = initialPayload.taxedOperations.services + initialPayload.taxedOperations.other + initialPayload.taxedOperations.purchaseOfIntracommunityServiceProvision + initialPayload.taxedOperations.intracommunityAcquisitions + initialPayload.taxedOperations.energyDelivery + initialPayload.taxedOperations.purchaseOfServicesNotInFrance;
|
|
349
|
+
const totalCadreB = initialPayload.vat.carrieredOutInFrance.normalRate20.base + initialPayload.vat.carrieredOutInFrance.reduceRate5Dot5.base + initialPayload.vat.carrieredOutInFrance.reduceRate10.base + initialPayload.vat.overseasDepartment.reduceRate8Dot5.base + initialPayload.vat.overseasDepartment.reduceRate2Dot1.base + initialPayload.vat.otherRate.at1Dot75.base + initialPayload.vat.otherRate.at1Dot05.base + initialPayload.vat.otherRate.at10.base + initialPayload.vat.otherRate.atCorse2Dot1.base + initialPayload.vat.otherRate.atCorse0Dot9.base + initialPayload.vat.otherRate.at2Dot1.base + initialPayload.vat.otherRate.author.base + initialPayload.vat.otherRate.oldRate.base;
|
|
350
|
+
|
|
351
|
+
// On tolère une différence de 3, dans ce cas on force le champ
|
|
352
|
+
if (totalCadreA !== totalCadreB) {
|
|
353
|
+
const difference = totalCadreB - totalCadreA;
|
|
354
|
+
|
|
355
|
+
if (difference >= -3 && difference <= 3) {
|
|
356
|
+
const cadreAFields = [
|
|
357
|
+
{ key: 'services', value: initialPayload.taxedOperations.services },
|
|
358
|
+
{ key: 'other', value: initialPayload.taxedOperations.other },
|
|
359
|
+
{ key: 'purchaseOfIntracommunityServiceProvision', value: initialPayload.taxedOperations.purchaseOfIntracommunityServiceProvision },
|
|
360
|
+
{ key: 'intracommunityAcquisitions', value: initialPayload.taxedOperations.intracommunityAcquisitions },
|
|
361
|
+
{ key: 'energyDelivery', value: initialPayload.taxedOperations.energyDelivery },
|
|
362
|
+
{ key: 'purchaseOfServicesNotInFrance;', value: initialPayload.taxedOperations.purchaseOfServicesNotInFrance },
|
|
363
|
+
];
|
|
364
|
+
const biggestValue = maxBy(cadreAFields, 'value');
|
|
365
|
+
|
|
366
|
+
if (biggestValue) {
|
|
367
|
+
// @ts-ignore
|
|
368
|
+
initialPayload.taxedOperations[biggestValue.key] += difference;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
346
373
|
initialPayload.vat.grossDue = initialPayload.vat.carrieredOutInFrance.normalRate20.tax + initialPayload.vat.carrieredOutInFrance.reduceRate5Dot5.tax + initialPayload.vat.carrieredOutInFrance.reduceRate10.tax + initialPayload.vat.overseasDepartment.reduceRate8Dot5.tax + initialPayload.vat.overseasDepartment.reduceRate2Dot1.tax + initialPayload.vat.otherRate.at1Dot75.tax + initialPayload.vat.otherRate.at1Dot05.tax + initialPayload.vat.otherRate.at10.tax + initialPayload.vat.otherRate.atCorse2Dot1.tax + initialPayload.vat.otherRate.atCorse0Dot9.tax + initialPayload.vat.otherRate.at2Dot1.tax + initialPayload.vat.otherRate.author.tax + initialPayload.vat.otherRate.oldRate.tax + initialPayload.vat.oilProducts.normalRate20.tax + initialPayload.vat.oilProducts.reduceRate13.tax + initialPayload.vat.importations.normalRate20.tax + initialPayload.vat.importations.reduceRate10.tax + initialPayload.vat.importations.reduceRate8Dot5.tax + initialPayload.vat.importations.reduceRate5Dot5.tax + initialPayload.vat.importations.reduceRate2Dot1.tax + initialPayload.vat.importations.reduceRate1Dot05.tax + initialPayload.vat.previouslyDeductedToBeReturned.total + initialPayload.vat.sumToAdd;
|
|
347
374
|
initialPayload.vat.deductible.total = initialPayload.vat.deductible.immobilizations + initialPayload.vat.deductible.otherGoodsAndServices + initialPayload.vat.deductible.other.total + initialPayload.vat.deductible.report + initialPayload.vat.deductible.toImpute;
|
|
348
375
|
initialPayload.credit.amount = initialPayload.vat.grossDue - initialPayload.vat.deductible.total < 0 ? Math.abs(initialPayload.vat.grossDue - initialPayload.vat.deductible.total) : 0;
|
|
@@ -609,14 +609,14 @@ export function getCerfa3517CenturyRegistrationField(data: Cerfa3517_2023): Aspo
|
|
|
609
609
|
isMultiple: false,
|
|
610
610
|
tag: 'Valeur',
|
|
611
611
|
description: 'Remboursement de reliquat de TIC demandé 912242 Y5',
|
|
612
|
-
value: data.recapitulation.ticRefunded,
|
|
612
|
+
value: data.recapitulation.ticRefunded > 0 ? data.recapitulation.ticRefunded : null,
|
|
613
613
|
},
|
|
614
614
|
{
|
|
615
615
|
key: 'BJ',
|
|
616
616
|
isMultiple: false,
|
|
617
617
|
tag: 'Valeur',
|
|
618
618
|
description: 'Total des taxes intérieures de consommation dues 912247 Z5',
|
|
619
|
-
value: data.recapitulation.consumsion,
|
|
619
|
+
value: data.recapitulation.consumsion > 0 ? data.recapitulation.consumsion : null,
|
|
620
620
|
},
|
|
621
621
|
{
|
|
622
622
|
key: 'CA',
|
|
@@ -662,14 +662,14 @@ export function getCerfa3517CenturyRegistrationField(data: Cerfa3517_2023): Aspo
|
|
|
662
662
|
isMultiple: false,
|
|
663
663
|
tag: 'Valeur',
|
|
664
664
|
description: 'TICFE - Taxe due 912244 ',
|
|
665
|
-
value: data.tic.ticfe.tax,
|
|
665
|
+
value: data.tic.ticfe.tax && data.tic.ticfe.tax > 0 ? data.tic.ticfe.tax : null,
|
|
666
666
|
},
|
|
667
667
|
{
|
|
668
668
|
key: 'CJ',
|
|
669
669
|
isMultiple: false,
|
|
670
670
|
tag: 'Valeur',
|
|
671
671
|
description: 'Total de la contribution sur la rente infra-marginale de la production d\'électricité (lignes a à q) 912268 44A',
|
|
672
|
-
value: data.tax.contribution,
|
|
672
|
+
value: data.tax.contribution && data.tax.contribution > 0 ? data.tax.contribution : null,
|
|
673
673
|
},
|
|
674
674
|
{
|
|
675
675
|
key: 'DA',
|
|
@@ -984,14 +984,14 @@ export function getCerfa3517CenturyRegistrationField(data: Cerfa3517_2023): Aspo
|
|
|
984
984
|
isMultiple: false,
|
|
985
985
|
tag: 'Valeur',
|
|
986
986
|
description: 'TICCE - crédit imputé sur la TVA 912237 ',
|
|
987
|
-
value: data.tic.ticc.imputed,
|
|
987
|
+
value: data.tic.ticc.imputed && data.tic.ticc.imputed > 0 ? data.tic.ticc.imputed : null,
|
|
988
988
|
},
|
|
989
989
|
{
|
|
990
990
|
key: 'HH',
|
|
991
991
|
isMultiple: false,
|
|
992
992
|
tag: 'Valeur',
|
|
993
993
|
description: 'TICGN - Taxe due 912245 ',
|
|
994
|
-
value: data.tic.ticgn.tax,
|
|
994
|
+
value: data.tic.ticgn.tax && data.tic.ticgn.tax > 0 ? data.tic.ticgn.tax : null,
|
|
995
995
|
},
|
|
996
996
|
{
|
|
997
997
|
key: 'JA',
|
|
@@ -1019,14 +1019,14 @@ export function getCerfa3517CenturyRegistrationField(data: Cerfa3517_2023): Aspo
|
|
|
1019
1019
|
isMultiple: false,
|
|
1020
1020
|
tag: 'Valeur',
|
|
1021
1021
|
description: 'TOTAL - crédit imputé sur la TVA 912252 ',
|
|
1022
|
-
value: data.tic.total.imputed,
|
|
1022
|
+
value: data.tic.total.imputed && data.tic.total.imputed > 0 ? data.tic.total.imputed : null,
|
|
1023
1023
|
},
|
|
1024
1024
|
{
|
|
1025
1025
|
key: 'JH',
|
|
1026
1026
|
isMultiple: false,
|
|
1027
1027
|
tag: 'Valeur',
|
|
1028
1028
|
description: 'TICCE - Taxe due 912246 ',
|
|
1029
|
-
value: data.tic.ticc.tax,
|
|
1029
|
+
value: data.tic.ticc.tax && data.tic.ticc.tax > 0 ? data.tic.ticc.tax : null,
|
|
1030
1030
|
},
|
|
1031
1031
|
{
|
|
1032
1032
|
key: 'KA',
|
|
@@ -1082,14 +1082,14 @@ export function getCerfa3517CenturyRegistrationField(data: Cerfa3517_2023): Aspo
|
|
|
1082
1082
|
isMultiple: false,
|
|
1083
1083
|
tag: 'Valeur',
|
|
1084
1084
|
description: 'Crédit de TIC imputé sur la TVA (Total) 912238 X5',
|
|
1085
|
-
value: data.recapitulation.imputeOnVat,
|
|
1085
|
+
value: data.recapitulation.imputeOnVat && data.recapitulation.imputeOnVat > 0 ? data.recapitulation.imputeOnVat : null,
|
|
1086
1086
|
},
|
|
1087
1087
|
{
|
|
1088
1088
|
key: 'LH',
|
|
1089
1089
|
isMultiple: false,
|
|
1090
1090
|
tag: 'Valeur',
|
|
1091
1091
|
description: 'TOTAL - taxe due 912254 ',
|
|
1092
|
-
value: data.tic.total.tax,
|
|
1092
|
+
value: data.tic.total.tax && data.tic.total.tax > 0 ? data.tic.total.tax : null,
|
|
1093
1093
|
},
|
|
1094
1094
|
{
|
|
1095
1095
|
key: 'MA',
|
|
@@ -1166,21 +1166,21 @@ export function getCerfa3517CenturyRegistrationField(data: Cerfa3517_2023): Aspo
|
|
|
1166
1166
|
isMultiple: false,
|
|
1167
1167
|
tag: 'Valeur',
|
|
1168
1168
|
description: 'Taxe due par les employeurs de main-d\'½uvre étrangère (L. 436-10 du CESEDA) (uniquement pour les cessations d\'activité ayant lieu en 2023) 912261 45',
|
|
1169
|
-
value: data.tax.ofEmployer,
|
|
1169
|
+
value: data.tax.ofEmployer && data.tax.ofEmployer > 0 ? data.tax.ofEmployer : null,
|
|
1170
1170
|
},
|
|
1171
1171
|
{
|
|
1172
1172
|
key: 'NT',
|
|
1173
1173
|
isMultiple: false,
|
|
1174
1174
|
tag: 'Valeur',
|
|
1175
1175
|
description: 'TICFE - Reliquat de crédit à rembourser 912239 ',
|
|
1176
|
-
value: data.tic.ticfe.refund,
|
|
1176
|
+
value: data.tic.ticfe.refund && data.tic.ticfe.refund > 0 ? data.tic.ticfe.refund : null,
|
|
1177
1177
|
},
|
|
1178
1178
|
{
|
|
1179
1179
|
key: 'NU',
|
|
1180
1180
|
isMultiple: false,
|
|
1181
1181
|
tag: 'Valeur',
|
|
1182
1182
|
description: 'TICFE - crédit constaté 912248 ',
|
|
1183
|
-
value: data.tic.ticfe.credit,
|
|
1183
|
+
value: data.tic.ticfe.credit && data.tic.ticfe.credit > 0 ? data.tic.ticfe.credit : null,
|
|
1184
1184
|
},
|
|
1185
1185
|
{
|
|
1186
1186
|
key: 'QA',
|
|
@@ -1341,28 +1341,28 @@ export function getCerfa3517CenturyRegistrationField(data: Cerfa3517_2023): Aspo
|
|
|
1341
1341
|
isMultiple: false,
|
|
1342
1342
|
tag: 'Valeur',
|
|
1343
1343
|
description: 'TICFE - crédit imputé sur la TVA 912235 ',
|
|
1344
|
-
value: data.tic.ticfe.imputed,
|
|
1344
|
+
value: data.tic.ticfe.imputed && data.tic.ticfe.imputed > 0 ? data.tic.ticfe.imputed : null,
|
|
1345
1345
|
},
|
|
1346
1346
|
{
|
|
1347
1347
|
key: 'TF',
|
|
1348
1348
|
isMultiple: false,
|
|
1349
1349
|
tag: 'Valeur',
|
|
1350
1350
|
description: 'TICGN - crédit imputé sur la TVA 912236 ',
|
|
1351
|
-
value: data.tic.ticgn.imputed,
|
|
1351
|
+
value: data.tic.ticgn.imputed && data.tic.ticgn.imputed > 0 ? data.tic.ticgn.imputed : null,
|
|
1352
1352
|
},
|
|
1353
1353
|
{
|
|
1354
1354
|
key: 'TG',
|
|
1355
1355
|
isMultiple: false,
|
|
1356
1356
|
tag: 'Valeur',
|
|
1357
1357
|
description: 'TICGN - Reliquat de crédit à rembourser 912240 ',
|
|
1358
|
-
value: data.tic.ticgn.refund,
|
|
1358
|
+
value: data.tic.ticgn.refund && data.tic.ticgn.refund > 0 ? data.tic.ticgn.refund : null,
|
|
1359
1359
|
},
|
|
1360
1360
|
{
|
|
1361
1361
|
key: 'TH',
|
|
1362
1362
|
isMultiple: false,
|
|
1363
1363
|
tag: 'Valeur',
|
|
1364
1364
|
description: 'TICGN - crédit constaté 912249 ',
|
|
1365
|
-
value: data.tic.ticgn.credit,
|
|
1365
|
+
value: data.tic.ticgn.credit && data.tic.ticgn.credit > 0 ? data.tic.ticgn.credit : null,
|
|
1366
1366
|
},
|
|
1367
1367
|
{
|
|
1368
1368
|
key: 'UB',
|
|
@@ -1390,14 +1390,14 @@ export function getCerfa3517CenturyRegistrationField(data: Cerfa3517_2023): Aspo
|
|
|
1390
1390
|
isMultiple: false,
|
|
1391
1391
|
tag: 'Valeur',
|
|
1392
1392
|
description: 'TICCE - Reliquat de crédit à rembourser 912241 ',
|
|
1393
|
-
value: data.tic.ticc.refund,
|
|
1393
|
+
value: data.tic.ticc.refund && data.tic.ticc.refund > 0 ? data.tic.ticc.refund : null,
|
|
1394
1394
|
},
|
|
1395
1395
|
{
|
|
1396
1396
|
key: 'UH',
|
|
1397
1397
|
isMultiple: false,
|
|
1398
1398
|
tag: 'Valeur',
|
|
1399
1399
|
description: 'TICCE - crédit constaté 912250 ',
|
|
1400
|
-
value: data.tic.ticc.credit,
|
|
1400
|
+
value: data.tic.ticc.credit && data.tic.ticc.credit > 0 ? data.tic.ticc.credit : null,
|
|
1401
1401
|
},
|
|
1402
1402
|
{
|
|
1403
1403
|
key: 'VA',
|
|
@@ -1621,14 +1621,14 @@ export function getCerfa3517CenturyRegistrationField(data: Cerfa3517_2023): Aspo
|
|
|
1621
1621
|
isMultiple: false,
|
|
1622
1622
|
tag: 'Valeur',
|
|
1623
1623
|
description: 'TOTAL - reliquat de crédit à rembourser 912253 ',
|
|
1624
|
-
value: data.tic.total.refund,
|
|
1624
|
+
value: data.tic.total.refund && data.tic.total.refund > 0 ? data.tic.total.refund : null,
|
|
1625
1625
|
},
|
|
1626
1626
|
{
|
|
1627
1627
|
key: 'XH',
|
|
1628
1628
|
isMultiple: false,
|
|
1629
1629
|
tag: 'Valeur',
|
|
1630
1630
|
description: 'TOTAL - crédit constaté 912251 ',
|
|
1631
|
-
value: data.tic.total.credit,
|
|
1631
|
+
value: data.tic.total.credit && data.tic.total.credit > 0 ? data.tic.total.credit : null,
|
|
1632
1632
|
},
|
|
1633
1633
|
{
|
|
1634
1634
|
key: 'ZB',
|