@silexpert/core 1.1.15 → 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.
@@ -4,7 +4,7 @@ import { round as _round } from 'lodash';
4
4
  import { Vat } from '../../../types/Enum/Vat';
5
5
  import { getAmountByAccountNumber, getTaxAmountByAccountNumber, textFormatting } from '../utils';
6
6
  export function getCerfa3310Century23Payload(accountingEntries, payload) {
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;
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, _97, _98, _99, _100, _101;
8
8
  const shouldHaveVatCode = isDefined((_a = payload.setting) === null || _a === void 0 ? void 0 : _a.tvaCode) && isDefined(payload.society.siret);
9
9
  const vats = Object.values(Vat);
10
10
  const frenchVat = vats.filter((v) => !v.isVatImportation && !v.isVatIntracom).map((v) => v.id);
@@ -15,49 +15,49 @@ export function getCerfa3310Century23Payload(accountingEntries, payload) {
15
15
  const vatEntries = accountingEntries.filter((ae) => typeof ae.idVat === 'number');
16
16
  // Opérations taxées
17
17
  const taxedServicesEntries = vatEntries.filter((ae) => frenchVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
18
- const servicesAccounts = ['701', '702', '703', '704', '705', '706', '707', '708'];
19
- const taxedServicesFromFrance = getAmountByAccountNumber(taxedServicesEntries, servicesAccounts);
20
- const taxedOther = getAmountByAccountNumber(vatEntries.filter((ae) => withTaxVat.includes(ae.idVat)), ['775']);
18
+ const servicesAccounts = ['701', '702', '703', '704', '705', '706', '707', '708', '472'];
19
+ const taxedServicesFromFrance = getAmountByAccountNumber(taxedServicesEntries, servicesAccounts, 0, true);
20
+ const taxedOther = getAmountByAccountNumber(vatEntries.filter((ae) => withTaxVat.includes(ae.idVat)), ['775'], 0, true);
21
21
  const intracommunityServiceAccounts = ['604', '611', '612', '613', '614', '615', '616', '617', '618', '619', '62'];
22
22
  const intracommunityServiceEntries = vatEntries.filter((ae) => withTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat));
23
- const taxedPurchaseOfIntracommunityService = getAmountByAccountNumber(intracommunityServiceEntries, intracommunityServiceAccounts);
23
+ const taxedPurchaseOfIntracommunityService = getAmountByAccountNumber(intracommunityServiceEntries, intracommunityServiceAccounts, 0, true);
24
24
  const taxedImportEntries = vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
25
25
  const taxedImportAccounts = ['6'];
26
- const taxedImport = getAmountByAccountNumber(taxedImportEntries, taxedImportAccounts);
27
- const taxedIntracommunityAcquisitions = getAmountByAccountNumber(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607']);
26
+ const taxedImport = getAmountByAccountNumber(taxedImportEntries, taxedImportAccounts, 0, true);
27
+ const taxedIntracommunityAcquisitions = getAmountByAccountNumber(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607'], 0, true);
28
28
  // Opérations non taxées
29
- const untaxedExportationNotInEurope = getAmountByAccountNumber(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts);
30
- const untaxedOther = getAmountByAccountNumber(vatEntries.filter((ae) => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['7']);
31
- const untaxedImport = getAmountByAccountNumber(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6']);
32
- const untaxedIntracomunity = getAmountByAccountNumber(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607']);
33
- const untaxedIntracommunityDelivery = getAmountByAccountNumber(vatEntries.filter((ae) => withoutTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat)), ['701', '707']);
29
+ const untaxedExportationNotInEurope = getAmountByAccountNumber(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts, 0, true);
30
+ const untaxedOther = getAmountByAccountNumber(vatEntries.filter((ae) => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['7'], 0, true);
31
+ const untaxedImport = getAmountByAccountNumber(vatEntries.filter((ae) => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6'], 0, true);
32
+ const untaxedIntracomunity = getAmountByAccountNumber(vatEntries.filter((ae) => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607'], 0, true);
33
+ const untaxedIntracommunityDelivery = getAmountByAccountNumber(vatEntries.filter((ae) => withoutTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat)), ['701', '707'], 0, true);
34
34
  // TVA brute
35
- const normalRate = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), servicesAccounts)
36
- + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), intracommunityServiceAccounts);
35
+ const normalRate = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
36
+ + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), ['6'], 0, true);
37
37
  const normalRateTax = _round(normalRate * 0.2);
38
- const reducedRate5Dot5 = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), servicesAccounts)
39
- + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), intracommunityServiceAccounts);
38
+ const reducedRate5Dot5 = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
39
+ + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true);
40
40
  const reducedRate5Dot5Tax = _round(reducedRate5Dot5 * 0.055);
