@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.
Files changed (67) hide show
  1. package/dist/cjs/api/resources/Revision.d.ts +5 -3
  2. package/dist/cjs/api/resources/Revision.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/Revision.js +10 -4
  4. package/dist/cjs/api/resources/Revision.js.map +1 -1
  5. package/dist/cjs/types/Enum/CommercialOfferType.d.ts +13 -0
  6. package/dist/cjs/types/Enum/CommercialOfferType.d.ts.map +1 -1
  7. package/dist/cjs/types/Enum/CommercialOfferType.js +10 -0
  8. package/dist/cjs/types/Enum/CommercialOfferType.js.map +1 -1
  9. package/dist/cjs/types/Enum/TaskResponseType.d.ts +2 -1
  10. package/dist/cjs/types/Enum/TaskResponseType.d.ts.map +1 -1
  11. package/dist/cjs/types/Enum/TaskResponseType.js +1 -0
  12. package/dist/cjs/types/Enum/TaskResponseType.js.map +1 -1
  13. package/dist/cjs/types/Interface/api/revision/Query.d.ts +20 -3
  14. package/dist/cjs/types/Interface/api/revision/Query.d.ts.map +1 -1
  15. package/dist/cjs/types/Interface/api/revision/Query.js +86 -13
  16. package/dist/cjs/types/Interface/api/revision/Query.js.map +1 -1
  17. package/dist/cjs/types/Interface/api/revision/Read.d.ts +19 -7
  18. package/dist/cjs/types/Interface/api/revision/Read.d.ts.map +1 -1
  19. package/dist/cjs/types/Interface/api/revision/Read.js.map +1 -1
  20. package/dist/cjs/types/Interface/models/IAccountDetail.d.ts +2 -1
  21. package/dist/cjs/types/Interface/models/IAccountDetail.d.ts.map +1 -1
  22. package/dist/cjs/types/Interface/models/IAccountDetail.js.map +1 -1
  23. package/dist/cjs/types/Interface/models/ICommercialOffer.d.ts +1 -0
  24. package/dist/cjs/types/Interface/models/ICommercialOffer.d.ts.map +1 -1
  25. package/dist/cjs/types/Interface/models/ICommercialOffer.js.map +1 -1
  26. package/dist/cjs/utils/commercialOffer.d.ts +1 -1
  27. package/dist/cjs/utils/commercialOffer.d.ts.map +1 -1
  28. package/dist/cjs/utils/commercialOffer.js +6 -2
  29. package/dist/cjs/utils/commercialOffer.js.map +1 -1
  30. package/dist/mjs/api/resources/Revision.d.ts +5 -3
  31. package/dist/mjs/api/resources/Revision.d.ts.map +1 -1
  32. package/dist/mjs/api/resources/Revision.js +22 -4
  33. package/dist/mjs/api/resources/Revision.js.map +1 -1
  34. package/dist/mjs/types/Enum/CommercialOfferType.d.ts +13 -0
  35. package/dist/mjs/types/Enum/CommercialOfferType.d.ts.map +1 -1
  36. package/dist/mjs/types/Enum/CommercialOfferType.js +10 -0
  37. package/dist/mjs/types/Enum/CommercialOfferType.js.map +1 -1
  38. package/dist/mjs/types/Enum/TaskResponseType.d.ts +2 -1
  39. package/dist/mjs/types/Enum/TaskResponseType.d.ts.map +1 -1
  40. package/dist/mjs/types/Enum/TaskResponseType.js +1 -0
  41. package/dist/mjs/types/Enum/TaskResponseType.js.map +1 -1
  42. package/dist/mjs/types/Interface/api/revision/Query.d.ts +20 -3
  43. package/dist/mjs/types/Interface/api/revision/Query.d.ts.map +1 -1
  44. package/dist/mjs/types/Interface/api/revision/Query.js +92 -9
  45. package/dist/mjs/types/Interface/api/revision/Query.js.map +1 -1
  46. package/dist/mjs/types/Interface/api/revision/Read.d.ts +19 -7
  47. package/dist/mjs/types/Interface/api/revision/Read.d.ts.map +1 -1
  48. package/dist/mjs/types/Interface/api/revision/Read.js.map +1 -1
  49. package/dist/mjs/types/Interface/models/IAccountDetail.d.ts +2 -1
  50. package/dist/mjs/types/Interface/models/IAccountDetail.d.ts.map +1 -1
  51. package/dist/mjs/types/Interface/models/IAccountDetail.js.map +1 -1
  52. package/dist/mjs/types/Interface/models/ICommercialOffer.d.ts +1 -0
  53. package/dist/mjs/types/Interface/models/ICommercialOffer.d.ts.map +1 -1
  54. package/dist/mjs/types/Interface/models/ICommercialOffer.js.map +1 -1
  55. package/dist/mjs/utils/commercialOffer.d.ts +1 -1
  56. package/dist/mjs/utils/commercialOffer.d.ts.map +1 -1
  57. package/dist/mjs/utils/commercialOffer.js +6 -2
  58. package/dist/mjs/utils/commercialOffer.js.map +1 -1
  59. package/package.json +1 -1
  60. package/ts/api/resources/Revision.ts +25 -5
  61. package/ts/types/Enum/CommercialOfferType.ts +10 -0
  62. package/ts/types/Enum/TaskResponseType.ts +1 -0
  63. package/ts/types/Interface/api/revision/Query.ts +66 -7
  64. package/ts/types/Interface/api/revision/Read.ts +21 -7
  65. package/ts/types/Interface/models/IAccountDetail.ts +2 -1
  66. package/ts/types/Interface/models/ICommercialOffer.ts +1 -0
  67. 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.289",
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', { params });
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', { params });
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
  };
