@silexpert/core 1.1.23 → 1.1.24
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,9 +4,9 @@ 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 getCerfa3517Century23Payload(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, _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;
|
|
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, _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;
|
|
8
8
|
const shouldHaveVatCode = isDefined((_a = payload.setting) === null || _a === void 0 ? void 0 : _a.tvaCode) && isDefined(payload.society.siret);
|
|
9
|
-
const shouldFillRefund = _round((_b = payload.refund.asked) !== null &&
|
|
9
|
+
const shouldFillRefund = _round((_c = (_b = payload.refund) === null || _b === void 0 ? void 0 : _b.asked) !== null && _c !== void 0 ? _c : 0) > 0;
|
|
10
10
|
const isNil = payload.isNil === true;
|
|
11
11
|
const vats = Object.values(Vat);
|
|
12
12
|
const vatEntries = accountingEntries.filter((ae) => typeof ae.idVat === 'number');
|
|
@@ -26,14 +26,14 @@ export function getCerfa3517Century23Payload(accountingEntries, payload) {
|
|
|
26
26
|
const saleOfImmobilization = getAmountByAccountNumber(vatEntries.filter((ae) => !withoutTaxVat.includes(ae.idVat) && frenchVat.includes(ae.idVat)), ['775']);
|
|
27
27
|
const onInvoiceDeductible = getAmountByAccountNumber(vatEntries, ['445660']);
|
|
28
28
|
const onImmobilizationDeductible = getAmountByAccountNumber(vatEntries, ['445662']);
|
|
29
|
-
const julyAdvance = (
|
|
30
|
-
const julyAdvancePayload = (
|
|
31
|
-
const decemberAdvance = (
|
|
32
|
-
const decemberAdvancePayload = (
|
|
29
|
+
const julyAdvance = (_e = (_d = payload === null || payload === void 0 ? void 0 : payload.exerciceAdvanceRegistrations) === null || _d === void 0 ? void 0 : _d.find((a) => dayjs(a.endDate).month() === 6)) !== null && _e !== void 0 ? _e : null;
|
|
30
|
+
const julyAdvancePayload = (_f = julyAdvance === null || julyAdvance === void 0 ? void 0 : julyAdvance.payload) !== null && _f !== void 0 ? _f : null;
|
|
31
|
+
const decemberAdvance = (_h = (_g = payload === null || payload === void 0 ? void 0 : payload.exerciceAdvanceRegistrations) === null || _g === void 0 ? void 0 : _g.find((a) => dayjs(a.endDate).month() === 11)) !== null && _h !== void 0 ? _h : null;
|
|
32
|
+
const decemberAdvancePayload = (_j = decemberAdvance === null || decemberAdvance === void 0 ? void 0 : decemberAdvance.payload) !== null && _j !== void 0 ? _j : null;
|
|
33
33
|
const data = {
|
|
34
34
|
isNil: payload.isNil === true,
|
|
35
35
|
declaration: {
|
|
36
|
-
comment: (
|
|
36
|
+
comment: (_k = payload.comment) !== null && _k !== void 0 ? _k : null,
|
|
37
37
|
period: {
|
|
38
38
|
start: {
|
|
39
39
|
day: dayjs(payload.startDate).format('DD'),
|
|
@@ -53,7 +53,7 @@ export function getCerfa3517Century23Payload(accountingEntries, payload) {
|
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
55
|
numbers: {
|
|
56
|
-
SIE: (
|
|
56
|
+
SIE: (_m = (_l = payload.sie) === null || _l === void 0 ? void 0 : _l.sages) !== null && _m !== void 0 ? _m : null,
|
|
57
57
|
folder: null,
|
|
58
58
|
key: null,
|
|
59
59
|
period: null,
|
|
@@ -63,13 +63,13 @@ export function getCerfa3517Century23Payload(accountingEntries, payload) {
|
|
|
63
63
|
system: null,
|
|
64
64
|
},
|
|
65
65
|
intracommunityVat: {
|
|
66
|
-
first: shouldHaveVatCode ? ((
|
|
67
|
-
second: shouldHaveVatCode ? ((
|
|
68
|
-
third: shouldHaveVatCode ? ((
|
|
66
|
+
first: shouldHaveVatCode ? ((_q = (_p = (_o = payload.setting) === null || _o === void 0 ? void 0 : _o.tvaCode) === null || _p === void 0 ? void 0 : _p.slice(0, 2)) !== null && _q !== void 0 ? _q : null) : null,
|
|
67
|
+
second: shouldHaveVatCode ? ((_t = (_s = (_r = payload.setting) === null || _r === void 0 ? void 0 : _r.tvaCode) === null || _s === void 0 ? void 0 : _s.slice(2, 4)) !== null && _t !== void 0 ? _t : null) : null,
|
|
68
|
+
third: shouldHaveVatCode ? ((_v = (_u = payload.society.siret) === null || _u === void 0 ? void 0 : _u.slice(0, 9)) !== null && _v !== void 0 ? _v : null) : null,
|
|
69
69
|
},
|
|
70
70
|
siret: {
|
|
71
|
-
first: isDefined(payload.society.siret) ? ((
|
|
72
|
-
second: isDefined(payload.society.siret) ? ((
|
|
71
|
+
first: isDefined(payload.society.siret) ? ((_x = (_w = payload.society.siret) === null || _w === void 0 ? void 0 : _w.slice(0, 9)) !== null && _x !== void 0 ? _x : null) : null,
|
|
72
|
+
second: isDefined(payload.society.siret) ? ((_z = (_y = payload.society.siret) === null || _y === void 0 ? void 0 : _y.slice(5)) !== null && _z !== void 0 ? _z : null) : null,
|
|
73
73
|
},
|
|
74
74
|
},
|
|
75
75
|
payment: {
|
|
@@ -93,8 +93,8 @@ export function getCerfa3517Century23Payload(accountingEntries, payload) {
|
|
|
93
93
|
tax: isNil ? 0 : _round(vatNormalRate20 * 0.2),
|
|
94
94
|
},
|
|
95
95
|
normalRate20OnPetrol: {
|
|
96
|
-
base: isNil ? 0 : _round((
|
|
97
|
-
tax: isNil ? 0 : _round((
|
|
96
|
+
base: isNil ? 0 : _round((_1 = (_0 = payload.vat) === null || _0 === void 0 ? void 0 : _0.normalRate20OnPetrol) !== null && _1 !== void 0 ? _1 : 0),
|
|
97
|
+
tax: isNil ? 0 : _round((_3 = (_2 = payload.vat) === null || _2 === void 0 ? void 0 : _2.normalRate20OnPetrol) !== null && _3 !== void 0 ? _3 : 0 * 0.2),
|
|
98
98
|
},
|
|
99
99
|
reduceRate5Dot5: {
|
|
100
100
|
base: isNil ? 0 : _round(vatReducedRate5Dot5),
|
|
@@ -113,24 +113,24 @@ export function getCerfa3517Century23Payload(accountingEntries, payload) {
|
|
|
113
113
|
tax: isNil ? 0 : _round(vatReducedRate2Dot1 * 0.021),
|
|
114
114
|
},
|
|
115
115
|
particularRate: {
|
|
116
|
-
base: isNil ? 0 : _round((
|
|
117
|
-
tax: isNil ? 0 : _round((
|
|
116
|
+
base: isNil ? 0 : _round((_6 = (_5 = (_4 = payload.vat) === null || _4 === void 0 ? void 0 : _4.particularRate) === null || _5 === void 0 ? void 0 : _5.base) !== null && _6 !== void 0 ? _6 : 0),
|
|
117
|
+
tax: isNil ? 0 : _round((_9 = (_8 = (_7 = payload.vat) === null || _7 === void 0 ? void 0 : _7.particularRate) === null || _8 === void 0 ? void 0 : _8.tax) !== null && _9 !== void 0 ? _9 : 0),
|
|
118
118
|
},
|
|
119
119
|
reducedRateOnPetrol: {
|
|
120
|
-
base: isNil ? 0 : _round((
|
|
121
|
-
tax: isNil ? 0 : _round(((
|
|
120
|
+
base: isNil ? 0 : _round((_11 = (_10 = payload.vat) === null || _10 === void 0 ? void 0 : _10.reducedRateOnPetrol) !== null && _11 !== void 0 ? _11 : 0),
|
|
121
|
+
tax: isNil ? 0 : _round(((_13 = (_12 = payload.vat) === null || _12 === void 0 ? void 0 : _12.reducedRateOnPetrol) !== null && _13 !== void 0 ? _13 : 0) * 0.13),
|
|
122
122
|
},
|
|
123
123
|
oldRate: {
|
|
124
|
-
base: isNil ? 0 : _round((
|
|
125
|
-
tax: isNil ? 0 : _round((
|
|
124
|
+
base: isNil ? 0 : _round((_16 = (_15 = (_14 = payload.vat) === null || _14 === void 0 ? void 0 : _14.oldRate) === null || _15 === void 0 ? void 0 : _15.base) !== null && _16 !== void 0 ? _16 : 0),
|
|
125
|
+
tax: isNil ? 0 : _round((_19 = (_18 = (_17 = payload.vat) === null || _17 === void 0 ? void 0 : _17.oldRate) === null || _18 === void 0 ? void 0 : _18.tax) !== null && _19 !== void 0 ? _19 : 0),
|
|
126
126
|
},
|
|
127
127
|
energyBought: {
|
|
128
|
-
base: isNil ? 0 : _round((
|
|
129
|
-
tax: isNil ? 0 : _round((
|
|
128
|
+
base: isNil ? 0 : _round((_22 = (_21 = (_20 = payload.vat) === null || _20 === void 0 ? void 0 : _20.energyBought) === null || _21 === void 0 ? void 0 : _21.base) !== null && _22 !== void 0 ? _22 : 0),
|
|
129
|
+
tax: isNil ? 0 : _round((_25 = (_24 = (_23 = payload.vat) === null || _23 === void 0 ? void 0 : _23.energyBought) === null || _24 === void 0 ? void 0 : _24.tax) !== null && _25 !== void 0 ? _25 : 0),
|
|
130
130
|
},
|
|
131
131
|
prestation: {
|
|
132
|
-
base: isNil ? 0 : _round((
|
|
133
|
-
tax: isNil ? 0 : _round((
|
|
132
|
+
base: isNil ? 0 : _round((_28 = (_27 = (_26 = payload.vat) === null || _26 === void 0 ? void 0 : _26.prestation) === null || _27 === void 0 ? void 0 : _27.base) !== null && _28 !== void 0 ? _28 : 0),
|
|
133
|
+
tax: isNil ? 0 : _round((_31 = (_30 = (_29 = payload.vat) === null || _29 === void 0 ? void 0 : _29.prestation) === null || _30 === void 0 ? void 0 : _30.tax) !== null && _31 !== void 0 ? _31 : 0),
|
|
134
134
|
},
|
|
135
135
|
prestation2: {
|
|
136
136
|
base: isNil ? 0 : _round(prestation2Base),
|
|
@@ -145,33 +145,33 @@ export function getCerfa3517Century23Payload(accountingEntries, payload) {
|
|
|
145
145
|
total: { tax: 0 }, // Calculé plus bas
|
|
146
146
|
},
|
|
147
147
|
other: {
|
|
148
|
-
refund: isNil ? 0 : _round((
|
|
149
|
-
previousDeducted: isNil ? 0 : _round((
|
|
150
|
-
sum: isNil ? 0 : _round((
|
|
148
|
+
refund: isNil ? 0 : _round((_33 = (_32 = payload.other) === null || _32 === void 0 ? void 0 : _32.refund) !== null && _33 !== void 0 ? _33 : 0),
|
|
149
|
+
previousDeducted: isNil ? 0 : _round((_35 = (_34 = payload.other) === null || _34 === void 0 ? void 0 : _34.previousDeducted) !== null && _35 !== void 0 ? _35 : 0),
|
|
150
|
+
sum: isNil ? 0 : _round((_37 = (_36 = payload.other) === null || _36 === void 0 ? void 0 : _36.sum) !== null && _37 !== void 0 ? _37 : 0),
|
|
151
151
|
total: 0, // Calculé plus bas
|
|
152
152
|
},
|
|
153
153
|
deductible: {
|
|
154
154
|
onInvoice: isNil ? 0 : _round(onInvoiceDeductible),
|
|
155
|
-
onFlatRate: isNil ? 0 : _round((
|
|
155
|
+
onFlatRate: isNil ? 0 : _round((_39 = (_38 = payload.deductible) === null || _38 === void 0 ? void 0 : _38.onFlatRate) !== null && _39 !== void 0 ? _39 : 0),
|
|
156
156
|
total1: 0,
|
|
157
|
-
rate: isNil ? 0 : _round((
|
|
157
|
+
rate: isNil ? 0 : _round((_41 = (_40 = payload.deductible) === null || _40 === void 0 ? void 0 : _40.rate) !== null && _41 !== void 0 ? _41 : 100, 2),
|
|
158
158
|
onImmobilization: isNil ? 0 : _round(onImmobilizationDeductible),
|
|
159
|
-
previousCredit: isNil ? 0 : _round((
|
|
160
|
-
forget: isNil ? 0 : _round((
|
|
161
|
-
sumToImpute: isNil ? 0 : _round((
|
|
159
|
+
previousCredit: isNil ? 0 : _round((_43 = (_42 = payload.deductible) === null || _42 === void 0 ? void 0 : _42.previousCredit) !== null && _43 !== void 0 ? _43 : 0),
|
|
160
|
+
forget: isNil ? 0 : _round((_45 = (_44 = payload.deductible) === null || _44 === void 0 ? void 0 : _44.forget) !== null && _45 !== void 0 ? _45 : 0),
|
|
161
|
+
sumToImpute: isNil ? 0 : _round((_47 = (_46 = payload.deductible) === null || _46 === void 0 ? void 0 : _46.sumToImpute) !== null && _47 !== void 0 ? _47 : 0),
|
|
162
162
|
total: 0,
|
|
163
|
-
vatDeductible: isNil ? 0 : _round((
|
|
163
|
+
vatDeductible: isNil ? 0 : _round((_49 = (_48 = payload.deductible) === null || _48 === void 0 ? void 0 : _48.vatDeductible) !== null && _49 !== void 0 ? _49 : 0),
|
|
164
164
|
},
|
|
165
165
|
net: {
|
|
166
166
|
due: 0,
|
|
167
167
|
credit: 0,
|
|
168
168
|
advance1: {
|
|
169
|
-
paid: isNil ? 0 : _round(((
|
|
170
|
-
toPay: isNil ? 0 : _round((
|
|
169
|
+
paid: isNil ? 0 : _round(((_50 = julyAdvancePayload === null || julyAdvancePayload === void 0 ? void 0 : julyAdvancePayload.amountWanted) !== null && _50 !== void 0 ? _50 : 0) * 0.55),
|
|
170
|
+
toPay: isNil ? 0 : _round((_52 = (_51 = payload.advance1) === null || _51 === void 0 ? void 0 : _51.toPay) !== null && _52 !== void 0 ? _52 : 0),
|
|
171
171
|
},
|
|
172
172
|
advance2: {
|
|
173
|
-
paid: isNil ? 0 : _round(((
|
|
174
|
-
toPay: isNil ? 0 : _round((
|
|
173
|
+
paid: isNil ? 0 : _round(((_53 = decemberAdvancePayload === null || decemberAdvancePayload === void 0 ? void 0 : decemberAdvancePayload.amountWanted) !== null && _53 !== void 0 ? _53 : 0) * 0.4),
|
|
174
|
+
toPay: isNil ? 0 : _round((_55 = (_54 = payload.advance2) === null || _54 === void 0 ? void 0 : _54.toPay) !== null && _55 !== void 0 ? _55 : 0),
|
|
175
175
|
},
|
|
176
176
|
advance: {
|
|
177
177
|
toPay: 0,
|
|
@@ -183,67 +183,67 @@ export function getCerfa3517Century23Payload(accountingEntries, payload) {
|
|
|
183
183
|
balanceSurplus: 0, // Calculé plus bas
|
|
184
184
|
},
|
|
185
185
|
tax: {
|
|
186
|
-
onRetransmission: isNil ? 0 : _round((
|
|
187
|
-
onResultFarm: isNil ? 0 : _round((
|
|
186
|
+
onRetransmission: isNil ? 0 : _round((_57 = (_56 = payload.tax) === null || _56 === void 0 ? void 0 : _56.onRetransmission) !== null && _57 !== void 0 ? _57 : 0),
|
|
187
|
+
onResultFarm: isNil ? 0 : _round((_59 = (_58 = payload.tax) === null || _58 === void 0 ? void 0 : _58.onResultFarm) !== null && _59 !== void 0 ? _59 : 0),
|
|
188
188
|
payingVideo: {
|
|
189
|
-
reduced: isNil ? 0 : _round((
|
|
190
|
-
normal: isNil ? 0 : _round((
|
|
189
|
+
reduced: isNil ? 0 : _round((_62 = (_61 = (_60 = payload.tax) === null || _60 === void 0 ? void 0 : _60.payingVideo) === null || _61 === void 0 ? void 0 : _61.reduced) !== null && _62 !== void 0 ? _62 : 0),
|
|
190
|
+
normal: isNil ? 0 : _round((_65 = (_64 = (_63 = payload.tax) === null || _63 === void 0 ? void 0 : _63.payingVideo) === null || _64 === void 0 ? void 0 : _64.normal) !== null && _65 !== void 0 ? _65 : 0),
|
|
191
191
|
},
|
|
192
192
|
freeVideo: {
|
|
193
|
-
reduce: isNil ? 0 : _round((
|
|
194
|
-
normal: isNil ? 0 : _round((
|
|
193
|
+
reduce: isNil ? 0 : _round((_68 = (_67 = (_66 = payload.tax) === null || _66 === void 0 ? void 0 : _66.freeVideo) === null || _67 === void 0 ? void 0 : _67.reduced) !== null && _68 !== void 0 ? _68 : 0),
|
|
194
|
+
normal: isNil ? 0 : _round((_71 = (_70 = (_69 = payload.tax) === null || _69 === void 0 ? void 0 : _69.freeVideo) === null || _70 === void 0 ? void 0 : _70.normal) !== null && _71 !== void 0 ? _71 : 0),
|
|
195
195
|
},
|
|
196
|
-
bailiff: isNil ? 0 : _round((
|
|
197
|
-
contribution: isNil ? 0 : _round((
|
|
198
|
-
ofEmployer: isNil ? 0 : _round((
|
|
199
|
-
onBoardingCorse: isNil ? 0 : _round((
|
|
200
|
-
onBoarding: isNil ? 0 : _round((
|
|
201
|
-
development: isNil ? 0 : _round((
|
|
202
|
-
publicity: isNil ? 0 : _round((
|
|
203
|
-
onCompanySurplus: isNil ? 0 : _round((
|
|
204
|
-
onPublicElectricity: isNil ? 0 : _round((
|
|
205
|
-
onCanceledOrders: isNil ? 0 : _round((
|
|
206
|
-
specialDue: isNil ? 0 : _round((
|
|
207
|
-
slaughter: isNil ? 0 : _round((
|
|
208
|
-
cutting: isNil ? 0 : _round((
|
|
209
|
-
substances: isNil ? 0 : _round((
|
|
210
|
-
fishing: isNil ? 0 : _round((
|
|
211
|
-
fishingProduct: isNil ? 0 : _round((
|
|
212
|
-
agreement: isNil ? 0 : _round((
|
|
196
|
+
bailiff: isNil ? 0 : _round((_73 = (_72 = payload.tax) === null || _72 === void 0 ? void 0 : _72.bailiff) !== null && _73 !== void 0 ? _73 : 0),
|
|
197
|
+
contribution: isNil ? 0 : _round((_75 = (_74 = payload.tax) === null || _74 === void 0 ? void 0 : _74.contribution) !== null && _75 !== void 0 ? _75 : 0),
|
|
198
|
+
ofEmployer: isNil ? 0 : _round((_77 = (_76 = payload.tax) === null || _76 === void 0 ? void 0 : _76.ofEmployer) !== null && _77 !== void 0 ? _77 : 0),
|
|
199
|
+
onBoardingCorse: isNil ? 0 : _round((_79 = (_78 = payload.tax) === null || _78 === void 0 ? void 0 : _78.onBoardingCorse) !== null && _79 !== void 0 ? _79 : 0),
|
|
200
|
+
onBoarding: isNil ? 0 : _round((_81 = (_80 = payload.tax) === null || _80 === void 0 ? void 0 : _80.onBoarding) !== null && _81 !== void 0 ? _81 : 0),
|
|
201
|
+
development: isNil ? 0 : _round((_83 = (_82 = payload.tax) === null || _82 === void 0 ? void 0 : _82.development) !== null && _83 !== void 0 ? _83 : 0),
|
|
202
|
+
publicity: isNil ? 0 : _round((_85 = (_84 = payload.tax) === null || _84 === void 0 ? void 0 : _84.publicity) !== null && _85 !== void 0 ? _85 : 0),
|
|
203
|
+
onCompanySurplus: isNil ? 0 : _round((_87 = (_86 = payload.tax) === null || _86 === void 0 ? void 0 : _86.onCompanySurplus) !== null && _87 !== void 0 ? _87 : 0),
|
|
204
|
+
onPublicElectricity: isNil ? 0 : _round((_89 = (_88 = payload.tax) === null || _88 === void 0 ? void 0 : _88.onPublicElectricity) !== null && _89 !== void 0 ? _89 : 0),
|
|
205
|
+
onCanceledOrders: isNil ? 0 : _round((_91 = (_90 = payload.tax) === null || _90 === void 0 ? void 0 : _90.onCanceledOrders) !== null && _91 !== void 0 ? _91 : 0),
|
|
206
|
+
specialDue: isNil ? 0 : _round((_93 = (_92 = payload.tax) === null || _92 === void 0 ? void 0 : _92.specialDue) !== null && _93 !== void 0 ? _93 : 0),
|
|
207
|
+
slaughter: isNil ? 0 : _round((_95 = (_94 = payload.tax) === null || _94 === void 0 ? void 0 : _94.slaughter) !== null && _95 !== void 0 ? _95 : 0),
|
|
208
|
+
cutting: isNil ? 0 : _round((_97 = (_96 = payload.tax) === null || _96 === void 0 ? void 0 : _96.cutting) !== null && _97 !== void 0 ? _97 : 0),
|
|
209
|
+
substances: isNil ? 0 : _round((_99 = (_98 = payload.tax) === null || _98 === void 0 ? void 0 : _98.substances) !== null && _99 !== void 0 ? _99 : 0),
|
|
210
|
+
fishing: isNil ? 0 : _round((_101 = (_100 = payload.tax) === null || _100 === void 0 ? void 0 : _100.fishing) !== null && _101 !== void 0 ? _101 : 0),
|
|
211
|
+
fishingProduct: isNil ? 0 : _round((_103 = (_102 = payload.tax) === null || _102 === void 0 ? void 0 : _102.fishingProduct) !== null && _103 !== void 0 ? _103 : 0),
|
|
212
|
+
agreement: isNil ? 0 : _round((_105 = (_104 = payload.tax) === null || _104 === void 0 ? void 0 : _104.agreement) !== null && _105 !== void 0 ? _105 : 0),
|
|
213
213
|
phyto: {
|
|
214
|
-
onCirculation: isNil ? 0 : _round((
|
|
215
|
-
onExportation: isNil ? 0 : _round((
|
|
216
|
-
total: isNil ? 0 : _round((
|
|
214
|
+
onCirculation: isNil ? 0 : _round((_108 = (_107 = (_106 = payload.tax) === null || _106 === void 0 ? void 0 : _106.phyto) === null || _107 === void 0 ? void 0 : _107.onCirculation) !== null && _108 !== void 0 ? _108 : 0),
|
|
215
|
+
onExportation: isNil ? 0 : _round((_111 = (_110 = (_109 = payload.tax) === null || _109 === void 0 ? void 0 : _109.phyto) === null || _110 === void 0 ? void 0 : _110.onExportation) !== null && _111 !== void 0 ? _111 : 0),
|
|
216
|
+
total: isNil ? 0 : _round((_114 = (_113 = (_112 = payload.tax) === null || _112 === void 0 ? void 0 : _112.phyto) === null || _113 === void 0 ? void 0 : _113.total) !== null && _114 !== void 0 ? _114 : 0),
|
|
217
217
|
},
|
|
218
218
|
onPreciousMetal: {
|
|
219
|
-
normalRate: isNil ? 0 : _round((
|
|
220
|
-
reduceRate: isNil ? 0 : _round((
|
|
219
|
+
normalRate: isNil ? 0 : _round((_117 = (_116 = (_115 = payload.tax) === null || _115 === void 0 ? void 0 : _115.onPreciousMetal) === null || _116 === void 0 ? void 0 : _116.normalRate) !== null && _117 !== void 0 ? _117 : 0),
|
|
220
|
+
reduceRate: isNil ? 0 : _round((_120 = (_119 = (_118 = payload.tax) === null || _118 === void 0 ? void 0 : _118.onPreciousMetal) === null || _119 === void 0 ? void 0 : _119.reduceRate) !== null && _120 !== void 0 ? _120 : 0),
|
|
221
221
|
},
|
|
222
|
-
onContribution: isNil ? 0 : _round((
|
|
223
|
-
onSaleAntiquity: isNil ? 0 : _round((
|
|
224
|
-
onYearly: isNil ? 0 : _round((
|
|
225
|
-
onCO2: isNil ? 0 : _round((
|
|
226
|
-
oldVehicle: isNil ? 0 : _round((
|
|
227
|
-
profit: isNil ? 0 : _round((
|
|
228
|
-
social: isNil ? 0 : _round((
|
|
229
|
-
fromOtherCountry: isNil ? 0 : _round((
|
|
230
|
-
trottingRace: isNil ? 0 : _round((
|
|
231
|
-
gallopRace: isNil ? 0 : _round((
|
|
232
|
-
sportBetting: isNil ? 0 : _round((
|
|
233
|
-
sportBettingSocial: isNil ? 0 : _round((
|
|
234
|
-
sportBettingSport: isNil ? 0 : _round((
|
|
235
|
-
sportBettingCommercial: isNil ? 0 : _round((
|
|
236
|
-
sportBettingCommercialSocial: isNil ? 0 : _round((
|
|
237
|
-
sportBettingCommercialSport: isNil ? 0 : _round((
|
|
238
|
-
onlineGame: isNil ? 0 : _round((
|
|
239
|
-
onlineGameSocial: isNil ? 0 : _round((
|
|
240
|
-
fuelExploration: isNil ? 0 : _round((
|
|
241
|
-
nonAlcool: isNil ? 0 : _round((
|
|
242
|
-
nonAlcoolWithSugar: isNil ? 0 : _round((
|
|
243
|
-
nonAlcoolWithEdul: isNil ? 0 : _round((
|
|
244
|
-
mineralWater: isNil ? 0 : _round((
|
|
245
|
-
numericalService: isNil ? 0 : _round((
|
|
246
|
-
platform: isNil ? 0 : _round((
|
|
222
|
+
onContribution: isNil ? 0 : _round((_122 = (_121 = payload.tax) === null || _121 === void 0 ? void 0 : _121.onContribution) !== null && _122 !== void 0 ? _122 : 0),
|
|
223
|
+
onSaleAntiquity: isNil ? 0 : _round((_124 = (_123 = payload.tax) === null || _123 === void 0 ? void 0 : _123.onSaleAntiquity) !== null && _124 !== void 0 ? _124 : 0),
|
|
224
|
+
onYearly: isNil ? 0 : _round((_126 = (_125 = payload.tax) === null || _125 === void 0 ? void 0 : _125.onYearly) !== null && _126 !== void 0 ? _126 : 0),
|
|
225
|
+
onCO2: isNil ? 0 : _round((_128 = (_127 = payload.tax) === null || _127 === void 0 ? void 0 : _127.onCO2) !== null && _128 !== void 0 ? _128 : 0),
|
|
226
|
+
oldVehicle: isNil ? 0 : _round((_130 = (_129 = payload.tax) === null || _129 === void 0 ? void 0 : _129.oldVehicle) !== null && _130 !== void 0 ? _130 : 0),
|
|
227
|
+
profit: isNil ? 0 : _round((_132 = (_131 = payload.tax) === null || _131 === void 0 ? void 0 : _131.profit) !== null && _132 !== void 0 ? _132 : 0),
|
|
228
|
+
social: isNil ? 0 : _round((_134 = (_133 = payload.tax) === null || _133 === void 0 ? void 0 : _133.social) !== null && _134 !== void 0 ? _134 : 0),
|
|
229
|
+
fromOtherCountry: isNil ? 0 : _round((_136 = (_135 = payload.tax) === null || _135 === void 0 ? void 0 : _135.fromOtherCountry) !== null && _136 !== void 0 ? _136 : 0),
|
|
230
|
+
trottingRace: isNil ? 0 : _round((_138 = (_137 = payload.tax) === null || _137 === void 0 ? void 0 : _137.trottingRace) !== null && _138 !== void 0 ? _138 : 0),
|
|
231
|
+
gallopRace: isNil ? 0 : _round((_140 = (_139 = payload.tax) === null || _139 === void 0 ? void 0 : _139.gallopRace) !== null && _140 !== void 0 ? _140 : 0),
|
|
232
|
+
sportBetting: isNil ? 0 : _round((_142 = (_141 = payload.tax) === null || _141 === void 0 ? void 0 : _141.sportBetting) !== null && _142 !== void 0 ? _142 : 0),
|
|
233
|
+
sportBettingSocial: isNil ? 0 : _round((_144 = (_143 = payload.tax) === null || _143 === void 0 ? void 0 : _143.sportBettingSocial) !== null && _144 !== void 0 ? _144 : 0),
|
|
234
|
+
sportBettingSport: isNil ? 0 : _round((_146 = (_145 = payload.tax) === null || _145 === void 0 ? void 0 : _145.sportBettingSport) !== null && _146 !== void 0 ? _146 : 0),
|
|
235
|
+
sportBettingCommercial: isNil ? 0 : _round((_148 = (_147 = payload.tax) === null || _147 === void 0 ? void 0 : _147.sportBettingCommercial) !== null && _148 !== void 0 ? _148 : 0),
|
|
236
|
+
sportBettingCommercialSocial: isNil ? 0 : _round((_150 = (_149 = payload.tax) === null || _149 === void 0 ? void 0 : _149.sportBettingCommercialSocial) !== null && _150 !== void 0 ? _150 : 0),
|
|
237
|
+
sportBettingCommercialSport: isNil ? 0 : _round((_152 = (_151 = payload.tax) === null || _151 === void 0 ? void 0 : _151.sportBettingCommercialSport) !== null && _152 !== void 0 ? _152 : 0),
|
|
238
|
+
onlineGame: isNil ? 0 : _round((_154 = (_153 = payload.tax) === null || _153 === void 0 ? void 0 : _153.onlineGame) !== null && _154 !== void 0 ? _154 : 0),
|
|
239
|
+
onlineGameSocial: isNil ? 0 : _round((_156 = (_155 = payload.tax) === null || _155 === void 0 ? void 0 : _155.onlineGameSocial) !== null && _156 !== void 0 ? _156 : 0),
|
|
240
|
+
fuelExploration: isNil ? 0 : _round((_158 = (_157 = payload.tax) === null || _157 === void 0 ? void 0 : _157.fuelExploration) !== null && _158 !== void 0 ? _158 : 0),
|
|
241
|
+
nonAlcool: isNil ? 0 : _round((_160 = (_159 = payload.tax) === null || _159 === void 0 ? void 0 : _159.nonAlcool) !== null && _160 !== void 0 ? _160 : 0),
|
|
242
|
+
nonAlcoolWithSugar: isNil ? 0 : _round((_162 = (_161 = payload.tax) === null || _161 === void 0 ? void 0 : _161.nonAlcoolWithSugar) !== null && _162 !== void 0 ? _162 : 0),
|
|
243
|
+
nonAlcoolWithEdul: isNil ? 0 : _round((_164 = (_163 = payload.tax) === null || _163 === void 0 ? void 0 : _163.nonAlcoolWithEdul) !== null && _164 !== void 0 ? _164 : 0),
|
|
244
|
+
mineralWater: isNil ? 0 : _round((_166 = (_165 = payload.tax) === null || _165 === void 0 ? void 0 : _165.mineralWater) !== null && _166 !== void 0 ? _166 : 0),
|
|
245
|
+
numericalService: isNil ? 0 : _round((_168 = (_167 = payload.tax) === null || _167 === void 0 ? void 0 : _167.numericalService) !== null && _168 !== void 0 ? _168 : 0),
|
|
246
|
+
platform: isNil ? 0 : _round((_170 = (_169 = payload.tax) === null || _169 === void 0 ? void 0 : _169.platform) !== null && _170 !== void 0 ? _170 : 0),
|
|
247
247
|
total: 0, // Calculé plus bas
|
|
248
248
|
},
|
|
249
249
|
tic: {
|
|
@@ -262,9 +262,9 @@ export function getCerfa3517Century23Payload(accountingEntries, payload) {
|
|
|
262
262
|
},
|
|
263
263
|
recapitulation: {
|
|
264
264
|
balance: 0,
|
|
265
|
-
refund: isNil ? 0 : _round((
|
|
266
|
-
creditToReport: isNil ? 0 : _round((
|
|
267
|
-
imputedCredit: isNil ? 0 : _round((
|
|
265
|
+
refund: isNil ? 0 : _round((_172 = (_171 = payload.refund) === null || _171 === void 0 ? void 0 : _171.asked) !== null && _172 !== void 0 ? _172 : 0),
|
|
266
|
+
creditToReport: isNil ? 0 : _round((_174 = (_173 = payload.deductible) === null || _173 === void 0 ? void 0 : _173.previousCredit) !== null && _174 !== void 0 ? _174 : 0),
|
|
267
|
+
imputedCredit: isNil ? 0 : _round((_176 = (_175 = payload.recapitulation) === null || _175 === void 0 ? void 0 : _175.imputedCredit) !== null && _176 !== void 0 ? _176 : 0),
|
|
268
268
|
ticRefunded: 0,
|
|
269
269
|
imputeOnVat: 0,
|
|
270
270
|
vatNetDue: 0,
|
|
@@ -278,20 +278,20 @@ export function getCerfa3517Century23Payload(accountingEntries, payload) {
|
|
|
278
278
|
},
|
|
279
279
|
total: 0,
|
|
280
280
|
refund: {
|
|
281
|
-
creditRefundable: shouldFillRefund ? isNil ? 0 : _round((
|
|
281
|
+
creditRefundable: shouldFillRefund ? isNil ? 0 : _round((_178 = (_177 = payload.refund) === null || _177 === void 0 ? void 0 : _177.creditRefundable) !== null && _178 !== void 0 ? _178 : 0) : 0,
|
|
282
282
|
surplus: 0,
|
|
283
283
|
maximum: 0,
|
|
284
|
-
asked: isNil ? 0 : _round((
|
|
284
|
+
asked: isNil ? 0 : _round((_180 = (_179 = payload.refund) === null || _179 === void 0 ? void 0 : _179.asked) !== null && _180 !== void 0 ? _180 : 0),
|
|
285
285
|
reportable: 0,
|
|
286
286
|
place: shouldFillRefund ? payload.society.city : null,
|
|
287
287
|
date: shouldFillRefund ? dayjs().format('YYYY-MM-DD') : null,
|
|
288
288
|
shouldCredit: true,
|
|
289
289
|
shouldImpute: false,
|
|
290
|
-
name: shouldFillRefund ? `${(
|
|
290
|
+
name: shouldFillRefund ? `${(_181 = payload.owner) === null || _181 === void 0 ? void 0 : _181.firstname} ${(_182 = payload.owner) === null || _182 === void 0 ? void 0 : _182.lastname}` : null,
|
|
291
291
|
},
|
|
292
292
|
bankAccount: {
|
|
293
|
-
iban: (
|
|
294
|
-
bic: (
|
|
293
|
+
iban: (_184 = (_183 = payload.details) === null || _183 === void 0 ? void 0 : _183.iban) !== null && _184 !== void 0 ? _184 : null,
|
|
294
|
+
bic: (_186 = (_185 = payload.details) === null || _185 === void 0 ? void 0 : _185.bic) !== null && _186 !== void 0 ? _186 : null,
|
|
295
295
|
},
|
|
296
296
|
};
|
|
297
297
|
data.vat.total.tax = data.vat.normalRate20.tax + data.vat.normalRate20OnPetrol.tax + data.vat.reduceRate5Dot5.tax + data.vat.reduceRate10.tax + data.vat.reduceRate8Dot5.tax + data.vat.reduceRate2Dot1.tax + data.vat.particularRate.tax + data.vat.reducedRateOnPetrol.tax + data.vat.oldRate.tax + data.vat.energyBought.tax + data.vat.prestation.tax + data.vat.prestation2.tax + data.vat.saleOfImmobilization.tax + data.vat.ownDelivery.tax + data.vat.other.tax;
|