41
- const reducedRate10 = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), servicesAccounts)
42
- + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), intracommunityServiceAccounts);
41
+ const reducedRate10 = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
42
+ + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), ['6'], 0, true);
43
43
  const reducedRate10Tax = _round(reducedRate10 * 0.1);
44
- const reducedRate8Dot5 = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), servicesAccounts)
45
- + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), intracommunityServiceAccounts);
44
+ const reducedRate8Dot5 = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
45
+ + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), ['6'], 0, true);
46
46
  const reducedRate8Dot5Tax = _round(reducedRate8Dot5 * 0.085);
47
- const reducedRate2Dot1 = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), servicesAccounts)
48
- + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), intracommunityServiceAccounts);
47
+ const reducedRate2Dot1 = getAmountByAccountNumber(taxedServicesEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), servicesAccounts, 0, true)
48
+ + getAmountByAccountNumber(intracommunityServiceEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), ['6'], 0, true);
49
49
  const reducedRate2Dot1Tax = _round(reducedRate2Dot1 * 0.021);
50
- const importNormalRate = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), taxedImportAccounts);
50
+ const importNormalRate = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 20).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
51
51
  const importNormalRateTax = _round(importNormalRate * 0.2);
52
- const importReducedRate10 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), taxedImportAccounts);
52
+ const importReducedRate10 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 10).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
53
53
  const importReducedRate10Tax = _round(importReducedRate10 * 0.1);
54
- const importReducedRate8Dot5 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts);
54
+ const importReducedRate8Dot5 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 8.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
55
55
  const importReducedRate8Dot5Tax = _round(importReducedRate8Dot5 * 0.085);
56
- const importReducedRate5Dot5 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts);
56
+ const importReducedRate5Dot5 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 5.5).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
57
57
  const importReducedRate5Dot5Tax = _round(importReducedRate8Dot5 * 0.055);
58
- const importReducedRate2Dot1 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), taxedImportAccounts);
58
+ const importReducedRate2Dot1 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 2.1).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
59
59
  const importReducedRate2Dot1Tax = _round(importReducedRate2Dot1 * 0.021);
