@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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.24",
|
|
4
4
|
"description": "Silex Core perform HTTP Request and object binding. Silex core helps developers to retrieve and return formatted object",
|
|
5
5
|
"homepage": "https://gitlab.compta-clementine.fr/dev/silex-api",
|
|
6
6
|
"main": "js/index.js",
|
|
@@ -9,7 +9,7 @@ import { Cerfa3514_2022, CerfaPayloadForm, IRegistration } from '../../../types'
|
|
|
9
9
|
|
|
10
10
|
export function getCerfa3517Century23Payload(accountingEntries: IAccountingEntry[], payload: PayloadCerfa3517_2023): Cerfa3517_2023 {
|
|
11
11
|
const shouldHaveVatCode = isDefined(payload.setting?.tvaCode) && isDefined(payload.society.siret);
|
|
12
|
-
const shouldFillRefund = _round(payload.refund
|
|
12
|
+
const shouldFillRefund = _round(payload.refund?.asked ?? 0) > 0;
|
|
13
13
|
const isNil = payload.isNil === true;
|
|
14
14
|
const vats = Object.values(Vat);
|
|
15
15
|
|
|
@@ -105,8 +105,8 @@ export function getCerfa3517Century23Payload(accountingEntries: IAccountingEntry
|
|
|
105
105
|
tax: isNil ? 0 : _round(vatNormalRate20 * 0.2),
|
|
106
106
|
},
|
|
107
107
|
normalRate20OnPetrol: {
|
|
108
|
-
base: isNil ? 0 : _round(payload.vat
|
|
109
|
-
tax: isNil ? 0 : _round(payload.vat
|
|
108
|
+
base: isNil ? 0 : _round(payload.vat?.normalRate20OnPetrol ?? 0),
|
|
109
|
+
tax: isNil ? 0 : _round(payload.vat?.normalRate20OnPetrol ?? 0 * 0.2),
|
|
110
110
|
},
|
|
111
111
|
reduceRate5Dot5: {
|
|
112
112
|
base: isNil ? 0 : _round(vatReducedRate5Dot5),
|
|
@@ -125,24 +125,24 @@ export function getCerfa3517Century23Payload(accountingEntries: IAccountingEntry
|
|
|
125
125
|
tax: isNil ? 0 : _round(vatReducedRate2Dot1 * 0.021),
|
|
126
126
|
},
|
|
127
127
|
particularRate: {
|
|
128
|
-
base: isNil ? 0 : _round(payload.vat
|
|
129
|
-
tax: isNil ? 0 : _round(payload.vat
|
|
128
|
+
base: isNil ? 0 : _round(payload.vat?.particularRate?.base ?? 0),
|
|
129
|
+
tax: isNil ? 0 : _round(payload.vat?.particularRate?.tax ?? 0),
|
|
130
130
|
},
|
|
131
131
|
reducedRateOnPetrol: {
|
|
132
132
|
base: isNil ? 0 : _round(payload.vat?.reducedRateOnPetrol ?? 0),
|
|
133
133
|
tax: isNil ? 0 : _round((payload.vat?.reducedRateOnPetrol ?? 0) * 0.13),
|
|
134
134
|
},
|
|
135
135
|
oldRate: {
|
|
136
|
-
base: isNil ? 0 : _round(payload.vat
|
|
137
|
-
tax: isNil ? 0 : _round(payload.vat
|
|
136
|
+
base: isNil ? 0 : _round(payload.vat?.oldRate?.base ?? 0),
|
|
137
|
+
tax: isNil ? 0 : _round(payload.vat?.oldRate?.tax ?? 0),
|
|
138
138
|
},
|
|
139
139
|
energyBought: {
|
|
140
|
-
base: isNil ? 0 : _round(payload.vat
|
|
141
|
-
tax: isNil ? 0 : _round(payload.vat
|
|
140
|
+
base: isNil ? 0 : _round(payload.vat?.energyBought?.base ?? 0),
|
|
141
|
+
tax: isNil ? 0 : _round(payload.vat?.energyBought?.tax ?? 0),
|
|
142
142
|
},
|
|
143
143
|
prestation: {
|
|
144
|
-
base: isNil ? 0 : _round(payload.vat
|
|
145
|
-
tax: isNil ? 0 : _round(payload.vat
|
|
144
|
+
base: isNil ? 0 : _round(payload.vat?.prestation?.base ?? 0),
|
|
145
|
+
tax: isNil ? 0 : _round(payload.vat?.prestation?.tax ?? 0),
|
|
146
146
|
},
|
|
147
147
|
prestation2: {
|
|
148
148
|
base: isNil ? 0 : _round(prestation2Base),
|
|
@@ -166,7 +166,7 @@ export function getCerfa3517Century23Payload(accountingEntries: IAccountingEntry
|
|
|
166
166
|
onInvoice: isNil ? 0 : _round(onInvoiceDeductible),
|
|
167
167
|
onFlatRate: isNil ? 0 : _round(payload.deductible?.onFlatRate ?? 0),
|
|
168
168
|
total1: 0, // Calculé plus bas
|
|
169
|
-
rate: isNil ? 0 : _round(payload.deductible
|
|
169
|
+
rate: isNil ? 0 : _round(payload.deductible?.rate ?? 100, 2),
|
|
170
170
|
onImmobilization: isNil ? 0 : _round(onImmobilizationDeductible),
|
|
171
171
|
previousCredit: isNil ? 0 : _round(payload.deductible?.previousCredit ?? 0),
|
|
172
172
|
forget: isNil ? 0 : _round(payload.deductible?.forget ?? 0),
|
|
@@ -198,12 +198,12 @@ export function getCerfa3517Century23Payload(accountingEntries: IAccountingEntry
|
|
|
198
198
|
onRetransmission: isNil ? 0 : _round(payload.tax?.onRetransmission ?? 0),
|
|
199
199
|
onResultFarm: isNil ? 0 : _round(payload.tax?.onResultFarm ?? 0),
|
|
200
200
|
payingVideo: {
|
|
201
|
-
reduced: isNil ? 0 : _round(payload.tax
|
|
202
|
-
normal: isNil ? 0 : _round(payload.tax
|
|
201
|
+
reduced: isNil ? 0 : _round(payload.tax?.payingVideo?.reduced ?? 0),
|
|
202
|
+
normal: isNil ? 0 : _round(payload.tax?.payingVideo?.normal ?? 0),
|
|
203
203
|
},
|
|
204
204
|
freeVideo: {
|
|
205
|
-
reduce: isNil ? 0 : _round(payload.tax
|
|
206
|
-
normal: isNil ? 0 : _round(payload.tax
|
|
205
|
+
reduce: isNil ? 0 : _round(payload.tax?.freeVideo?.reduced ?? 0),
|
|
206
|
+
normal: isNil ? 0 : _round(payload.tax?.freeVideo?.normal ?? 0),
|
|
207
207
|
},
|
|
208
208
|
bailiff: isNil ? 0 : _round(payload.tax?.bailiff ?? 0),
|
|
209
209
|
contribution: isNil ? 0 : _round(payload.tax?.contribution ?? 0),
|
|
@@ -223,13 +223,13 @@ export function getCerfa3517Century23Payload(accountingEntries: IAccountingEntry
|
|
|
223
223
|
fishingProduct: isNil ? 0 : _round(payload.tax?.fishingProduct ?? 0),
|
|
224
224
|
agreement: isNil ? 0 : _round(payload.tax?.agreement ?? 0),
|
|
225
225
|
phyto: {
|
|
226
|
-
onCirculation: isNil ? 0 : _round(payload.tax
|
|
227
|
-
onExportation: isNil ? 0 : _round(payload.tax
|
|
228
|
-
total: isNil ? 0 : _round(payload.tax
|
|
226
|
+
onCirculation: isNil ? 0 : _round(payload.tax?.phyto?.onCirculation ?? 0),
|
|
227
|
+
onExportation: isNil ? 0 : _round(payload.tax?.phyto?.onExportation ?? 0),
|
|
228
|
+
total: isNil ? 0 : _round(payload.tax?.phyto?.total ?? 0),
|
|
229
229
|
},
|
|
230
230
|
onPreciousMetal: {
|
|
231
|
-
normalRate: isNil ? 0 : _round(payload.tax
|
|
232
|
-
reduceRate: isNil ? 0 : _round(payload.tax
|
|
231
|
+
normalRate: isNil ? 0 : _round(payload.tax?.onPreciousMetal?.normalRate ?? 0),
|
|
232
|
+
reduceRate: isNil ? 0 : _round(payload.tax?.onPreciousMetal?.reduceRate ?? 0),
|
|
233
233
|
},
|
|
234
234
|
onContribution: isNil ? 0 : _round(payload.tax?.onContribution ?? 0),
|
|
235
235
|
onSaleAntiquity: isNil ? 0 : _round(payload.tax?.onSaleAntiquity ?? 0),
|
|
@@ -274,9 +274,9 @@ export function getCerfa3517Century23Payload(accountingEntries: IAccountingEntry
|
|
|
274
274
|
},
|
|
275
275
|
recapitulation: {
|
|
276
276
|
balance: 0, // Calculé plus bas
|
|
277
|
-
refund: isNil ? 0 : _round(payload.refund
|
|
278
|
-
creditToReport: isNil ? 0 : _round(payload.deductible
|
|
279
|
-
imputedCredit: isNil ? 0 : _round(payload.recapitulation
|
|
277
|
+
refund: isNil ? 0 : _round(payload.refund?.asked ?? 0),
|
|
278
|
+
creditToReport: isNil ? 0 : _round(payload.deductible?.previousCredit ?? 0),
|
|
279
|
+
imputedCredit: isNil ? 0 : _round(payload.recapitulation?.imputedCredit ?? 0),
|
|
280
280
|
ticRefunded: 0, // Calculé plus bas
|
|
281
281
|
imputeOnVat: 0, // Calculé plus bas
|
|
282
282
|
vatNetDue: 0, // Calculé plus bas
|
|
@@ -290,10 +290,10 @@ export function getCerfa3517Century23Payload(accountingEntries: IAccountingEntry
|
|
|
290
290
|
},
|
|
291
291
|
total: 0, // Calculé plus bas
|
|
292
292
|
refund: {
|
|
293
|
-
creditRefundable: shouldFillRefund ? isNil ? 0 : _round(payload.refund
|
|
293
|
+
creditRefundable: shouldFillRefund ? isNil ? 0 : _round(payload.refund?.creditRefundable ?? 0) : 0,
|
|
294
294
|
surplus: 0, // Calculé plus bas
|
|
295
295
|
maximum: 0, // Calculé plus bas
|
|
296
|
-
asked: isNil ? 0 : _round(payload.refund
|
|
296
|
+
asked: isNil ? 0 : _round(payload.refund?.asked ?? 0),
|
|
297
297
|
reportable: 0, //
|
|
298
298
|
place: shouldFillRefund ? payload.society.city : null,
|
|
299
299
|
date: shouldFillRefund ? dayjs().format('YYYY-MM-DD') : null,
|