@silexpert/core 1.1.76 → 1.1.78
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/SocietyConfigBalanceSheet.d.ts +1 -0
- package/es/api/resources/SocietyConfigBalanceSheet.d.ts.map +1 -1
- package/es/api/resources/SocietyConfigBalanceSheet.js +3 -0
- package/es/api/resources/SocietyConfigBalanceSheet.js.map +1 -1
- package/es/types/Enum/Activity.d.ts +12 -0
- package/es/types/Enum/Activity.d.ts.map +1 -1
- package/es/types/Enum/Activity.js +13 -0
- package/es/types/Enum/Activity.js.map +1 -1
- package/es/types/Enum/DepositDocumentType.d.ts +9 -0
- package/es/types/Enum/DepositDocumentType.d.ts.map +1 -1
- package/es/types/Enum/DepositDocumentType.js +37 -0
- package/es/types/Enum/DepositDocumentType.js.map +1 -1
- package/es/types/Enum/FollowList.d.ts +98 -0
- package/es/types/Enum/FollowList.d.ts.map +1 -0
- package/es/types/Enum/FollowList.js +98 -0
- package/es/types/Enum/FollowList.js.map +1 -0
- package/es/types/Enum/Ged.d.ts +21 -1
- package/es/types/Enum/Ged.d.ts.map +1 -1
- package/es/types/Enum/Ged.js +34 -0
- package/es/types/Enum/Ged.js.map +1 -1
- package/es/types/Interface/api/prestashop/GetPrestashopDataFromJSONOutputParams.d.ts +9 -0
- package/es/types/Interface/api/prestashop/GetPrestashopDataFromJSONOutputParams.d.ts.map +1 -0
- package/es/types/Interface/api/prestashop/GetPrestashopDataFromJSONOutputParams.js +2 -0
- package/es/types/Interface/api/prestashop/GetPrestashopDataFromJSONOutputParams.js.map +1 -0
- package/es/types/Interface/api/society/SocietyWithStatsCaParams.d.ts +2 -0
- package/es/types/Interface/api/society/SocietyWithStatsCaParams.d.ts.map +1 -1
- package/es/types/Interface/api/society/SocietyWithStatsCaParams.js.map +1 -1
- package/es/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.d.ts +2 -0
- package/es/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.d.ts.map +1 -1
- package/es/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.js +11 -3
- package/es/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.js.map +1 -1
- package/es/types/Interface/models/IFollow.d.ts +0 -2
- package/es/types/Interface/models/IFollow.d.ts.map +1 -1
- package/es/types/Interface/models/IFollow.js.map +1 -1
- package/es/types/Interface/models/ISocietyConfigBalanceSheet.d.ts +2 -1
- package/es/types/Interface/models/ISocietyConfigBalanceSheet.d.ts.map +1 -1
- package/es/types/Interface/models/ISocietyConfigBalanceSheet.js.map +1 -1
- package/es/types/index.d.ts +2 -0
- package/es/types/index.d.ts.map +1 -1
- package/es/types/index.js +2 -0
- package/es/types/index.js.map +1 -1
- package/es/utils/vat/utils.d.ts +1 -1
- package/es/utils/vat/utils.d.ts.map +1 -1
- package/es/utils/vat/utils.js +8 -1
- package/es/utils/vat/utils.js.map +1 -1
- package/js/api/resources/SocietyConfigBalanceSheet.js +3 -0
- package/js/api/resources/SocietyConfigBalanceSheet.js.map +1 -1
- package/js/types/Enum/Activity.js +26 -12
- package/js/types/Enum/Activity.js.map +1 -1
- package/js/types/Enum/DepositDocumentType.js +31 -1
- package/js/types/Enum/DepositDocumentType.js.map +1 -1
- package/js/types/Enum/FollowList.js +103 -0
- package/js/types/Enum/FollowList.js.map +1 -0
- package/js/types/Enum/Ged.js +28 -0
- package/js/types/Enum/Ged.js.map +1 -1
- package/js/types/Interface/api/prestashop/GetPrestashopDataFromJSONOutputParams.js +6 -0
- package/js/types/Interface/api/prestashop/GetPrestashopDataFromJSONOutputParams.js.map +1 -0
- package/js/types/Interface/api/society/SocietyWithStatsCaParams.js.map +1 -1
- package/js/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.js +3 -1
- package/js/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.js.map +1 -1
- package/js/types/Interface/models/IFollow.js.map +1 -1
- package/js/types/Interface/models/ISocietyConfigBalanceSheet.js.map +1 -1
- package/js/types/index.js +20 -0
- package/js/types/index.js.map +1 -1
- package/js/utils/vat/utils.js +6 -1
- package/js/utils/vat/utils.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/SocietyConfigBalanceSheet.ts +4 -0
- package/ts/types/Enum/Activity.ts +14 -0
- package/ts/types/Enum/DepositDocumentType.ts +39 -1
- package/ts/types/Enum/FollowList.ts +97 -0
- package/ts/types/Enum/Ged.ts +36 -0
- package/ts/types/Interface/api/prestashop/GetPrestashopDataFromJSONOutputParams.ts +10 -0
- package/ts/types/Interface/api/society/SocietyWithStatsCaParams.ts +3 -1
- package/ts/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.ts +10 -3
- package/ts/types/Interface/models/IFollow.ts +0 -5
- package/ts/types/Interface/models/ISocietyConfigBalanceSheet.ts +2 -1
- package/ts/types/index.ts +2 -0
- package/ts/utils/vat/utils.ts +8 -1
package/js/utils/vat/utils.js
CHANGED
|
@@ -27,13 +27,17 @@ function getAmountByAccountNumber(accountingEntries, accountsNumber, precision =
|
|
|
27
27
|
function setZeroIfIsNegative(value) {
|
|
28
28
|
return value < 0 ? 0 : value;
|
|
29
29
|
}
|
|
30
|
-
function getTaxAmountByAccountNumber(accountingEntries, accountsNumber, precision = 0) {
|
|
30
|
+
function getTaxAmountByAccountNumber(accountingEntries, accountsNumber, precision = 0, logging = false) {
|
|
31
31
|
const accountingEntriesUniq = (0, _lodash.uniqBy)(accountingEntries, 'id');
|
|
32
32
|
return (0, _lodash.round)(accountingEntriesUniq.reduce((acc, accountingEntry) => {
|
|
33
33
|
let accTmp = acc;
|
|
34
34
|
accountsNumber.some(number => {
|
|
35
35
|
var _a, _b;
|
|
36
36
|
if (accountingEntry.account && accountingEntry.account.number && accountingEntry.account.number.toString().startsWith(number)) {
|
|
37
|
+
// eslint-disable-next-line no-console
|
|
38
|
+
if (logging) console.log('\'\'');
|
|
39
|
+
// eslint-disable-next-line no-console
|
|
40
|
+
if (logging) console.log(accountingEntry);
|
|
37
41
|
accTmp += (accountingEntry.debit - accountingEntry.credit) * (((_b = (_a = Object.values(_Vat.Vat).find(v => v.id === accountingEntry.idVat)) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0) / 100);
|
|
38
42
|
return true;
|
|
39
43
|
}
|
|
@@ -52,6 +56,7 @@ function textFormatting(value, length = null) {
|
|
|
52
56
|
formattedValue = formattedValue.replace(/"/g, ''); // Suppression des "
|
|
53
57
|
formattedValue = formattedValue.replace(/^ */, ''); // Suppression des espaces de début
|
|
54
58
|
formattedValue = formattedValue.replace(/ *$/, ''); // Suppression des espaces de fin
|
|
59
|
+
formattedValue = formattedValue.replace(/€/g, 'EUR');
|
|
55
60
|
if (length) formattedValue = formattedValue.slice(0, length);
|
|
56
61
|
return formattedValue;
|
|
57
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["getAmountByAccountNumber","exports","setZeroIfIsNegative","getTaxAmountByAccountNumber","textFormatting","_lodash","require","_Vat","accountingEntries","accountsNumber","precision","isAbs","accountingEntriesUniq","_uniqBy","result","_round","reduce","acc","accountingEntry","accTmp","some","number","account","toString","startsWith","debit","credit","Math","abs","value","_b","_a","Object","values","Vat","find","v","id","idVat","length","formattedValue","replace","slice"],"sources":["../../../ts/utils/vat/utils.ts"],"sourcesContent":["import { round as _round, uniqBy as _uniqBy } from 'lodash';\nimport { IAccountingEntry } from '../../types/Interface/models/IAccountingEntry';\nimport { Vat } from '../../types/Enum/Vat';\n\nexport function getAmountByAccountNumber(accountingEntries: IAccountingEntry[], accountsNumber: string[], precision = 0, isAbs = false): number {\n const accountingEntriesUniq = _uniqBy(accountingEntries, 'id');\n const result = _round(accountingEntriesUniq.reduce((acc, accountingEntry) => {\n let accTmp = acc;\n accountsNumber.some((number) => {\n if (accountingEntry.account && accountingEntry.account.number && accountingEntry.account.number.toString().startsWith(number)) {\n accTmp += accountingEntry.debit - accountingEntry.credit;\n return true;\n }\n return false;\n });\n return accTmp;\n }, 0), precision);\n return isAbs ? Math.abs(result) : result;\n}\n\nexport function setZeroIfIsNegative(value: number): number {\n return value < 0 ? 0 : value;\n}\n\nexport function getTaxAmountByAccountNumber(accountingEntries: IAccountingEntry[], accountsNumber: string[], precision = 0): number {\n const accountingEntriesUniq = _uniqBy(accountingEntries, 'id');\n return _round(accountingEntriesUniq.reduce((acc, accountingEntry) => {\n let accTmp = acc;\n accountsNumber.some((number) => {\n if (accountingEntry.account && accountingEntry.account.number && accountingEntry.account.number.toString().startsWith(number)) {\n accTmp += ((accountingEntry.debit - accountingEntry.credit) * (((Object.values(Vat).find((v) => v.id === accountingEntry.idVat)?.value ?? 0) / 100)));\n return true;\n }\n return false;\n });\n return accTmp;\n }, precision));\n}\n\nexport function textFormatting(value: any, length: number | null = null): string | null {\n if (value && typeof value === 'string') {\n let formattedValue = value.replace(/[\\u2018\\u2019]/g, '\\''); // Suppression des \"Curly Quotes\"\n formattedValue = formattedValue.replace(/&/g, ''); // Suppression des &\n formattedValue = formattedValue.replace(/!/g, ''); // Suppression des !\n formattedValue = formattedValue.replace(/[\\t]/g, ''); // Suppression des tabulations\n formattedValue = formattedValue.replace(/`/g, '\\''); // Suppression des `\n formattedValue = formattedValue.replace(/\"/g, ''); // Suppression des \"\n formattedValue = formattedValue.replace(/^ */, ''); // Suppression des espaces de début\n formattedValue = formattedValue.replace(/ *$/, ''); // Suppression des espaces de fin\n if (length) formattedValue = formattedValue.slice(0, length);\n return formattedValue;\n }\n return null;\n}"],"mappings":";;;;;QAIgBA,wBAAwB,GAAxBA,wBAAwB;AAAAC,OAAA,CAgBxBC,mBAAmB,GAAnBA,mBAAmB;AAAAD,OAAA,CAInBE,2BAA2B,GAA3BA,2BAA2B;AAAAF,OAAA,
|
|
1
|
+
{"version":3,"file":"utils.js","names":["getAmountByAccountNumber","exports","setZeroIfIsNegative","getTaxAmountByAccountNumber","textFormatting","_lodash","require","_Vat","accountingEntries","accountsNumber","precision","isAbs","accountingEntriesUniq","_uniqBy","result","_round","reduce","acc","accountingEntry","accTmp","some","number","account","toString","startsWith","debit","credit","Math","abs","value","logging","console","log","_b","_a","Object","values","Vat","find","v","id","idVat","length","formattedValue","replace","slice"],"sources":["../../../ts/utils/vat/utils.ts"],"sourcesContent":["import { round as _round, uniqBy as _uniqBy } from 'lodash';\nimport { IAccountingEntry } from '../../types/Interface/models/IAccountingEntry';\nimport { Vat } from '../../types/Enum/Vat';\n\nexport function getAmountByAccountNumber(accountingEntries: IAccountingEntry[], accountsNumber: string[], precision = 0, isAbs = false): number {\n const accountingEntriesUniq = _uniqBy(accountingEntries, 'id');\n const result = _round(accountingEntriesUniq.reduce((acc, accountingEntry) => {\n let accTmp = acc;\n accountsNumber.some((number) => {\n if (accountingEntry.account && accountingEntry.account.number && accountingEntry.account.number.toString().startsWith(number)) {\n accTmp += accountingEntry.debit - accountingEntry.credit;\n return true;\n }\n return false;\n });\n return accTmp;\n }, 0), precision);\n return isAbs ? Math.abs(result) : result;\n}\n\nexport function setZeroIfIsNegative(value: number): number {\n return value < 0 ? 0 : value;\n}\n\nexport function getTaxAmountByAccountNumber(accountingEntries: IAccountingEntry[], accountsNumber: string[], precision = 0, logging = false): number {\n const accountingEntriesUniq = _uniqBy(accountingEntries, 'id');\n return _round(accountingEntriesUniq.reduce((acc, accountingEntry) => {\n let accTmp = acc;\n accountsNumber.some((number) => {\n if (accountingEntry.account && accountingEntry.account.number && accountingEntry.account.number.toString().startsWith(number)) {\n\n // eslint-disable-next-line no-console\n if (logging) console.log('\\'\\'');\n // eslint-disable-next-line no-console\n if (logging) console.log(accountingEntry);\n\n accTmp += ((accountingEntry.debit - accountingEntry.credit) * (((Object.values(Vat).find((v) => v.id === accountingEntry.idVat)?.value ?? 0) / 100)));\n return true;\n }\n return false;\n });\n return accTmp;\n }, precision));\n}\n\nexport function textFormatting(value: any, length: number | null = null): string | null {\n if (value && typeof value === 'string') {\n let formattedValue = value.replace(/[\\u2018\\u2019]/g, '\\''); // Suppression des \"Curly Quotes\"\n formattedValue = formattedValue.replace(/&/g, ''); // Suppression des &\n formattedValue = formattedValue.replace(/!/g, ''); // Suppression des !\n formattedValue = formattedValue.replace(/[\\t]/g, ''); // Suppression des tabulations\n formattedValue = formattedValue.replace(/`/g, '\\''); // Suppression des `\n formattedValue = formattedValue.replace(/\"/g, ''); // Suppression des \"\n formattedValue = formattedValue.replace(/^ */, ''); // Suppression des espaces de début\n formattedValue = formattedValue.replace(/ *$/, ''); // Suppression des espaces de fin\n formattedValue = formattedValue.replace(/€/g, 'EUR');\n if (length) formattedValue = formattedValue.slice(0, length);\n return formattedValue;\n }\n return null;\n}"],"mappings":";;;;;QAIgBA,wBAAwB,GAAxBA,wBAAwB;AAAAC,OAAA,CAgBxBC,mBAAmB,GAAnBA,mBAAmB;AAAAD,OAAA,CAInBE,2BAA2B,GAA3BA,2BAA2B;AAAAF,OAAA,CAqB3BG,cAAc,GAAdA,cAAc;AA7C9B,IAAAC,OAAA,GAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAD,OAAA;AAEM,SAAUN,wBAAwBA,CAACQ,iBAAqC,EAAEC,cAAwB,EAAEC,SAAS,GAAG,CAAC,EAAEC,KAAK,GAAG,KAAK;EACpI,MAAMC,qBAAqB,GAAG,IAAAC,cAAO,EAACL,iBAAiB,EAAE,IAAI,CAAC;EAC9D,MAAMM,MAAM,GAAG,IAAAC,aAAM,EAACH,qBAAqB,CAACI,MAAM,CAAC,CAACC,GAAG,EAAEC,eAAe,KAAI;IAC1E,IAAIC,MAAM,GAAGF,GAAG;IAChBR,cAAc,CAACW,IAAI,CAAEC,MAAM,IAAI;MAC7B,IAAIH,eAAe,CAACI,OAAO,IAAIJ,eAAe,CAACI,OAAO,CAACD,MAAM,IAAIH,eAAe,CAACI,OAAO,CAACD,MAAM,CAACE,QAAQ,EAAE,CAAC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,IAAI;AACb"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.78",
|
|
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",
|
|
@@ -13,6 +13,10 @@ export class SocietyConfigBalanceSheet extends Resource {
|
|
|
13
13
|
return this.axios.$post(`/societies/${id}/balance-sheets/${idBalanceSheet}/settings`, payload);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
updateOrCreateSample(id: number, payload: ISocietyConfigBalanceSheet): Promise<ISocietyConfigBalanceSheet> {
|
|
17
|
+
return this.axios.$post(`/societies/${id}/asked-documents/settings`, payload);
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
public getAll(id: number, params: QueryGetAllSocietyConfigBalanceSheet): Promise<SocietyConfigBalanceSheet[]> {
|
|
17
21
|
return this.axios.$get(`/societies/${id}/balance-sheets/settings/list`, { params });
|
|
18
22
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Account } from './Account';
|
|
2
|
+
|
|
1
3
|
export enum Activity {
|
|
2
4
|
PRESTA_SERVICE = 1,
|
|
3
5
|
COMMERCANT = 2,
|
|
@@ -17,49 +19,61 @@ export const ActivityDetail = {
|
|
|
17
19
|
PRESTA_SERVICE: {
|
|
18
20
|
id: Activity.PRESTA_SERVICE,
|
|
19
21
|
name: 'Prestations de service',
|
|
22
|
+
salesAccountByDefault: Account.SERVICE.id,
|
|
20
23
|
},
|
|
21
24
|
COMMERCANT: {
|
|
22
25
|
id: Activity.COMMERCANT,
|
|
23
26
|
name: 'Commerce',
|
|
27
|
+
salesAccountByDefault: Account.MERCHANDISE.id,
|
|
24
28
|
},
|
|
25
29
|
PROF_LIB: {
|
|
26
30
|
id: Activity.PROF_LIB,
|
|
27
31
|
name: 'Service à la personne',
|
|
32
|
+
salesAccountByDefault: Account.SERVICE.id,
|
|
28
33
|
},
|
|
29
34
|
AUTRES: {
|
|
30
35
|
id: Activity.AUTRES,
|
|
31
36
|
name: 'Autre',
|
|
37
|
+
salesAccountByDefault: Account.SERVICE.id,
|
|
32
38
|
},
|
|
33
39
|
AGRICOLE: {
|
|
34
40
|
id: Activity.AGRICOLE,
|
|
35
41
|
name: 'Agriculture',
|
|
42
|
+
salesAccountByDefault: Account.PRODUCTION.id,
|
|
36
43
|
},
|
|
37
44
|
INFORMATIQUE: {
|
|
38
45
|
id: Activity.INFORMATIQUE,
|
|
39
46
|
name: 'Informatique',
|
|
47
|
+
salesAccountByDefault: Account.SERVICE.id,
|
|
40
48
|
},
|
|
41
49
|
CONSEIL: {
|
|
42
50
|
id: Activity.CONSEIL,
|
|
43
51
|
name: 'Conseils',
|
|
52
|
+
salesAccountByDefault: Account.SERVICE.id,
|
|
44
53
|
},
|
|
45
54
|
ART: {
|
|
46
55
|
id: Activity.ART,
|
|
47
56
|
name: 'Arts',
|
|
57
|
+
salesAccountByDefault: Account.PRODUCTION.id,
|
|
48
58
|
},
|
|
49
59
|
RESTAURATION: {
|
|
50
60
|
id: Activity.RESTAURATION,
|
|
51
61
|
name: 'Restauration',
|
|
62
|
+
salesAccountByDefault: Account.PRODUCTION.id,
|
|
52
63
|
},
|
|
53
64
|
TRANSPORT: {
|
|
54
65
|
id: Activity.TRANSPORT,
|
|
55
66
|
name: 'Transports',
|
|
67
|
+
salesAccountByDefault: Account.SERVICE.id,
|
|
56
68
|
},
|
|
57
69
|
BTP: {
|
|
58
70
|
id: Activity.BTP,
|
|
59
71
|
name: 'BTP & Artisans',
|
|
72
|
+
salesAccountByDefault: Account.SERVICE.id,
|
|
60
73
|
},
|
|
61
74
|
MEDICAL: {
|
|
62
75
|
id: Activity.MEDICAL,
|
|
63
76
|
name: 'Médical',
|
|
77
|
+
salesAccountByDefault: Account.SERVICE.id,
|
|
64
78
|
},
|
|
65
79
|
};
|
|
@@ -171,4 +171,42 @@ export const DepositDocumentType = [
|
|
|
171
171
|
},
|
|
172
172
|
],
|
|
173
173
|
},
|
|
174
|
-
];
|
|
174
|
+
];
|
|
175
|
+
|
|
176
|
+
export const JuridicalDepositDocumentType = [
|
|
177
|
+
{
|
|
178
|
+
id: TypeFile.IDENTITY_CARD_RECTO,
|
|
179
|
+
name: 'Justificatif d’identité recto',
|
|
180
|
+
idGedFolder: GedFolder.FORMALISM,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: TypeFile.IDENTITY_CARD_VERSO,
|
|
184
|
+
name: 'Justificatif d’identité verso',
|
|
185
|
+
idGedFolder: GedFolder.FORMALISM,
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: TypeFile.RESIDENCE_CERTIFICATE,
|
|
189
|
+
name: 'Attestation domicile',
|
|
190
|
+
idGedFolder: GedFolder.FORMALISM,
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: TypeFile.NO_CONDEMNATION,
|
|
194
|
+
name: 'Attestation non condamnation',
|
|
195
|
+
idGedFolder: GedFolder.JURIDICAL,
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
id: TypeFile.CAPITAL_DEPOSIT,
|
|
199
|
+
name: 'Attestation dépôt de capital',
|
|
200
|
+
idGedFolder: GedFolder.JURIDICAL,
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
id: TypeFile.DOMICILIATION,
|
|
204
|
+
name: 'Contrat domiciliation',
|
|
205
|
+
idGedFolder: GedFolder.FORMALISM,
|
|
206
|
+
},
|
|
207
|
+
];
|
|
208
|
+
|
|
209
|
+
export enum DocumentConfigurationType {
|
|
210
|
+
BALANCESHEET = 1,
|
|
211
|
+
JURIDICAL = 2,
|
|
212
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export const FollowList = {
|
|
2
|
+
FAILED_CALL: {
|
|
3
|
+
id: 1,
|
|
4
|
+
name: 'Echec appel',
|
|
5
|
+
color: 'teal lighten-4',
|
|
6
|
+
},
|
|
7
|
+
NOT_SUBSCRIBED: {
|
|
8
|
+
id: 2,
|
|
9
|
+
name: 'Non souscris/abandon',
|
|
10
|
+
color: 'red lighten-4',
|
|
11
|
+
},
|
|
12
|
+
FAKE_CONTACT: {
|
|
13
|
+
id: 3,
|
|
14
|
+
name: 'Faux contact',
|
|
15
|
+
color: 'red lighten-4',
|
|
16
|
+
},
|
|
17
|
+
THROW_BACK: {
|
|
18
|
+
id: 4,
|
|
19
|
+
name: 'A relancer',
|
|
20
|
+
color: 'blue lighten-4',
|
|
21
|
+
},
|
|
22
|
+
PROMISE_CONTRACT: {
|
|
23
|
+
id: 5,
|
|
24
|
+
name: 'Promesse contrat',
|
|
25
|
+
color: 'green lighten-4',
|
|
26
|
+
},
|
|
27
|
+
NO_ANSWER: {
|
|
28
|
+
id: 6,
|
|
29
|
+
name: 'Ne répond pas/à relancer',
|
|
30
|
+
color: 'purple lighten-4',
|
|
31
|
+
},
|
|
32
|
+
ECDS: {
|
|
33
|
+
id: 7,
|
|
34
|
+
name: 'ECDS',
|
|
35
|
+
color: 'green lighten-4',
|
|
36
|
+
},
|
|
37
|
+
SUBSCRIBE: {
|
|
38
|
+
id: 8,
|
|
39
|
+
name: 'Souscris',
|
|
40
|
+
color: 'green lighten-4',
|
|
41
|
+
},
|
|
42
|
+
OTHER: {
|
|
43
|
+
id: 9,
|
|
44
|
+
name: 'Autre',
|
|
45
|
+
color: 'lime lighten-4',
|
|
46
|
+
},
|
|
47
|
+
TO_REMIND: {
|
|
48
|
+
id: 10,
|
|
49
|
+
name: 'A rappeler pour une souscription',
|
|
50
|
+
color: 'lightskyblue',
|
|
51
|
+
},
|
|
52
|
+
PRESTA_COMPL: {
|
|
53
|
+
id: 11,
|
|
54
|
+
name: 'Prestation Complémentaire',
|
|
55
|
+
color: 'white',
|
|
56
|
+
},
|
|
57
|
+
RELOAD_1: {
|
|
58
|
+
id: 12,
|
|
59
|
+
name: 'Relance 1',
|
|
60
|
+
color: 'pink',
|
|
61
|
+
},
|
|
62
|
+
RELOAD_2: {
|
|
63
|
+
id: 13,
|
|
64
|
+
name: 'Relance 2',
|
|
65
|
+
color: 'pink lighten-1',
|
|
66
|
+
},
|
|
67
|
+
RELOAD_3: {
|
|
68
|
+
id: 14,
|
|
69
|
+
name: 'Relance 3',
|
|
70
|
+
color: 'pink lighten-2',
|
|
71
|
+
},
|
|
72
|
+
RELOAD_4: {
|
|
73
|
+
id: 15,
|
|
74
|
+
name: 'Relance 4',
|
|
75
|
+
color: 'pink lighten-3',
|
|
76
|
+
},
|
|
77
|
+
RELOAD_5: {
|
|
78
|
+
id: 16,
|
|
79
|
+
name: 'Relance 5',
|
|
80
|
+
color: 'pink lighten-4',
|
|
81
|
+
},
|
|
82
|
+
NRP: {
|
|
83
|
+
id: 17,
|
|
84
|
+
name: 'NRP Constitution',
|
|
85
|
+
color: 'purple lighten-3',
|
|
86
|
+
},
|
|
87
|
+
CONSTITUTION_ANSWER: {
|
|
88
|
+
id: 18,
|
|
89
|
+
name: 'Répondu Constitution',
|
|
90
|
+
color: 'green lighten-3',
|
|
91
|
+
},
|
|
92
|
+
RDV_PROGRAM: {
|
|
93
|
+
id: 19,
|
|
94
|
+
name: 'RDV programmé',
|
|
95
|
+
color: 'orange lighten-1',
|
|
96
|
+
},
|
|
97
|
+
};
|
package/ts/types/Enum/Ged.ts
CHANGED
|
@@ -77,6 +77,16 @@ export enum TypeFile {
|
|
|
77
77
|
FUND_TO_SIGN = 26,
|
|
78
78
|
SUPPLIER_BOOK_TO_SIGN = 27,
|
|
79
79
|
CLIENT_BOOK_TO_SIGN = 28,
|
|
80
|
+
STATUTES_PROJECT = 29,
|
|
81
|
+
IDENTITY_CARD_RECTO = 30,
|
|
82
|
+
IDENTITY_CARD_VERSO = 31,
|
|
83
|
+
RESIDENCE_CERTIFICATE = 32,
|
|
84
|
+
NO_CONDEMNATION = 33,
|
|
85
|
+
CAPITAL_DEPOSIT = 34,
|
|
86
|
+
DOMICILIATION = 35,
|
|
87
|
+
DEFINITIVE_STATUTES = 36,
|
|
88
|
+
LEGAL_ANNOUNCEMENT = 37,
|
|
89
|
+
DEPOSIT_GREFFE = 38,
|
|
80
90
|
}
|
|
81
91
|
|
|
82
92
|
export enum GedFileType {
|
|
@@ -130,6 +140,32 @@ export const SignFileDetail = [
|
|
|
130
140
|
},
|
|
131
141
|
];
|
|
132
142
|
|
|
143
|
+
export const JuridicalSignFileDetail = [
|
|
144
|
+
{
|
|
145
|
+
id: TypeFile.STATUTES_PROJECT,
|
|
146
|
+
name: 'Projet de statut',
|
|
147
|
+
idGedFolder: GedFolder.JURIDICAL,
|
|
148
|
+
},
|
|
149
|
+
];
|
|
150
|
+
|
|
151
|
+
export const JuridicalJuristFile = [
|
|
152
|
+
{
|
|
153
|
+
id: TypeFile.DEFINITIVE_STATUTES,
|
|
154
|
+
title: 'Statut définitif',
|
|
155
|
+
idGedFolder: GedFolder.JURIDICAL,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: TypeFile.LEGAL_ANNOUNCEMENT,
|
|
159
|
+
title: 'Attestation annonce légale',
|
|
160
|
+
idGedFolder: GedFolder.LEGAL_ANNOUNCEMENTS,
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: TypeFile.DEPOSIT_GREFFE,
|
|
164
|
+
title: 'Attestation dépôt Greffe',
|
|
165
|
+
idGedFolder: GedFolder.JURIDICAL,
|
|
166
|
+
},
|
|
167
|
+
];
|
|
168
|
+
|
|
133
169
|
export const GedFileTypeDetail = {
|
|
134
170
|
STATUTES: {
|
|
135
171
|
id: GedFileType.STATUTES,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GedFileType } from '../../../Enum/Ged';
|
|
2
2
|
import { IRegulate } from '../../models/IRegulate';
|
|
3
|
+
import { IRegulation } from '../../models/IRegulation';
|
|
3
4
|
import { ISociety } from '../../models/ISociety';
|
|
4
5
|
import { ReadInvalidFieldState } from './ReadSociety';
|
|
5
6
|
|
|
@@ -9,5 +10,6 @@ export interface SocietyWithStatsCaParams extends ISociety {
|
|
|
9
10
|
stateOfProgress?: string,
|
|
10
11
|
isBillingOk?: boolean,
|
|
11
12
|
labAcceptation?: boolean,
|
|
12
|
-
regulates?: IRegulate[]
|
|
13
|
+
regulates?: IRegulate[],
|
|
14
|
+
regulation?: IRegulation
|
|
13
15
|
}
|
package/ts/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
IsOptional, IsString, IsIn, IsInt,
|
|
2
|
+
IsOptional, IsString, IsIn, IsInt, IsEnum,
|
|
3
3
|
} from 'class-validator';
|
|
4
|
-
import { ApiPropertyOptional
|
|
4
|
+
import { ApiPropertyOptional } from '../../../../utils';
|
|
5
|
+
import { DocumentConfigurationType } from '../../../Enum/DepositDocumentType';
|
|
5
6
|
|
|
6
7
|
export class QueryGetAllSocietyConfigBalanceSheet {
|
|
7
|
-
@
|
|
8
|
+
@ApiPropertyOptional()
|
|
8
9
|
@IsInt()
|
|
10
|
+
@IsOptional()
|
|
9
11
|
idBalanceSheet?: number;
|
|
10
12
|
|
|
11
13
|
@ApiPropertyOptional()
|
|
@@ -22,4 +24,9 @@ export class QueryGetAllSocietyConfigBalanceSheet {
|
|
|
22
24
|
})
|
|
23
25
|
@IsIn(['society', 'user'], { each: true })
|
|
24
26
|
include?: string[];
|
|
27
|
+
|
|
28
|
+
@ApiPropertyOptional()
|
|
29
|
+
@IsEnum(DocumentConfigurationType)
|
|
30
|
+
@IsOptional()
|
|
31
|
+
configurationType?: DocumentConfigurationType;
|
|
25
32
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { IFollowList } from './IFollowList';
|
|
2
|
-
|
|
3
1
|
// follows
|
|
4
2
|
export interface IFollow {
|
|
5
3
|
id?: number;
|
|
@@ -12,7 +10,4 @@ export interface IFollow {
|
|
|
12
10
|
idSociety: number;
|
|
13
11
|
createdAt?: Date | null;
|
|
14
12
|
updatedAt?: Date | null;
|
|
15
|
-
|
|
16
|
-
// Associations
|
|
17
|
-
typeFollow: IFollowList;
|
|
18
13
|
}
|
|
@@ -3,7 +3,7 @@ import { IExercice } from './IExercice';
|
|
|
3
3
|
import { IBalanceSheet } from './IBalanceSheet';
|
|
4
4
|
import { ISociety } from './ISociety';
|
|
5
5
|
import { IUser } from './IUser';
|
|
6
|
-
import { StateDepositDocument, StateClientDepositDocument } from '../../Enum/DepositDocumentType';
|
|
6
|
+
import { StateDepositDocument, StateClientDepositDocument, DocumentConfigurationType } from '../../Enum/DepositDocumentType';
|
|
7
7
|
|
|
8
8
|
// societyConfigBalanceSheet
|
|
9
9
|
export interface ISocietyConfigBalanceSheet {
|
|
@@ -13,6 +13,7 @@ export interface ISocietyConfigBalanceSheet {
|
|
|
13
13
|
idSociety: number | null;
|
|
14
14
|
comment: string | null;
|
|
15
15
|
amount: number | null;
|
|
16
|
+
configurationType: DocumentConfigurationType;
|
|
16
17
|
idTypeDocumentsWaiting?: number | null;
|
|
17
18
|
idExercice: number | null;
|
|
18
19
|
idBalanceSheet: number | null;
|
package/ts/types/index.ts
CHANGED
|
@@ -476,6 +476,7 @@ export * from './Enum/Compensation';
|
|
|
476
476
|
export * from './Enum/CashDeskTransactionType';
|
|
477
477
|
export * from './Enum/ThirdParty';
|
|
478
478
|
export * from './Enum/PaymentExpectation';
|
|
479
|
+
export * from './Enum/FollowList';
|
|
479
480
|
|
|
480
481
|
// Interfaces API
|
|
481
482
|
export * from './Interface/api/adjustment/Query';
|
|
@@ -743,6 +744,7 @@ export * from './Interface/api/shopify/InvoicesShopify';
|
|
|
743
744
|
export * from './Interface/api/shopify/line_item';
|
|
744
745
|
export * from './Interface/api/shopify/tax_line';
|
|
745
746
|
export * from './Interface/api/shopify/shipping_line';
|
|
747
|
+
export * from './Interface/api/prestashop/GetPrestashopDataFromJSONOutputParams';
|
|
746
748
|
export * from './Interface/api/prestashop/PSOrder';
|
|
747
749
|
export * from './Interface/api/prestashop/PSAddress';
|
|
748
750
|
export * from './Interface/api/prestashop/PSCountry';
|
package/ts/utils/vat/utils.ts
CHANGED
|
@@ -22,12 +22,18 @@ export function setZeroIfIsNegative(value: number): number {
|
|
|
22
22
|
return value < 0 ? 0 : value;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export function getTaxAmountByAccountNumber(accountingEntries: IAccountingEntry[], accountsNumber: string[], precision = 0): number {
|
|
25
|
+
export function getTaxAmountByAccountNumber(accountingEntries: IAccountingEntry[], accountsNumber: string[], precision = 0, logging = false): number {
|
|
26
26
|
const accountingEntriesUniq = _uniqBy(accountingEntries, 'id');
|
|
27
27
|
return _round(accountingEntriesUniq.reduce((acc, accountingEntry) => {
|
|
28
28
|
let accTmp = acc;
|
|
29
29
|
accountsNumber.some((number) => {
|
|
30
30
|
if (accountingEntry.account && accountingEntry.account.number && accountingEntry.account.number.toString().startsWith(number)) {
|
|
31
|
+
|
|
32
|
+
// eslint-disable-next-line no-console
|
|
33
|
+
if (logging) console.log('\'\'');
|
|
34
|
+
// eslint-disable-next-line no-console
|
|
35
|
+
if (logging) console.log(accountingEntry);
|
|
36
|
+
|
|
31
37
|
accTmp += ((accountingEntry.debit - accountingEntry.credit) * (((Object.values(Vat).find((v) => v.id === accountingEntry.idVat)?.value ?? 0) / 100)));
|
|
32
38
|
return true;
|
|
33
39
|
}
|
|
@@ -47,6 +53,7 @@ export function textFormatting(value: any, length: number | null = null): string
|
|
|
47
53
|
formattedValue = formattedValue.replace(/"/g, ''); // Suppression des "
|
|
48
54
|
formattedValue = formattedValue.replace(/^ */, ''); // Suppression des espaces de début
|
|
49
55
|
formattedValue = formattedValue.replace(/ *$/, ''); // Suppression des espaces de fin
|
|
56
|
+
formattedValue = formattedValue.replace(/€/g, 'EUR');
|
|
50
57
|
if (length) formattedValue = formattedValue.slice(0, length);
|
|
51
58
|
return formattedValue;
|
|
52
59
|
}
|