@@ -36,6 +36,7 @@ export enum RoleAvailableForTask {
36
36
  EXPERT_ACCOUNTANT = Role.EXPERT_ACCOUNTANT,
37
37
  REFERENT_CLIENT = Role.EXPERT_ACCOUNTANT,
38
38
  REFERENT_LITIGE = Role.EXPERT_ACCOUNTANT,
39
+ DATA_OFFICER = Role.DATA_OFFICER,
39
40
  }
40
41
 
41
42
  export const TaskResponseType = {
@@ -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
- // Interface paginate
38
- @ApiProperty({ default: 25 })
39
- @IsNumber()
40
- limit?: number = 25;
39
+ export class QueryRevisionThirdParty extends RequiredQueryPaginate {
40
+ @ApiProperty()
41
+ @IsDate()
42
+ startDate: Date;
41
43
 
42
- @ApiProperty({ default: 1 })
44
+ @ApiProperty()
45
+ @IsDate()
46
+ endDate: Date;
47
+
48
+ @ApiProperty()
49
+ @IsInt()
50
+ idSociety: number;
51
+
52
+ @ApiProperty()
43
53
  @IsNumber()
44
- page?: number = 1;
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
- export interface ReadRevision {
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
- unlocked: number | null;
19
- locked: number | null;
20
- previousBalance: number;
21
- nextBalance: number;
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;
@@ -9,6 +9,7 @@ export interface ICommercialOffer {
9
9
  amount?: number,
10
10
  turnoverMax?: number,
11
11
  idComptaType?: number,
12
+ legalForm?: any,
12
13
  startDate: Date,
13
14
  endDate: Date,
14
15
  cumulative: boolean,
@@ -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) => offer.idCommercialOfferType === idCommercialOfferType && offer.brand.includes(societyBrand) && ((offer.turnoverMax && offer.turnoverMax === turnoverMax) || true) && ((offer.idComptaType && ((offer.idComptaType === ComptaType.ACCRUALS && idComptaType % 2 === 0) || (offer.idComptaType === ComptaType.CASH_BASED && !(idComptaType % 2 === 0)))) || true));
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