@silexpert/core 1.0.108 → 1.0.111
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/RevisionGuide.d.ts +3 -3
- package/es/api/resources/RevisionGuide.d.ts.map +1 -1
- package/es/api/resources/RevisionGuide.js +6 -6
- package/es/api/resources/RevisionGuide.js.map +1 -1
- package/es/types/Enum/Activity.d.ts +9 -1
- package/es/types/Enum/Activity.d.ts.map +1 -1
- package/es/types/Enum/Activity.js +8 -0
- package/es/types/Enum/Activity.js.map +1 -1
- package/es/types/Enum/BalanceSheet.d.ts +11 -11
- package/es/types/Enum/BalanceSheet.js +11 -11
- package/es/types/Enum/BalanceSheet.js.map +1 -1
- package/es/types/Enum/GeneralThirdParty.d.ts.map +1 -1
- package/es/types/Enum/GeneralThirdParty.js +0 -1
- package/es/types/Enum/GeneralThirdParty.js.map +1 -1
- package/es/types/Enum/MailDomainType.d.ts +3 -0
- package/es/types/Enum/MailDomainType.d.ts.map +1 -0
- package/es/types/Enum/MailDomainType.js +105 -0
- package/es/types/Enum/MailDomainType.js.map +1 -0
- package/es/types/Interface/api/facturation/CreateRebilling.js +2 -2
- package/es/types/Interface/api/facturation/CreateRebilling.js.map +1 -1
- package/es/types/Interface/api/revisionGuide/CreateRevisionGuide.d.ts +1 -0
- package/es/types/Interface/api/revisionGuide/CreateRevisionGuide.d.ts.map +1 -1
- package/es/types/Interface/api/revisionGuide/CreateRevisionGuide.js +4 -0
- package/es/types/Interface/api/revisionGuide/CreateRevisionGuide.js.map +1 -1
- package/es/types/Interface/models/IExercice.d.ts +2 -2
- package/es/types/Interface/models/IExercice.js.map +1 -1
- package/es/types/Interface/models/IRevisionGuide.d.ts +1 -0
- package/es/types/Interface/models/IRevisionGuide.d.ts.map +1 -1
- package/es/types/Interface/models/IRevisionGuide.js.map +1 -1
- package/es/types/Interface/models/ISociety.d.ts +1 -0
- package/es/types/Interface/models/ISociety.d.ts.map +1 -1
- package/es/types/Interface/models/ISociety.js.map +1 -1
- package/es/types/index.d.ts +1 -0
- package/es/types/index.d.ts.map +1 -1
- package/es/types/index.js +1 -0
- package/es/types/index.js.map +1 -1
- package/es/utils/commercialManagement/document.d.ts +3 -3
- package/es/utils/commercialManagement/document.d.ts.map +1 -1
- package/es/utils/commercialManagement/document.js +6 -6
- package/es/utils/commercialManagement/document.js.map +1 -1
- package/es/utils/commercialManagement/templates/common.js +3 -3
- package/es/utils/commercialManagement/templates/common.js.map +1 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.d.ts.map +1 -1
- package/es/utils/index.js +1 -0
- package/es/utils/index.js.map +1 -1
- package/es/utils/quotation.d.ts +13 -0
- package/es/utils/quotation.d.ts.map +1 -0
- package/es/utils/quotation.js +107 -0
- package/es/utils/quotation.js.map +1 -0
- package/js/api/resources/RevisionGuide.js +6 -6
- package/js/api/resources/RevisionGuide.js.map +1 -1
- package/js/types/Enum/Activity.js +8 -0
- package/js/types/Enum/Activity.js.map +1 -1
- package/js/types/Enum/BalanceSheet.js +11 -11
- package/js/types/Enum/BalanceSheet.js.map +1 -1
- package/js/types/Enum/GeneralThirdParty.js +0 -3
- package/js/types/Enum/GeneralThirdParty.js.map +1 -1
- package/js/types/Enum/MailDomainType.js +8 -0
- package/js/types/Enum/MailDomainType.js.map +1 -0
- package/js/types/Interface/api/facturation/CreateRebilling.js +1 -1
- package/js/types/Interface/api/facturation/CreateRebilling.js.map +1 -1
- package/js/types/Interface/api/revisionGuide/CreateRevisionGuide.js +2 -0
- package/js/types/Interface/api/revisionGuide/CreateRevisionGuide.js.map +1 -1
- package/js/types/index.js +12 -0
- package/js/types/index.js.map +1 -1
- package/js/utils/commercialManagement/document.js +13 -11
- package/js/utils/commercialManagement/document.js.map +1 -1
- package/js/utils/commercialManagement/templates/common.js +3 -3
- package/js/utils/commercialManagement/templates/common.js.map +1 -1
- package/js/utils/index.js +12 -0
- package/js/utils/index.js.map +1 -1
- package/js/utils/quotation.js +137 -0
- package/js/utils/quotation.js.map +1 -0
- package/package.json +1 -1
- package/ts/api/resources/RevisionGuide.ts +6 -6
- package/ts/types/Enum/Activity.ts +8 -0
- package/ts/types/Enum/BalanceSheet.ts +11 -11
- package/ts/types/Enum/GeneralThirdParty.ts +0 -1
- package/ts/types/Enum/MailDomainType.ts +105 -0
- package/ts/types/Interface/api/facturation/CreateRebilling.ts +2 -2
- package/ts/types/Interface/api/revisionGuide/CreateRevisionGuide.ts +3 -0
- package/ts/types/Interface/models/IExercice.ts +2 -2
- package/ts/types/Interface/models/IRevisionGuide.ts +1 -0
- package/ts/types/Interface/models/ISociety.ts +1 -0
- package/ts/types/index.ts +1 -0
- package/ts/utils/commercialManagement/document.ts +8 -9
- package/ts/utils/commercialManagement/templates/common.ts +3 -3
- package/ts/utils/index.ts +2 -1
- package/ts/utils/quotation.ts +125 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getLeadQuotation = getLeadQuotation;
|
|
7
|
+
|
|
8
|
+
var _MailDomainType = require("../types/Enum/MailDomainType");
|
|
9
|
+
|
|
10
|
+
var _Activity = require("../types/Enum/Activity");
|
|
11
|
+
|
|
12
|
+
function getLeadQuotation(params) {
|
|
13
|
+
const {
|
|
14
|
+
firstname,
|
|
15
|
+
lastname,
|
|
16
|
+
phone,
|
|
17
|
+
mail,
|
|
18
|
+
annualTurnover,
|
|
19
|
+
source,
|
|
20
|
+
alreadyExist,
|
|
21
|
+
activitySector
|
|
22
|
+
} = params;
|
|
23
|
+
|
|
24
|
+
if (firstname === 'test' || lastname === 'test' || (mail === null || mail === void 0 ? void 0 : mail.includes('test')) || ['606060606', '707070707', '612345678', '712345678', '687654321', '787654321'].includes(phone)) {
|
|
25
|
+
return 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let quotation = 0;
|
|
29
|
+
/* cotation du prénom */
|
|
30
|
+
|
|
31
|
+
if (firstname) quotation += 5;
|
|
32
|
+
/* cotation du nom */
|
|
33
|
+
|
|
34
|
+
if (lastname) quotation += 5;
|
|
35
|
+
/* cotation du numéro de téléphone */
|
|
36
|
+
|
|
37
|
+
if (['6', '7'].includes(phone.substr(0, 1))) {
|
|
38
|
+
quotation += 15;
|
|
39
|
+
} else {
|
|
40
|
+
quotation += 5;
|
|
41
|
+
}
|
|
42
|
+
/* cotation de l'adresse email */
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
if (_MailDomainType.BasicDomain.find(domain => mail === null || mail === void 0 ? void 0 : mail.includes(domain))) {
|
|
46
|
+
quotation += 5;
|
|
47
|
+
} else if (!_MailDomainType.ForbidenDomain.find(domain => mail === null || mail === void 0 ? void 0 : mail.includes(domain))) {
|
|
48
|
+
quotation += 15;
|
|
49
|
+
}
|
|
50
|
+
/* cotation du CA annuel */
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
if ([0, 150000, 400000, 783000, 783001].includes(annualTurnover)) {
|
|
54
|
+
quotation += 10;
|
|
55
|
+
} else if ([50000, 234000].includes(annualTurnover)) {
|
|
56
|
+
quotation += 5;
|
|
57
|
+
}
|
|
58
|
+
/* cotation de la date d'ajout */
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
if ([1, 2, 3, 4, 5].includes(new Date().getDay())) {
|
|
62
|
+
const dateTime = new Date();
|
|
63
|
+
const year = dateTime.getFullYear();
|
|
64
|
+
const month = dateTime.getMonth();
|
|
65
|
+
const day = dateTime.getDate();
|
|
66
|
+
const startTime = new Date(`${year}-${month + 1}-${day} 08:45:00`);
|
|
67
|
+
const endTime = new Date(`${year}-${month + 1}-${day} 18:45:00`);
|
|
68
|
+
|
|
69
|
+
if (startTime.getTime() <= dateTime.getTime() && endTime.getTime() >= dateTime.getTime()) {
|
|
70
|
+
quotation += 15;
|
|
71
|
+
} else {
|
|
72
|
+
quotation += 5;
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
quotation += 5;
|
|
76
|
+
}
|
|
77
|
+
/* cotation de la source */
|
|
78
|
+
|
|
79
|
+
/* Parrainage */
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
if (source === 49) {
|
|
83
|
+
quotation += 10;
|
|
84
|
+
/* calendly, appel entrant */
|
|
85
|
+
} else if (source === 2) {
|
|
86
|
+
quotation += 8;
|
|
87
|
+
/* adWords, Bing, Formulaire */
|
|
88
|
+
} else if (source === 4) {
|
|
89
|
+
quotation += 6;
|
|
90
|
+
/* Chat, Whatsapp */
|
|
91
|
+
} else if ([29, 92].includes(source)) {
|
|
92
|
+
quotation += 2;
|
|
93
|
+
}
|
|
94
|
+
/* cotation de la qualité (nombre de champs remplis) */
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
const fieldNumber = [firstname, lastname, phone, mail, annualTurnover, activitySector].filter(data => !!data).length;
|
|
98
|
+
|
|
99
|
+
switch (fieldNumber) {
|
|
100
|
+
case 6:
|
|
101
|
+
quotation += 10;
|
|
102
|
+
break;
|
|
103
|
+
|
|
104
|
+
case 5:
|
|
105
|
+
quotation += 8;
|
|
106
|
+
break;
|
|
107
|
+
|
|
108
|
+
case 4:
|
|
109
|
+
quotation += 6;
|
|
110
|
+
break;
|
|
111
|
+
|
|
112
|
+
case 3:
|
|
113
|
+
quotation += 4;
|
|
114
|
+
break;
|
|
115
|
+
|
|
116
|
+
case 2:
|
|
117
|
+
quotation += 2;
|
|
118
|
+
break;
|
|
119
|
+
|
|
120
|
+
default:
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
/* cotation de l'existence du lead (déjà existant ou non) */
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
if (alreadyExist) quotation += 8;
|
|
127
|
+
/* cotation du secteur d'activité */
|
|
128
|
+
|
|
129
|
+
if ([_Activity.Activity.INFORMATIQUE, _Activity.Activity.CONSEIL].includes(activitySector)) {
|
|
130
|
+
quotation += 10;
|
|
131
|
+
} else if ([_Activity.Activity.TRANSPORT, _Activity.Activity.BTP, _Activity.Activity.RESTAURATION, _Activity.Activity.COMMERCANT, _Activity.Activity.MEDICAL, _Activity.Activity.PROF_LIB].includes(activitySector)) {
|
|
132
|
+
quotation += 5;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return quotation;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=quotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quotation.js","mappings":";;;;;QAcgBA,gB,GAAAA,gB;;AAdhB;;AACA;;AAaM,SAAUA,gBAAV,CAA2BC,MAA3B,EAAyD;EAC7D,MAAM;IACJC,SADI;IACOC,QADP;IACiBC,KADjB;IACwBC,IADxB;IAC8BC,cAD9B;IAC8CC,MAD9C;IACsDC,YADtD;IACoEC;EADpE,IAEFR,MAFJ;;EAGA,IACEC,SAAS,KAAK,MAAd,IACGC,QAAQ,KAAK,MADhB,KAEGE,IAAI,SAAJ,QAAI,WAAJ,GAAI,MAAJ,OAAI,CAAEK,QAAN,CAAe,MAAf,CAFH,KAGG,CAAC,WAAD,EAAc,WAAd,EAA2B,WAA3B,EAAwC,WAAxC,EAAqD,WAArD,EAAkE,WAAlE,EAA+EA,QAA/E,CAAwFN,KAAxF,CAJL,EAKE;IACA,OAAO,CAAP;EACD;;EACD,IAAIO,SAAS,GAAG,CAAhB;EAEA;;EACA,IAAIT,SAAJ,EAAeS,SAAS,IAAI,CAAb;EAEf;;EACA,IAAIR,QAAJ,EAAcQ,SAAS,IAAI,CAAb;EAEd;;EACA,IAAI,CAAC,GAAD,EAAM,GAAN,EAAWD,QAAX,CAAoBN,KAAK,CAACQ,MAAN,CAAa,CAAb,EAAgB,CAAhB,CAApB,CAAJ,EAA6C;IAC3CD,SAAS,IAAI,EAAb;EACD,CAFD,MAEO;IACLA,SAAS,IAAI,CAAb;EACD;EAED;;;EACA,IAAIE,4BAAYC,IAAZ,CAAkBC,MAAD,IAAYV,IAAI,SAAJ,QAAI,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AAqBH,mBAASI,GAA9B,EAAmCJ,mBAASK,YAA5C,EAA0DL,mBAASM,UAAnE,EAA+EN,mBAASO,OAAxF,EAAiGP,mBAASQ,QAA1G,EAAoH/B,QAApH,CAA6HD,cAA7H,CAAJ,EAAkJ;IACvJE,SAAS,IAAI,CAAb;EACD;;EAED,OAAOA,SAAP;AACD","names":["getLeadQuotation","params","firstname","lastname","phone","mail","annualTurnover","source","alreadyExist","activitySector","includes","quotation","substr","BasicDomain","find","domain","ForbidenDomain","Date","getDay","dateTime","year","getFullYear","month","getMonth","day","getDate","startTime","endTime","getTime","fieldNumber","filter","data","length","Activity","INFORMATIQUE","CONSEIL","TRANSPORT","BTP","RESTAURATION","COMMERCANT","MEDICAL","PROF_LIB"],"sourceRoot":"","sources":["../../ts/utils/quotation.ts"],"sourcesContent":["import { ForbidenDomain, BasicDomain } from '../types/Enum/MailDomainType';\nimport { Activity } from '../types/Enum/Activity';\n\ntype getLeadQuotationParams = {\n firstname: string,\n lastname: string,\n phone: string,\n mail: string,\n annualTurnover: number,\n source: number,\n alreadyExist: boolean,\n activitySector: number,\n};\n\nexport function getLeadQuotation(params: getLeadQuotationParams):number {\n const {\n firstname, lastname, phone, mail, annualTurnover, source, alreadyExist, activitySector,\n } = params;\n if (\n firstname === 'test'\n || lastname === 'test'\n || mail?.includes('test')\n || ['606060606', '707070707', '612345678', '712345678', '687654321', '787654321'].includes(phone)\n ) {\n return 0;\n }\n let quotation = 0;\n\n /* cotation du prénom */\n if (firstname) quotation += 5;\n\n /* cotation du nom */\n if (lastname) quotation += 5;\n\n /* cotation du numéro de téléphone */\n if (['6', '7'].includes(phone.substr(0, 1))) {\n quotation += 15;\n } else {\n quotation += 5;\n }\n\n /* cotation de l'adresse email */\n if (BasicDomain.find((domain) => mail?.includes(domain))) {\n quotation += 5;\n } else\n if (!ForbidenDomain.find((domain) => mail?.includes(domain))) {\n quotation += 15;\n }\n\n /* cotation du CA annuel */\n if ([0, 150000, 400000, 783000, 783001].includes(annualTurnover)) {\n quotation += 10;\n } else if ([50000, 234000].includes(annualTurnover)) {\n quotation += 5;\n }\n\n /* cotation de la date d'ajout */\n if ([1, 2, 3, 4, 5].includes(new Date().getDay())) {\n const dateTime = new Date();\n const year = dateTime.getFullYear();\n const month = dateTime.getMonth();\n const day = dateTime.getDate();\n const startTime = new Date(`${year}-${month + 1}-${day} 08:45:00`);\n const endTime = new Date(`${year}-${month + 1}-${day} 18:45:00`);\n if ((startTime.getTime() <= dateTime.getTime()) && (endTime.getTime() >= dateTime.getTime())) {\n quotation += 15;\n } else {\n quotation += 5;\n }\n } else {\n quotation += 5;\n }\n\n /* cotation de la source */\n /* Parrainage */\n if (source === 49) {\n quotation += 10;\n\n /* calendly, appel entrant */\n } else if (source === 2) {\n quotation += 8;\n\n /* adWords, Bing, Formulaire */\n } else if (source === 4) {\n quotation += 6;\n\n /* Chat, Whatsapp */\n } else if ([29, 92].includes(source)) {\n quotation += 2;\n }\n\n /* cotation de la qualité (nombre de champs remplis) */\n const fieldNumber = [firstname, lastname, phone, mail, annualTurnover, activitySector].filter((data) => !!data).length;\n switch (fieldNumber) {\n case 6:\n quotation += 10;\n break;\n case 5:\n quotation += 8;\n break;\n case 4:\n quotation += 6;\n break;\n case 3:\n quotation += 4;\n break;\n case 2:\n quotation += 2;\n break;\n default:\n break;\n }\n\n /* cotation de l'existence du lead (déjà existant ou non) */\n if (alreadyExist) quotation += 8;\n\n /* cotation du secteur d'activité */\n if ([Activity.INFORMATIQUE, Activity.CONSEIL].includes(activitySector)) {\n quotation += 10;\n } else if ([Activity.TRANSPORT, Activity.BTP, Activity.RESTAURATION, Activity.COMMERCANT, Activity.MEDICAL, Activity.PROF_LIB].includes(activitySector)) {\n quotation += 5;\n }\n\n return quotation;\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.111",
|
|
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",
|
|
@@ -2,15 +2,15 @@ import { Resource } from '../Resource';
|
|
|
2
2
|
import { CreateRevisionGuide, IRevisionGuide } from '../../types';
|
|
3
3
|
|
|
4
4
|
export class RevisionGuide extends Resource {
|
|
5
|
-
getAll(
|
|
6
|
-
return this.axios.$get(`/
|
|
5
|
+
getAll(idBalanceSheet: number): Promise<IRevisionGuide[]> {
|
|
6
|
+
return this.axios.$get(`/balancesheet/${idBalanceSheet}/revisionGuide`);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
updateOrCreate(
|
|
10
|
-
return this.axios.$post(`/
|
|
9
|
+
updateOrCreate(idBalanceSheet: number, payload: CreateRevisionGuide[]): Promise<IRevisionGuide[]> {
|
|
10
|
+
return this.axios.$post(`/balancesheet/${idBalanceSheet}/revisionGuide`, payload);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
generateFile(
|
|
14
|
-
return this.axios.$post(`/
|
|
13
|
+
generateFile(idBalanceSheet: number): Promise<IRevisionGuide[]> {
|
|
14
|
+
return this.axios.$post(`/balancesheet/${idBalanceSheet}/revisionGuide/file`);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -28,7 +28,7 @@ export const BalanceSheetDetails = [
|
|
|
28
28
|
text: 'À faire',
|
|
29
29
|
color: 'grey',
|
|
30
30
|
textColor: 'grey--text',
|
|
31
|
-
forRoles: [['front_office'], ['expert'], ['customer_success']],
|
|
31
|
+
forRoles: [['front_office', 'front_office_express'], ['expert'], ['customer_success']],
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
text: 'En cours de prod.',
|
|
@@ -36,7 +36,7 @@ export const BalanceSheetDetails = [
|
|
|
36
36
|
alias: 'ENC',
|
|
37
37
|
color: 'grey',
|
|
38
38
|
textColor: 'grey--text ',
|
|
39
|
-
forRoles: [['front_office'], ['expert']],
|
|
39
|
+
forRoles: [['front_office', 'front_office_express'], ['expert']],
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
text: 'Att. retour client',
|
|
@@ -44,14 +44,14 @@ export const BalanceSheetDetails = [
|
|
|
44
44
|
alias: 'ARC',
|
|
45
45
|
color: 'cyan',
|
|
46
46
|
textColor: 'cyan--text',
|
|
47
|
-
forRoles: [['front_office'], ['expert']],
|
|
47
|
+
forRoles: [['front_office', 'front_office_express'], ['expert']],
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
text: 'À réviser',
|
|
51
51
|
value: BalanceSheetState.TO_REVISE,
|
|
52
52
|
color: 'purple lighten-2',
|
|
53
53
|
textColor: 'purple--text',
|
|
54
|
-
forRoles: [['front_office'], ['expert']],
|
|
54
|
+
forRoles: [['front_office', 'front_office_express'], ['expert']],
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
text: 'À revoir',
|
|
@@ -66,7 +66,7 @@ export const BalanceSheetDetails = [
|
|
|
66
66
|
value: BalanceSheetState.TO_SUPERVISE,
|
|
67
67
|
color: 'teal',
|
|
68
68
|
textColor: 'teal--text',
|
|
69
|
-
forRoles: [['front_office'], ['expert']],
|
|
69
|
+
forRoles: [['front_office', 'front_office_express'], ['expert']],
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
text: 'À envoyer',
|
|
@@ -80,7 +80,7 @@ export const BalanceSheetDetails = [
|
|
|
80
80
|
value: BalanceSheetState.SENDED_TO_CLIENT,
|
|
81
81
|
color: 'blue',
|
|
82
82
|
textColor: 'blue--text',
|
|
83
|
-
forRoles: [['front_office'], ['expert']],
|
|
83
|
+
forRoles: [['front_office', 'front_office_express'], ['expert']],
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
text: 'Accepté par client',
|
|
@@ -88,35 +88,35 @@ export const BalanceSheetDetails = [
|
|
|
88
88
|
color: 'blue darken-2',
|
|
89
89
|
textColor: 'blue--text ',
|
|
90
90
|
alias: 'APC',
|
|
91
|
-
forRoles: [['front_office'], ['expert']],
|
|
91
|
+
forRoles: [['front_office', 'front_office_express'], ['expert']],
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
text: 'Envoyé au SIE',
|
|
95
95
|
value: BalanceSheetState.SENDED_TO_SIE,
|
|
96
96
|
color: 'blue darken-4',
|
|
97
97
|
textColor: 'blue--text',
|
|
98
|
-
forRoles: [['front_office'], ['expert']],
|
|
98
|
+
forRoles: [['front_office', 'front_office_express'], ['expert']],
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
value: BalanceSheetState.ACCEPTED_BY_SIE,
|
|
102
102
|
text: 'Accepté au SIE',
|
|
103
103
|
color: 'grey darken-1',
|
|
104
104
|
textColor: 'green--text',
|
|
105
|
-
forRoles: [['front_office'], ['expert']],
|
|
105
|
+
forRoles: [['front_office', 'front_office_express'], ['expert']],
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
108
|
text: 'Refus SIE',
|
|
109
109
|
value: BalanceSheetState.REFUSED_BY_SIE,
|
|
110
110
|
color: 'red darken-3',
|
|
111
111
|
textColor: 'green--text ',
|
|
112
|
-
forRoles: [['front_office'], ['expert']],
|
|
112
|
+
forRoles: [['front_office', 'front_office_express'], ['expert']],
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
text: 'Envoi provisoire SIE',
|
|
116
116
|
value: BalanceSheetState.SENDED_PROVISIONALLY_TO_SIE,
|
|
117
117
|
color: 'green darken-4',
|
|
118
118
|
textColor: 'green--text ',
|
|
119
|
-
forRoles: [['front_office'], ['expert']],
|
|
119
|
+
forRoles: [['front_office', 'front_office_express'], ['expert']],
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
value: BalanceSheetState.NOT_SUBJECT_TO,
|
|
@@ -88,7 +88,6 @@ export const generalThirdParties: GeneralThirdParty[] = [
|
|
|
88
88
|
{ company: 'ELECTRO DEPOT', idAccount: 24 },
|
|
89
89
|
{ company: 'UBER', idAccount: 58383 },
|
|
90
90
|
{ company: 'DELIVEROO', idAccount: 117 },
|
|
91
|
-
{ company: 'PROMOCASH', idAccount: 58357 },
|
|
92
91
|
{ company: 'LYRECO', idAccount: 25 },
|
|
93
92
|
{ company: 'YZICO', idAccount: 104 },
|
|
94
93
|
{ company: 'AXA', idAccount: 27292 },
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export const ForbidenDomain = [
|
|
2
|
+
'@test.fr',
|
|
3
|
+
'@test.com',
|
|
4
|
+
'@yopmail.com',
|
|
5
|
+
'@yopmail.fr',
|
|
6
|
+
'@armyspy.com',
|
|
7
|
+
'@cuvox.de',
|
|
8
|
+
'@dayrep.com',
|
|
9
|
+
'@einrot.com',
|
|
10
|
+
'@fleckens.com',
|
|
11
|
+
'@gustr.com',
|
|
12
|
+
'@jourrapide.com',
|
|
13
|
+
'@rhyta.com',
|
|
14
|
+
'@superrito.com',
|
|
15
|
+
'@teleworm.us',
|
|
16
|
+
'@nedoz.com',
|
|
17
|
+
'@wimsg.com',
|
|
18
|
+
'@tzymail.com',
|
|
19
|
+
'@firemailbox.club',
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
export const BasicDomain = [
|
|
23
|
+
'@gmail.com',
|
|
24
|
+
'@yahoo.com',
|
|
25
|
+
'@outlook.com',
|
|
26
|
+
'@aol.com',
|
|
27
|
+
'@mail.com',
|
|
28
|
+
'@yandex.com',
|
|
29
|
+
'@protonmail.com',
|
|
30
|
+
'@icloud.com',
|
|
31
|
+
'@zoho.com',
|
|
32
|
+
'@gmx.com',
|
|
33
|
+
'@qq.com',
|
|
34
|
+
'@163.com',
|
|
35
|
+
'@sina.com',
|
|
36
|
+
'@hotmail.com',
|
|
37
|
+
'@rediffmail.com',
|
|
38
|
+
'@live.com',
|
|
39
|
+
'@naver.com',
|
|
40
|
+
'@daum.net',
|
|
41
|
+
'@hanmail.net',
|
|
42
|
+
'@walla.co',
|
|
43
|
+
'@yahoo.co',
|
|
44
|
+
'@mail.ru',
|
|
45
|
+
'@t-online.de',
|
|
46
|
+
'@web.de',
|
|
47
|
+
'@gmx.net',
|
|
48
|
+
'@yahoo.de',
|
|
49
|
+
'@outlook.es',
|
|
50
|
+
'@live.co',
|
|
51
|
+
'@libero.it',
|
|
52
|
+
'@virgilio.it',
|
|
53
|
+
'@alice.it',
|
|
54
|
+
'@tin.it',
|
|
55
|
+
'@indiatimes.com',
|
|
56
|
+
'@bigpond.com',
|
|
57
|
+
'@orange.fr',
|
|
58
|
+
'@free.fr',
|
|
59
|
+
'@laposte.net',
|
|
60
|
+
'@wanadoo.fr',
|
|
61
|
+
'@rocketmail.com',
|
|
62
|
+
'@aim.com',
|
|
63
|
+
'@inbox.com',
|
|
64
|
+
'@netscape.net',
|
|
65
|
+
'@uol.com',
|
|
66
|
+
'@bol.com',
|
|
67
|
+
'@ig.com',
|
|
68
|
+
'@outlook.com',
|
|
69
|
+
'@icloud.com',
|
|
70
|
+
'@bigpond.net',
|
|
71
|
+
'@mail.bg',
|
|
72
|
+
'@post.cz',
|
|
73
|
+
'@seznam.cz',
|
|
74
|
+
'@gmail.ru',
|
|
75
|
+
'@tut.by',
|
|
76
|
+
'@bk.ru',
|
|
77
|
+
'@list.ru',
|
|
78
|
+
'@mail.kz',
|
|
79
|
+
'@yahoo.es',
|
|
80
|
+
'@yahoo.fr',
|
|
81
|
+
'@yahoo.it',
|
|
82
|
+
'@outlook.in',
|
|
83
|
+
'@outlook.com',
|
|
84
|
+
'@hotmail.es',
|
|
85
|
+
'@hotmail.fr',
|
|
86
|
+
'@hotmail.it',
|
|
87
|
+
'@hotmail.de',
|
|
88
|
+
'@hotmail.com',
|
|
89
|
+
'@hotmail.sg',
|
|
90
|
+
'@hotmail.be',
|
|
91
|
+
'@hotmail.cl',
|
|
92
|
+
'@hotmail.co',
|
|
93
|
+
'@hotmail.pt',
|
|
94
|
+
'@hotmail.gr',
|
|
95
|
+
'@hotmail.cz',
|
|
96
|
+
'@hotmail.ch',
|
|
97
|
+
'@hotmail.ru',
|
|
98
|
+
'@hotmail.hu',
|
|
99
|
+
'@hotmail.ro',
|
|
100
|
+
'@hotmail.sk',
|
|
101
|
+
'@hotmail.no',
|
|
102
|
+
'@hotmail.dk',
|
|
103
|
+
'@hotmail.fi',
|
|
104
|
+
'@hotmail.ie',
|
|
105
|
+
];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
IsBoolean, IsInt,
|
|
2
|
+
IsBoolean, IsInt, IsOptional, IsString,
|
|
3
3
|
} from 'class-validator';
|
|
4
4
|
import { ApiProperty, ApiPropertyOptional } from '../../../..';
|
|
5
5
|
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
@@ -17,7 +17,7 @@ export class CreateRebilling {
|
|
|
17
17
|
hasToBeAccruals?: string;
|
|
18
18
|
|
|
19
19
|
@ApiProperty()
|
|
20
|
-
@
|
|
20
|
+
@IsInt()
|
|
21
21
|
turnoverMax: number;
|
|
22
22
|
|
|
23
23
|
@ApiProperty()
|
|
@@ -16,7 +16,7 @@ export interface IExercice {
|
|
|
16
16
|
id?: number;
|
|
17
17
|
startDate: Date | null;
|
|
18
18
|
endDate: Date | null;
|
|
19
|
-
turnover?:
|
|
19
|
+
turnover?: number | null;
|
|
20
20
|
invoicePurchase?: number | null;
|
|
21
21
|
invoiceSales?: number | null;
|
|
22
22
|
isBack: boolean;
|
|
@@ -32,7 +32,7 @@ export interface IExercice {
|
|
|
32
32
|
labKeeping: number;
|
|
33
33
|
receiptJeDeclare: boolean;
|
|
34
34
|
annualFolderEdition: boolean;
|
|
35
|
-
turnoverDone:
|
|
35
|
+
turnoverDone: number;
|
|
36
36
|
turnoverMax?: number;
|
|
37
37
|
processClossingExercice: boolean;
|
|
38
38
|
idFilePaymentSchedule?: number | null;
|
|
@@ -101,6 +101,7 @@ export interface ISociety {
|
|
|
101
101
|
dateRelanceCommercial: Date | null;
|
|
102
102
|
firstPayslipDate: Date | null;
|
|
103
103
|
totalSharesHeld: number | null;
|
|
104
|
+
leadQuotation: number | null;
|
|
104
105
|
idVatRegime: number | null;
|
|
105
106
|
idTaxSystem: number | null;
|
|
106
107
|
idActivity: number | null;
|
package/ts/types/index.ts
CHANGED
|
@@ -466,6 +466,7 @@ export * from './Enum/StatusSignature';
|
|
|
466
466
|
export * from './Enum/BankCollectingState';
|
|
467
467
|
export * from './Enum/Phone';
|
|
468
468
|
export * from './Enum/GeneralThirdParty';
|
|
469
|
+
export * from './Enum/MailDomainType';
|
|
469
470
|
|
|
470
471
|
// Interfaces API
|
|
471
472
|
export * from './Interface/api/partnerTransactionType/ReadPartnerTransactionType';
|
|
@@ -31,7 +31,7 @@ type brandColorType = {
|
|
|
31
31
|
primary700: string
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
export function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoiceType, payload: CreateInvoiceDocument | CreatePreSaleDocument, shouldHideBrandName = false): ReadCommercialDocumentTemplate {
|
|
34
|
+
export function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoiceType, payload: CreateInvoiceDocument | CreatePreSaleDocument, shouldHideBrandName = false, nodeEnv: string | undefined = undefined): ReadCommercialDocumentTemplate {
|
|
35
35
|
const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));
|
|
36
36
|
const vats = _orderBy(Object.values(_groupBy(products, 'vatFormatted')).map((v) => (vatToReadVatEditing(v)), 'value')).filter((v) => v.id !== Vat.MARGE.id);
|
|
37
37
|
const thirdParty = thirdPartyToReadThirdPartyEditing(payload.thirdParty);
|
|
@@ -84,8 +84,8 @@ export function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoic
|
|
|
84
84
|
AccountingCategoryList.find((a) => a.id === payload.accountingCategory)
|
|
85
85
|
?.label ?? null,
|
|
86
86
|
// @ts-ignore
|
|
87
|
-
brandColors: getBrandConfig({ objectWaited: 'colors' }) as brandColorType,
|
|
88
|
-
brandName: `${getBrandConfig({ objectWaited: 'name' })}`,
|
|
87
|
+
brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,
|
|
88
|
+
brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv })}`,
|
|
89
89
|
shouldHideBrandName,
|
|
90
90
|
};
|
|
91
91
|
|
|
@@ -121,7 +121,7 @@ export function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoic
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
export function generateAdvanceDocument(payload: CreateInvoiceDocument, shouldHideBrandName = false): ReadCommercialDocumentTemplate {
|
|
124
|
+
export function generateAdvanceDocument(payload: CreateInvoiceDocument, shouldHideBrandName = false, nodeEnv: string | undefined = undefined): ReadCommercialDocumentTemplate {
|
|
125
125
|
if (!payload.deposit) throw new Error('Aucun acompte défini');
|
|
126
126
|
|
|
127
127
|
const data: ReadDocumentEditing & { brandColors: brandColorType, brandName: string, shouldHideBrandName: boolean } = {
|
|
@@ -182,8 +182,8 @@ export function generateAdvanceDocument(payload: CreateInvoiceDocument, shouldHi
|
|
|
182
182
|
AccountingCategoryList.find((a) => a.id === payload.accountingCategory)
|
|
183
183
|
?.label ?? null,
|
|
184
184
|
// @ts-ignore
|
|
185
|
-
brandColors: getBrandConfig({ objectWaited: 'colors' }) as brandColorType,
|
|
186
|
-
brandName: `${getBrandConfig({ objectWaited: 'name' })}`,
|
|
185
|
+
brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,
|
|
186
|
+
brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv })}`,
|
|
187
187
|
shouldHideBrandName,
|
|
188
188
|
};
|
|
189
189
|
|
|
@@ -213,7 +213,7 @@ export function generateAdvanceDocument(payload: CreateInvoiceDocument, shouldHi
|
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
export function generateMailHeader(params: CreateMailHeader, shouldHideBrandName = false): ReadCommercialMailTemplate {
|
|
216
|
+
export function generateMailHeader(params: CreateMailHeader, shouldHideBrandName = false, nodeEnv: string | undefined = undefined): ReadCommercialMailTemplate {
|
|
217
217
|
dayjs.locale('fr');
|
|
218
218
|
const data = {
|
|
219
219
|
...params.payload,
|
|
@@ -227,8 +227,7 @@ export function generateMailHeader(params: CreateMailHeader, shouldHideBrandName
|
|
|
227
227
|
companyName: params.companyName,
|
|
228
228
|
fileUrl: params.fileUrl,
|
|
229
229
|
// @ts-ignore
|
|
230
|
-
brandColors: getBrandConfig({ objectWaited: 'colors' }) as brandColorType,
|
|
231
|
-
brandName: `${getBrandConfig({ objectWaited: 'name' })}`,
|
|
230
|
+
brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,
|
|
232
231
|
shouldHideBrandName,
|
|
233
232
|
};
|
|
234
233
|
|
|
@@ -361,13 +361,13 @@ export class CommercialDocumentMailHTML {
|
|
|
361
361
|
<div style="display: flex; width: 240px; color: #838384; margin-bottom: 10px;">
|
|
362
362
|
Total TVA <div style="margin-left: auto;"><%- totalVatFormatted.integerValue %>,<span style="font-size: 12px;"><%- totalVatFormatted.centValue %> €</span></div>
|
|
363
363
|
</div>
|
|
364
|
-
<div style="width: 240px; height: 2px; background-color: <%= brandColors.
|
|
364
|
+
<div style="width: 240px; height: 2px; background-color: <%= brandColors.primary300 %>; margin-bottom: 10px;"></div>
|
|
365
365
|
<% } %>
|
|
366
366
|
<div style="display: flex; width: 240px; font-size: 16px; color: black;">
|
|
367
367
|
Total <% if (hasVat) { %>TTC<% } %> <div style="font-size: 20px; font-weight: 500; margin-left: auto;" ><%- totalTaxIncludedFormatted.integerValue %>,<span style="font-size: 16px;"><%- totalTaxIncludedFormatted.centValue %> €</span></div>
|
|
368
368
|
</div>
|
|
369
369
|
</div>
|
|
370
|
-
<a <% if (fileUrl) { %>href="<%= fileUrl %>"<% } %> target="_blank" style="color: white; text-decoration: none; background-color: <%= brandColors.primary500 %>; <% if (fileUrl) { %> cursor: pointer; <% } %> padding: 10px 45px; font-size: 16px; border-radius: 4px;">
|
|
370
|
+
<a <% if (fileUrl) { %>href="<%= fileUrl %>"<% } %> target="_blank" style="color: white; text-decoration: none; background-color: <%= brandColors.primary500 %>; <% if (fileUrl) { %> cursor: pointer; <% } else { %> cursor: default; pointer-events: none; <% } %> padding: 10px 45px; font-size: 16px; border-radius: 4px;">
|
|
371
371
|
Afficher le document
|
|
372
372
|
</a>
|
|
373
373
|
</div>
|
|
@@ -388,7 +388,7 @@ export class CommercialDocumentMailHTML {
|
|
|
388
388
|
</div>
|
|
389
389
|
</div>
|
|
390
390
|
<% if (!shouldHideBrandName) { %>
|
|
391
|
-
<div style="margin-top: 16px; width: fit-content; margin-left: auto; margin-right: auto; font-size: 14px;">
|
|
391
|
+
<div style="margin-top: 16px; width: fit-content; white-space: nowrap; margin-left: auto; margin-right: auto; font-size: 14px;">
|
|
392
392
|
<div class="brand-tag" style="display: flex; line-height: 22px; height: 22px;">
|
|
393
393
|
Généré par <% if (hostS3) { %><img src="<%= hostS3 %>config/logo-brand.png" alt="logo" style="max-height: 22px; margin-left: 8px;" /><% } %>
|
|
394
394
|
</div>
|
package/ts/utils/index.ts
CHANGED