60
- const importReducedRate1Dot05 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 1.05).map((v) => v.id).includes(e.idVat)), taxedImportAccounts);
60
+ const importReducedRate1Dot05 = getAmountByAccountNumber(taxedImportEntries.filter((e) => vats.filter((v) => v.value === 1.05).map((v) => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
61
61
  const importReducedRate1Dot05Tax = _round(importReducedRate1Dot05 * 0.0105);
62
62
  const intracommunityTax = getTaxAmountByAccountNumber(intracommunityServiceEntries, intracommunityServiceAccounts);
63
63
  // TVA Déductible
@@ -68,8 +68,8 @@ export function getCerfa3310Century23Payload(accountingEntries, payload) {
68
68
  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);
69
69
  const isNil = payload.isNil === true;
70
70
  const isHolidayDeposit = payload.isHolidayDeposit === true;
71
- const sumToAdd = isNil ? 0 : isHolidayDeposit ? (_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)) : _round((_m = (_l = payload.vat) === null || _l === void 0 ? void 0 : _l.sumToAdd) !== null && _m !== void 0 ? _m : 0);
72
- const comment = isHolidayDeposit ? `ACOMPTE CONGES ${payload.comment}` : ((_o = payload.comment) !== null && _o !== void 0 ? _o : null);
71
+ const sumToAdd = isNil ? 0 : isHolidayDeposit ? (_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)) : _round((_m = (_l = payload.vat) === null || _l === void 0 ? void 0 : _l.sumToAdd) !== null && _m !== void 0 ? _m : 0) + _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);
72
+ const comment = isHolidayDeposit ? `ACOMPTE CONGES ${(_r = payload.comment) !== null && _r !== void 0 ? _r : ''}` : ((_s = payload.comment) !== null && _s !== void 0 ? _s : null);
73
73
  const initialPayload = {
74
74
  isNil,
75
75
  isDGE: false,
@@ -82,7 +82,7 @@ export function getCerfa3310Century23Payload(accountingEntries, payload) {
82
82
  full: `${payload.society.address}\n${payload.society.zipCode} ${payload.society.city}`,
83
83
  },
84
84
  numbers: {
85
- SIE: (_q = (_p = payload.sie) === null || _p === void 0 ? void 0 : _p.sages) !== null && _q !== void 0 ? _q : null,
85
+ SIE: (_u = (_t = payload.sie) === null || _t === void 0 ? void 0 : _t.sages) !== null && _u !== void 0 ? _u : null,
86
86
  folder: null,
87
87
  key: null,
88
88
  period: null,
@@ -94,7 +94,7 @@ export function getCerfa3310Century23Payload(accountingEntries, payload) {
94
94
  },
95
95
  service: {
96
96
  address: {
97
- full: isDefined((_s = (_r = payload.sie) === null || _r === void 0 ? void 0 : _r.address) === null || _s === void 0 ? void 0 : _s.address1) ? `${(_t = payload.sie) === null || _t === void 0 ? void 0 : _t.address.address1}\n${(_u = payload.sie) === null || _u === void 0 ? void 0 : _u.address.address2}\n${(_v = payload.sie) === null || _v === void 0 ? void 0 : _v.address.address3}\n${(_w = payload.sie) === null || _w === void 0 ? void 0 : _w.address.address4}\n${(_x = payload.sie) === null || _x === void 0 ? void 0 : _x.address.address5}` : null,
97
+ full: 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,
98
98
  },
99
99
  },
100
100
  period: {
@@ -110,13 +110,13 @@ export function getCerfa3310Century23Payload(accountingEntries, payload) {
110
110
  },
111
111
  },
112
112
  siret: {
113
- first: isDefined(payload.society.siret) ? ((_z = (_y = payload.society.siret) === null || _y === void 0 ? void 0 : _y.slice(0, 9)) !== null && _z !== void 0 ? _z : null) : null,
114
- second: isDefined(payload.society.siret) ? ((_1 = (_0 = payload.society.siret) === null || _0 === void 0 ? void 0 : _0.slice(5)) !== null && _1 !== void 0 ? _1 : null) : null,
113
+ first: 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,
114
+ second: 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,
115
115
  },
116
116
  intracommunityVat: {
117
- first: shouldHaveVatCode ? ((_4 = (_3 = (_2 = payload.setting) === null || _2 === void 0 ? void 0 : _2.tvaCode) === null || _3 === void 0 ? void 0 : _3.slice(0, 2)) !== null && _4 !== void 0 ? _4 : null) : null,
118
- second: shouldHaveVatCode ? ((_7 = (_6 = (_5 = payload.setting) === null || _5 === void 0 ? void 0 : _5.tvaCode) === null || _6 === void 0 ? void 0 : _6.slice(2, 4)) !== null && _7 !== void 0 ? _7 : null) : null,
119
- third: shouldHaveVatCode ? ((_9 = (_8 = payload.society.siret) === null || _8 === void 0 ? void 0 : _8.slice(0, 9)) !== null && _9 !== void 0 ? _9 : null) : null,
117
+ 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,
118
+ 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,
119
+ third: shouldHaveVatCode ? ((_13 = (_12 = payload.society.siret) === null || _12 === void 0 ? void 0 : _12.slice(0, 9)) !== null && _13 !== void 0 ? _13 : null) : null,
120
120
  },
121
121
  payment: {
122
122
  date: dayjs().format('YYYY-MM-DD'),
@@ -130,29 +130,29 @@ export function getCerfa3310Century23Payload(accountingEntries, payload) {
130
130
  other: isNil || isHolidayDeposit ? 0 : taxedOther,
131
131
  purchaseOfIntracommunityServiceProvision: isNil || isHolidayDeposit ? 0 : taxedPurchaseOfIntracommunityService,
132
132
  import: isNil || isHolidayDeposit ? 0 : taxedImport,
133
- withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : _round((_11 = (_10 = payload.taxedOperations) === null || _10 === void 0 ? void 0 : _10.withdrawSuspensiveRegime) !== null && _11 !== void 0 ? _11 : 0),
134
- releaseFromConsumption: isNil || isHolidayDeposit ? 0 : _round((_13 = (_12 = payload.taxedOperations) === null || _12 === void 0 ? void 0 : _12.releaseFromConsumption) !== null && _13 !== void 0 ? _13 : 0),
133
+ withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : _round((_15 = (_14 = payload.taxedOperations) === null || _14 === void 0 ? void 0 : _14.withdrawSuspensiveRegime) !== null && _15 !== void 0 ? _15 : 0),
134
+ releaseFromConsumption: isNil || isHolidayDeposit ? 0 : _round((_17 = (_16 = payload.taxedOperations) === null || _16 === void 0 ? void 0 : _16.releaseFromConsumption) !== null && _17 !== void 0 ? _17 : 0),
135
135
  intracommunityAcquisitions: isNil || isHolidayDeposit ? 0 : taxedIntracommunityAcquisitions,
136
- energyDelivery: isNil || isHolidayDeposit ? 0 : _round((_15 = (_14 = payload.taxedOperations) === null || _14 === void 0 ? void 0 : _14.energyDelivery) !== null && _15 !== void 0 ? _15 : 0),
137
- purchaseOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : _round((_17 = (_16 = payload.taxedOperations) === null || _16 === void 0 ? void 0 : _16.purchaseOfServicesNotInFrance) !== null && _17 !== void 0 ? _17 : 0),
138
- regularizations: isNil || isHolidayDeposit ? 0 : _round((_19 = (_18 = payload.taxedOperations) === null || _18 === void 0 ? void 0 : _18.regularizations) !== null && _19 !== void 0 ? _19 : 0),
136
+ energyDelivery: isNil || isHolidayDeposit ? 0 : _round((_19 = (_18 = payload.taxedOperations) === null || _18 === void 0 ? void 0 : _18.energyDelivery) !== null && _19 !== void 0 ? _19 : 0),
137
+ purchaseOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : _round((_21 = (_20 = payload.taxedOperations) === null || _20 === void 0 ? void 0 : _20.purchaseOfServicesNotInFrance) !== null && _21 !== void 0 ? _21 : 0),
138
+ regularizations: isNil || isHolidayDeposit ? 0 : _round((_23 = (_22 = payload.taxedOperations) === null || _22 === void 0 ? void 0 : _22.regularizations) !== null && _23 !== void 0 ? _23 : 0),
139
139
  },
140
140
  untaxedOperations: {
141
141
  exportationNotInEurope: isNil || isHolidayDeposit ? 0 : untaxedExportationNotInEurope,
142
142
  other: isNil || isHolidayDeposit ? 0 : untaxedOther,
143
- distanceSelling: isNil || isHolidayDeposit ? 0 : _round((_21 = (_20 = payload.untaxedOperations) === null || _20 === void 0 ? void 0 : _20.distanceSelling) !== null && _21 !== void 0 ? _21 : 0),
143
+ distanceSelling: isNil || isHolidayDeposit ? 0 : _round((_25 = (_24 = payload.untaxedOperations) === null || _24 === void 0 ? void 0 : _24.distanceSelling) !== null && _25 !== void 0 ? _25 : 0),
144
144
  import: isNil || isHolidayDeposit ? 0 : untaxedImport,
145
- withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : _round((_23 = (_22 = payload.untaxedOperations) === null || _22 === void 0 ? void 0 : _22.withdrawSuspensiveRegime) !== null && _23 !== void 0 ? _23 : 0),
146
- importInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : _round((_25 = (_24 = payload.untaxedOperations) === null || _24 === void 0 ? void 0 : _24.importInSuspensiveSystem) !== null && _25 !== void 0 ? _25 : 0),
145
+ withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : _round((_27 = (_26 = payload.untaxedOperations) === null || _26 === void 0 ? void 0 : _26.withdrawSuspensiveRegime) !== null && _27 !== void 0 ? _27 : 0),
146
+ importInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : _round((_29 = (_28 = payload.untaxedOperations) === null || _28 === void 0 ? void 0 : _28.importInSuspensiveSystem) !== null && _29 !== void 0 ? _29 : 0),
147
147
  intracommunityAcquisitions: isNil || isHolidayDeposit ? 0 : untaxedIntracomunity,
148
148
  intracommunityDelivery: isNil || isHolidayDeposit ? 0 : untaxedIntracommunityDelivery,
149
- energyDelivery: isNil || isHolidayDeposit ? 0 : _round((_27 = (_26 = payload.untaxedOperations) === null || _26 === void 0 ? void 0 : _26.energyDelivery) !== null && _27 !== void 0 ? _27 : 0),
150
- oilProductsConsumption: isNil || isHolidayDeposit ? 0 : _round((_29 = (_28 = payload.untaxedOperations) === null || _28 === void 0 ? void 0 : _28.oilProductsConsumption) !== null && _29 !== void 0 ? _29 : 0),
151
- importPetrolInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : _round((_31 = (_30 = payload.untaxedOperations) === null || _30 === void 0 ? void 0 : _30.importPetrolInSuspensiveSystem) !== null && _31 !== void 0 ? _31 : 0),
152
- purchaseInFranchise: isNil || isHolidayDeposit ? 0 : _round((_33 = (_32 = payload.untaxedOperations) === null || _32 === void 0 ? void 0 : _32.purchaseInFranchise) !== null && _33 !== void 0 ? _33 : 0),
153
- saleOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : _round((_35 = (_34 = payload.untaxedOperations) === null || _34 === void 0 ? void 0 : _34.saleOfServicesNotInFrance) !== null && _35 !== void 0 ? _35 : 0),
154
- regularizations: isNil || isHolidayDeposit ? 0 : _round((_37 = (_36 = payload.untaxedOperations) === null || _36 === void 0 ? void 0 : _36.regularizations) !== null && _37 !== void 0 ? _37 : 0),
155
- internalUniq: isNil || isHolidayDeposit ? 0 : _round((_39 = (_38 = payload.untaxedOperations) === null || _38 === void 0 ? void 0 : _38.internalUniq) !== null && _39 !== void 0 ? _39 : 0),
149
+ energyDelivery: isNil || isHolidayDeposit ? 0 : _round((_31 = (_30 = payload.untaxedOperations) === null || _30 === void 0 ? void 0 : _30.energyDelivery) !== null && _31 !== void 0 ? _31 : 0),
150
+ oilProductsConsumption: isNil || isHolidayDeposit ? 0 : _round((_33 = (_32 = payload.untaxedOperations) === null || _32 === void 0 ? void 0 : _32.oilProductsConsumption) !== null && _33 !== void 0 ? _33 : 0),
151
+ importPetrolInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : _round((_35 = (_34 = payload.untaxedOperations) === null || _34 === void 0 ? void 0 : _34.importPetrolInSuspensiveSystem) !== null && _35 !== void 0 ? _35 : 0),
152
+ purchaseInFranchise: isNil || isHolidayDeposit ? 0 : _round((_37 = (_36 = payload.untaxedOperations) === null || _36 === void 0 ? void 0 : _36.purchaseInFranchise) !== null && _37 !== void 0 ? _37 : 0),
153
+ saleOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : _round((_39 = (_38 = payload.untaxedOperations) === null || _38 === void 0 ? void 0 : _38.saleOfServicesNotInFrance) !== null && _39 !== void 0 ? _39 : 0),
154
+ regularizations: isNil || isHolidayDeposit ? 0 : _round((_41 = (_40 = payload.untaxedOperations) === null || _40 === void 0 ? void 0 : _40.regularizations) !== null && _41 !== void 0 ? _41 : 0),
155
+ internalUniq: isNil || isHolidayDeposit ? 0 : _round((_43 = (_42 = payload.untaxedOperations) === null || _42 === void 0 ? void 0 : _42.internalUniq) !== null && _43 !== void 0 ? _43 : 0),
156
156
  },
157
157
  vat: {
158
158
  carrieredOutInFrance: {
@@ -181,12 +181,12 @@ export function getCerfa3310Century23Payload(accountingEntries, payload) {
181
181
  },
182
182
  oilProducts: {
183
183
  normalRate20: {
184
- base: isNil || isHolidayDeposit ? 0 : _round((_43 = (_42 = (_41 = (_40 = payload.vat) === null || _40 === void 0 ? void 0 : _40.oilProducts) === null || _41 === void 0 ? void 0 : _41.normalRate20) === null || _42 === void 0 ? void 0 : _42.base) !== null && _43 !== void 0 ? _43 : 0),
185
- tax: isNil || isHolidayDeposit ? 0 : (_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) * 0.02),
184
+ base: isNil || isHolidayDeposit ? 0 : _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),
185
+ tax: isNil || isHolidayDeposit ? 0 : (_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),
186
186
  },
187
187
  reduceRate13: {
188
- base: isNil || isHolidayDeposit ? 0 : _round((_51 = (_50 = (_49 = (_48 = payload.vat) === null || _48 === void 0 ? void 0 : _48.oilProducts) === null || _49 === void 0 ? void 0 : _49.reduceRate13) === null || _50 === void 0 ? void 0 : _50.base) !== null && _51 !== void 0 ? _51 : 0),
189
- tax: isNil || isHolidayDeposit ? 0 : (_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) * 0.013),
188
+ base: isNil || isHolidayDeposit ? 0 : _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),
189
+ tax: isNil || isHolidayDeposit ? 0 : (_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),
190
190
  },
191
191
  },
192
192
  importations: {
@@ -216,34 +216,34 @@ export function getCerfa3310Century23Payload(accountingEntries, payload) {
216
216
  },
217
217
  },
218
218
  previouslyDeductedToBeReturned: {
219
- onOilProducts: isNil || isHolidayDeposit ? 0 : _round((_58 = (_57 = (_56 = payload.vat) === null || _56 === void 0 ? void 0 : _56.previouslyDeductedToBeReturned) === null || _57 === void 0 ? void 0 : _57.onOilProducts) !== null && _58 !== void 0 ? _58 : 0),
220
- otherThanOilProducts: isNil || isHolidayDeposit ? 0 : _round((_61 = (_60 = (_59 = payload.vat) === null || _59 === void 0 ? void 0 : _59.previouslyDeductedToBeReturned) === null || _60 === void 0 ? void 0 : _60.otherThanOilProducts) !== null && _61 !== void 0 ? _61 : 0),
221
- total: isNil || isHolidayDeposit ? 0 : _round((_64 = (_63 = (_62 = payload.vat) === null || _62 === void 0 ? void 0 : _62.previouslyDeductedToBeReturned) === null || _63 === void 0 ? void 0 : _63.total) !== null && _64 !== void 0 ? _64 : 0),
219
+ onOilProducts: isNil || isHolidayDeposit ? 0 : _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),
220
+ otherThanOilProducts: isNil || isHolidayDeposit ? 0 : _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),
221
+ total: isNil || isHolidayDeposit ? 0 : _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),
222
222
  },
