@silexpert/core 1.1.18 → 1.1.20

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.
@@ -1,5 +1,5 @@
1
1
  import {
2
- BasePaginate, CreateRegistrationDetail, IAccountingTransaction, ICustomerVat, QueryCerfa, QueryPaginatedRegistration, QueryPreviousVatDeclaration, QueryVatEntry, ReadRegistration, ReadVatDeclarationUpdatedEntry, ReadVatEntry, ReadVatVariousOperations, UpdateOrCreateVatAdvance, UpdateOrCreateVatRegistration, UpdateRegistration,
2
+ BasePaginate, CreateRegistrationDetail, IAccountingTransaction, ICustomerVat, QueryCerfa, QueryPaginatedRegistration, QueryPreviousVatDeclaration, QueryVatEntry, ReadFormattedAccountingTransaction, ReadRegistration, ReadVatDeclarationUpdatedEntry, ReadVatEntry, ReadVatVariousOperations, UpdateOrCreateVatAdvance, UpdateOrCreateVatRegistration, UpdateRegistration,
3
3
  } from '../..';
4
4
  import { Resource } from '../Resource';
5
5
 
@@ -27,6 +27,23 @@ export class Vat extends Resource {
27
27
  return data;
28
28
  }
29
29
 
30
+ preview(idSociety: number, payload: UpdateOrCreateVatAdvance): Promise<Buffer> {
31
+ return this.axios.$post(`/societies/${idSociety}/vat/preview`, payload, {
32
+ responseType: 'arraybuffer',
33
+ headers: {
34
+ Accept: 'application/pdf',
35
+ },
36
+ });
37
+ }
38
+
39
+ migrateEntries(idSociety: number): Promise<ReadFormattedAccountingTransaction[]> {
40
+ return this.axios.$post('vat-declarations/migrate-entries', null, {
41
+ params: {
42
+ id: idSociety,
43
+ },
44
+ });
45
+ }
46
+
30
47
  getPaginated(idSociety: number, query: QueryPaginatedRegistration): Promise<BasePaginate<ReadRegistration>> {
31
48
  return this.axios.$get(`/societies/${idSociety}/vat`, { params: query });
32
49
  }
@@ -24,14 +24,14 @@ export const AdjustmentTypeList: Array<{ id:AdjustmentTypeId; label: string; cen
24
24
  id: AdjustmentTypeId.TOO_MUCH_DEDUCTED,
25
25
  label: 'TVA trop déduite',
26
26
  centuries: [2022, 2023, 2024, 2025],
27
- key: 'vat.deductible.toImpute',
27
+ key: 'vat.sumToAdd',
28
28
  inputKey: 'adjustment.tooMuchDeducted',
29
29
  },
30
30
  {
31
31
  id: AdjustmentTypeId.NOT_ENOUGH_DEDUCTED,
32
32
  label: 'TVA pas assez déduite',
33
33
  centuries: [2022, 2023, 2024, 2025],
34
- key: 'vat.sumToAdd',
34
+ key: 'vat.deductible.toImpute',
35
35
  inputKey: 'adjustment.notEnoughDeducted',
36
36
  },
37
37
  ];
@@ -15,10 +15,6 @@ export class QueryPreviousVatDeclaration {
15
15
  }
16
16
 
17
17
  export class QueryVatMigrationEntry {
18
- @ApiProperty()
19
- @IsString()
20
- token: string;
21
-
22
18
  @ApiPropertyOptional()
23
19
  @IsNumber()
24
20
  @IsOptional()
@@ -82,7 +82,7 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
82
82
  const isNil = payload.isNil === true;
83
83
  const isHolidayDeposit = payload.isHolidayDeposit === true;
84
84
 
85
- const sumToAdd = isNil ? 0 : isHolidayDeposit ? (_round((payload.previousVatDeclaration?.toPay?.total ?? 0) * 0.8, 2)) : _round(payload.vat?.sumToAdd ?? 0) + _round(payload.vat?.deductible?.toImpute ?? 0);
85
+ const sumToAdd = isNil ? 0 : isHolidayDeposit ? (_round((payload.previousVatDeclaration?.toPay?.total ?? 0) * 0.8, 2)) : _round(payload.vat?.sumToAdd ?? 0);
86
86
  const comment = isHolidayDeposit ? `ACOMPTE CONGES ${payload.comment ?? ''}` : (payload.comment ?? null);
87
87
 
88
88
  const initialPayload: Cerfa3310_2023 = {
@@ -249,7 +249,7 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
249
249
  total: isNil || isHolidayDeposit ? 0 : otherDeductibles,
250
250
  },
251
251
  report,
252
- toImpute: isNil || isHolidayDeposit ? 0 : _round(payload.vat?.deductible?.toImpute ?? 0) + _round(payload.vat?.sumToAdd ?? 0),
252
+ toImpute: isNil || isHolidayDeposit ? 0 : _round(payload.vat?.deductible?.toImpute ?? 0),
253
253
  total: 0, // Calculé plus bas
254
254
  onImportOtherThanOilProducts: isNil || isHolidayDeposit ? 0 : otherDeductibles,
255
255
  coefficient: isNil || isHolidayDeposit ? 100 : coefficient,
@@ -1393,6 +1393,7 @@ export const cerfa3310Century23Fields: CerfaPayloadForm[] = [{
1393
1393
  {
1394
1394
  label: '26 - Remboursement de crédit de TVA demandé sur formulaire n° 3519',
1395
1395
  key: 'credit.refundAsked',
1396
+ visibleIf: 'credit.amount',
1396
1397
  type: 'number',
1397
1398
  },
1398
1399
  {