@silexpert/core 1.1.357 → 1.1.359
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/types/Enum/BrandAnytime.d.ts +2 -142
- package/dist/cjs/types/Enum/BrandAnytime.d.ts.map +1 -1
- package/dist/cjs/types/Enum/BrandAnytime.js.map +1 -1
- package/dist/cjs/types/Enum/BrandClementine.d.ts +2 -461
- package/dist/cjs/types/Enum/BrandClementine.d.ts.map +1 -1
- package/dist/cjs/types/Enum/BrandClementine.js.map +1 -1
- package/dist/cjs/types/Enum/BrandComptalib.d.ts +2 -262
- package/dist/cjs/types/Enum/BrandComptalib.d.ts.map +1 -1
- package/dist/cjs/types/Enum/BrandComptalib.js.map +1 -1
- package/dist/cjs/types/Enum/BrandLegalstart.d.ts +2 -123
- package/dist/cjs/types/Enum/BrandLegalstart.d.ts.map +1 -1
- package/dist/cjs/types/Enum/BrandLegalstart.js.map +1 -1
- package/dist/cjs/types/Enum/BrandPourcentage.d.ts +2 -376
- package/dist/cjs/types/Enum/BrandPourcentage.d.ts.map +1 -1
- package/dist/cjs/types/Enum/BrandPourcentage.js.map +1 -1
- package/dist/cjs/types/Enum/BrandStatutsExpress.d.ts +2 -101
- package/dist/cjs/types/Enum/BrandStatutsExpress.d.ts.map +1 -1
- package/dist/cjs/types/Enum/BrandStatutsExpress.js.map +1 -1
- package/dist/cjs/types/Enum/SalesContractBrandClementine.d.ts +3 -41
- package/dist/cjs/types/Enum/SalesContractBrandClementine.d.ts.map +1 -1
- package/dist/cjs/types/Enum/SalesContractBrandClementine.js.map +1 -1
- package/dist/cjs/types/Enum/SalesContractBrandPourcentage.d.ts +4 -59
- package/dist/cjs/types/Enum/SalesContractBrandPourcentage.d.ts.map +1 -1
- package/dist/cjs/types/Enum/SalesContractBrandPourcentage.js.map +1 -1
- package/dist/cjs/types/Enum/Vat.d.ts +20 -1
- package/dist/cjs/types/Enum/Vat.d.ts.map +1 -1
- package/dist/cjs/types/Enum/Vat.js.map +1 -1
- package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.d.ts +2 -0
- package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.js +7 -0
- package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.js.map +1 -1
- package/dist/cjs/types/Interface/api/salesContract/Read.d.ts +11 -0
- package/dist/cjs/types/Interface/api/salesContract/Read.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/salesContract/Read.js +3 -0
- package/dist/cjs/types/Interface/api/salesContract/Read.js.map +1 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/utils/brands.d.ts +130 -14
- package/dist/cjs/utils/brands.d.ts.map +1 -1
- package/dist/cjs/utils/brands.js +28 -10
- package/dist/cjs/utils/brands.js.map +1 -1
- package/dist/cjs/utils/checkup.d.ts +1 -36
- package/dist/cjs/utils/checkup.d.ts.map +1 -1
- package/dist/cjs/utils/vat/3310/century23.d.ts.map +1 -1
- package/dist/cjs/utils/vat/3310/century23.js +69 -65
- package/dist/cjs/utils/vat/3310/century23.js.map +1 -1
- package/dist/mjs/types/Enum/BrandAnytime.d.ts +2 -142
- package/dist/mjs/types/Enum/BrandAnytime.d.ts.map +1 -1
- package/dist/mjs/types/Enum/BrandAnytime.js.map +1 -1
- package/dist/mjs/types/Enum/BrandClementine.d.ts +2 -461
- package/dist/mjs/types/Enum/BrandClementine.d.ts.map +1 -1
- package/dist/mjs/types/Enum/BrandClementine.js.map +1 -1
- package/dist/mjs/types/Enum/BrandComptalib.d.ts +2 -262
- package/dist/mjs/types/Enum/BrandComptalib.d.ts.map +1 -1
- package/dist/mjs/types/Enum/BrandComptalib.js.map +1 -1
- package/dist/mjs/types/Enum/BrandLegalstart.d.ts +2 -123
- package/dist/mjs/types/Enum/BrandLegalstart.d.ts.map +1 -1
- package/dist/mjs/types/Enum/BrandLegalstart.js.map +1 -1
- package/dist/mjs/types/Enum/BrandPourcentage.d.ts +2 -376
- package/dist/mjs/types/Enum/BrandPourcentage.d.ts.map +1 -1
- package/dist/mjs/types/Enum/BrandPourcentage.js.map +1 -1
- package/dist/mjs/types/Enum/BrandStatutsExpress.d.ts +2 -101
- package/dist/mjs/types/Enum/BrandStatutsExpress.d.ts.map +1 -1
- package/dist/mjs/types/Enum/BrandStatutsExpress.js.map +1 -1
- package/dist/mjs/types/Enum/SalesContractBrandClementine.d.ts +3 -41
- package/dist/mjs/types/Enum/SalesContractBrandClementine.d.ts.map +1 -1
- package/dist/mjs/types/Enum/SalesContractBrandClementine.js.map +1 -1
- package/dist/mjs/types/Enum/SalesContractBrandPourcentage.d.ts +4 -59
- package/dist/mjs/types/Enum/SalesContractBrandPourcentage.d.ts.map +1 -1
- package/dist/mjs/types/Enum/SalesContractBrandPourcentage.js.map +1 -1
- package/dist/mjs/types/Enum/Vat.d.ts +20 -1
- package/dist/mjs/types/Enum/Vat.d.ts.map +1 -1
- package/dist/mjs/types/Enum/Vat.js.map +1 -1
- package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.d.ts +2 -0
- package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.js +9 -1
- package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.js.map +1 -1
- package/dist/mjs/types/Interface/api/salesContract/Read.d.ts +11 -0
- package/dist/mjs/types/Interface/api/salesContract/Read.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/salesContract/Read.js +2 -0
- package/dist/mjs/types/Interface/api/salesContract/Read.js.map +1 -0
- package/dist/mjs/types/index.d.ts +1 -0
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +1 -0
- package/dist/mjs/types/index.js.map +1 -1
- package/dist/mjs/utils/brands.d.ts +130 -14
- package/dist/mjs/utils/brands.d.ts.map +1 -1
- package/dist/mjs/utils/brands.js +27 -10
- package/dist/mjs/utils/brands.js.map +1 -1
- package/dist/mjs/utils/checkup.d.ts +1 -36
- package/dist/mjs/utils/checkup.d.ts.map +1 -1
- package/dist/mjs/utils/vat/3310/century23.d.ts.map +1 -1
- package/dist/mjs/utils/vat/3310/century23.js +4 -0
- package/dist/mjs/utils/vat/3310/century23.js.map +1 -1
- package/package.json +1 -1
- package/ts/types/Enum/BrandAnytime.ts +3 -2
- package/ts/types/Enum/BrandClementine.ts +3 -2
- package/ts/types/Enum/BrandComptalib.ts +4 -2
- package/ts/types/Enum/BrandLegalstart.ts +3 -2
- package/ts/types/Enum/BrandPourcentage.ts +3 -2
- package/ts/types/Enum/BrandStatutsExpress.ts +4 -2
- package/ts/types/Enum/SalesContractBrandClementine.ts +7 -6
- package/ts/types/Enum/SalesContractBrandPourcentage.ts +9 -8
- package/ts/types/Enum/Vat.ts +21 -2
- package/ts/types/Interface/api/calendarEvent/createCalendarEventForUsers.ts +7 -1
- package/ts/types/Interface/api/salesContract/Read.ts +11 -0
- package/ts/types/index.ts +1 -0
- package/ts/utils/brands.ts +180 -30
- package/ts/utils/vat/3310/century23.ts +4 -0
|
@@ -7,9 +7,13 @@ const lodash_1 = require("lodash");
|
|
|
7
7
|
const Vat_1 = require("../../../types/Enum/Vat");
|
|
8
8
|
const utils_1 = require("../utils");
|
|
9
9
|
function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries = []) {
|
|
10
|
-
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, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180, _181, _182, _183, _184, _185, _186, _187, _188, _189, _190, _191, _192, _193, _194, _195, _196, _197, _198, _199, _200, _201, _202, _203, _204, _205, _206, _207, _208, _209, _210, _211, _212, _213, _214, _215, _216, _217, _218, _219, _220, _221, _222, _223, _224, _225, _226, _227, _228, _229, _230, _231, _232, _233, _234, _235, _236, _237;
|
|
10
|
+
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, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180, _181, _182, _183, _184, _185, _186, _187, _188, _189, _190, _191, _192, _193, _194, _195, _196, _197, _198, _199, _200, _201, _202, _203, _204, _205, _206, _207, _208, _209, _210, _211, _212, _213, _214, _215, _216, _217, _218, _219, _220, _221, _222, _223, _224, _225, _226, _227, _228, _229, _230, _231, _232, _233, _234, _235, _236, _237, _238;
|
|
11
11
|
const shouldHaveVatCode = (0, class_validator_1.isDefined)((_a = payload.setting) === null || _a === void 0 ? void 0 : _a.tvaCode) && (0, class_validator_1.isDefined)(payload.society.siret);
|
|
12
12
|
const vats = Object.values(Vat_1.Vat);
|
|
13
|
+
const isVatControl = Object.values((_b = payload.vatControl) !== null && _b !== void 0 ? _b : {}).filter(v => (0, class_validator_1.isDefined)(v)).length > 0;
|
|
14
|
+
// On désactive les automatismes des déclarations précédentes dans le contrôle de TVA
|
|
15
|
+
if (isVatControl)
|
|
16
|
+
payload.previousVatDeclaration = null;
|
|
13
17
|
const frenchVat = vats.filter((v) => !v.isVatImportation && !v.isVatIntracom).map((v) => v.id);
|
|
14
18
|
const withTaxVat = vats.filter((v) => v.value > 0).map((v) => v.id);
|
|
15
19
|
const intracomVat = vats.filter((v) => v.isVatIntracom && !v.isVatImportation).map((v) => v.id);
|
|
@@ -41,62 +45,62 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
|
|
|
41
45
|
// Opérations taxées -
|
|
42
46
|
const taxedServicesEntries = vatEntries.filter((ae) => frenchVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
|
|
43
47
|
const servicesAccounts = ['701', '702', '703', '704', '705', '706', '707', '708', '472'];
|
|
44
|
-
const taxedServicesFromFrance = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedServicesEntries, servicesAccounts, 0, true)) + ((
|
|
45
|
-
const taxedOther = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => withTaxVat.includes(ae.idVat)), ['775'], 0, true)) + ((
|
|
48
|
+
const taxedServicesFromFrance = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedServicesEntries, servicesAccounts, 0, true)) + ((_e = (_d = (_c = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _c === void 0 ? void 0 : _c.france) === null || _d === void 0 ? void 0 : _d.base20) !== null && _e !== void 0 ? _e : 0) + ((_h = (_g = (_f = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _f === void 0 ? void 0 : _f.france) === null || _g === void 0 ? void 0 : _g.base10) !== null && _h !== void 0 ? _h : 0) + ((_l = (_k = (_j = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _j === void 0 ? void 0 : _j.france) === null || _k === void 0 ? void 0 : _k.base8Dot5) !== null && _l !== void 0 ? _l : 0) + ((_p = (_o = (_m = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _m === void 0 ? void 0 : _m.france) === null || _o === void 0 ? void 0 : _o.base5Dot5) !== null && _p !== void 0 ? _p : 0) + ((_s = (_r = (_q = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _q === void 0 ? void 0 : _q.france) === null || _r === void 0 ? void 0 : _r.base2Dot1) !== null && _s !== void 0 ? _s : 0);
|
|
49
|
+
const taxedOther = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => withTaxVat.includes(ae.idVat)), ['775'], 0, true)) + ((_v = (_u = (_t = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _t === void 0 ? void 0 : _t.other) === null || _u === void 0 ? void 0 : _u.base20) !== null && _v !== void 0 ? _v : 0) + ((_y = (_x = (_w = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _w === void 0 ? void 0 : _w.other) === null || _x === void 0 ? void 0 : _x.base10) !== null && _y !== void 0 ? _y : 0) + ((_1 = (_0 = (_z = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _z === void 0 ? void 0 : _z.other) === null || _0 === void 0 ? void 0 : _0.base5Dot5) !== null && _1 !== void 0 ? _1 : 0) + ((_4 = (_3 = (_2 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _2 === void 0 ? void 0 : _2.other) === null || _3 === void 0 ? void 0 : _3.base2Dot1) !== null && _4 !== void 0 ? _4 : 0);
|
|
46
50
|
const intracommunityServiceAccounts = ['604', '611', '612', '613', '614', '615', '616', '617', '618', '619', '62'];
|
|
47
51
|
const intracommunityServiceEntries = vatEntries.filter((ae) => withTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat));
|
|
48
52
|
// Case A3
|
|
49
53
|
const taxedPurchaseOfIntracommunityService = 0; /* setZeroIfIsNegative(getAmountByAccountNumber(intracommunityServiceEntries, intracommunityServiceAccounts, 0, true)); */
|
|
50
54
|
const taxedImportEntries = vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
|
|
51
55
|
const taxedImportAccounts = ['6'];
|
|
52
|
-
const taxedImport = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedImportEntries, taxedImportAccounts, 0, true)) + ((
|
|
56
|
+
const taxedImport = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedImportEntries, taxedImportAccounts, 0, true)) + ((_7 = (_6 = (_5 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _5 === void 0 ? void 0 : _5.importations) === null || _6 === void 0 ? void 0 : _6.base20) !== null && _7 !== void 0 ? _7 : 0) + ((_10 = (_9 = (_8 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _8 === void 0 ? void 0 : _8.importations) === null || _9 === void 0 ? void 0 : _9.base10) !== null && _10 !== void 0 ? _10 : 0) + ((_13 = (_12 = (_11 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _11 === void 0 ? void 0 : _11.importations) === null || _12 === void 0 ? void 0 : _12.base8Dot5) !== null && _13 !== void 0 ? _13 : 0) + ((_16 = (_15 = (_14 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _14 === void 0 ? void 0 : _14.importations) === null || _15 === void 0 ? void 0 : _15.base5Dot5) !== null && _16 !== void 0 ? _16 : 0) + ((_19 = (_18 = (_17 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _17 === void 0 ? void 0 : _17.importations) === null || _18 === void 0 ? void 0 : _18.base2Dot1) !== null && _19 !== void 0 ? _19 : 0);
|
|
53
57
|
const intracommunityAccounts2 = ['601', '602', '603', '605', '606', '607', '651'];
|
|
54
58
|
const taxedIntracommunityAcquisitions = (0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat)), [...intracommunityAccounts2, ...intracommunityServiceAccounts], 0, true);
|
|
55
59
|
// Opérations non taxées
|
|
56
|
-
const untaxedExportationNotInEurope = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts, 0, true)) + ((
|
|
57
|
-
const untaxedOther = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['70', '71', '72', '73', '75', '77', '78', '790', '792', '793', '794', '795', '796', '797', '798', '799'], 0, true)) + ((
|
|
58
|
-
const untaxedImport = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6'], 0, true)) + ((
|
|
59
|
-
const untaxedIntracomunity = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), intracommunityAccounts2, 0, true)) + ((
|
|
60
|
+
const untaxedExportationNotInEurope = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts, 0, true)) + ((_22 = (_21 = (_20 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _20 === void 0 ? void 0 : _20.untaxed) === null || _21 === void 0 ? void 0 : _21.exportation) !== null && _22 !== void 0 ? _22 : 0);
|
|
61
|
+
const untaxedOther = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['70', '71', '72', '73', '75', '77', '78', '790', '792', '793', '794', '795', '796', '797', '798', '799'], 0, true)) + ((_25 = (_24 = (_23 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _23 === void 0 ? void 0 : _23.untaxed) === null || _24 === void 0 ? void 0 : _24.other) !== null && _25 !== void 0 ? _25 : 0); // 02/08/23 - ne plus prendre en compte les comptes 76,74,791 - Chloé R.
|
|
62
|
+
const untaxedImport = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6'], 0, true)) + ((_28 = (_27 = (_26 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _26 === void 0 ? void 0 : _26.untaxed) === null || _27 === void 0 ? void 0 : _27.importation) !== null && _28 !== void 0 ? _28 : 0);
|
|
63
|
+
const untaxedIntracomunity = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), intracommunityAccounts2, 0, true)) + ((_31 = (_30 = (_29 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _29 === void 0 ? void 0 : _29.untaxed) === null || _30 === void 0 ? void 0 : _30.intracomunity) !== null && _31 !== void 0 ? _31 : 0);
|
|
60
64
|
const untaxedIntracommunityDelivery = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => withoutTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat)), ['701', '707'], 0, true));
|
|
61
65
|
// TVA brute
|
|
62
66
|
const normalRate = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
63
|
-
+ (0, utils_1.getAmountByAccountNumber)(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + ((
|
|
67
|
+
+ (0, utils_1.getAmountByAccountNumber)(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + ((_34 = (_33 = (_32 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _32 === void 0 ? void 0 : _32.france) === null || _33 === void 0 ? void 0 : _33.base20) !== null && _34 !== void 0 ? _34 : 0) + ((_37 = (_36 = (_35 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _35 === void 0 ? void 0 : _35.other) === null || _36 === void 0 ? void 0 : _36.base20) !== null && _37 !== void 0 ? _37 : 0);
|
|
64
68
|
const normalRateTax = (0, lodash_1.round)(normalRate * 0.2);
|
|
65
69
|
const reducedRate5Dot5 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
66
|
-
+ (0, utils_1.getAmountByAccountNumber)(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + ((
|
|
70
|
+
+ (0, utils_1.getAmountByAccountNumber)(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + ((_40 = (_39 = (_38 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _38 === void 0 ? void 0 : _38.france) === null || _39 === void 0 ? void 0 : _39.base5Dot5) !== null && _40 !== void 0 ? _40 : 0) + ((_43 = (_42 = (_41 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _41 === void 0 ? void 0 : _41.other) === null || _42 === void 0 ? void 0 : _42.base5Dot5) !== null && _43 !== void 0 ? _43 : 0);
|
|
67
71
|
const reducedRate5Dot5Tax = (0, lodash_1.round)(reducedRate5Dot5 * 0.055);
|
|
68
72
|
const reducedRate10 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
69
|
-
+ (0, utils_1.getAmountByAccountNumber)(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + ((
|
|
73
|
+
+ (0, utils_1.getAmountByAccountNumber)(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + ((_46 = (_45 = (_44 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _44 === void 0 ? void 0 : _44.france) === null || _45 === void 0 ? void 0 : _45.base10) !== null && _46 !== void 0 ? _46 : 0) + ((_49 = (_48 = (_47 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _47 === void 0 ? void 0 : _47.other) === null || _48 === void 0 ? void 0 : _48.base10) !== null && _49 !== void 0 ? _49 : 0);
|
|
70
74
|
const reducedRate10Tax = (0, lodash_1.round)(reducedRate10 * 0.1);
|
|
71
75
|
const reducedRate8Dot5 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
72
|
-
+ (0, utils_1.getAmountByAccountNumber)(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + ((
|
|
76
|
+
+ (0, utils_1.getAmountByAccountNumber)(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + ((_52 = (_51 = (_50 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _50 === void 0 ? void 0 : _50.france) === null || _51 === void 0 ? void 0 : _51.base8Dot5) !== null && _52 !== void 0 ? _52 : 0) + ((_55 = (_54 = (_53 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _53 === void 0 ? void 0 : _53.other) === null || _54 === void 0 ? void 0 : _54.base5Dot5) !== null && _55 !== void 0 ? _55 : 0);
|
|
73
77
|
const reducedRate8Dot5Tax = (0, lodash_1.round)(reducedRate8Dot5 * 0.085);
|
|
74
78
|
const reducedRate2Dot1 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
|
|
75
|
-
+ (0, utils_1.getAmountByAccountNumber)(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + ((
|
|
79
|
+
+ (0, utils_1.getAmountByAccountNumber)(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), ['6'], 0, true)) + ((_58 = (_57 = (_56 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _56 === void 0 ? void 0 : _56.france) === null || _57 === void 0 ? void 0 : _57.base2Dot1) !== null && _58 !== void 0 ? _58 : 0) + ((_61 = (_60 = (_59 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _59 === void 0 ? void 0 : _59.other) === null || _60 === void 0 ? void 0 : _60.base2Dot1) !== null && _61 !== void 0 ? _61 : 0);
|
|
76
80
|
const reducedRate2Dot1Tax = (0, lodash_1.round)(reducedRate2Dot1 * 0.021);
|
|
77
|
-
const importNormalRate = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((
|
|
81
|
+
const importNormalRate = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((_64 = (_63 = (_62 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _62 === void 0 ? void 0 : _62.importations) === null || _63 === void 0 ? void 0 : _63.base20) !== null && _64 !== void 0 ? _64 : 0);
|
|
78
82
|
const importNormalRateTax = (0, lodash_1.round)(importNormalRate * 0.2);
|
|
79
|
-
const importReducedRate10 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((
|
|
83
|
+
const importReducedRate10 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((_67 = (_66 = (_65 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _65 === void 0 ? void 0 : _65.importations) === null || _66 === void 0 ? void 0 : _66.base10) !== null && _67 !== void 0 ? _67 : 0);
|
|
80
84
|
const importReducedRate10Tax = (0, lodash_1.round)(importReducedRate10 * 0.1);
|
|
81
|
-
const importReducedRate8Dot5 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((
|
|
85
|
+
const importReducedRate8Dot5 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((_70 = (_69 = (_68 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _68 === void 0 ? void 0 : _68.importations) === null || _69 === void 0 ? void 0 : _69.base8Dot5) !== null && _70 !== void 0 ? _70 : 0);
|
|
82
86
|
const importReducedRate8Dot5Tax = (0, lodash_1.round)(importReducedRate8Dot5 * 0.085);
|
|
83
|
-
const importReducedRate5Dot5 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((
|
|
87
|
+
const importReducedRate5Dot5 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((_73 = (_72 = (_71 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _71 === void 0 ? void 0 : _71.importations) === null || _72 === void 0 ? void 0 : _72.base5Dot5) !== null && _73 !== void 0 ? _73 : 0);
|
|
84
88
|
const importReducedRate5Dot5Tax = (0, lodash_1.round)(importReducedRate8Dot5 * 0.055);
|
|
85
|
-
const importReducedRate2Dot1 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((
|
|
89
|
+
const importReducedRate2Dot1 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((_76 = (_75 = (_74 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _74 === void 0 ? void 0 : _74.importations) === null || _75 === void 0 ? void 0 : _75.base2Dot1) !== null && _76 !== void 0 ? _76 : 0);
|
|
86
90
|
const importReducedRate2Dot1Tax = (0, lodash_1.round)(importReducedRate2Dot1 * 0.021);
|
|
87
91
|
const importReducedRate1Dot05 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 1.05).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
|
|
88
92
|
const importReducedRate1Dot05Tax = (0, lodash_1.round)(importReducedRate1Dot05 * 0.0105);
|
|
89
93
|
const intracommunityTax = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getTaxAmountByAccountNumber)(intracommunityServiceEntries, [...intracommunityServiceAccounts, ...intracommunityAccounts2], 0));
|
|
90
94
|
// TVA Déductible
|
|
91
|
-
const immobilizationTax = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getTaxAmountByAccountNumber)(vatEntries, ['2'])) + ((
|
|
92
|
-
const otherGoodsAndServices = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getTaxAmountByAccountNumber)(vatEntries.filter((e) => vats.filter((v) => !v.isVatImportation).map((v) => v.id).includes(e.idVat)), ['6'])) + ((
|
|
93
|
-
const otherDeductibles = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getTaxAmountByAccountNumber)(vatEntries.filter((e) => vats.filter((v) => v.isVatImportation).map((v) => v.id).includes(e.idVat)), ['6'])) + ((
|
|
94
|
-
const report = (((
|
|
95
|
-
const coefficient = (0, lodash_1.round)((
|
|
95
|
+
const immobilizationTax = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getTaxAmountByAccountNumber)(vatEntries, ['2'])) + ((_79 = (_78 = (_77 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _77 === void 0 ? void 0 : _77.deducted) === null || _78 === void 0 ? void 0 : _78.immobilization) !== null && _79 !== void 0 ? _79 : 0);
|
|
96
|
+
const otherGoodsAndServices = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getTaxAmountByAccountNumber)(vatEntries.filter((e) => vats.filter((v) => !v.isVatImportation).map((v) => v.id).includes(e.idVat)), ['6'])) + ((_82 = (_81 = (_80 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _80 === void 0 ? void 0 : _80.deducted) === null || _81 === void 0 ? void 0 : _81.abs) !== null && _82 !== void 0 ? _82 : 0);
|
|
97
|
+
const otherDeductibles = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getTaxAmountByAccountNumber)(vatEntries.filter((e) => vats.filter((v) => v.isVatImportation).map((v) => v.id).includes(e.idVat)), ['6'])) + ((_85 = (_84 = (_83 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _83 === void 0 ? void 0 : _83.deducted) === null || _84 === void 0 ? void 0 : _84.other) !== null && _85 !== void 0 ? _85 : 0);
|
|
98
|
+
const report = (((_87 = (_86 = payload.vat) === null || _86 === void 0 ? void 0 : _86.deductible) === null || _87 === void 0 ? void 0 : _87.toReport) && ((_89 = (_88 = payload.vat) === null || _88 === void 0 ? void 0 : _88.deductible) === null || _89 === void 0 ? void 0 : _89.toReport) > 0 ? (0, lodash_1.round)((_92 = (_91 = (_90 = payload.vat) === null || _90 === void 0 ? void 0 : _90.deductible) === null || _91 === void 0 ? void 0 : _91.toReport) !== null && _92 !== void 0 ? _92 : 0) : (_95 = (_94 = (_93 = payload.previousVatDeclaration) === null || _93 === void 0 ? void 0 : _93.credit) === null || _94 === void 0 ? void 0 : _94.toReport) !== null && _95 !== void 0 ? _95 : 0) + ((_98 = (_97 = (_96 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _96 === void 0 ? void 0 : _96.deducted) === null || _97 === void 0 ? void 0 : _97.reported) !== null && _98 !== void 0 ? _98 : 0);
|
|
99
|
+
const coefficient = (0, lodash_1.round)((_101 = (_100 = (_99 = payload.vat) === null || _99 === void 0 ? void 0 : _99.deductible) === null || _100 === void 0 ? void 0 : _100.coefficient) !== null && _101 !== void 0 ? _101 : 100, 2);
|
|
96
100
|
const isNil = payload.isNil === true;
|
|
97
101
|
const isHolidayDeposit = payload.isHolidayDeposit === true;
|
|
98
|
-
const sumToAdd = (0, utils_1.setZeroIfIsNegative)(isNil ? 0 : isHolidayDeposit ? ((0, lodash_1.round)(((
|
|
99
|
-
const comment = isHolidayDeposit ? `ACOMPTE CONGES ${(
|
|
102
|
+
const sumToAdd = (0, utils_1.setZeroIfIsNegative)(isNil ? 0 : isHolidayDeposit ? ((0, lodash_1.round)(((_104 = (_103 = (_102 = payload.previousVatDeclaration) === null || _102 === void 0 ? void 0 : _102.toPay) === null || _103 === void 0 ? void 0 : _103.total) !== null && _104 !== void 0 ? _104 : 0) * 0.8)) : ((0, lodash_1.round)((_106 = (_105 = payload.vat) === null || _105 === void 0 ? void 0 : _105.sumToAdd) !== null && _106 !== void 0 ? _106 : 0) + mxToAdd)) + ((_109 = (_108 = (_107 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _107 === void 0 ? void 0 : _107.regularisations) === null || _108 === void 0 ? void 0 : _108.case5B) !== null && _109 !== void 0 ? _109 : 0);
|
|
103
|
+
const comment = isHolidayDeposit ? `ACOMPTE CONGES ${(_110 = payload.comment) !== null && _110 !== void 0 ? _110 : ''}` : ((_111 = payload.comment) !== null && _111 !== void 0 ? _111 : null);
|
|
100
104
|
const initialPayload = {
|
|
101
105
|
isNil,
|
|
102
106
|
isDGE: false,
|
|
@@ -109,7 +113,7 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
|
|
|
109
113
|
full: `${payload.society.address}\n${payload.society.zipCode} ${payload.society.city}`,
|
|
110
114
|
},
|
|
111
115
|
numbers: {
|
|
112
|
-
SIE: (
|
|
116
|
+
SIE: (_113 = (_112 = payload.sie) === null || _112 === void 0 ? void 0 : _112.sages) !== null && _113 !== void 0 ? _113 : null,
|
|
113
117
|
folder: null,
|
|
114
118
|
key: null,
|
|
115
119
|
period: null,
|
|
@@ -121,7 +125,7 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
|
|
|
121
125
|
},
|
|
122
126
|
service: {
|
|
123
127
|
address: {
|
|
124
|
-
full: (0, class_validator_1.isDefined)((
|
|
128
|
+
full: (0, class_validator_1.isDefined)((_115 = (_114 = payload.sie) === null || _114 === void 0 ? void 0 : _114.address) === null || _115 === void 0 ? void 0 : _115.address1) ? `${(_116 = payload.sie) === null || _116 === void 0 ? void 0 : _116.address.address1}\n${(_117 = payload.sie) === null || _117 === void 0 ? void 0 : _117.address.address2}\n${(_118 = payload.sie) === null || _118 === void 0 ? void 0 : _118.address.address3}\n${(_119 = payload.sie) === null || _119 === void 0 ? void 0 : _119.address.address4}\n${(_120 = payload.sie) === null || _120 === void 0 ? void 0 : _120.address.address5}` : null,
|
|
125
129
|
},
|
|
126
130
|
},
|
|
127
131
|
period: {
|
|
@@ -137,13 +141,13 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
|
|
|
137
141
|
},
|
|
138
142
|
},
|
|
139
143
|
siret: {
|
|
140
|
-
first: (0, class_validator_1.isDefined)(payload.society.siret) ? ((
|
|
141
|
-
second: (0, class_validator_1.isDefined)(payload.society.siret) ? ((
|
|
144
|
+
first: (0, class_validator_1.isDefined)(payload.society.siret) ? ((_122 = (_121 = payload.society.siret) === null || _121 === void 0 ? void 0 : _121.slice(0, 9)) !== null && _122 !== void 0 ? _122 : null) : null,
|
|
145
|
+
second: (0, class_validator_1.isDefined)(payload.society.siret) ? ((_124 = (_123 = payload.society.siret) === null || _123 === void 0 ? void 0 : _123.slice(-5)) !== null && _124 !== void 0 ? _124 : null) : null,
|
|
142
146
|
},
|
|
143
147
|
intracommunityVat: {
|
|
144
|
-
first: shouldHaveVatCode ? ((
|
|
145
|
-
second: shouldHaveVatCode ? ((
|
|
146
|
-
third: shouldHaveVatCode ? ((
|
|
148
|
+
first: shouldHaveVatCode ? ((_127 = (_126 = (_125 = payload.setting) === null || _125 === void 0 ? void 0 : _125.tvaCode) === null || _126 === void 0 ? void 0 : _126.slice(0, 2)) !== null && _127 !== void 0 ? _127 : null) : null,
|
|
149
|
+
second: shouldHaveVatCode ? ((_130 = (_129 = (_128 = payload.setting) === null || _128 === void 0 ? void 0 : _128.tvaCode) === null || _129 === void 0 ? void 0 : _129.slice(2, 4)) !== null && _130 !== void 0 ? _130 : null) : null,
|
|
150
|
+
third: shouldHaveVatCode ? ((_132 = (_131 = payload.society.siret) === null || _131 === void 0 ? void 0 : _131.slice(0, 9)) !== null && _132 !== void 0 ? _132 : null) : null,
|
|
147
151
|
},
|
|
148
152
|
payment: {
|
|
149
153
|
date: dayjs().format('YYYY-MM-DD'),
|
|
@@ -157,29 +161,29 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
|
|
|
157
161
|
other: isNil || isHolidayDeposit ? 0 : taxedOther,
|
|
158
162
|
purchaseOfIntracommunityServiceProvision: isNil || isHolidayDeposit ? 0 : taxedPurchaseOfIntracommunityService,
|
|
159
163
|
import: isNil || isHolidayDeposit ? 0 : taxedImport,
|
|
160
|
-
withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
161
|
-
releaseFromConsumption: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
164
|
+
withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_134 = (_133 = payload.taxedOperations) === null || _133 === void 0 ? void 0 : _133.withdrawSuspensiveRegime) !== null && _134 !== void 0 ? _134 : 0),
|
|
165
|
+
releaseFromConsumption: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_136 = (_135 = payload.taxedOperations) === null || _135 === void 0 ? void 0 : _135.releaseFromConsumption) !== null && _136 !== void 0 ? _136 : 0),
|
|
162
166
|
intracommunityAcquisitions: isNil || isHolidayDeposit ? 0 : taxedIntracommunityAcquisitions,
|
|
163
|
-
energyDelivery: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
164
|
-
purchaseOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
165
|
-
regularizations: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
167
|
+
energyDelivery: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_138 = (_137 = payload.taxedOperations) === null || _137 === void 0 ? void 0 : _137.energyDelivery) !== null && _138 !== void 0 ? _138 : 0),
|
|
168
|
+
purchaseOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_140 = (_139 = payload.taxedOperations) === null || _139 === void 0 ? void 0 : _139.purchaseOfServicesNotInFrance) !== null && _140 !== void 0 ? _140 : 0),
|
|
169
|
+
regularizations: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_142 = (_141 = payload.taxedOperations) === null || _141 === void 0 ? void 0 : _141.regularizations) !== null && _142 !== void 0 ? _142 : 0) + ((_145 = (_144 = (_143 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _143 === void 0 ? void 0 : _143.regularisations) === null || _144 === void 0 ? void 0 : _144.base20) !== null && _145 !== void 0 ? _145 : 0) + ((_148 = (_147 = (_146 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _146 === void 0 ? void 0 : _146.regularisations) === null || _147 === void 0 ? void 0 : _147.base10) !== null && _148 !== void 0 ? _148 : 0) + ((_151 = (_150 = (_149 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _149 === void 0 ? void 0 : _149.regularisations) === null || _150 === void 0 ? void 0 : _150.base5Dot5) !== null && _151 !== void 0 ? _151 : 0) + ((_154 = (_153 = (_152 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _152 === void 0 ? void 0 : _152.regularisations) === null || _153 === void 0 ? void 0 : _153.base2Dot1) !== null && _154 !== void 0 ? _154 : 0),
|
|
166
170
|
},
|
|
167
171
|
untaxedOperations: {
|
|
168
172
|
exportationNotInEurope: isNil || isHolidayDeposit ? 0 : untaxedExportationNotInEurope,
|
|
169
173
|
other: isNil || isHolidayDeposit ? 0 : untaxedOther,
|
|
170
|
-
distanceSelling: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
174
|
+
distanceSelling: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_156 = (_155 = payload.untaxedOperations) === null || _155 === void 0 ? void 0 : _155.distanceSelling) !== null && _156 !== void 0 ? _156 : 0),
|
|
171
175
|
import: isNil || isHolidayDeposit ? 0 : untaxedImport,
|
|
172
|
-
withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
173
|
-
importInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
176
|
+
withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_158 = (_157 = payload.untaxedOperations) === null || _157 === void 0 ? void 0 : _157.withdrawSuspensiveRegime) !== null && _158 !== void 0 ? _158 : 0),
|
|
177
|
+
importInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_160 = (_159 = payload.untaxedOperations) === null || _159 === void 0 ? void 0 : _159.importInSuspensiveSystem) !== null && _160 !== void 0 ? _160 : 0),
|
|
174
178
|
intracommunityAcquisitions: isNil || isHolidayDeposit ? 0 : untaxedIntracomunity,
|
|
175
179
|
intracommunityDelivery: isNil || isHolidayDeposit ? 0 : untaxedIntracommunityDelivery,
|
|
176
|
-
energyDelivery: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
177
|
-
oilProductsConsumption: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
178
|
-
importPetrolInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
179
|
-
purchaseInFranchise: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
180
|
-
saleOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
181
|
-
regularizations: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
182
|
-
internalUniq: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
180
|
+
energyDelivery: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_162 = (_161 = payload.untaxedOperations) === null || _161 === void 0 ? void 0 : _161.energyDelivery) !== null && _162 !== void 0 ? _162 : 0),
|
|
181
|
+
oilProductsConsumption: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_164 = (_163 = payload.untaxedOperations) === null || _163 === void 0 ? void 0 : _163.oilProductsConsumption) !== null && _164 !== void 0 ? _164 : 0),
|
|
182
|
+
importPetrolInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_166 = (_165 = payload.untaxedOperations) === null || _165 === void 0 ? void 0 : _165.importPetrolInSuspensiveSystem) !== null && _166 !== void 0 ? _166 : 0),
|
|
183
|
+
purchaseInFranchise: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_168 = (_167 = payload.untaxedOperations) === null || _167 === void 0 ? void 0 : _167.purchaseInFranchise) !== null && _168 !== void 0 ? _168 : 0),
|
|
184
|
+
saleOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_170 = (_169 = payload.untaxedOperations) === null || _169 === void 0 ? void 0 : _169.saleOfServicesNotInFrance) !== null && _170 !== void 0 ? _170 : 0),
|
|
185
|
+
regularizations: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_172 = (_171 = payload.untaxedOperations) === null || _171 === void 0 ? void 0 : _171.regularizations) !== null && _172 !== void 0 ? _172 : 0) + ((_175 = (_174 = (_173 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _173 === void 0 ? void 0 : _173.untaxed) === null || _174 === void 0 ? void 0 : _174.regularisation) !== null && _175 !== void 0 ? _175 : 0),
|
|
186
|
+
internalUniq: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_177 = (_176 = payload.untaxedOperations) === null || _176 === void 0 ? void 0 : _176.internalUniq) !== null && _177 !== void 0 ? _177 : 0),
|
|
183
187
|
},
|
|
184
188
|
vat: {
|
|
185
189
|
carrieredOutInFrance: {
|
|
@@ -208,12 +212,12 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
|
|
|
208
212
|
},
|
|
209
213
|
oilProducts: {
|
|
210
214
|
normalRate20: {
|
|
211
|
-
base: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
212
|
-
tax: isNil || isHolidayDeposit ? 0 : ((0, lodash_1.round)((
|
|
215
|
+
base: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_181 = (_180 = (_179 = (_178 = payload.vat) === null || _178 === void 0 ? void 0 : _178.oilProducts) === null || _179 === void 0 ? void 0 : _179.normalRate20) === null || _180 === void 0 ? void 0 : _180.base) !== null && _181 !== void 0 ? _181 : 0),
|
|
216
|
+
tax: isNil || isHolidayDeposit ? 0 : ((0, lodash_1.round)((_185 = (_184 = (_183 = (_182 = payload.vat) === null || _182 === void 0 ? void 0 : _182.oilProducts) === null || _183 === void 0 ? void 0 : _183.normalRate20) === null || _184 === void 0 ? void 0 : _184.base) !== null && _185 !== void 0 ? _185 : 0) * 0.02),
|
|
213
217
|
},
|
|
214
218
|
reduceRate13: {
|
|
215
|
-
base: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
216
|
-
tax: isNil || isHolidayDeposit ? 0 : ((0, lodash_1.round)((
|
|
219
|
+
base: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_189 = (_188 = (_187 = (_186 = payload.vat) === null || _186 === void 0 ? void 0 : _186.oilProducts) === null || _187 === void 0 ? void 0 : _187.reduceRate13) === null || _188 === void 0 ? void 0 : _188.base) !== null && _189 !== void 0 ? _189 : 0),
|
|
220
|
+
tax: isNil || isHolidayDeposit ? 0 : ((0, lodash_1.round)((_193 = (_192 = (_191 = (_190 = payload.vat) === null || _190 === void 0 ? void 0 : _190.oilProducts) === null || _191 === void 0 ? void 0 : _191.reduceRate13) === null || _192 === void 0 ? void 0 : _192.base) !== null && _193 !== void 0 ? _193 : 0) * 0.013),
|
|
217
221
|
},
|
|
218
222
|
},
|
|
219
223
|
importations: {
|
|
@@ -243,34 +247,34 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
|
|
|
243
247
|
},
|
|
244
248
|
},
|
|
245
249
|
previouslyDeductedToBeReturned: {
|
|
246
|
-
onOilProducts: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
247
|
-
otherThanOilProducts: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
248
|
-
total: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
250
|
+
onOilProducts: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_196 = (_195 = (_194 = payload.vat) === null || _194 === void 0 ? void 0 : _194.previouslyDeductedToBeReturned) === null || _195 === void 0 ? void 0 : _195.onOilProducts) !== null && _196 !== void 0 ? _196 : 0),
|
|
251
|
+
otherThanOilProducts: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_199 = (_198 = (_197 = payload.vat) === null || _197 === void 0 ? void 0 : _197.previouslyDeductedToBeReturned) === null || _198 === void 0 ? void 0 : _198.otherThanOilProducts) !== null && _199 !== void 0 ? _199 : 0),
|
|
252
|
+
total: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_202 = (_201 = (_200 = payload.vat) === null || _200 === void 0 ? void 0 : _200.previouslyDeductedToBeReturned) === null || _201 === void 0 ? void 0 : _201.total) !== null && _202 !== void 0 ? _202 : 0),
|
|
249
253
|
},
|
|
250
254
|
sumToAdd,
|
|
251
255
|
grossDue: 0, // Calculé plus bas
|
|
252
256
|
onIntracommunityAcquisition: isNil || isHolidayDeposit ? 0 : intracommunityTax,
|
|
253
|
-
toMonaco: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
257
|
+
toMonaco: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_204 = (_203 = payload.vat) === null || _203 === void 0 ? void 0 : _203.toMonaco) !== null && _204 !== void 0 ? _204 : 0),
|
|
254
258
|
deductible: {
|
|
255
259
|
immobilizations: isNil || isHolidayDeposit ? 0 : (immobilizationTax !== null && immobilizationTax !== void 0 ? immobilizationTax : 0),
|
|
256
260
|
otherGoodsAndServices: isNil || isHolidayDeposit ? 0 : (otherGoodsAndServices !== null && otherGoodsAndServices !== void 0 ? otherGoodsAndServices : 0),
|
|
257
261
|
other: {
|
|
258
|
-
oil: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
262
|
+
oil: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_208 = (_207 = (_206 = (_205 = payload.vat) === null || _205 === void 0 ? void 0 : _205.deductible) === null || _206 === void 0 ? void 0 : _206.other) === null || _207 === void 0 ? void 0 : _207.oil) !== null && _208 !== void 0 ? _208 : 0),
|
|
259
263
|
thanOilProducts: 0,
|
|
260
264
|
collected: 0,
|
|
261
265
|
total: isNil || isHolidayDeposit ? 0 : otherDeductibles,
|
|
262
266
|
},
|
|
263
267
|
report,
|
|
264
|
-
toImpute: isNil || isHolidayDeposit ? 0 : ((0, lodash_1.round)((
|
|
268
|
+
toImpute: isNil || isHolidayDeposit ? 0 : ((0, lodash_1.round)((_211 = (_210 = (_209 = payload.vat) === null || _209 === void 0 ? void 0 : _209.deductible) === null || _210 === void 0 ? void 0 : _210.toImpute) !== null && _211 !== void 0 ? _211 : 0) + mxToSub) + ((_214 = (_213 = (_212 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _212 === void 0 ? void 0 : _212.deducted) === null || _213 === void 0 ? void 0 : _213.case2C) !== null && _214 !== void 0 ? _214 : 0),
|
|
265
269
|
total: 0, // Calculé plus bas
|
|
266
270
|
onImportOtherThanOilProducts: isNil || isHolidayDeposit ? 0 : otherDeductibles,
|
|
267
271
|
coefficient: isNil || isHolidayDeposit ? 100 : coefficient,
|
|
268
|
-
onOilProducts: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
272
|
+
onOilProducts: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_217 = (_216 = (_215 = payload.vat) === null || _215 === void 0 ? void 0 : _215.deductible) === null || _216 === void 0 ? void 0 : _216.onOilProducts) !== null && _217 !== void 0 ? _217 : 0),
|
|
269
273
|
},
|
|
270
274
|
otherRate: {
|
|
271
275
|
oldRate: {
|
|
272
|
-
base: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
273
|
-
tax: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
276
|
+
base: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_221 = (_220 = (_219 = (_218 = payload.vat) === null || _218 === void 0 ? void 0 : _218.otherRate) === null || _219 === void 0 ? void 0 : _219.oldRate) === null || _220 === void 0 ? void 0 : _220.base) !== null && _221 !== void 0 ? _221 : 0),
|
|
277
|
+
tax: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_225 = (_224 = (_223 = (_222 = payload.vat) === null || _222 === void 0 ? void 0 : _222.otherRate) === null || _223 === void 0 ? void 0 : _223.oldRate) === null || _224 === void 0 ? void 0 : _224.tax) !== null && _225 !== void 0 ? _225 : 0),
|
|
274
278
|
},
|
|
275
279
|
at1Dot75: {
|
|
276
280
|
base: 0,
|
|
@@ -304,16 +308,16 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
|
|
|
304
308
|
},
|
|
305
309
|
credit: {
|
|
306
310
|
amount: 0, // Calculé plus bas
|
|
307
|
-
refundAsked: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
308
|
-
transferedToSocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
309
|
-
assimiledTaxes: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
311
|
+
refundAsked: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_227 = (_226 = payload.credit) === null || _226 === void 0 ? void 0 : _226.refundAsked) !== null && _227 !== void 0 ? _227 : 0) + ((_229 = (_228 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _228 === void 0 ? void 0 : _228.refundAsked) !== null && _229 !== void 0 ? _229 : 0),
|
|
312
|
+
transferedToSocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_231 = (_230 = payload.credit) === null || _230 === void 0 ? void 0 : _230.transferedToSocietyHeadOfGroup) !== null && _231 !== void 0 ? _231 : 0),
|
|
313
|
+
assimiledTaxes: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_233 = (_232 = payload.credit) === null || _232 === void 0 ? void 0 : _232.assimiledTaxes) !== null && _233 !== void 0 ? _233 : 0),
|
|
310
314
|
toReport: 0, // Calculé plus bas
|
|
311
315
|
ticRefund: 0,
|
|
312
316
|
ticTransfered: 0,
|
|
313
317
|
},
|
|
314
318
|
toPay: {
|
|
315
319
|
netDue: 0, // Calculé plus bas
|
|
316
|
-
acquittedBySocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((
|
|
320
|
+
acquittedBySocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : (0, lodash_1.round)((_235 = (_234 = payload.toPay) === null || _234 === void 0 ? void 0 : _234.acquittedBySocietyHeadOfGroup) !== null && _235 !== void 0 ? _235 : 0),
|
|
317
321
|
total: 0,
|
|
318
322
|
},
|
|
319
323
|
tic: {
|
|
@@ -348,7 +352,7 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
|
|
|
348
352
|
initialPayload.credit.amount = initialPayload.vat.grossDue - initialPayload.vat.deductible.total < 0 ? Math.abs(initialPayload.vat.grossDue - initialPayload.vat.deductible.total) : 0;
|
|
349
353
|
initialPayload.toPay.netDue = initialPayload.vat.grossDue - initialPayload.vat.deductible.total > 0 ? initialPayload.vat.grossDue - initialPayload.vat.deductible.total : 0;
|
|
350
354
|
initialPayload.credit.toReport = initialPayload.credit.amount - initialPayload.credit.refundAsked - initialPayload.credit.transferedToSocietyHeadOfGroup;
|
|
351
|
-
initialPayload.toPay.total = initialPayload.toPay.netDue + initialPayload.credit.assimiledTaxes + ((
|
|
355
|
+
initialPayload.toPay.total = initialPayload.toPay.netDue + initialPayload.credit.assimiledTaxes + ((_238 = (_237 = (_236 = initialPayload.tic) === null || _236 === void 0 ? void 0 : _236.total) === null || _237 === void 0 ? void 0 : _237.tax) !== null && _238 !== void 0 ? _238 : 0) - initialPayload.toPay.acquittedBySocietyHeadOfGroup;
|
|
352
356
|
return initialPayload;
|
|
353
357
|
}
|
|
354
358
|
exports.getCerfa3310Century23Payload = getCerfa3310Century23Payload;
|