223
223
  sumToAdd,
224
224
  grossDue: 0,
225
225
  onIntracommunityAcquisition: isNil || isHolidayDeposit ? 0 : intracommunityTax,
226
- toMonaco: isNil || isHolidayDeposit ? 0 : _round((_66 = (_65 = payload.vat) === null || _65 === void 0 ? void 0 : _65.toMonaco) !== null && _66 !== void 0 ? _66 : 0),
226
+ toMonaco: isNil || isHolidayDeposit ? 0 : _round((_70 = (_69 = payload.vat) === null || _69 === void 0 ? void 0 : _69.toMonaco) !== null && _70 !== void 0 ? _70 : 0),
227
227
  deductible: {
228
228
  immobilizations: isNil || isHolidayDeposit ? 0 : (immobilizationTax !== null && immobilizationTax !== void 0 ? immobilizationTax : 0),
229
229
  otherGoodsAndServices: isNil || isHolidayDeposit ? 0 : (otherGoodsAndServices !== null && otherGoodsAndServices !== void 0 ? otherGoodsAndServices : 0),
230
230
  other: {
231
- oil: isNil || isHolidayDeposit ? 0 : _round((_70 = (_69 = (_68 = (_67 = payload.vat) === null || _67 === void 0 ? void 0 : _67.deductible) === null || _68 === void 0 ? void 0 : _68.other) === null || _69 === void 0 ? void 0 : _69.oil) !== null && _70 !== void 0 ? _70 : 0),
231
+ oil: isNil || isHolidayDeposit ? 0 : _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),
232
232
  thanOilProducts: 0,
233
233
  collected: 0,
234
234
  total: isNil || isHolidayDeposit ? 0 : otherDeductibles,
235
235
  },
