@silexpert/core 1.1.34 → 1.1.35
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 +2 -2
- package/es/types/Interface/api/registration/ReadRegistration.d.ts.map +1 -1
- package/es/types/Interface/api/registration/ReadRegistration.js +2 -1
- package/es/types/Interface/api/registration/ReadRegistration.js.map +1 -1
- package/es/utils/vat/3310/century23.js +31 -31
- package/es/utils/vat/3310/century23.js.map +1 -1
- package/es/utils/vat/3517/century23.js +11 -11
- package/es/utils/vat/3517/century23.js.map +1 -1
- package/es/utils/vat/utils.d.ts +1 -0
- package/es/utils/vat/utils.d.ts.map +1 -1
- package/es/utils/vat/utils.js +3 -0
- package/es/utils/vat/utils.js.map +1 -1
- package/js/types/Interface/api/registration/ReadRegistration.js +2 -0
- package/js/types/Interface/api/registration/ReadRegistration.js.map +1 -1
- package/js/utils/vat/3310/century23.js +25 -25
- package/js/utils/vat/3310/century23.js.map +1 -1
- package/js/utils/vat/3517/century23.js +10 -10
- package/js/utils/vat/3517/century23.js.map +1 -1
- package/js/utils/vat/utils.js +4 -0
- package/js/utils/vat/utils.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 +31 -31
- package/ts/utils/vat/3517/century23.ts +11 -11
- package/ts/utils/vat/utils.ts +4 -0
|
@@ -33,9 +33,9 @@ export interface ReadVatEntry {
|
|
|
33
33
|
isRevised: boolean;
|
|
34
34
|
entry?: IAccountingEntry;
|
|
35
35
|
}
|
|
36
|
-
export
|
|
36
|
+
export declare class UpdatedAnnotationObject {
|
|
37
37
|
old: IAccountingEntry[];
|
|
38
38
|
new: IAccountingEntry[];
|
|
39
|
-
}
|
|
39
|
+
}
|
|
40
40
|
export type UpdatedAnnotation = UpdatedAnnotationObject[];
|
|
41
41
|
//# sourceMappingURL=ReadRegistration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadRegistration.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/registration/ReadRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EACL,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,qBAAqB,EACvF,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAAE,KAAK,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAE5E,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC;AAEvD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;IACX,uBAAuB,EAAE,MAAM,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,gBAAgB,CAAA;CACzB;AAED,
|
|
1
|
+
{"version":3,"file":"ReadRegistration.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/registration/ReadRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EACL,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,qBAAqB,EACvF,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAAE,KAAK,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAE5E,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC;AAEvD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;IACX,uBAAuB,EAAE,MAAM,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,gBAAgB,CAAA;CACzB;AAED,qBAAa,uBAAuB;IAClC,GAAG,EAAE,gBAAgB,EAAE,CAAC;IACxB,GAAG,EAAE,gBAAgB,EAAE,CAAC;CACzB;AAED,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadRegistration.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/registration/ReadRegistration.ts"],"names":[],"mappings":"","sourcesContent":["import { IRegistration } from '../../models/IRegistration';\nimport {\n IAccount, IAccountingEntry, InterchangeState, RegistrationState, RegistrationTickState,\n} from '../../..';\n\nexport type ReadRegistration = IRegistration & { state: RegistrationState };\n\nexport interface ReadSynchronization {\n id: number;\n hasError: boolean;\n hasDepositError: boolean;\n isProcessFinished: boolean;\n hasPaymentError: boolean;\n isTimeOut: boolean;\n hasFailed: boolean;\n}\n\nexport type ReadRegistrationHistory = InterchangeState;\n\nexport interface ReadRegistrationTick {\n state: RegistrationTickState;\n title: string | null;\n details: InterchangeState,\n date: string | null;\n isPayment?: boolean;\n}\n\nexport interface ReadVatEntry {\n isAsset: boolean;\n idVat: number | null;\n account: IAccount | null;\n totalTaxIncluded: number;\n totalTaxExcluded: number,\n totalTax: number,\n label: string,\n date: Date,\n idAccountingTransaction: number;\n isRevised: boolean;\n entry?: IAccountingEntry\n}\n\nexport
|
|
1
|
+
{"version":3,"file":"ReadRegistration.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/registration/ReadRegistration.ts"],"names":[],"mappings":"AAyCA,MAAM,OAAO,uBAAuB;CAGnC","sourcesContent":["import { IRegistration } from '../../models/IRegistration';\nimport {\n IAccount, IAccountingEntry, InterchangeState, RegistrationState, RegistrationTickState,\n} from '../../..';\n\nexport type ReadRegistration = IRegistration & { state: RegistrationState };\n\nexport interface ReadSynchronization {\n id: number;\n hasError: boolean;\n hasDepositError: boolean;\n isProcessFinished: boolean;\n hasPaymentError: boolean;\n isTimeOut: boolean;\n hasFailed: boolean;\n}\n\nexport type ReadRegistrationHistory = InterchangeState;\n\nexport interface ReadRegistrationTick {\n state: RegistrationTickState;\n title: string | null;\n details: InterchangeState,\n date: string | null;\n isPayment?: boolean;\n}\n\nexport interface ReadVatEntry {\n isAsset: boolean;\n idVat: number | null;\n account: IAccount | null;\n totalTaxIncluded: number;\n totalTaxExcluded: number,\n totalTax: number,\n label: string,\n date: Date,\n idAccountingTransaction: number;\n isRevised: boolean;\n entry?: IAccountingEntry\n}\n\nexport class UpdatedAnnotationObject {\n old: IAccountingEntry[];\n new: IAccountingEntry[];\n}\n\nexport type UpdatedAnnotation = UpdatedAnnotationObject[];"]}
|
|
@@ -2,7 +2,7 @@ import * as dayjs from 'dayjs';
|
|
|
2
2
|
import { isDefined } from 'class-validator';
|
|
3
3
|
import { round as _round, flatten, uniqBy } from 'lodash';
|
|
4
4
|
import { Vat } from '../../../types/Enum/Vat';
|
|
5
|
-
import { getAmountByAccountNumber, getTaxAmountByAccountNumber, textFormatting } from '../utils';
|
|
5
|
+
import { getAmountByAccountNumber, getTaxAmountByAccountNumber, setZeroIfIsNegative, textFormatting } from '../utils';
|
|
6
6
|
export function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries = []) {
|
|
7
7
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96;
|
|
8
8
|
const shouldHaveVatCode = isDefined((_a = payload.setting) === null || _a === void 0 ? void 0 : _a.tvaCode) && isDefined(payload.society.siret);
|
|
@@ -38,54 +38,54 @@ export function getCerfa3310Century23Payload(accountingEntries, payload, updated
|
|
|
38
38
|
// Opérations taxées
|
|
39
39
|
const taxedServicesEntries = vatEntries.filter((ae) => frenchVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
|
|
40
40
|
const servicesAccounts = ['701', '702', '703', '704', '705', '706', '707', '708', '472'];
|
|
41
|
-
const taxedServicesFromFrance = getAmountByAccountNumber(taxedServicesEntries, servicesAccounts, 0, true);
|
|
42
|
-
const taxedOther = getAmountByAccountNumber(vatEntries.filter((ae) => withTaxVat.includes(ae.idVat)), ['775'], 0, true);
|
|
41
|
+
const taxedServicesFromFrance = setZeroIfIsNegative(getAmountByAccountNumber(taxedServicesEntries, servicesAccounts, 0, true));
|
|
42
|
+
const taxedOther = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => withTaxVat.includes(ae.idVat)), ['775'], 0, true));
|
|
43
43
|
const intracommunityServiceAccounts = ['604', '611', '612', '613', '614', '615', '616', '617', '618', '619', '62'];
|
|
44
44
|
const intracommunityServiceEntries = vatEntries.filter((ae) => withTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat));
|
|
45
|
-
const taxedPurchaseOfIntracommunityService = getAmountByAccountNumber(intracommunityServiceEntries, intracommunityServiceAccounts, 0, true);
|
|
45
|
+
const taxedPurchaseOfIntracommunityService = setZeroIfIsNegative(getAmountByAccountNumber(intracommunityServiceEntries, intracommunityServiceAccounts, 0, true));
|
|
46
46
|
const taxedImportEntries = vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
|
|
47
47
|
const taxedImportAccounts = ['6'];
|
|
48
|
-
const taxedImport = getAmountByAccountNumber(taxedImportEntries, taxedImportAccounts, 0, true);
|
|
49
|
-
const taxedIntracommunityAcquisitions = getAmountByAccountNumber(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607'], 0, true);
|
|
48
|
+
const taxedImport = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries, taxedImportAccounts, 0, true));
|
|
49
|
+
const taxedIntracommunityAcquisitions = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607'], 0, true));
|
|
50
50
|
// Opérations non taxées
|
|
51
|
-
const untaxedExportationNotInEurope = getAmountByAccountNumber(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts, 0, true);
|
|
52
|
-
const untaxedOther = getAmountByAccountNumber(vatEntries.filter((ae) => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['7'], 0, true);
|
|
53
|
-
const untaxedImport = getAmountByAccountNumber(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6'], 0, true);
|
|
54
|
-
const untaxedIntracomunity = getAmountByAccountNumber(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607'], 0, true);
|
|
55
|
-
const untaxedIntracommunityDelivery = getAmountByAccountNumber(vatEntries.filter((ae) => withoutTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat)), ['701', '707'], 0, true);
|
|
51
|
+
const untaxedExportationNotInEurope = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts, 0, true));
|
|
52
|
+
const untaxedOther = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['7'], 0, true));
|
|
53
|
+
const untaxedImport = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6'], 0, true));
|
|
54
|
+
const untaxedIntracomunity = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607'], 0, true));
|
|
55
|
+
const untaxedIntracommunityDelivery = setZeroIfIsNegative(getAmountByAccountNumber(vatEntries.filter((ae) => withoutTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat)), ['701', '707'], 0, true));
|
|
56
56
|
// TVA brute
|
|
57
|
-
const normalRate = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
58
|
-
+ getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), ['6'], 0, true);
|
|
57
|
+
const normalRate = setZeroIfIsNegative(getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
58
|
+
+ getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), ['6'], 0, true));
|
|
59
59
|
const normalRateTax = _round(normalRate * 0.2);
|
|
60
|
-
const reducedRate5Dot5 = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
61
|
-
+ getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true);
|
|
60
|
+
const reducedRate5Dot5 = setZeroIfIsNegative(getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
61
|
+
+ getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true));
|
|
62
62
|
const reducedRate5Dot5Tax = _round(reducedRate5Dot5 * 0.055);
|
|
63
|
-
const reducedRate10 = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
64
|
-
+ getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), ['6'], 0, true);
|
|
63
|
+
const reducedRate10 = setZeroIfIsNegative(getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
64
|
+
+ getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), ['6'], 0, true));
|
|
65
65
|
const reducedRate10Tax = _round(reducedRate10 * 0.1);
|
|
66
|
-
const reducedRate8Dot5 = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
67
|
-
+ getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true);
|
|
66
|
+
const reducedRate8Dot5 = setZeroIfIsNegative(getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
67
|
+
+ getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true));
|
|
68
68
|
const reducedRate8Dot5Tax = _round(reducedRate8Dot5 * 0.085);
|
|
69
|
-
const reducedRate2Dot1 = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
70
|
-
+ getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), ['6'], 0, true);
|
|
69
|
+
const reducedRate2Dot1 = setZeroIfIsNegative(getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
70
|
+
+ getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), ['6'], 0, true));
|
|
71
71
|
const reducedRate2Dot1Tax = _round(reducedRate2Dot1 * 0.021);
|
|
72
|
-
const importNormalRate = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
|
|
72
|
+
const importNormalRate = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
|
|
73
73
|
const importNormalRateTax = _round(importNormalRate * 0.2);
|
|
74
|
-
const importReducedRate10 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
|
|
74
|
+
const importReducedRate10 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
|
|
75
75
|
const importReducedRate10Tax = _round(importReducedRate10 * 0.1);
|
|
76
|
-
const importReducedRate8Dot5 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
|
|
76
|
+
const importReducedRate8Dot5 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
|
|
77
77
|
const importReducedRate8Dot5Tax = _round(importReducedRate8Dot5 * 0.085);
|
|
78
|
-
const importReducedRate5Dot5 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
|
|
78
|
+
const importReducedRate5Dot5 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
|
|
79
79
|
const importReducedRate5Dot5Tax = _round(importReducedRate8Dot5 * 0.055);
|
|
80
|
-
const importReducedRate2Dot1 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
|
|
80
|
+
const importReducedRate2Dot1 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
|
|
81
81
|
const importReducedRate2Dot1Tax = _round(importReducedRate2Dot1 * 0.021);
|
|
82
|
-
const importReducedRate1Dot05 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 1.05).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
|
|
82
|
+
const importReducedRate1Dot05 = setZeroIfIsNegative(getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 1.05).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
|
|
83
83
|
const importReducedRate1Dot05Tax = _round(importReducedRate1Dot05 * 0.0105);
|
|
84
|
-
const intracommunityTax = getTaxAmountByAccountNumber(intracommunityServiceEntries, intracommunityServiceAccounts);
|
|
84
|
+
const intracommunityTax = setZeroIfIsNegative(getTaxAmountByAccountNumber(intracommunityServiceEntries, intracommunityServiceAccounts));
|
|
85
85
|
// TVA Déductible
|
|
86
|
-
const immobilizationTax = getTaxAmountByAccountNumber(vatEntries, ['2']);
|
|
87
|
-
const otherGoodsAndServices = getTaxAmountByAccountNumber(vatEntries.filter((e) => vats.filter((v) => !v.isVatImportation).map((v) => v.id).includes(e.idVat)), ['6']);
|
|
88
|
-
const otherDeductibles = getTaxAmountByAccountNumber(vatEntries.filter((e) => vats.filter((v) => v.isVatImportation).map((v) => v.id).includes(e.idVat)), ['6']);
|
|
86
|
+
const immobilizationTax = setZeroIfIsNegative(getTaxAmountByAccountNumber(vatEntries, ['2']));
|
|
87
|
+
const otherGoodsAndServices = setZeroIfIsNegative(getTaxAmountByAccountNumber(vatEntries.filter((e) => vats.filter((v) => !v.isVatImportation).map((v) => v.id).includes(e.idVat)), ['6']));
|
|
88
|
+
const otherDeductibles = setZeroIfIsNegative(getTaxAmountByAccountNumber(vatEntries.filter((e) => vats.filter((v) => v.isVatImportation).map((v) => v.id).includes(e.idVat)), ['6']));
|
|
89
89
|
const report = (_d = (_c = (_b = payload.previousVatDeclaration) === null || _b === void 0 ? void 0 : _b.credit) === null || _c === void 0 ? void 0 : _c.toReport) !== null && _d !== void 0 ? _d : 0;
|
|
90
90
|
const coefficient = _round((_g = (_f = (_e = payload.vat) === null || _e === void 0 ? void 0 : _e.deductible) === null || _f === void 0 ? void 0 : _f.coefficient) !== null && _g !== void 0 ? _g : 100, 2);
|
|
91
91
|
const isNil = payload.isNil === true;
|