@silexpert/core 1.1.289 → 1.1.291
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/dist/cjs/api/resources/Revision.d.ts +5 -3
- package/dist/cjs/api/resources/Revision.d.ts.map +1 -1
- package/dist/cjs/api/resources/Revision.js +10 -4
- package/dist/cjs/api/resources/Revision.js.map +1 -1
- package/dist/cjs/types/Enum/CommercialOfferType.d.ts +13 -0
- package/dist/cjs/types/Enum/CommercialOfferType.d.ts.map +1 -1
- package/dist/cjs/types/Enum/CommercialOfferType.js +10 -0
- package/dist/cjs/types/Enum/CommercialOfferType.js.map +1 -1
- package/dist/cjs/types/Enum/TaskResponseType.d.ts +2 -1
- package/dist/cjs/types/Enum/TaskResponseType.d.ts.map +1 -1
- package/dist/cjs/types/Enum/TaskResponseType.js +1 -0
- package/dist/cjs/types/Enum/TaskResponseType.js.map +1 -1
- package/dist/cjs/types/Interface/api/revision/Query.d.ts +20 -3
- package/dist/cjs/types/Interface/api/revision/Query.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/revision/Query.js +86 -13
- package/dist/cjs/types/Interface/api/revision/Query.js.map +1 -1
- package/dist/cjs/types/Interface/api/revision/Read.d.ts +19 -7
- package/dist/cjs/types/Interface/api/revision/Read.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/revision/Read.js.map +1 -1
- package/dist/cjs/types/Interface/models/IAccountDetail.d.ts +2 -1
- package/dist/cjs/types/Interface/models/IAccountDetail.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IAccountDetail.js.map +1 -1
- package/dist/cjs/types/Interface/models/ICommercialOffer.d.ts +1 -0
- package/dist/cjs/types/Interface/models/ICommercialOffer.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/ICommercialOffer.js.map +1 -1
- package/dist/cjs/utils/commercialOffer.d.ts +1 -1
- package/dist/cjs/utils/commercialOffer.d.ts.map +1 -1
- package/dist/cjs/utils/commercialOffer.js +6 -2
- package/dist/cjs/utils/commercialOffer.js.map +1 -1
- package/dist/mjs/api/resources/Revision.d.ts +5 -3
- package/dist/mjs/api/resources/Revision.d.ts.map +1 -1
- package/dist/mjs/api/resources/Revision.js +22 -4
- package/dist/mjs/api/resources/Revision.js.map +1 -1
- package/dist/mjs/types/Enum/CommercialOfferType.d.ts +13 -0
- package/dist/mjs/types/Enum/CommercialOfferType.d.ts.map +1 -1
- package/dist/mjs/types/Enum/CommercialOfferType.js +10 -0
- package/dist/mjs/types/Enum/CommercialOfferType.js.map +1 -1
- package/dist/mjs/types/Enum/TaskResponseType.d.ts +2 -1
- package/dist/mjs/types/Enum/TaskResponseType.d.ts.map +1 -1
- package/dist/mjs/types/Enum/TaskResponseType.js +1 -0
- package/dist/mjs/types/Enum/TaskResponseType.js.map +1 -1
- package/dist/mjs/types/Interface/api/revision/Query.d.ts +20 -3
- package/dist/mjs/types/Interface/api/revision/Query.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/revision/Query.js +92 -9
- package/dist/mjs/types/Interface/api/revision/Query.js.map +1 -1
- package/dist/mjs/types/Interface/api/revision/Read.d.ts +19 -7
- package/dist/mjs/types/Interface/api/revision/Read.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/revision/Read.js.map +1 -1
- package/dist/mjs/types/Interface/models/IAccountDetail.d.ts +2 -1
- package/dist/mjs/types/Interface/models/IAccountDetail.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IAccountDetail.js.map +1 -1
- package/dist/mjs/types/Interface/models/ICommercialOffer.d.ts +1 -0
- package/dist/mjs/types/Interface/models/ICommercialOffer.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/ICommercialOffer.js.map +1 -1
- package/dist/mjs/utils/commercialOffer.d.ts +1 -1
- package/dist/mjs/utils/commercialOffer.d.ts.map +1 -1
- package/dist/mjs/utils/commercialOffer.js +6 -2
- package/dist/mjs/utils/commercialOffer.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Revision.ts +25 -5
- package/ts/types/Enum/CommercialOfferType.ts +10 -0
- package/ts/types/Enum/TaskResponseType.ts +1 -0
- package/ts/types/Interface/api/revision/Query.ts +66 -7
- package/ts/types/Interface/api/revision/Read.ts +21 -7
- package/ts/types/Interface/models/IAccountDetail.ts +2 -1
- package/ts/types/Interface/models/ICommercialOffer.ts +1 -0
- package/ts/utils/commercialOffer.ts +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.291",
|
|
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": "dist/cjs/index.js",
|
|
@@ -8,16 +8,36 @@ import {
|
|
|
8
8
|
QueryRevisionPaginate,
|
|
9
9
|
IAccountingTransaction,
|
|
10
10
|
QueryRevisionApprobation,
|
|
11
|
-
QueryRevisionAccountComment, IAccountDetail, ICycle, QueryRevisionPendingPoint, ISupervisionPendingPoint, QueryRevisionGenericPendingPoint, CreateOrUpdateState, ISupervisionPendingPointReply, CreateReply, CreatePersonalNote, ISupervisionPersonalAccountantNote, UpdatePersonalNote, GetPersonalNoteForPeriod, ISupervision, QuerySupervision, CreateSupervisionNoteFile, GetNote, IGedFile, CreateSummaryDocument, QueryRevisionAccountControlFile, QueryRevisionExport, QueryRevisionMergeIntoThirdParty, ReadRevisionMergeIntoThirdParty,
|
|
11
|
+
QueryRevisionAccountComment, IAccountDetail, ICycle, QueryRevisionPendingPoint, ISupervisionPendingPoint, QueryRevisionGenericPendingPoint, CreateOrUpdateState, ISupervisionPendingPointReply, CreateReply, CreatePersonalNote, ISupervisionPersonalAccountantNote, UpdatePersonalNote, GetPersonalNoteForPeriod, ISupervision, QuerySupervision, CreateSupervisionNoteFile, GetNote, IGedFile, CreateSummaryDocument, QueryRevisionAccountControlFile, QueryRevisionExport, QueryRevisionThirdPartyPaginate, ReadAccrualRevision, QueryRevisionThirdParty, QueryRevisionMergeIntoThirdParty, ReadRevisionMergeIntoThirdParty,
|
|
12
12
|
} from '../..';
|
|
13
13
|
|
|
14
14
|
export class Revision extends Resource {
|
|
15
|
-
getAllByAccounts(params: QueryRevision): Promise<ReadRevision[]> {
|
|
16
|
-
return this.axios.$get('/revisions/accounts', {
|
|
15
|
+
getAllByAccounts(params: QueryRevision, signal?: AbortSignal): Promise<ReadRevision[]> {
|
|
16
|
+
return this.axios.$get('/revisions/accounts', {
|
|
17
|
+
params,
|
|
18
|
+
...(signal ? { signal } : {}),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
getAllByThirdParties(params: QueryRevisionThirdParty, signal?: AbortSignal): Promise<ReadAccrualRevision[]> {
|
|
23
|
+
return this.axios.$get('/revisions/third-parties', {
|
|
24
|
+
params,
|
|
25
|
+
...(signal ? { signal } : {}),
|
|
26
|
+
});
|
|
17
27
|
}
|
|
18
28
|
|
|
19
|
-
getPaginateByAccounts(params: QueryRevisionPaginate): Promise<BasePaginate<ReadRevision>> {
|
|
20
|
-
return this.axios.$get('/revisions/accounts/paginate', {
|
|
29
|
+
getPaginateByAccounts(params: QueryRevisionPaginate, signal?: AbortSignal): Promise<BasePaginate<ReadRevision>> {
|
|
30
|
+
return this.axios.$get('/revisions/accounts/paginate', {
|
|
31
|
+
params,
|
|
32
|
+
...(signal ? { signal } : {}),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
getPaginatedByThirdParty(params: QueryRevisionThirdPartyPaginate, signal?: AbortSignal): Promise<BasePaginate<ReadAccrualRevision>> {
|
|
37
|
+
return this.axios.$get('/revisions/third-parties/paginate', {
|
|
38
|
+
params,
|
|
39
|
+
...(signal ? { signal } : {}),
|
|
40
|
+
});
|
|
21
41
|
}
|
|
22
42
|
|
|
23
43
|
getPaginateTransactionsByAccount(idAccount: number, params: QueryRevisionAccount, cancelToken?: CancelToken, signal?: AbortSignal): Promise<BasePaginate<ReadRevisionAccount>> {
|
|
@@ -111,4 +111,14 @@ export const CommercialOfferTypeDetail = {
|
|
|
111
111
|
isCatalog: null,
|
|
112
112
|
isBack: true,
|
|
113
113
|
},
|
|
114
|
+
BALANCE_SHEET_OFFERED_NO_EXPRESS : {
|
|
115
|
+
id: 9,
|
|
116
|
+
label: 'Bilan à 0 non express',
|
|
117
|
+
text: 'Bilan à %value% € par exercice non express sous réserve qu\'il y ai moins de 50 lignes sur le relevé bancaire',
|
|
118
|
+
amountType: CommercialOfferAmountType.MONEY,
|
|
119
|
+
idPrestationList: [],
|
|
120
|
+
isComptable: true,
|
|
121
|
+
isCatalog: null,
|
|
122
|
+
isBack: false,
|
|
123
|
+
},
|
|
114
124
|
};
|
|
@@ -8,9 +8,10 @@ import {
|
|
|
8
8
|
IsArray,
|
|
9
9
|
} from 'class-validator';
|
|
10
10
|
import { ApiProperty, ApiPropertyOptional, QueryPaginate } from '../../../..';
|
|
11
|
+
import { RequiredQueryPaginate } from '../BasePaginate';
|
|
11
12
|
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
12
13
|
|
|
13
|
-
export class QueryRevision {
|
|
14
|
+
export class QueryRevision extends RequiredQueryPaginate {
|
|
14
15
|
@ApiProperty()
|
|
15
16
|
@IsDate()
|
|
16
17
|
startDate: Date;
|
|
@@ -33,15 +34,35 @@ export class QueryRevision {
|
|
|
33
34
|
@ToBoolean()
|
|
34
35
|
@IsOptional()
|
|
35
36
|
descending?: boolean;
|
|
37
|
+
}
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
@ApiProperty(
|
|
39
|
-
@
|
|
40
|
-
|
|
39
|
+
export class QueryRevisionThirdParty extends RequiredQueryPaginate {
|
|
40
|
+
@ApiProperty()
|
|
41
|
+
@IsDate()
|
|
42
|
+
startDate: Date;
|
|
41
43
|
|
|
42
|
-
@ApiProperty(
|
|
44
|
+
@ApiProperty()
|
|
45
|
+
@IsDate()
|
|
46
|
+
endDate: Date;
|
|
47
|
+
|
|
48
|
+
@ApiProperty()
|
|
49
|
+
@IsInt()
|
|
50
|
+
idSociety: number;
|
|
51
|
+
|
|
52
|
+
@ApiProperty()
|
|
43
53
|
@IsNumber()
|
|
44
|
-
|
|
54
|
+
idThirdPartyType: number;
|
|
55
|
+
|
|
56
|
+
@ApiPropertyOptional()
|
|
57
|
+
@IsString()
|
|
58
|
+
@IsOptional()
|
|
59
|
+
orderBy?: 'designation' | 'amount' | 'number';
|
|
60
|
+
|
|
61
|
+
@ApiPropertyOptional()
|
|
62
|
+
@IsBoolean()
|
|
63
|
+
@ToBoolean()
|
|
64
|
+
@IsOptional()
|
|
65
|
+
descending?: boolean;
|
|
45
66
|
}
|
|
46
67
|
|
|
47
68
|
export class QueryRevisionAccount implements QueryPaginate {
|
|
@@ -217,6 +238,44 @@ export class QueryRevisionPaginate {
|
|
|
217
238
|
page?: number = 1;
|
|
218
239
|
}
|
|
219
240
|
|
|
241
|
+
export class QueryRevisionThirdPartyPaginate {
|
|
242
|
+
@ApiProperty()
|
|
243
|
+
@IsNumber()
|
|
244
|
+
idThirdPartyType: number;
|
|
245
|
+
|
|
246
|
+
@ApiProperty()
|
|
247
|
+
@IsDate()
|
|
248
|
+
startDate: Date;
|
|
249
|
+
|
|
250
|
+
@ApiProperty()
|
|
251
|
+
@IsDate()
|
|
252
|
+
endDate: Date;
|
|
253
|
+
|
|
254
|
+
@ApiProperty()
|
|
255
|
+
@IsInt()
|
|
256
|
+
idSociety: number;
|
|
257
|
+
|
|
258
|
+
@ApiPropertyOptional()
|
|
259
|
+
@IsString()
|
|
260
|
+
@IsOptional()
|
|
261
|
+
orderBy?: 'designation' | 'amount' | 'number';
|
|
262
|
+
|
|
263
|
+
@ApiPropertyOptional()
|
|
264
|
+
@IsBoolean()
|
|
265
|
+
@ToBoolean()
|
|
266
|
+
@IsOptional()
|
|
267
|
+
descending?: boolean;
|
|
268
|
+
|
|
269
|
+
// Interface paginate
|
|
270
|
+
@ApiProperty({ default: 25 })
|
|
271
|
+
@IsNumber()
|
|
272
|
+
limit?: number = 25;
|
|
273
|
+
|
|
274
|
+
@ApiProperty({ default: 1 })
|
|
275
|
+
@IsNumber()
|
|
276
|
+
page?: number = 1;
|
|
277
|
+
}
|
|
278
|
+
|
|
220
279
|
export class QueryRevisionSearchEntries {
|
|
221
280
|
// Mandatory
|
|
222
281
|
@ApiProperty()
|
|
@@ -1,25 +1,39 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IAccountDetail,
|
|
3
|
-
IAccountingFile, IAccountingJournal, ILettering, IUser,
|
|
3
|
+
IAccountingFile, IAccountingJournal, ILettering, IUser, ThirdPartyType,
|
|
4
4
|
} from '../../..';
|
|
5
5
|
import { IFile } from '../../..';
|
|
6
6
|
import { ThirdParty } from '../../../../api/resources/ThirdParty';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
interface Revision {
|
|
9
10
|
balance: number;
|
|
10
11
|
balanceDebit: number;
|
|
11
12
|
balanceCredit: number;
|
|
13
|
+
unlocked: number | null;
|
|
14
|
+
locked: number | null;
|
|
15
|
+
previousBalance: number;
|
|
16
|
+
nextBalance: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type ReadRevision = Revision & {
|
|
12
20
|
account: {
|
|
13
21
|
id: number,
|
|
14
22
|
name: string | null,
|
|
15
23
|
number: number | null,
|
|
16
24
|
accountDetails: Array<IAccountDetail>
|
|
17
25
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type ReadAccrualRevision = Revision & {
|
|
29
|
+
thirdParty: {
|
|
30
|
+
id: number,
|
|
31
|
+
name: string | null,
|
|
32
|
+
accountancyName: string | null,
|
|
33
|
+
idThirdPartyType: ThirdPartyType,
|
|
34
|
+
accountDetails: Array<IAccountDetail>
|
|
35
|
+
},
|
|
36
|
+
};
|
|
23
37
|
|
|
24
38
|
export interface ReadRevisionAccount {
|
|
25
39
|
id: number;
|
|
@@ -14,7 +14,8 @@ export interface IAccountDetail {
|
|
|
14
14
|
dateCheckAccountant: Date | null;
|
|
15
15
|
checkByIdSupervisor: number | null;
|
|
16
16
|
dateCheckSupervisor: Date | null;
|
|
17
|
-
idAccount: number;
|
|
17
|
+
idAccount: number | null;
|
|
18
|
+
idThirdParty: number | null;
|
|
18
19
|
idFile?: number;
|
|
19
20
|
idExercice?: number;
|
|
20
21
|
idSociety: number;
|
|
@@ -28,8 +28,13 @@ const disableCommercialOffer = (idCurrentOffer: number, idOfferSelected: number[
|
|
|
28
28
|
else return false;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
const getCommercialOfferList = (idCommercialOfferType: number, societyBrand: number, offerList: ICommercialOffer[], turnoverMax: number, idComptaType: number): ICommercialOffer[] => {
|
|
32
|
-
const commercialOfferList: ICommercialOffer[] = offerList.filter((offer) =>
|
|
31
|
+
const getCommercialOfferList = (idCommercialOfferType: number, societyBrand: number, offerList: ICommercialOffer[], turnoverMax: number, idComptaType: number, idLegalForm: number): ICommercialOffer[] => {
|
|
32
|
+
const commercialOfferList: ICommercialOffer[] = offerList.filter((offer) =>
|
|
33
|
+
offer.idCommercialOfferType === idCommercialOfferType &&
|
|
34
|
+
offer.brand.includes(societyBrand) &&
|
|
35
|
+
((offer.turnoverMax && offer.turnoverMax === turnoverMax) || true) &&
|
|
36
|
+
((offer.idComptaType && ((offer.idComptaType === ComptaType.ACCRUALS && idComptaType % 2 === 0) || (offer.idComptaType === ComptaType.CASH_BASED && !(idComptaType % 2 === 0)))) || true) &&
|
|
37
|
+
(!offer.legalForm || offer.legalForm.includes(idLegalForm)));
|
|
33
38
|
return commercialOfferList.filter(offer => dayjs().isBetween(dayjs(offer.startDate), dayjs(offer.endDate), 'day', '[]'));
|
|
34
39
|
};
|
|
35
40
|
|