236
236
  report,
237
- toImpute: isNil || isHolidayDeposit ? 0 : _round((_73 = (_72 = (_71 = payload.vat) === null || _71 === void 0 ? void 0 : _71.deductible) === null || _72 === void 0 ? void 0 : _72.toImpute) !== null && _73 !== void 0 ? _73 : 0),
237
+ toImpute: isNil || isHolidayDeposit ? 0 : _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) + _round((_79 = (_78 = payload.vat) === null || _78 === void 0 ? void 0 : _78.sumToAdd) !== null && _79 !== void 0 ? _79 : 0),
238
238
  total: 0,
239
239
  onImportOtherThanOilProducts: isNil || isHolidayDeposit ? 0 : otherDeductibles,
240
240
  coefficient: isNil || isHolidayDeposit ? 100 : coefficient,
241
- onOilProducts: isNil || isHolidayDeposit ? 0 : _round((_76 = (_75 = (_74 = payload.vat) === null || _74 === void 0 ? void 0 : _74.deductible) === null || _75 === void 0 ? void 0 : _75.onOilProducts) !== null && _76 !== void 0 ? _76 : 0),
241
+ onOilProducts: isNil || isHolidayDeposit ? 0 : _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),
242
242
  },
243
243
  otherRate: {
244
244
  oldRate: {
245
- base: isNil || isHolidayDeposit ? 0 : _round((_80 = (_79 = (_78 = (_77 = payload.vat) === null || _77 === void 0 ? void 0 : _77.otherRate) === null || _78 === void 0 ? void 0 : _78.oldRate) === null || _79 === void 0 ? void 0 : _79.base) !== null && _80 !== void 0 ? _80 : 0),
246
- tax: isNil || isHolidayDeposit ? 0 : _round((_84 = (_83 = (_82 = (_81 = payload.vat) === null || _81 === void 0 ? void 0 : _81.otherRate) === null || _82 === void 0 ? void 0 : _82.oldRate) === null || _83 === void 0 ? void 0 : _83.tax) !== null && _84 !== void 0 ? _84 : 0),
245
+ base: isNil || isHolidayDeposit ? 0 : _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),
246
+ tax: isNil || isHolidayDeposit ? 0 : _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),
247
247
  },
