@silexpert/core 0.4.133 → 0.4.134
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/api/resources/Revision.d.ts +3 -1
- package/es/api/resources/Revision.d.ts.map +1 -1
- package/es/api/resources/Revision.js +7 -1
- package/es/api/resources/Revision.js.map +1 -1
- package/es/types/Enum/BalanceSheet.d.ts +3 -0
- package/es/types/Enum/BalanceSheet.d.ts.map +1 -1
- package/es/types/Enum/BalanceSheet.js +6 -0
- package/es/types/Enum/BalanceSheet.js.map +1 -1
- package/es/types/Enum/Util.d.ts +5 -0
- package/es/types/Enum/Util.d.ts.map +1 -1
- package/es/types/Enum/Util.js +6 -0
- package/es/types/Enum/Util.js.map +1 -1
- package/es/types/Interface/api/revision/QueryRevisionAccount.d.ts +12 -0
- package/es/types/Interface/api/revision/QueryRevisionAccount.d.ts.map +1 -0
- package/es/types/Interface/api/revision/QueryRevisionAccount.js +58 -0
- package/es/types/Interface/api/revision/QueryRevisionAccount.js.map +1 -0
- package/es/types/Interface/api/revision/ReadRevisionAccount.d.ts +41 -0
- package/es/types/Interface/api/revision/ReadRevisionAccount.d.ts.map +1 -0
- package/es/types/Interface/api/revision/ReadRevisionAccount.js +2 -0
- package/es/types/Interface/api/revision/ReadRevisionAccount.js.map +1 -0
- package/es/types/Interface/api/revision/ReadRevisionTransactionDetail.d.ts +53 -0
- package/es/types/Interface/api/revision/ReadRevisionTransactionDetail.d.ts.map +1 -0
- package/es/types/Interface/api/revision/ReadRevisionTransactionDetail.js +2 -0
- package/es/types/Interface/api/revision/ReadRevisionTransactionDetail.js.map +1 -0
- package/es/types/index.d.ts +3 -0
- package/es/types/index.d.ts.map +1 -1
- package/es/types/index.js +3 -0
- package/es/types/index.js.map +1 -1
- package/es/utils/brands.js +4 -4
- package/es/utils/brands.js.map +1 -1
- package/js/api/resources/Revision.js +11 -1
- package/js/api/resources/Revision.js.map +1 -1
- package/js/types/Enum/BalanceSheet.js +10 -0
- package/js/types/Enum/BalanceSheet.js.map +1 -1
- package/js/types/Enum/Util.js +8 -0
- package/js/types/Enum/Util.js.map +1 -1
- package/js/types/Interface/api/revision/QueryRevisionAccount.js +53 -0
- package/js/types/Interface/api/revision/QueryRevisionAccount.js.map +1 -0
- package/js/types/Interface/api/revision/ReadRevisionAccount.js +6 -0
- package/js/types/Interface/api/revision/ReadRevisionAccount.js.map +1 -0
- package/js/types/Interface/api/revision/ReadRevisionTransactionDetail.js +6 -0
- package/js/types/Interface/api/revision/ReadRevisionTransactionDetail.js.map +1 -0
- package/js/types/index.js +36 -0
- package/js/types/index.js.map +1 -1
- package/js/utils/brands.js +4 -4
- package/js/utils/brands.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Revision.ts +13 -2
- package/ts/types/Enum/BalanceSheet.ts +8 -0
- package/ts/types/Enum/Util.ts +5 -0
- package/ts/types/Interface/api/revision/QueryRevisionAccount.ts +42 -0
- package/ts/types/Interface/api/revision/ReadRevisionAccount.ts +40 -0
- package/ts/types/Interface/api/revision/ReadRevisionTransactionDetail.ts +55 -0
- package/ts/types/index.ts +3 -0
- package/ts/utils/brands.ts +4 -4
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ThirdPartyType } from './ThirdPartyType';
|
|
2
|
+
import { MathematicalSign } from './Util';
|
|
3
|
+
|
|
1
4
|
export enum BalanceSheetState {
|
|
2
5
|
TO_DO = 0,
|
|
3
6
|
ACCEPTED_BY_SIE = 1,
|
|
@@ -37,6 +40,7 @@ export type BalanceSheetField = {
|
|
|
37
40
|
calculationAdd?: string[]; // Tableau des keys à additionner pour obtenir le total
|
|
38
41
|
|
|
39
42
|
type?: BalanceSheetType; // Permet de calculer par somme de compte, créditeur ou débiteur
|
|
43
|
+
idThirdPartyTypeToAdd?: [ThirdPartyType, MathematicalSign] // Type de tiers à additionner, uniquement au crédit / débit / tous
|
|
40
44
|
};
|
|
41
45
|
|
|
42
46
|
export type BalanceSheetList = BalanceSheetField[];
|
|
@@ -229,11 +233,13 @@ export const BALANCE_SHEET_LIST_ACTIVE: BalanceSheetList = [
|
|
|
229
233
|
{
|
|
230
234
|
name: 'Créances clients et comptes rattachés',
|
|
231
235
|
accounts: ['411', '413', '416', '418'],
|
|
236
|
+
idThirdPartyTypeToAdd: [ThirdPartyType.CUSTOMER, MathematicalSign.LESS],
|
|
232
237
|
accountsDeducted: ['491'],
|
|
233
238
|
},
|
|
234
239
|
{
|
|
235
240
|
name: 'Autres',
|
|
236
241
|
accounts: ['401', '4096', '4097', '4098', '42', '43', '44', '45', '46', '48'],
|
|
242
|
+
idThirdPartyTypeToAdd: [ThirdPartyType.PROVIDER, MathematicalSign.LESS],
|
|
237
243
|
accountsDeducted: ['495', '496'], // Actif : On compte dedans que ceux qui sont positifs que 4
|
|
238
244
|
type: 'active',
|
|
239
245
|
},
|
|
@@ -488,6 +494,7 @@ export const BALANCE_SHEET_LIST_PASSIVE: BalanceSheetList = [
|
|
|
488
494
|
name: 'Dettes Fournisseurs et Comptes rattachés',
|
|
489
495
|
key: 'payables',
|
|
490
496
|
accounts: ['401', '403', '4081', '4088'],
|
|
497
|
+
idThirdPartyTypeToAdd: [ThirdPartyType.PROVIDER, MathematicalSign.PLUS],
|
|
491
498
|
isSubcategory: true,
|
|
492
499
|
total: 0,
|
|
493
500
|
type: 'passive',
|
|
@@ -512,6 +519,7 @@ export const BALANCE_SHEET_LIST_PASSIVE: BalanceSheetList = [
|
|
|
512
519
|
name: 'Autres dettes',
|
|
513
520
|
key: 'OtherDebts',
|
|
514
521
|
accounts: ['411', '4196', '4197', '4198', '464', '467', '4686', '478', '509'],
|
|
522
|
+
idThirdPartyTypeToAdd: [ThirdPartyType.CUSTOMER, MathematicalSign.PLUS],
|
|
515
523
|
isSubcategory: true,
|
|
516
524
|
total: 0,
|
|
517
525
|
type: 'passive',
|
package/ts/types/Enum/Util.ts
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IsBoolean, IsDate, IsInt, IsNumber, IsString,
|
|
3
|
+
} from 'class-validator';
|
|
4
|
+
import { ApiProperty, QueryPaginate } from '../../../..';
|
|
5
|
+
import { ApiPropertyOptional } from '../../../../utils';
|
|
6
|
+
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
7
|
+
|
|
8
|
+
export class QueryRevisionAccount implements QueryPaginate {
|
|
9
|
+
@ApiProperty()
|
|
10
|
+
@IsNumber()
|
|
11
|
+
page: number;
|
|
12
|
+
|
|
13
|
+
@ApiPropertyOptional({ default: 'idAccount' })
|
|
14
|
+
@IsString()
|
|
15
|
+
orderBy: string;
|
|
16
|
+
|
|
17
|
+
@ApiProperty()
|
|
18
|
+
@IsDate()
|
|
19
|
+
startDate: Date;
|
|
20
|
+
|
|
21
|
+
@ApiProperty()
|
|
22
|
+
@IsDate()
|
|
23
|
+
endDate: Date;
|
|
24
|
+
|
|
25
|
+
@ApiPropertyOptional({ default: 25 })
|
|
26
|
+
@IsNumber()
|
|
27
|
+
limit: number;
|
|
28
|
+
|
|
29
|
+
@ApiPropertyOptional({ default: true })
|
|
30
|
+
@IsBoolean()
|
|
31
|
+
@ToBoolean()
|
|
32
|
+
descending: boolean;
|
|
33
|
+
|
|
34
|
+
@ApiPropertyOptional()
|
|
35
|
+
@IsBoolean()
|
|
36
|
+
@ToBoolean()
|
|
37
|
+
isRevised: boolean;
|
|
38
|
+
|
|
39
|
+
@ApiProperty()
|
|
40
|
+
@IsInt()
|
|
41
|
+
idSociety: number;
|
|
42
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IAccountingFile, IAccountingJournal, ILettering, IUser,
|
|
3
|
+
} from '../../..';
|
|
4
|
+
|
|
5
|
+
export interface ReadRevisionAccount {
|
|
6
|
+
id: number;
|
|
7
|
+
master: boolean;
|
|
8
|
+
dateValue: Date;
|
|
9
|
+
designation: string | null;
|
|
10
|
+
comment: string | null;
|
|
11
|
+
debit: number;
|
|
12
|
+
credit: number;
|
|
13
|
+
isPerso: boolean;
|
|
14
|
+
autoAnnotate: boolean;
|
|
15
|
+
idInherit: number | null;
|
|
16
|
+
idAccount: number;
|
|
17
|
+
idThirdParty: number;
|
|
18
|
+
idAccountingTransaction: number;
|
|
19
|
+
idVat: number | null;
|
|
20
|
+
idImmobilization: number | null;
|
|
21
|
+
createdAt: Date;
|
|
22
|
+
updatedAt: Date;
|
|
23
|
+
accountingTransaction: {
|
|
24
|
+
id: number;
|
|
25
|
+
idBankAccount: number,
|
|
26
|
+
dateLocked: Date | null;
|
|
27
|
+
dateVerified: Date | null;
|
|
28
|
+
idUser: number | null;
|
|
29
|
+
exported: Date | null;
|
|
30
|
+
idAccountingJournal: number;
|
|
31
|
+
idLettering: number | null;
|
|
32
|
+
accountingFiles: Array<IAccountingFile>;
|
|
33
|
+
accountingJournal: IAccountingJournal;
|
|
34
|
+
lettering: ILettering;
|
|
35
|
+
user: IUser;
|
|
36
|
+
},
|
|
37
|
+
thirdParty: { id: number, fullname: string } | null,
|
|
38
|
+
calculatedVat?: number;
|
|
39
|
+
balance: number | null;
|
|
40
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { IFile } from '../../..';
|
|
2
|
+
|
|
3
|
+
export interface ReadRevisionTransactionDetail {
|
|
4
|
+
id: number;
|
|
5
|
+
label: string | null;
|
|
6
|
+
reference: string | null;
|
|
7
|
+
dateValue: Date;
|
|
8
|
+
dateLocked: Date | null;
|
|
9
|
+
dateVerified: Date | null;
|
|
10
|
+
originalValue: number | null;
|
|
11
|
+
idUser: number | null;
|
|
12
|
+
isBlocked: boolean;
|
|
13
|
+
isMerged: boolean;
|
|
14
|
+
isAsset: boolean;
|
|
15
|
+
exported: Date | null;
|
|
16
|
+
kilometers: number | null;
|
|
17
|
+
internComment: string | null;
|
|
18
|
+
invoiceRequested: boolean;
|
|
19
|
+
idBankAccount: number | null;
|
|
20
|
+
idSociety: number;
|
|
21
|
+
idCurrency?: number | null;
|
|
22
|
+
idSocietyVehicle: number | null;
|
|
23
|
+
idSocietyPartner: number | null;
|
|
24
|
+
idRule: number | null;
|
|
25
|
+
idAccountingJournal: number;
|
|
26
|
+
idEstimateInvoice: number | null;
|
|
27
|
+
idEAF: number | null;
|
|
28
|
+
file: IFile[] | null;
|
|
29
|
+
accountingEntries: RevisionAccountingEntries[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface RevisionAccountingEntries {
|
|
33
|
+
id: number;
|
|
34
|
+
master: boolean;
|
|
35
|
+
dateValue: Date;
|
|
36
|
+
designation: string;
|
|
37
|
+
comment: string | null;
|
|
38
|
+
debit: number;
|
|
39
|
+
credit: number;
|
|
40
|
+
isPerso: boolean;
|
|
41
|
+
idInherit: number | null;
|
|
42
|
+
idAccount: number | null;
|
|
43
|
+
idThirdParty: number | null;
|
|
44
|
+
idVat: number | null;
|
|
45
|
+
idImmobilization?: number | null;
|
|
46
|
+
account: RevisionAccount;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface RevisionAccount {
|
|
50
|
+
id: number;
|
|
51
|
+
number: number;
|
|
52
|
+
name: string;
|
|
53
|
+
idParentAccount: number | null;
|
|
54
|
+
idVat: number | null;
|
|
55
|
+
}
|
package/ts/types/index.ts
CHANGED
|
@@ -481,6 +481,9 @@ export * from './Interface/api/revision/QueryRevision';
|
|
|
481
481
|
export * from './Interface/api/revision/ReadRevision';
|
|
482
482
|
export * from './Interface/api/revision/RevisionObject';
|
|
483
483
|
export * from './Interface/api/revision/Revision';
|
|
484
|
+
export * from './Interface/api/revision/QueryRevisionAccount';
|
|
485
|
+
export * from './Interface/api/revision/ReadRevisionAccount';
|
|
486
|
+
export * from './Interface/api/revision/ReadRevisionTransactionDetail';
|
|
484
487
|
|
|
485
488
|
// export * from './Interface/api/survey/QuerySurvey';
|
|
486
489
|
export * from './Interface/api/survey/ReadSurvey';
|
package/ts/utils/brands.ts
CHANGED
|
@@ -16,17 +16,17 @@ type getBrandConfigParams = {
|
|
|
16
16
|
|
|
17
17
|
const getBrandNameByNodeEnv = (nodeEnv?: string): 'Legalstart'| 'Comptalib' | 'Clementine' => {
|
|
18
18
|
if (nodeEnv) {
|
|
19
|
-
if (
|
|
19
|
+
if (nodeEnv.indexOf('legalstart') > -1 || nodeEnv.indexOf('Legalstart') > -1) {
|
|
20
20
|
return 'Legalstart';
|
|
21
21
|
}
|
|
22
|
-
if (
|
|
22
|
+
if (nodeEnv.indexOf('comptalib') > -1 || nodeEnv.indexOf('Comptalib') > -1) {
|
|
23
23
|
return 'Comptalib';
|
|
24
24
|
}
|
|
25
25
|
} else if (process.env.API_HOST) {
|
|
26
|
-
if (process.env.API_HOST.indexOf('legalstart') > -1) {
|
|
26
|
+
if (process.env.API_HOST.indexOf('legalstart') > -1 || process.env.API_HOST.indexOf('Legalstart') > -1) {
|
|
27
27
|
return 'Legalstart';
|
|
28
28
|
}
|
|
29
|
-
if (process.env.API_HOST.indexOf('comptalib') > -1) {
|
|
29
|
+
if (process.env.API_HOST.indexOf('comptalib') > -1 || process.env.API_HOST.indexOf('Comptalib') > -1) {
|
|
30
30
|
return 'Comptalib';
|
|
31
31
|
}
|
|
32
32
|
}
|