@silexpert/core 1.1.29 → 1.1.33
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/types/Enum/AdjustmentType.d.ts +0 -4
- package/es/types/Enum/AdjustmentType.d.ts.map +1 -1
- package/es/types/Enum/AdjustmentType.js +0 -4
- package/es/types/Enum/AdjustmentType.js.map +1 -1
- package/es/types/Interface/api/cerfa/3310.d.ts +0 -4
- package/es/types/Interface/api/cerfa/3310.d.ts.map +1 -1
- package/es/types/Interface/api/cerfa/3310.js.map +1 -1
- package/es/utils/vat/3310/century23.d.ts +2 -1
- package/es/utils/vat/3310/century23.d.ts.map +1 -1
- package/es/utils/vat/3310/century23.js +67 -45
- package/es/utils/vat/3310/century23.js.map +1 -1
- package/es/utils/vat/centuries.js +1 -1
- package/es/utils/vat/centuries.js.map +1 -1
- package/js/types/Enum/AdjustmentType.js +0 -7
- package/js/types/Enum/AdjustmentType.js.map +1 -1
- package/js/types/Interface/api/cerfa/3310.js.map +1 -1
- package/js/utils/vat/3310/century23.js +66 -44
- package/js/utils/vat/3310/century23.js.map +1 -1
- package/js/utils/vat/centuries.js +1 -1
- package/js/utils/vat/centuries.js.map +1 -1
- package/package.json +1 -1
- package/ts/types/Enum/AdjustmentType.ts +0 -5
- package/ts/types/Interface/api/cerfa/3310.ts +1 -5
- package/ts/utils/vat/3310/century23.ts +26 -4
- package/ts/utils/vat/centuries.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"centuries.js","names":["_dayjs","require","dayjs","_interopRequireWildcard","_CerfaType","_century","_century2","_century3","_century4","_century5","_century6","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","vatDocuments","idCerfaType","CerfaType","CERFA_3310","name","century","centuries","payload","accountingEntries","getCerfa3310Century23Payload","asponePayload","data","getCerfa3310Century23RegistrationFields","fields","cerfa3310Century23Fields","fileName","annex","shouldInclude","_a","Boolean","credit","refundAsked","amount","getCerfa3519Century17Payload","getCerfa3519Century23RegistrationFields","cerfa3519Century17Fields","CERFA_3514","getCerfa3514Century22Payload","getCerfa3514Century23RegistrationFields","cerfa3514Century22Fields","CERFA_3517","getCerfa3517Century23Payload","getCerfa3517CenturyRegistrationField","cerfa3517Century23Fields","getVatCerfaObject","exports","startDate","year","format","cerfa","find","v","c","Error"],"sources":["../../../ts/utils/vat/centuries.ts"],"sourcesContent":["import * as dayjs from 'dayjs';\nimport { CerfaType } from '../../types/Enum/CerfaType';\nimport { VatDocument } from '../../types/Interface/api/cerfa/ReadCerfa';\nimport { cerfa3310Century23Fields, getCerfa3310Century23Payload, getCerfa3310Century23RegistrationFields } from './3310/century23';\nimport { IAccountingEntry } from '../../types/Interface/models/IAccountingEntry';\nimport { Cerfa3310_2023, PayloadCerfa3310_2023 } from '../../types/Interface/api/cerfa/3310';\nimport {\n Cerfa3514_2022, Cerfa3519_2017, PayloadCerfa3514_2022, PayloadCerfa3519_2017,\n} from '../../types';\nimport { cerfa3519Century17Fields, getCerfa3519Century17Payload } from './3519/century17';\nimport { getCerfa3519Century23RegistrationFields } from './3519/century23';\nimport { cerfa3514Century22Fields, getCerfa3514Century22Payload } from './3514/century22';\nimport { getCerfa3514Century23RegistrationFields } from './3514/century23';\nimport { Cerfa3517_2023, PayloadCerfa3517_2023 } from '../../types/Interface/api/cerfa/3517';\nimport { cerfa3517Century23Fields, getCerfa3517Century23Payload, getCerfa3517CenturyRegistrationField } from './3517/century23';\n\nconst vatDocuments: VatDocument[] = [\n {\n idCerfaType: CerfaType.CERFA_3310,\n name: '3310',\n century: '23',\n centuries: [2022, 2023, 2024, 2025],\n payload: (accountingEntries: IAccountingEntry[], payload: PayloadCerfa3310_2023) => getCerfa3310Century23Payload(accountingEntries, payload),\n asponePayload: (data: Cerfa3310_2023) => getCerfa3310Century23RegistrationFields(data),\n fields: cerfa3310Century23Fields,\n fileName: '3310-2023',\n annex: {\n name: '3519',\n century: '23',\n shouldInclude: (data: Cerfa3310_2023) => Boolean(data.credit?.refundAsked && data.credit.refundAsked > 0),\n payload: (amount: number, payload: PayloadCerfa3519_2017) => getCerfa3519Century17Payload(amount, payload),\n asponePayload: (data: Cerfa3519_2017) => getCerfa3519Century23RegistrationFields(data),\n fields: cerfa3519Century17Fields,\n fileName: '3519-2017',\n },\n },\n {\n idCerfaType: CerfaType.CERFA_3514,\n name: '3514',\n century: '23',\n centuries: [2022, 2023, 2024, 2025],\n payload: (payload: PayloadCerfa3514_2022) => getCerfa3514Century22Payload(payload),\n asponePayload: (data: Cerfa3514_2022) => getCerfa3514Century23RegistrationFields(data),\n fields: cerfa3514Century22Fields,\n fileName: '3514-2022',\n },\n {\n idCerfaType: CerfaType.CERFA_3517,\n name: '3517',\n century: '23',\n centuries: [2022, 2023, 2024, 2025],\n payload: (accountingEntries: IAccountingEntry[], payload: PayloadCerfa3517_2023) => getCerfa3517Century23Payload(accountingEntries, payload),\n asponePayload: (data: Cerfa3517_2023) => getCerfa3517CenturyRegistrationField(data),\n fields: cerfa3517Century23Fields,\n fileName: '3517-2023',\n },\n];\n\nexport const getVatCerfaObject = (idCerfaType: CerfaType, startDate: string): VatDocument => {\n const year = +dayjs(startDate).format('YYYY');\n\n const cerfa = vatDocuments.find((v) => v.idCerfaType === idCerfaType && v.centuries.find((c) => c === year));\n if (!cerfa) throw new Error(`Cerfa type #${idCerfaType} with century ${year} is not managed yet.`);\n\n return cerfa;\n};"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAA+B,IAAnBC,KAAK,GAAAC,uBAAA,CAAAH,MAAA;AACjB,IAAAI,UAAA,GAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AAMA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GA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C,UAAU;EACjCC,IAAI,EAAE,MAAM;EACZC,OAAO,EAAE,IAAI;EACbC,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;EACnCC,OAAO,EAAEA,CAACC,iBAAqC,EAAED,OAA8B,KAAK,
|
|
1
|
+
{"version":3,"file":"centuries.js","names":["_dayjs","require","dayjs","_interopRequireWildcard","_CerfaType","_century","_century2","_century3","_century4","_century5","_century6","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","vatDocuments","idCerfaType","CerfaType","CERFA_3310","name","century","centuries","payload","accountingEntries","updatedEntries","getCerfa3310Century23Payload","asponePayload","data","getCerfa3310Century23RegistrationFields","fields","cerfa3310Century23Fields","fileName","annex","shouldInclude","_a","Boolean","credit","refundAsked","amount","getCerfa3519Century17Payload","getCerfa3519Century23RegistrationFields","cerfa3519Century17Fields","CERFA_3514","getCerfa3514Century22Payload","getCerfa3514Century23RegistrationFields","cerfa3514Century22Fields","CERFA_3517","getCerfa3517Century23Payload","getCerfa3517CenturyRegistrationField","cerfa3517Century23Fields","getVatCerfaObject","exports","startDate","year","format","cerfa","find","v","c","Error"],"sources":["../../../ts/utils/vat/centuries.ts"],"sourcesContent":["import * as dayjs from 'dayjs';\nimport { CerfaType } from '../../types/Enum/CerfaType';\nimport { VatDocument } from '../../types/Interface/api/cerfa/ReadCerfa';\nimport { cerfa3310Century23Fields, getCerfa3310Century23Payload, getCerfa3310Century23RegistrationFields } from './3310/century23';\nimport { IAccountingEntry } from '../../types/Interface/models/IAccountingEntry';\nimport { Cerfa3310_2023, PayloadCerfa3310_2023 } from '../../types/Interface/api/cerfa/3310';\nimport {\n Cerfa3514_2022, Cerfa3519_2017, PayloadCerfa3514_2022, PayloadCerfa3519_2017, UpdatedAnnotation,\n} from '../../types';\nimport { cerfa3519Century17Fields, getCerfa3519Century17Payload } from './3519/century17';\nimport { getCerfa3519Century23RegistrationFields } from './3519/century23';\nimport { cerfa3514Century22Fields, getCerfa3514Century22Payload } from './3514/century22';\nimport { getCerfa3514Century23RegistrationFields } from './3514/century23';\nimport { Cerfa3517_2023, PayloadCerfa3517_2023 } from '../../types/Interface/api/cerfa/3517';\nimport { cerfa3517Century23Fields, getCerfa3517Century23Payload, getCerfa3517CenturyRegistrationField } from './3517/century23';\n\nconst vatDocuments: VatDocument[] = [\n {\n idCerfaType: CerfaType.CERFA_3310,\n name: '3310',\n century: '23',\n centuries: [2022, 2023, 2024, 2025],\n payload: (accountingEntries: IAccountingEntry[], payload: PayloadCerfa3310_2023, updatedEntries: UpdatedAnnotation) => getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries),\n asponePayload: (data: Cerfa3310_2023) => getCerfa3310Century23RegistrationFields(data),\n fields: cerfa3310Century23Fields,\n fileName: '3310-2023',\n annex: {\n name: '3519',\n century: '23',\n shouldInclude: (data: Cerfa3310_2023) => Boolean(data.credit?.refundAsked && data.credit.refundAsked > 0),\n payload: (amount: number, payload: PayloadCerfa3519_2017) => getCerfa3519Century17Payload(amount, payload),\n asponePayload: (data: Cerfa3519_2017) => getCerfa3519Century23RegistrationFields(data),\n fields: cerfa3519Century17Fields,\n fileName: '3519-2017',\n },\n },\n {\n idCerfaType: CerfaType.CERFA_3514,\n name: '3514',\n century: '23',\n centuries: [2022, 2023, 2024, 2025],\n payload: (payload: PayloadCerfa3514_2022) => getCerfa3514Century22Payload(payload),\n asponePayload: (data: Cerfa3514_2022) => getCerfa3514Century23RegistrationFields(data),\n fields: cerfa3514Century22Fields,\n fileName: '3514-2022',\n },\n {\n idCerfaType: CerfaType.CERFA_3517,\n name: '3517',\n century: '23',\n centuries: [2022, 2023, 2024, 2025],\n payload: (accountingEntries: IAccountingEntry[], payload: PayloadCerfa3517_2023) => getCerfa3517Century23Payload(accountingEntries, payload),\n asponePayload: (data: Cerfa3517_2023) => getCerfa3517CenturyRegistrationField(data),\n fields: cerfa3517Century23Fields,\n fileName: '3517-2023',\n },\n];\n\nexport const getVatCerfaObject = (idCerfaType: CerfaType, startDate: string): VatDocument => {\n const year = +dayjs(startDate).format('YYYY');\n\n const cerfa = vatDocuments.find((v) => v.idCerfaType === idCerfaType && v.centuries.find((c) => c === year));\n if (!cerfa) throw new Error(`Cerfa type #${idCerfaType} with century ${year} is not managed yet.`);\n\n return cerfa;\n};"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAA+B,IAAnBC,KAAK,GAAAC,uBAAA,CAAAH,MAAA;AACjB,IAAAI,UAAA,GAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AAMA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAEA,IAAAS,SAAA,GAAAT,OAAA;AAAgI,SAAAU,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,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AAC,CAACzC,WAAW,KAAKA,WAAW,IAAIyC,CAAC,CAACpC,SAAS,CAACmC,IAAI,CAAEE,CAAC,IAAKA,CAAC,KAAKL,IAAI,CAAC,CAAC;EAC5G,IAAI,CAACE,KAAK,EAAE,MAAM,IAAII,KAAK,CAAC,eAAe3C,WAAW,iBAAiBqC,IAAI,sBAAsB,CAAC;EAElG,OAAOE,KAAK;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.33",
|
|
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",
|
|
@@ -34,9 +34,4 @@ export const AdjustmentTypeList: Array<{ id:AdjustmentTypeId; label: string; cen
|
|
|
34
34
|
key: 'vat.deductible.toImpute',
|
|
35
35
|
inputKey: 'adjustment.notEnoughDeducted',
|
|
36
36
|
},
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
export const VatDeclarationMxAdjustment: Array<{ key: string; label: string; }> = [
|
|
40
|
-
{ key: 'mx.collected', label: 'Opérations modifiées M-X (collecté)' },
|
|
41
|
-
{ key: 'mx.deducted', label: 'Opérations modifiées M-X (déductible)' },
|
|
42
37
|
];
|
|
@@ -175,7 +175,7 @@ export interface Cerfa3310_2023 {
|
|
|
175
175
|
ticgn?: Tic,
|
|
176
176
|
ticc?: Tic,
|
|
177
177
|
total?: Tic,
|
|
178
|
-
}
|
|
178
|
+
},
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
export type PayloadCerfa3310_2023 = {
|
|
@@ -187,10 +187,6 @@ export type PayloadCerfa3310_2023 = {
|
|
|
187
187
|
isNil: boolean;
|
|
188
188
|
previousVatDeclaration: Cerfa3310_2023 | null;
|
|
189
189
|
sie: ServiceOfTax | null;
|
|
190
|
-
mx: {
|
|
191
|
-
collected: number;
|
|
192
|
-
deducted: number;
|
|
193
|
-
};
|
|
194
190
|
comment?: string;
|
|
195
191
|
taxedOperations?: {
|
|
196
192
|
withdrawSuspensiveRegime?: number;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as dayjs from 'dayjs';
|
|
2
2
|
import { isDefined } from 'class-validator';
|
|
3
|
-
import { round as _round } from 'lodash';
|
|
3
|
+
import { round as _round, flatten } from 'lodash';
|
|
4
4
|
import { IAccountingEntry } from '../../../types/Interface/models/IAccountingEntry';
|
|
5
5
|
import { Cerfa3310_2023, PayloadCerfa3310_2023 } from '../../../types/Interface/api/cerfa/3310';
|
|
6
6
|
import { Vat } from '../../../types/Enum/Vat';
|
|
7
7
|
import { getAmountByAccountNumber, getTaxAmountByAccountNumber, textFormatting } from '../utils';
|
|
8
8
|
import { AsponeFormFields, CerfaPayloadForm } from '../../../types/Interface/api/cerfa/ReadCerfa';
|
|
9
|
+
import { UpdatedAnnotation } from '../../../types/Interface/api/registration/ReadRegistration';
|
|
9
10
|
|
|
10
|
-
export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry[], payload: PayloadCerfa3310_2023): Cerfa3310_2023 {
|
|
11
|
+
export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry[], payload: PayloadCerfa3310_2023, updatedEntries: UpdatedAnnotation = []): Cerfa3310_2023 {
|
|
11
12
|
const shouldHaveVatCode = isDefined(payload.setting?.tvaCode) && isDefined(payload.society.siret);
|
|
12
13
|
const vats = Object.values(Vat);
|
|
13
14
|
|
|
@@ -19,6 +20,27 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
|
|
|
19
20
|
|
|
20
21
|
const vatEntries = accountingEntries.filter((ae) => typeof ae.idVat === 'number') as Array<IAccountingEntry & { idVat: number }>;
|
|
21
22
|
|
|
23
|
+
const oldEntries = flatten(updatedEntries?.map((u) => u.old));
|
|
24
|
+
const newEntries = flatten(updatedEntries?.map((u) => u.new));
|
|
25
|
+
|
|
26
|
+
const collectedOldAmount = getAmountByAccountNumber(oldEntries, ['4457'], 0);
|
|
27
|
+
const collectedNewAmount = getAmountByAccountNumber(newEntries, ['4457'], 0);
|
|
28
|
+
|
|
29
|
+
const deductedOldAmount = getAmountByAccountNumber(oldEntries, ['4456'], 0);
|
|
30
|
+
const deductedNewAmount = getAmountByAccountNumber(newEntries, ['4456'], 0);
|
|
31
|
+
|
|
32
|
+
const mxCollected = collectedNewAmount - collectedOldAmount;
|
|
33
|
+
const mxDeducted = deductedNewAmount - deductedOldAmount;
|
|
34
|
+
|
|
35
|
+
let mxToAdd = 0;
|
|
36
|
+
let mxToSub = 0;
|
|
37
|
+
|
|
38
|
+
if (mxCollected > 0) { mxToAdd += mxCollected; }
|
|
39
|
+
if (mxDeducted < 0) { mxToAdd += Math.abs(mxDeducted); }
|
|
40
|
+
|
|
41
|
+
if (mxCollected < 0) { mxToSub += Math.abs(mxCollected); }
|
|
42
|
+
if (mxDeducted > 0) { mxToSub += mxDeducted; }
|
|
43
|
+
|
|
22
44
|
// Opérations taxées
|
|
23
45
|
const taxedServicesEntries = vatEntries.filter((ae) => frenchVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
|
|
24
46
|
const servicesAccounts = ['701', '702', '703', '704', '705', '706', '707', '708', '472'];
|
|
@@ -82,7 +104,7 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
|
|
|
82
104
|
const isNil = payload.isNil === true;
|
|
83
105
|
const isHolidayDeposit = payload.isHolidayDeposit === true;
|
|
84
106
|
|
|
85
|
-
const sumToAdd = isNil ? 0 : isHolidayDeposit ? (_round((payload.previousVatDeclaration?.toPay?.total ?? 0) * 0.8, 2)) : (_round(payload.vat?.sumToAdd ?? 0) +
|
|
107
|
+
const sumToAdd = isNil ? 0 : isHolidayDeposit ? (_round((payload.previousVatDeclaration?.toPay?.total ?? 0) * 0.8, 2)) : (_round(payload.vat?.sumToAdd ?? 0) + mxToAdd);
|
|
86
108
|
const comment = isHolidayDeposit ? `ACOMPTE CONGES ${payload.comment ?? ''}` : (payload.comment ?? null);
|
|
87
109
|
|
|
88
110
|
const initialPayload: Cerfa3310_2023 = {
|
|
@@ -249,7 +271,7 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
|
|
|
249
271
|
total: isNil || isHolidayDeposit ? 0 : otherDeductibles,
|
|
250
272
|
},
|
|
251
273
|
report,
|
|
252
|
-
toImpute: isNil || isHolidayDeposit ? 0 : (_round(payload.vat?.deductible?.toImpute ?? 0) +
|
|
274
|
+
toImpute: isNil || isHolidayDeposit ? 0 : (_round(payload.vat?.deductible?.toImpute ?? 0) + mxToSub),
|
|
253
275
|
total: 0, // Calculé plus bas
|
|
254
276
|
onImportOtherThanOilProducts: isNil || isHolidayDeposit ? 0 : otherDeductibles,
|
|
255
277
|
coefficient: isNil || isHolidayDeposit ? 100 : coefficient,
|
|
@@ -5,7 +5,7 @@ import { cerfa3310Century23Fields, getCerfa3310Century23Payload, getCerfa3310Cen
|
|
|
5
5
|
import { IAccountingEntry } from '../../types/Interface/models/IAccountingEntry';
|
|
6
6
|
import { Cerfa3310_2023, PayloadCerfa3310_2023 } from '../../types/Interface/api/cerfa/3310';
|
|
7
7
|
import {
|
|
8
|
-
Cerfa3514_2022, Cerfa3519_2017, PayloadCerfa3514_2022, PayloadCerfa3519_2017,
|
|
8
|
+
Cerfa3514_2022, Cerfa3519_2017, PayloadCerfa3514_2022, PayloadCerfa3519_2017, UpdatedAnnotation,
|
|
9
9
|
} from '../../types';
|
|
10
10
|
import { cerfa3519Century17Fields, getCerfa3519Century17Payload } from './3519/century17';
|
|
11
11
|
import { getCerfa3519Century23RegistrationFields } from './3519/century23';
|
|
@@ -20,7 +20,7 @@ const vatDocuments: VatDocument[] = [
|
|
|
20
20
|
name: '3310',
|
|
21
21
|
century: '23',
|
|
22
22
|
centuries: [2022, 2023, 2024, 2025],
|
|
23
|
-
payload: (accountingEntries: IAccountingEntry[], payload: PayloadCerfa3310_2023) => getCerfa3310Century23Payload(accountingEntries, payload),
|
|
23
|
+
payload: (accountingEntries: IAccountingEntry[], payload: PayloadCerfa3310_2023, updatedEntries: UpdatedAnnotation) => getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries),
|
|
24
24
|
asponePayload: (data: Cerfa3310_2023) => getCerfa3310Century23RegistrationFields(data),
|
|
25
25
|
fields: cerfa3310Century23Fields,
|
|
26
26
|
fileName: '3310-2023',
|