248
248
  at1Dot75: {
249
249
  base: 0,
@@ -277,16 +277,16 @@ export function getCerfa3310Century23Payload(accountingEntries, payload) {
277
277
  },
278
278
  credit: {
279
279
  amount: 0,
280
- refundAsked: isNil || isHolidayDeposit ? 0 : _round((_86 = (_85 = payload.credit) === null || _85 === void 0 ? void 0 : _85.refundAsked) !== null && _86 !== void 0 ? _86 : 0),
281
- transferedToSocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : _round((_88 = (_87 = payload.credit) === null || _87 === void 0 ? void 0 : _87.transferedToSocietyHeadOfGroup) !== null && _88 !== void 0 ? _88 : 0),
282
- assimiledTaxes: isNil || isHolidayDeposit ? 0 : _round((_90 = (_89 = payload.credit) === null || _89 === void 0 ? void 0 : _89.assimiledTaxes) !== null && _90 !== void 0 ? _90 : 0),
280
+ refundAsked: isNil || isHolidayDeposit ? 0 : _round((_92 = (_91 = payload.credit) === null || _91 === void 0 ? void 0 : _91.refundAsked) !== null && _92 !== void 0 ? _92 : 0),
281
+ transferedToSocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : _round((_94 = (_93 = payload.credit) === null || _93 === void 0 ? void 0 : _93.transferedToSocietyHeadOfGroup) !== null && _94 !== void 0 ? _94 : 0),
282
+ assimiledTaxes: isNil || isHolidayDeposit ? 0 : _round((_96 = (_95 = payload.credit) === null || _95 === void 0 ? void 0 : _95.assimiledTaxes) !== null && _96 !== void 0 ? _96 : 0),
283
283
  toReport: 0,
284
284
  ticRefund: 0,
285
285
  ticTransfered: 0,
286
286
  },
287
287
  toPay: {
288
288
  netDue: 0,
289
- acquittedBySocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : _round((_92 = (_91 = payload.toPay) === null || _91 === void 0 ? void 0 : _91.acquittedBySocietyHeadOfGroup) !== null && _92 !== void 0 ? _92 : 0),
289
+ acquittedBySocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : _round((_98 = (_97 = payload.toPay) === null || _97 === void 0 ? void 0 : _97.acquittedBySocietyHeadOfGroup) !== null && _98 !== void 0 ? _98 : 0),
290
290
  total: 0,
291
291
  },
292
292
  tic: {
@@ -300,7 +300,7 @@ export function getCerfa3310Century23Payload(accountingEntries, payload) {
300
300
  initialPayload.credit.amount = initialPayload.vat.grossDue - initialPayload.vat.deductible.total < 0 ? Math.abs(initialPayload.vat.grossDue - initialPayload.vat.deductible.total) : 0;
301
301
  initialPayload.toPay.netDue = initialPayload.vat.grossDue - initialPayload.vat.deductible.total > 0 ? initialPayload.vat.grossDue - initialPayload.vat.deductible.total : 0;
302
302
  initialPayload.credit.toReport = initialPayload.credit.amount - initialPayload.credit.refundAsked - initialPayload.credit.transferedToSocietyHeadOfGroup;
303
- initialPayload.toPay.total = initialPayload.toPay.netDue + initialPayload.credit.assimiledTaxes + ((_95 = (_94 = (_93 = initialPayload.tic) === null || _93 === void 0 ? void 0 : _93.total) === null || _94 === void 0 ? void 0 : _94.tax) !== null && _95 !== void 0 ? _95 : 0) - initialPayload.toPay.acquittedBySocietyHeadOfGroup;
303
+ 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;
304
304
  return initialPayload;
305
305
  }
306
306
  export function getCerfa3310Century23RegistrationFields(data) {