@silexpert/core 1.1.14 → 1.1.16
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.js +70 -70
- package/es/utils/vat/3310/century23.js.map +1 -1
- package/es/utils/vat/utils.d.ts +1 -1
- package/es/utils/vat/utils.d.ts.map +1 -1
- package/es/utils/vat/utils.js +9 -3
- package/es/utils/vat/utils.js.map +1 -1
- package/js/utils/vat/3310/century23.js +65 -65
- package/js/utils/vat/3310/century23.js.map +1 -1
- package/js/utils/vat/utils.js +8 -3
- package/js/utils/vat/utils.js.map +1 -1
- package/package.json +1 -1
- package/ts/utils/vat/3310/century23.ts +30 -30
- package/ts/utils/vat/utils.ts +8 -3
|
@@ -15,7 +15,7 @@ var _utils = require("../utils");
|
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
function getCerfa3310Century23Payload(accountingEntries, payload) {
|
|
18
|
-
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;
|
|
18
|
+
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;
|
|
19
19
|
const shouldHaveVatCode = (0, _classValidator.isDefined)((_a = payload.setting) === null || _a === void 0 ? void 0 : _a.tvaCode) && (0, _classValidator.isDefined)(payload.society.siret);
|
|
20
20
|
const vats = Object.values(_Vat.Vat);
|
|
21
21
|
const frenchVat = vats.filter(v => !v.isVatImportation && !v.isVatIntracom).map(v => v.id);
|
|
@@ -26,44 +26,44 @@ function getCerfa3310Century23Payload(accountingEntries, payload) {
|
|
|
26
26
|
const vatEntries = accountingEntries.filter(ae => typeof ae.idVat === 'number');
|
|
27
27
|
// Opérations taxées
|
|
28
28
|
const taxedServicesEntries = vatEntries.filter(ae => frenchVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
|
|
29
|
-
const servicesAccounts = ['701', '702', '703', '704', '705', '706', '707', '708'];
|
|
30
|
-
const taxedServicesFromFrance = (0, _utils.getAmountByAccountNumber)(taxedServicesEntries, servicesAccounts);
|
|
31
|
-
const taxedOther = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => withTaxVat.includes(ae.idVat)), ['775']);
|
|
29
|
+
const servicesAccounts = ['701', '702', '703', '704', '705', '706', '707', '708', '472'];
|
|
30
|
+
const taxedServicesFromFrance = (0, _utils.getAmountByAccountNumber)(taxedServicesEntries, servicesAccounts, 0, true);
|
|
31
|
+
const taxedOther = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => withTaxVat.includes(ae.idVat)), ['775'], 0, true);
|
|
32
32
|
const intracommunityServiceAccounts = ['604', '611', '612', '613', '614', '615', '616', '617', '618', '619', '62'];
|
|
33
33
|
const intracommunityServiceEntries = vatEntries.filter(ae => withTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat));
|
|
34
|
-
const taxedPurchaseOfIntracommunityService = (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries, intracommunityServiceAccounts);
|
|
34
|
+
const taxedPurchaseOfIntracommunityService = (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries, intracommunityServiceAccounts, 0, true);
|
|
35
35
|
const taxedImportEntries = vatEntries.filter(ae => importationVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
|
|
36
36
|
const taxedImportAccounts = ['6'];
|
|
37
|
-
const taxedImport = (0, _utils.getAmountByAccountNumber)(taxedImportEntries, taxedImportAccounts);
|
|
38
|
-
const taxedIntracommunityAcquisitions = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => intracomVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607']);
|
|
37
|
+
const taxedImport = (0, _utils.getAmountByAccountNumber)(taxedImportEntries, taxedImportAccounts, 0, true);
|
|
38
|
+
const taxedIntracommunityAcquisitions = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => intracomVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607'], 0, true);
|
|
39
39
|
// Opérations non taxées
|
|
40
|
-
const untaxedExportationNotInEurope = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts);
|
|
41
|
-
const untaxedOther = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['7']);
|
|
42
|
-
const untaxedImport = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6']);
|
|
43
|
-
const untaxedIntracomunity = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607']);
|
|
44
|
-
const untaxedIntracommunityDelivery = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => withoutTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat)), ['701', '707']);
|
|
40
|
+
const untaxedExportationNotInEurope = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts, 0, true);
|
|
41
|
+
const untaxedOther = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['7'], 0, true);
|
|
42
|
+
const untaxedImport = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6'], 0, true);
|
|
43
|
+
const untaxedIntracomunity = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607'], 0, true);
|
|
44
|
+
const untaxedIntracommunityDelivery = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => withoutTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat)), ['701', '707'], 0, true);
|
|
45
45
|
// TVA brute
|
|
46
|
-
const normalRate = (0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 20).map(v => v.id).includes(e.idVat)), servicesAccounts) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 20).map(v => v.id).includes(e.idVat)),
|
|
46
|
+
const normalRate = (0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 20).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 20).map(v => v.id).includes(e.idVat)), ['6'], 0, true);
|
|
47
47
|
const normalRateTax = (0, _lodash.round)(normalRate * 0.2);
|
|
48
|
-
const reducedRate5Dot5 = (0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 5.5).map(v => v.id).includes(e.idVat)), servicesAccounts) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 5.5).map(v => v.id).includes(e.idVat)),
|
|
48
|
+
const reducedRate5Dot5 = (0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 5.5).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 5.5).map(v => v.id).includes(e.idVat)), ['6'], 0, true);
|
|
49
49
|
const reducedRate5Dot5Tax = (0, _lodash.round)(reducedRate5Dot5 * 0.055);
|
|
50
|
-
const reducedRate10 = (0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 10).map(v => v.id).includes(e.idVat)), servicesAccounts) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 10).map(v => v.id).includes(e.idVat)),
|
|
50
|
+
const reducedRate10 = (0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 10).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 10).map(v => v.id).includes(e.idVat)), ['6'], 0, true);
|
|
51
51
|
const reducedRate10Tax = (0, _lodash.round)(reducedRate10 * 0.1);
|
|
52
|
-
const reducedRate8Dot5 = (0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 8.5).map(v => v.id).includes(e.idVat)), servicesAccounts) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 8.5).map(v => v.id).includes(e.idVat)),
|
|
52
|
+
const reducedRate8Dot5 = (0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 8.5).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 8.5).map(v => v.id).includes(e.idVat)), ['6'], 0, true);
|
|
53
53
|
const reducedRate8Dot5Tax = (0, _lodash.round)(reducedRate8Dot5 * 0.085);
|
|
54
|
-
const reducedRate2Dot1 = (0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 2.1).map(v => v.id).includes(e.idVat)), servicesAccounts) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 2.1).map(v => v.id).includes(e.idVat)),
|
|
54
|
+
const reducedRate2Dot1 = (0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 2.1).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 2.1).map(v => v.id).includes(e.idVat)), ['6'], 0, true);
|
|
55
55
|
const reducedRate2Dot1Tax = (0, _lodash.round)(reducedRate2Dot1 * 0.021);
|
|
56
|
-
const importNormalRate = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 20).map(v => v.id).includes(e.idVat)), taxedImportAccounts);
|
|
56
|
+
const importNormalRate = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 20).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
|
|
57
57
|
const importNormalRateTax = (0, _lodash.round)(importNormalRate * 0.2);
|
|
58
|
-
const importReducedRate10 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 10).map(v => v.id).includes(e.idVat)), taxedImportAccounts);
|
|
58
|
+
const importReducedRate10 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 10).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
|
|
59
59
|
const importReducedRate10Tax = (0, _lodash.round)(importReducedRate10 * 0.1);
|
|
60
|
-
const importReducedRate8Dot5 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 8.5).map(v => v.id).includes(e.idVat)), taxedImportAccounts);
|
|
60
|
+
const importReducedRate8Dot5 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 8.5).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
|
|
61
61
|
const importReducedRate8Dot5Tax = (0, _lodash.round)(importReducedRate8Dot5 * 0.085);
|
|
62
|
-
const importReducedRate5Dot5 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 5.5).map(v => v.id).includes(e.idVat)), taxedImportAccounts);
|
|
62
|
+
const importReducedRate5Dot5 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 5.5).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
|
|
63
63
|
const importReducedRate5Dot5Tax = (0, _lodash.round)(importReducedRate8Dot5 * 0.055);
|
|
64
|
-
const importReducedRate2Dot1 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 2.1).map(v => v.id).includes(e.idVat)), taxedImportAccounts);
|
|
64
|
+
const importReducedRate2Dot1 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 2.1).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
|
|
65
65
|
const importReducedRate2Dot1Tax = (0, _lodash.round)(importReducedRate2Dot1 * 0.021);
|
|
66
|
-
const importReducedRate1Dot05 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 1.05).map(v => v.id).includes(e.idVat)), taxedImportAccounts);
|
|
66
|
+
const importReducedRate1Dot05 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 1.05).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
|
|
67
67
|
const importReducedRate1Dot05Tax = (0, _lodash.round)(importReducedRate1Dot05 * 0.0105);
|
|
68
68
|
const intracommunityTax = (0, _utils.getTaxAmountByAccountNumber)(intracommunityServiceEntries, intracommunityServiceAccounts);
|
|
69
69
|
// TVA Déductible
|
|
@@ -74,8 +74,8 @@ function getCerfa3310Century23Payload(accountingEntries, payload) {
|
|
|
74
74
|
const coefficient = (0, _lodash.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);
|
|
75
75
|
const isNil = payload.isNil === true;
|
|
76
76
|
const isHolidayDeposit = payload.isHolidayDeposit === true;
|
|
77
|
-
const sumToAdd = isNil ? 0 : isHolidayDeposit ? (0, _lodash.round)(((_k = (_j = (_h = payload.previousVatDeclaration) === null || _h === void 0 ? void 0 : _h.toPay) === null || _j === void 0 ? void 0 : _j.total) !== null && _k !== void 0 ? _k : 0) * 0.8, 2) : (0, _lodash.round)((_m = (_l = payload.vat) === null || _l === void 0 ? void 0 : _l.sumToAdd) !== null && _m !== void 0 ? _m : 0);
|
|
78
|
-
const comment = isHolidayDeposit ? `ACOMPTE CONGES ${payload.comment}` : (
|
|
77
|
+
const sumToAdd = isNil ? 0 : isHolidayDeposit ? (0, _lodash.round)(((_k = (_j = (_h = payload.previousVatDeclaration) === null || _h === void 0 ? void 0 : _h.toPay) === null || _j === void 0 ? void 0 : _j.total) !== null && _k !== void 0 ? _k : 0) * 0.8, 2) : (0, _lodash.round)((_m = (_l = payload.vat) === null || _l === void 0 ? void 0 : _l.sumToAdd) !== null && _m !== void 0 ? _m : 0) + (0, _lodash.round)((_q = (_p = (_o = payload.vat) === null || _o === void 0 ? void 0 : _o.deductible) === null || _p === void 0 ? void 0 : _p.toImpute) !== null && _q !== void 0 ? _q : 0);
|
|
78
|
+
const comment = isHolidayDeposit ? `ACOMPTE CONGES ${(_r = payload.comment) !== null && _r !== void 0 ? _r : ''}` : (_s = payload.comment) !== null && _s !== void 0 ? _s : null;
|
|
79
79
|
const initialPayload = {
|
|
80
80
|
isNil,
|
|
81
81
|
isDGE: false,
|
|
@@ -88,7 +88,7 @@ function getCerfa3310Century23Payload(accountingEntries, payload) {
|
|
|
88
88
|
full: `${payload.society.address}\n${payload.society.zipCode} ${payload.society.city}`
|
|
89
89
|
},
|
|
90
90
|
numbers: {
|
|
91
|
-
SIE: (
|
|
91
|
+
SIE: (_u = (_t = payload.sie) === null || _t === void 0 ? void 0 : _t.sages) !== null && _u !== void 0 ? _u : null,
|
|
92
92
|
folder: null,
|
|
93
93
|
key: null,
|
|
94
94
|
period: null,
|
|
@@ -100,7 +100,7 @@ function getCerfa3310Century23Payload(accountingEntries, payload) {
|
|
|
100
100
|
},
|
|
101
101
|
service: {
|
|
102
102
|
address: {
|
|
103
|
-
full: (0, _classValidator.isDefined)((
|
|
103
|
+
full: (0, _classValidator.isDefined)((_w = (_v = payload.sie) === null || _v === void 0 ? void 0 : _v.address) === null || _w === void 0 ? void 0 : _w.address1) ? `${(_x = payload.sie) === null || _x === void 0 ? void 0 : _x.address.address1}\n${(_y = payload.sie) === null || _y === void 0 ? void 0 : _y.address.address2}\n${(_z = payload.sie) === null || _z === void 0 ? void 0 : _z.address.address3}\n${(_0 = payload.sie) === null || _0 === void 0 ? void 0 : _0.address.address4}\n${(_1 = payload.sie) === null || _1 === void 0 ? void 0 : _1.address.address5}` : null
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
period: {
|
|
@@ -116,13 +116,13 @@ function getCerfa3310Century23Payload(accountingEntries, payload) {
|
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
118
|
siret: {
|
|
119
|
-
first: (0, _classValidator.isDefined)(payload.society.siret) ? (
|
|
120
|
-
second: (0, _classValidator.isDefined)(payload.society.siret) ? (
|
|
119
|
+
first: (0, _classValidator.isDefined)(payload.society.siret) ? (_3 = (_2 = payload.society.siret) === null || _2 === void 0 ? void 0 : _2.slice(0, 9)) !== null && _3 !== void 0 ? _3 : null : null,
|
|
120
|
+
second: (0, _classValidator.isDefined)(payload.society.siret) ? (_5 = (_4 = payload.society.siret) === null || _4 === void 0 ? void 0 : _4.slice(5)) !== null && _5 !== void 0 ? _5 : null : null
|
|
121
121
|
},
|
|
122
122
|
intracommunityVat: {
|
|
123
|
-
first: shouldHaveVatCode ? (
|
|
124
|
-
second: shouldHaveVatCode ? (
|
|
125
|
-
third: shouldHaveVatCode ? (
|
|
123
|
+
first: shouldHaveVatCode ? (_8 = (_7 = (_6 = payload.setting) === null || _6 === void 0 ? void 0 : _6.tvaCode) === null || _7 === void 0 ? void 0 : _7.slice(0, 2)) !== null && _8 !== void 0 ? _8 : null : null,
|
|
124
|
+
second: shouldHaveVatCode ? (_11 = (_10 = (_9 = payload.setting) === null || _9 === void 0 ? void 0 : _9.tvaCode) === null || _10 === void 0 ? void 0 : _10.slice(2, 4)) !== null && _11 !== void 0 ? _11 : null : null,
|
|
125
|
+
third: shouldHaveVatCode ? (_13 = (_12 = payload.society.siret) === null || _12 === void 0 ? void 0 : _12.slice(0, 9)) !== null && _13 !== void 0 ? _13 : null : null
|
|
126
126
|
},
|
|
127
127
|
payment: {
|
|
128
128
|
date: dayjs().format('YYYY-MM-DD'),
|
|
@@ -136,29 +136,29 @@ function getCerfa3310Century23Payload(accountingEntries, payload) {
|
|
|
136
136
|
other: isNil || isHolidayDeposit ? 0 : taxedOther,
|
|
137
137
|
purchaseOfIntracommunityServiceProvision: isNil || isHolidayDeposit ? 0 : taxedPurchaseOfIntracommunityService,
|
|
138
138
|
import: isNil || isHolidayDeposit ? 0 : taxedImport,
|
|
139
|
-
withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
140
|
-
releaseFromConsumption: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
139
|
+
withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_15 = (_14 = payload.taxedOperations) === null || _14 === void 0 ? void 0 : _14.withdrawSuspensiveRegime) !== null && _15 !== void 0 ? _15 : 0),
|
|
140
|
+
releaseFromConsumption: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_17 = (_16 = payload.taxedOperations) === null || _16 === void 0 ? void 0 : _16.releaseFromConsumption) !== null && _17 !== void 0 ? _17 : 0),
|
|
141
141
|
intracommunityAcquisitions: isNil || isHolidayDeposit ? 0 : taxedIntracommunityAcquisitions,
|
|
142
|
-
energyDelivery: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
143
|
-
purchaseOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
144
|
-
regularizations: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
142
|
+
energyDelivery: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_19 = (_18 = payload.taxedOperations) === null || _18 === void 0 ? void 0 : _18.energyDelivery) !== null && _19 !== void 0 ? _19 : 0),
|
|
143
|
+
purchaseOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_21 = (_20 = payload.taxedOperations) === null || _20 === void 0 ? void 0 : _20.purchaseOfServicesNotInFrance) !== null && _21 !== void 0 ? _21 : 0),
|
|
144
|
+
regularizations: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_23 = (_22 = payload.taxedOperations) === null || _22 === void 0 ? void 0 : _22.regularizations) !== null && _23 !== void 0 ? _23 : 0)
|
|
145
145
|
},
|
|
146
146
|
untaxedOperations: {
|
|
147
147
|
exportationNotInEurope: isNil || isHolidayDeposit ? 0 : untaxedExportationNotInEurope,
|
|
148
148
|
other: isNil || isHolidayDeposit ? 0 : untaxedOther,
|
|
149
|
-
distanceSelling: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
149
|
+
distanceSelling: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_25 = (_24 = payload.untaxedOperations) === null || _24 === void 0 ? void 0 : _24.distanceSelling) !== null && _25 !== void 0 ? _25 : 0),
|
|
150
150
|
import: isNil || isHolidayDeposit ? 0 : untaxedImport,
|
|
151
|
-
withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
152
|
-
importInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
151
|
+
withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_27 = (_26 = payload.untaxedOperations) === null || _26 === void 0 ? void 0 : _26.withdrawSuspensiveRegime) !== null && _27 !== void 0 ? _27 : 0),
|
|
152
|
+
importInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_29 = (_28 = payload.untaxedOperations) === null || _28 === void 0 ? void 0 : _28.importInSuspensiveSystem) !== null && _29 !== void 0 ? _29 : 0),
|
|
153
153
|
intracommunityAcquisitions: isNil || isHolidayDeposit ? 0 : untaxedIntracomunity,
|
|
154
154
|
intracommunityDelivery: isNil || isHolidayDeposit ? 0 : untaxedIntracommunityDelivery,
|
|
155
|
-
energyDelivery: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
156
|
-
oilProductsConsumption: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
157
|
-
importPetrolInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
158
|
-
purchaseInFranchise: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
159
|
-
saleOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
160
|
-
regularizations: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
161
|
-
internalUniq: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
155
|
+
energyDelivery: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_31 = (_30 = payload.untaxedOperations) === null || _30 === void 0 ? void 0 : _30.energyDelivery) !== null && _31 !== void 0 ? _31 : 0),
|
|
156
|
+
oilProductsConsumption: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_33 = (_32 = payload.untaxedOperations) === null || _32 === void 0 ? void 0 : _32.oilProductsConsumption) !== null && _33 !== void 0 ? _33 : 0),
|
|
157
|
+
importPetrolInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_35 = (_34 = payload.untaxedOperations) === null || _34 === void 0 ? void 0 : _34.importPetrolInSuspensiveSystem) !== null && _35 !== void 0 ? _35 : 0),
|
|
158
|
+
purchaseInFranchise: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_37 = (_36 = payload.untaxedOperations) === null || _36 === void 0 ? void 0 : _36.purchaseInFranchise) !== null && _37 !== void 0 ? _37 : 0),
|
|
159
|
+
saleOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_39 = (_38 = payload.untaxedOperations) === null || _38 === void 0 ? void 0 : _38.saleOfServicesNotInFrance) !== null && _39 !== void 0 ? _39 : 0),
|
|
160
|
+
regularizations: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_41 = (_40 = payload.untaxedOperations) === null || _40 === void 0 ? void 0 : _40.regularizations) !== null && _41 !== void 0 ? _41 : 0),
|
|
161
|
+
internalUniq: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_43 = (_42 = payload.untaxedOperations) === null || _42 === void 0 ? void 0 : _42.internalUniq) !== null && _43 !== void 0 ? _43 : 0)
|
|
162
162
|
},
|
|
163
163
|
vat: {
|
|
164
164
|
carrieredOutInFrance: {
|
|
@@ -187,12 +187,12 @@ function getCerfa3310Century23Payload(accountingEntries, payload) {
|
|
|
187
187
|
},
|
|
188
188
|
oilProducts: {
|
|
189
189
|
normalRate20: {
|
|
190
|
-
base: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
191
|
-
tax: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
190
|
+
base: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_47 = (_46 = (_45 = (_44 = payload.vat) === null || _44 === void 0 ? void 0 : _44.oilProducts) === null || _45 === void 0 ? void 0 : _45.normalRate20) === null || _46 === void 0 ? void 0 : _46.base) !== null && _47 !== void 0 ? _47 : 0),
|
|
191
|
+
tax: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_51 = (_50 = (_49 = (_48 = payload.vat) === null || _48 === void 0 ? void 0 : _48.oilProducts) === null || _49 === void 0 ? void 0 : _49.normalRate20) === null || _50 === void 0 ? void 0 : _50.base) !== null && _51 !== void 0 ? _51 : 0) * 0.02
|
|
192
192
|
},
|
|
193
193
|
reduceRate13: {
|
|
194
|
-
base: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
195
|
-
tax: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
194
|
+
base: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_55 = (_54 = (_53 = (_52 = payload.vat) === null || _52 === void 0 ? void 0 : _52.oilProducts) === null || _53 === void 0 ? void 0 : _53.reduceRate13) === null || _54 === void 0 ? void 0 : _54.base) !== null && _55 !== void 0 ? _55 : 0),
|
|
195
|
+
tax: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_59 = (_58 = (_57 = (_56 = payload.vat) === null || _56 === void 0 ? void 0 : _56.oilProducts) === null || _57 === void 0 ? void 0 : _57.reduceRate13) === null || _58 === void 0 ? void 0 : _58.base) !== null && _59 !== void 0 ? _59 : 0) * 0.013
|
|
196
196
|
}
|
|
197
197
|
},
|
|
198
198
|
importations: {
|
|
@@ -222,34 +222,34 @@ function getCerfa3310Century23Payload(accountingEntries, payload) {
|
|
|
222
222
|
}
|
|
223
223
|
},
|
|
224
224
|
previouslyDeductedToBeReturned: {
|
|
225
|
-
onOilProducts: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
226
|
-
otherThanOilProducts: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
227
|
-
total: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
225
|
+
onOilProducts: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_62 = (_61 = (_60 = payload.vat) === null || _60 === void 0 ? void 0 : _60.previouslyDeductedToBeReturned) === null || _61 === void 0 ? void 0 : _61.onOilProducts) !== null && _62 !== void 0 ? _62 : 0),
|
|
226
|
+
otherThanOilProducts: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_65 = (_64 = (_63 = payload.vat) === null || _63 === void 0 ? void 0 : _63.previouslyDeductedToBeReturned) === null || _64 === void 0 ? void 0 : _64.otherThanOilProducts) !== null && _65 !== void 0 ? _65 : 0),
|
|
227
|
+
total: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_68 = (_67 = (_66 = payload.vat) === null || _66 === void 0 ? void 0 : _66.previouslyDeductedToBeReturned) === null || _67 === void 0 ? void 0 : _67.total) !== null && _68 !== void 0 ? _68 : 0)
|
|
228
228
|
},
|
|
229
229
|
sumToAdd,
|
|
230
230
|
grossDue: 0,
|
|
231
231
|
onIntracommunityAcquisition: isNil || isHolidayDeposit ? 0 : intracommunityTax,
|
|
232
|
-
toMonaco: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
232
|
+
toMonaco: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_70 = (_69 = payload.vat) === null || _69 === void 0 ? void 0 : _69.toMonaco) !== null && _70 !== void 0 ? _70 : 0),
|
|
233
233
|
deductible: {
|
|
234
234
|
immobilizations: isNil || isHolidayDeposit ? 0 : immobilizationTax !== null && immobilizationTax !== void 0 ? immobilizationTax : 0,
|
|
235
235
|
otherGoodsAndServices: isNil || isHolidayDeposit ? 0 : otherGoodsAndServices !== null && otherGoodsAndServices !== void 0 ? otherGoodsAndServices : 0,
|
|
236
236
|
other: {
|
|
237
|
-
oil: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
237
|
+
oil: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_74 = (_73 = (_72 = (_71 = payload.vat) === null || _71 === void 0 ? void 0 : _71.deductible) === null || _72 === void 0 ? void 0 : _72.other) === null || _73 === void 0 ? void 0 : _73.oil) !== null && _74 !== void 0 ? _74 : 0),
|
|
238
238
|
thanOilProducts: 0,
|
|
239
239
|
collected: 0,
|
|
240
240
|
total: isNil || isHolidayDeposit ? 0 : otherDeductibles
|
|
241
241
|
},
|
|
242
242
|
report,
|
|
243
|
-
toImpute: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
243
|
+
toImpute: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_77 = (_76 = (_75 = payload.vat) === null || _75 === void 0 ? void 0 : _75.deductible) === null || _76 === void 0 ? void 0 : _76.toImpute) !== null && _77 !== void 0 ? _77 : 0) + (0, _lodash.round)((_79 = (_78 = payload.vat) === null || _78 === void 0 ? void 0 : _78.sumToAdd) !== null && _79 !== void 0 ? _79 : 0),
|
|
244
244
|
total: 0,
|
|
245
245
|
onImportOtherThanOilProducts: isNil || isHolidayDeposit ? 0 : otherDeductibles,
|
|
246
246
|
coefficient: isNil || isHolidayDeposit ? 100 : coefficient,
|
|
247
|
-
onOilProducts: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
247
|
+
onOilProducts: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_82 = (_81 = (_80 = payload.vat) === null || _80 === void 0 ? void 0 : _80.deductible) === null || _81 === void 0 ? void 0 : _81.onOilProducts) !== null && _82 !== void 0 ? _82 : 0)
|
|
248
248
|
},
|
|
249
249
|
otherRate: {
|
|
250
250
|
oldRate: {
|
|
251
|
-
base: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
252
|
-
tax: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
251
|
+
base: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_86 = (_85 = (_84 = (_83 = payload.vat) === null || _83 === void 0 ? void 0 : _83.otherRate) === null || _84 === void 0 ? void 0 : _84.oldRate) === null || _85 === void 0 ? void 0 : _85.base) !== null && _86 !== void 0 ? _86 : 0),
|
|
252
|
+
tax: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_90 = (_89 = (_88 = (_87 = payload.vat) === null || _87 === void 0 ? void 0 : _87.otherRate) === null || _88 === void 0 ? void 0 : _88.oldRate) === null || _89 === void 0 ? void 0 : _89.tax) !== null && _90 !== void 0 ? _90 : 0)
|
|
253
253
|
},
|
|
254
254
|
at1Dot75: {
|
|
255
255
|
base: 0,
|
|
@@ -283,16 +283,16 @@ function getCerfa3310Century23Payload(accountingEntries, payload) {
|
|
|
283
283
|
},
|
|
284
284
|
credit: {
|
|
285
285
|
amount: 0,
|
|
286
|
-
refundAsked: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
287
|
-
transferedToSocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
288
|
-
assimiledTaxes: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
286
|
+
refundAsked: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_92 = (_91 = payload.credit) === null || _91 === void 0 ? void 0 : _91.refundAsked) !== null && _92 !== void 0 ? _92 : 0),
|
|
287
|
+
transferedToSocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_94 = (_93 = payload.credit) === null || _93 === void 0 ? void 0 : _93.transferedToSocietyHeadOfGroup) !== null && _94 !== void 0 ? _94 : 0),
|
|
288
|
+
assimiledTaxes: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_96 = (_95 = payload.credit) === null || _95 === void 0 ? void 0 : _95.assimiledTaxes) !== null && _96 !== void 0 ? _96 : 0),
|
|
289
289
|
toReport: 0,
|
|
290
290
|
ticRefund: 0,
|
|
291
291
|
ticTransfered: 0
|
|
292
292
|
},
|
|
293
293
|
toPay: {
|
|
294
294
|
netDue: 0,
|
|
295
|
-
acquittedBySocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((
|
|
295
|
+
acquittedBySocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_98 = (_97 = payload.toPay) === null || _97 === void 0 ? void 0 : _97.acquittedBySocietyHeadOfGroup) !== null && _98 !== void 0 ? _98 : 0),
|
|
296
296
|
total: 0
|
|
297
297
|
},
|
|
298
298
|
tic: {
|
|
@@ -306,7 +306,7 @@ function getCerfa3310Century23Payload(accountingEntries, payload) {
|
|
|
306
306
|
initialPayload.credit.amount = initialPayload.vat.grossDue - initialPayload.vat.deductible.total < 0 ? Math.abs(initialPayload.vat.grossDue - initialPayload.vat.deductible.total) : 0;
|
|
307
307
|
initialPayload.toPay.netDue = initialPayload.vat.grossDue - initialPayload.vat.deductible.total > 0 ? initialPayload.vat.grossDue - initialPayload.vat.deductible.total : 0;
|
|
308
308
|
initialPayload.credit.toReport = initialPayload.credit.amount - initialPayload.credit.refundAsked - initialPayload.credit.transferedToSocietyHeadOfGroup;
|
|
309
|
-
initialPayload.toPay.total = initialPayload.toPay.netDue + initialPayload.credit.assimiledTaxes + ((
|
|
309
|
+
initialPayload.toPay.total = initialPayload.toPay.netDue + initialPayload.credit.assimiledTaxes + ((_101 = (_100 = (_99 = initialPayload.tic) === null || _99 === void 0 ? void 0 : _99.total) === null || _100 === void 0 ? void 0 : _100.tax) !== null && _101 !== void 0 ? _101 : 0) - initialPayload.toPay.acquittedBySocietyHeadOfGroup;
|
|
310
310
|
return initialPayload;
|
|
311
311
|
}
|
|
312
312
|
function getCerfa3310Century23RegistrationFields(data) {
|