@silexpert/core 1.2.57 → 1.2.59
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/KilometricAllowance.d.ts +1 -0
- package/dist/cjs/api/resources/KilometricAllowance.d.ts.map +1 -1
- package/dist/cjs/api/resources/KilometricAllowance.js +3 -0
- package/dist/cjs/api/resources/KilometricAllowance.js.map +1 -1
- package/dist/cjs/api/resources/Reminder.d.ts +1 -0
- package/dist/cjs/api/resources/Reminder.d.ts.map +1 -1
- package/dist/cjs/api/resources/Reminder.js +3 -0
- package/dist/cjs/api/resources/Reminder.js.map +1 -1
- package/dist/cjs/types/Enum/CommercialManagement.d.ts +3 -4
- package/dist/cjs/types/Enum/CommercialManagement.d.ts.map +1 -1
- package/dist/cjs/types/Enum/CommercialManagement.js +46 -40
- package/dist/cjs/types/Enum/CommercialManagement.js.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts +4 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.js +21 -3
- package/dist/cjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Update.d.ts +2 -0
- package/dist/cjs/types/Interface/api/commercialManagement/Update.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Update.js +13 -0
- package/dist/cjs/types/Interface/api/commercialManagement/Update.js.map +1 -1
- package/dist/cjs/types/Interface/models/IInvoiceReminder.d.ts +4 -0
- package/dist/cjs/types/Interface/models/IInvoiceReminder.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IInvoiceReminder.js.map +1 -1
- package/dist/cjs/types/Interface/models/IInvoiceReminderAttachment.d.ts +12 -0
- package/dist/cjs/types/Interface/models/IInvoiceReminderAttachment.d.ts.map +1 -0
- package/dist/cjs/types/Interface/models/IInvoiceReminderAttachment.js +3 -0
- package/dist/cjs/types/Interface/models/IInvoiceReminderAttachment.js.map +1 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/saleEmail.d.ts.map +1 -1
- package/dist/cjs/utils/commercialManagement/saleEmail.js +4 -0
- package/dist/cjs/utils/commercialManagement/saleEmail.js.map +1 -1
- package/dist/mjs/api/resources/KilometricAllowance.d.ts +1 -0
- package/dist/mjs/api/resources/KilometricAllowance.d.ts.map +1 -1
- package/dist/mjs/api/resources/KilometricAllowance.js +3 -0
- package/dist/mjs/api/resources/KilometricAllowance.js.map +1 -1
- package/dist/mjs/api/resources/Reminder.d.ts +1 -0
- package/dist/mjs/api/resources/Reminder.d.ts.map +1 -1
- package/dist/mjs/api/resources/Reminder.js +3 -0
- package/dist/mjs/api/resources/Reminder.js.map +1 -1
- package/dist/mjs/types/Enum/CommercialManagement.d.ts +3 -4
- package/dist/mjs/types/Enum/CommercialManagement.d.ts.map +1 -1
- package/dist/mjs/types/Enum/CommercialManagement.js +46 -40
- package/dist/mjs/types/Enum/CommercialManagement.js.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts +4 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.js +26 -5
- package/dist/mjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Update.d.ts +2 -0
- package/dist/mjs/types/Interface/api/commercialManagement/Update.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Update.js +17 -2
- package/dist/mjs/types/Interface/api/commercialManagement/Update.js.map +1 -1
- package/dist/mjs/types/Interface/models/IInvoiceReminder.d.ts +4 -0
- package/dist/mjs/types/Interface/models/IInvoiceReminder.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IInvoiceReminder.js.map +1 -1
- package/dist/mjs/types/Interface/models/IInvoiceReminderAttachment.d.ts +12 -0
- package/dist/mjs/types/Interface/models/IInvoiceReminderAttachment.d.ts.map +1 -0
- package/dist/mjs/types/Interface/models/IInvoiceReminderAttachment.js +2 -0
- package/dist/mjs/types/Interface/models/IInvoiceReminderAttachment.js.map +1 -0
- package/dist/mjs/types/index.d.ts +1 -0
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +1 -0
- package/dist/mjs/types/index.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/saleEmail.d.ts.map +1 -1
- package/dist/mjs/utils/commercialManagement/saleEmail.js +4 -0
- package/dist/mjs/utils/commercialManagement/saleEmail.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/KilometricAllowance.ts +4 -0
- package/ts/api/resources/Reminder.ts +6 -0
- package/ts/types/Enum/CommercialManagement.ts +51 -41
- package/ts/types/Interface/api/commercialManagement/Create.ts +18 -2
- package/ts/types/Interface/api/commercialManagement/Update.ts +13 -2
- package/ts/types/Interface/models/IInvoiceReminder.ts +4 -0
- package/ts/types/Interface/models/IInvoiceReminderAttachment.ts +14 -0
- package/ts/types/index.ts +1 -0
- package/ts/utils/commercialManagement/saleEmail.ts +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saleEmail.js","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/saleEmail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"saleEmail.js","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/saleEmail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAW3D,MAAM,UAAU,kCAAkC,CAAC,KAAoB,EAAE,QAAgB;IACvF,qCAAqC;IACrC,MAAM,GAAG,GAAG,YAAY,CAAC;IAEzB,MAAM,cAAc,GAA0B,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IACxE,MAAM,6BAA6B,GAAa,EAAE,CAAC;IACnD,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,6BAA6B,CAAC,IAAI,CAAE,CAAuB,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAErH,yDAAyD;IACzD,MAAM,iBAAiB,GAAG,mCAAmC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAC5E,YAAY,CACV,mCAAmC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EACtD,6BAA6B,CAC9B,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CACtB,CAAC;IAEF,IAAI,SAAS,GAAG,QAAQ,CAAC;IACzB,iBAAiB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACjC,kGAAkG;QAClG,2EAA2E;QAC3E,MAAM,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QACtF,MAAM,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAEvE,IAAI,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACtC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;YACpD,WAAW,GAAG,GAAG,8BAA8B,CAAC,WAAqB,CAAC,IAAI,CAAC;QAC7E,CAAC;QACD,mIAAmI;QACnI,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YACjD,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC;QACpF,CAAC;aAAM,CAAC;YACN,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,WAAW,EAAE,CAAC,GAAG,WAAW,CAAC;QACpF,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { emailTemplateVariableAffiliatedData, intersection } from '../../types';\nimport { integerToFormattedAmountString } from '../amount';\n\nexport type InfoToUseType = {\n reference?: string;\n totalIncludedAmount?: number;\n societyName?: string;\n company?: string | null;\n fullname?: string | null;\n title?: string;\n};\n\nexport function transformModelWithCharcodeToString(datas: InfoToUseType, template: string): string {\n // this regex match the carac with []\n const reg = /\\[(.*?)\\]/g;\n\n const charcodesFound: RegExpMatchArray | [] = template.match(reg) ?? [];\n const charcodesFoundWithoutBrackets: string[] = [];\n charcodesFound.forEach((f) => charcodesFoundWithoutBrackets.push((f as unknown as string).replace(/[\\[\\]']+/g, '')));\n\n // we get the list of matching key template with key data\n const charcodesDetected = emailTemplateVariableAffiliatedData.filter((data) =>\n intersection(\n emailTemplateVariableAffiliatedData.map((d) => d.name),\n charcodesFoundWithoutBrackets,\n ).includes(data.name),\n );\n\n let newString = template;\n charcodesDetected.forEach((char) => {\n // we split the string just after the first occurence found, the first one will be replace by data\n // and the last one will be paste at the end, to be used for the next loop.\n const endOfString = newString.substring(newString.indexOf(']') + 1, newString.length);\n const splitString = newString.substring(0, newString.indexOf(']') + 1);\n\n let dataToInfer = datas[char.data[0]];\n if (!dataToInfer && char.data.length > 1) {\n dataToInfer = datas[char.data[1]];\n }\n\n if (char.formatType && char.formatType === 'amount') {\n dataToInfer = `${integerToFormattedAmountString(dataToInfer as number)} €`;\n }\n // if we don't find an occurence in the first part, then it means that we have an unknow occurence and then we pass to the next one\n if (splitString.indexOf(`[${char.name}]`) === -1) {\n newString = splitString + endOfString.replace(`[${char.name}]`, `${dataToInfer}`);\n } else {\n newString = splitString.replace(`[${char.name}]`, `${dataToInfer}`) + endOfString;\n }\n });\n return newString;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.59",
|
|
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",
|
|
@@ -14,6 +14,10 @@ export class KilometricAllowance extends Resource {
|
|
|
14
14
|
return this.axios.$post(`/exercices/${idExercice}/kilometric-allowance/validate`, payload);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
reset(idExercice: number): Promise<true> {
|
|
18
|
+
return this.axios.$post(`/exercices/${idExercice}/kilometric-allowance/reset`);
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
getPaginated(
|
|
18
22
|
idSociety: number,
|
|
19
23
|
params: QueryKilometricAllowance,
|
|
@@ -13,4 +13,10 @@ export class Reminder extends Resource {
|
|
|
13
13
|
delete(id: number, idEstimateInvoice: number): Promise<true> {
|
|
14
14
|
return this.axios.$delete(`/commercial-management/documents/${idEstimateInvoice}/reminders/${id}`);
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
deleteAttachment(id: number, idEstimateInvoice: number, idReminder: number): Promise<true> {
|
|
18
|
+
return this.axios.$delete(
|
|
19
|
+
`/commercial-management/documents/${idEstimateInvoice}/reminders/${idReminder}/attachments/${id}`,
|
|
20
|
+
);
|
|
21
|
+
}
|
|
16
22
|
}
|
|
@@ -101,9 +101,7 @@ export enum EmailTemplateVariable {
|
|
|
101
101
|
DOCUMENT_REFERENCE = 'reference_document',
|
|
102
102
|
DOCUMENT_TOTAL_INCLUDED_AMOUNT = 'montant_ttc_document',
|
|
103
103
|
DOCUMENT_TITLE = 'titre_document',
|
|
104
|
-
OWNER_SOCIETY_NAME = '
|
|
105
|
-
GOOGLE_LINK = 'lien_google',
|
|
106
|
-
TRUSTPILOT_LINK = 'lien_trustpilot',
|
|
104
|
+
OWNER_SOCIETY_NAME = 'raison_sociale',
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
export const emailTemplateVariableList = [
|
|
@@ -111,11 +109,15 @@ export const emailTemplateVariableList = [
|
|
|
111
109
|
'reference_document',
|
|
112
110
|
'montant_ttc_document',
|
|
113
111
|
'titre_document',
|
|
114
|
-
'
|
|
112
|
+
'raison_sociale',
|
|
115
113
|
'lien_google',
|
|
116
114
|
'lien_trustpilot',
|
|
117
115
|
];
|
|
118
|
-
export const emailTemplateVariableAffiliatedData: Array<{
|
|
116
|
+
export const emailTemplateVariableAffiliatedData: Array<{
|
|
117
|
+
name: string;
|
|
118
|
+
data: Array<keyof InfoToUseType>;
|
|
119
|
+
formatType?: string;
|
|
120
|
+
}> = [
|
|
119
121
|
{
|
|
120
122
|
name: 'nom_client',
|
|
121
123
|
data: ['fullname', 'company'],
|
|
@@ -127,13 +129,14 @@ export const emailTemplateVariableAffiliatedData: Array<{ name: string; data: Ar
|
|
|
127
129
|
{
|
|
128
130
|
name: 'montant_ttc_document',
|
|
129
131
|
data: ['totalIncludedAmount'],
|
|
132
|
+
formatType: 'amount',
|
|
130
133
|
},
|
|
131
134
|
{
|
|
132
135
|
name: 'titre_document',
|
|
133
136
|
data: ['title'],
|
|
134
137
|
},
|
|
135
138
|
{
|
|
136
|
-
name: '
|
|
139
|
+
name: 'raison_sociale',
|
|
137
140
|
data: ['societyName'],
|
|
138
141
|
},
|
|
139
142
|
];
|
|
@@ -143,7 +146,7 @@ export enum EmailType {
|
|
|
143
146
|
INVOICE = 2,
|
|
144
147
|
ORDER_FORM = 3,
|
|
145
148
|
CUSTOMER_REMINDER = 4,
|
|
146
|
-
|
|
149
|
+
ASSET = 5,
|
|
147
150
|
}
|
|
148
151
|
|
|
149
152
|
export const emailTypeList: Array<{ label: string; id: EmailType }> = [
|
|
@@ -164,8 +167,8 @@ export const emailTypeList: Array<{ label: string; id: EmailType }> = [
|
|
|
164
167
|
id: EmailType.CUSTOMER_REMINDER,
|
|
165
168
|
},
|
|
166
169
|
{
|
|
167
|
-
label:
|
|
168
|
-
id: EmailType.
|
|
170
|
+
label: 'Avoir',
|
|
171
|
+
id: EmailType.ASSET,
|
|
169
172
|
},
|
|
170
173
|
];
|
|
171
174
|
|
|
@@ -173,59 +176,66 @@ export const DefaultEmailTemplateList: Array<Omit<ISaleEmail, 'idSociety'>> = [
|
|
|
173
176
|
{
|
|
174
177
|
name: 'modèle_devis_defaut',
|
|
175
178
|
subject: 'Votre devis',
|
|
176
|
-
content: `<
|
|
177
|
-
<p>
|
|
178
|
-
<p>Vous
|
|
179
|
-
<p>Cordialement
|
|
180
|
-
[
|
|
181
|
-
</
|
|
179
|
+
content: `<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span> </p>
|
|
180
|
+
<p>Vous trouverez ci-joint votre devis N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span>. </p>
|
|
181
|
+
<p>Vous en souhaitant bonne réception.</p>
|
|
182
|
+
<p>Cordialement,
|
|
183
|
+
<span style="color: rgb(131, 131, 132);">[raison_sociale]</span>
|
|
184
|
+
</p>`,
|
|
182
185
|
type: EmailType.ESTIMATE,
|
|
183
186
|
isDefault: false,
|
|
184
187
|
},
|
|
185
188
|
{
|
|
186
189
|
name: 'modèle_facture_defaut',
|
|
187
190
|
subject: 'Votre facture',
|
|
188
|
-
content: `<
|
|
189
|
-
<p>
|
|
190
|
-
<p>
|
|
191
|
-
<
|
|
192
|
-
|
|
193
|
-
<p>Cordialement,<br/>
|
|
194
|
-
[nom_societe]</p>
|
|
195
|
-
</div>`,
|
|
191
|
+
content: `<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span> </p>
|
|
192
|
+
<p>Vous trouverez ci-joint votre facture N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span>.</p> <p>Vous en souhaitant bonne réception.</p>
|
|
193
|
+
<p>Cordialement,
|
|
194
|
+
<span style="color: rgb(131, 131, 132);">[raison_sociale]</span>
|
|
195
|
+
</p>`,
|
|
196
196
|
type: EmailType.INVOICE,
|
|
197
197
|
isDefault: false,
|
|
198
198
|
},
|
|
199
199
|
{
|
|
200
200
|
name: 'modèle_bon_de_commande_defaut',
|
|
201
201
|
subject: 'Votre bon de commande',
|
|
202
|
-
content: `<
|
|
203
|
-
<p>
|
|
204
|
-
<p>Vous
|
|
205
|
-
|
|
206
|
-
</
|
|
207
|
-
|
|
208
|
-
[nom_societe]
|
|
209
|
-
</p>
|
|
210
|
-
</div>`,
|
|
202
|
+
content: `<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span></p>
|
|
203
|
+
<p>Vous trouverez ci-joint votre bon de commande N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span>. </p>
|
|
204
|
+
<p>Vous en souhaitant bonne réception.</p>
|
|
205
|
+
<p>Cordialement,
|
|
206
|
+
<span style="color: rgb(131, 131, 132);">[raison_sociale]</span>
|
|
207
|
+
</p>`,
|
|
211
208
|
type: EmailType.ORDER_FORM,
|
|
212
209
|
isDefault: false,
|
|
213
210
|
},
|
|
214
211
|
{
|
|
215
|
-
name: 'modè
|
|
216
|
-
subject: 'Votre
|
|
217
|
-
content: `<
|
|
218
|
-
<p>Bonjour,</p>
|
|
212
|
+
name: 'modèle_avoir_defaut',
|
|
213
|
+
subject: 'Votre avoir',
|
|
214
|
+
content: `<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span> </p>
|
|
219
215
|
<p>Vous trouverez ci-joint votre facture.</p>
|
|
216
|
+
<p>Vous trouverez ci-joint votre bon de commande N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span>. </p>
|
|
217
|
+
<p>Vous en souhaitant bonne réception.</p>
|
|
218
|
+
<p>Cordialement,
|
|
219
|
+
<span style="color: rgb(131, 131, 132);">[raison_sociale]</span>
|
|
220
|
+
</p>`,
|
|
221
|
+
type: EmailType.ASSET,
|
|
222
|
+
isDefault: false,
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: 'modèle_relance_defaut',
|
|
226
|
+
subject: 'Votre facture',
|
|
227
|
+
content: `<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span> </p>
|
|
220
228
|
<p>
|
|
221
|
-
|
|
222
|
-
Merci de votre confiance !
|
|
229
|
+
Je me permets de revenir vers vous concernant la facture N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span> pour laquelle le paiement est toujours en attente.
|
|
223
230
|
</p>
|
|
224
231
|
<p>
|
|
225
|
-
|
|
226
|
-
[nom_societe]
|
|
232
|
+
Je vous joins à nouveau le document en pièce jointe en cas de besoin.
|
|
227
233
|
</p>
|
|
228
|
-
|
|
234
|
+
<p>Vous en souhaitant bonne réception.</p>
|
|
235
|
+
<p>
|
|
236
|
+
Cordialement,
|
|
237
|
+
<span style="color: rgb(131, 131, 132);">[raison_sociale]</span>
|
|
238
|
+
</p>`,
|
|
229
239
|
type: EmailType.CUSTOMER_REMINDER,
|
|
230
240
|
isDefault: false,
|
|
231
241
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IsArray,
|
|
3
3
|
IsBoolean,
|
|
4
|
+
IsDate,
|
|
4
5
|
IsDateString,
|
|
5
6
|
IsEnum,
|
|
6
7
|
IsIn,
|
|
@@ -554,6 +555,15 @@ export class CreateReminder {
|
|
|
554
555
|
@ToBoolean()
|
|
555
556
|
afterSeven: boolean;
|
|
556
557
|
|
|
558
|
+
@ApiProperty()
|
|
559
|
+
@IsBoolean()
|
|
560
|
+
@ToBoolean()
|
|
561
|
+
withSignature: boolean;
|
|
562
|
+
|
|
563
|
+
@ApiProperty()
|
|
564
|
+
@IsString()
|
|
565
|
+
email: string;
|
|
566
|
+
|
|
557
567
|
@ApiPropertyOptional()
|
|
558
568
|
@IsString()
|
|
559
569
|
@IsOptional()
|
|
@@ -564,9 +574,15 @@ export class CreateReminder {
|
|
|
564
574
|
@IsOptional()
|
|
565
575
|
message?: string;
|
|
566
576
|
|
|
577
|
+
@ApiPropertyOptional()
|
|
578
|
+
@IsDate()
|
|
579
|
+
@IsOptional()
|
|
580
|
+
customizedDate?: Date;
|
|
581
|
+
|
|
567
582
|
@ApiProperty()
|
|
568
|
-
@
|
|
569
|
-
|
|
583
|
+
@IsArray()
|
|
584
|
+
@IsInt({ each: true })
|
|
585
|
+
idFiles: number[];
|
|
570
586
|
}
|
|
571
587
|
|
|
572
588
|
export class CreateRecurrence {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IsBoolean, IsDate, IsDateString, IsEnum, IsOptional, IsString } from 'class-validator';
|
|
2
|
-
import { ApiPropertyOptional } from '../../../../utils';
|
|
1
|
+
import { IsArray, IsBoolean, IsDate, IsDateString, IsEnum, IsInt, IsOptional, IsString } from 'class-validator';
|
|
2
|
+
import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
|
|
3
3
|
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
4
4
|
import { RecurrenceType } from '../../../Enum/RecurrenceType';
|
|
5
5
|
|
|
@@ -64,6 +64,12 @@ export class UpdateReminder {
|
|
|
64
64
|
@IsOptional()
|
|
65
65
|
afterSeven: boolean;
|
|
66
66
|
|
|
67
|
+
@ApiPropertyOptional()
|
|
68
|
+
@IsBoolean()
|
|
69
|
+
@ToBoolean()
|
|
70
|
+
@IsOptional()
|
|
71
|
+
withSignature?: boolean;
|
|
72
|
+
|
|
67
73
|
@ApiPropertyOptional()
|
|
68
74
|
@IsString()
|
|
69
75
|
@IsOptional()
|
|
@@ -78,6 +84,11 @@ export class UpdateReminder {
|
|
|
78
84
|
@IsString()
|
|
79
85
|
@IsOptional()
|
|
80
86
|
email?: string;
|
|
87
|
+
|
|
88
|
+
@ApiProperty()
|
|
89
|
+
@IsArray()
|
|
90
|
+
@IsInt({ each: true })
|
|
91
|
+
idFiles: number[];
|
|
81
92
|
}
|
|
82
93
|
|
|
83
94
|
export class UpdateRecurrence {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ISociety } from './ISociety';
|
|
2
2
|
import { IEstimateInvoice } from './IEstimateInvoice';
|
|
3
|
+
import { IInvoiceReminderAttachment } from './IInvoiceReminderAttachment';
|
|
3
4
|
|
|
4
5
|
// societyRelance
|
|
5
6
|
export interface IInvoiceReminder {
|
|
@@ -12,6 +13,8 @@ export interface IInvoiceReminder {
|
|
|
12
13
|
subject?: string | null;
|
|
13
14
|
message?: string | null;
|
|
14
15
|
email: string | null;
|
|
16
|
+
customizedDate?: Date | null;
|
|
17
|
+
withSignature?: boolean;
|
|
15
18
|
idSociety: number;
|
|
16
19
|
idEstimateInvoice: number | null;
|
|
17
20
|
createdAt?: Date | null;
|
|
@@ -20,4 +23,5 @@ export interface IInvoiceReminder {
|
|
|
20
23
|
// Associations
|
|
21
24
|
society?: ISociety;
|
|
22
25
|
estimateInvoice?: IEstimateInvoice;
|
|
26
|
+
attachments?: IInvoiceReminderAttachment[];
|
|
23
27
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IFile } from './IFile';
|
|
2
|
+
import { IInvoiceReminder } from './IInvoiceReminder';
|
|
3
|
+
|
|
4
|
+
export interface IInvoiceReminderAttachment {
|
|
5
|
+
id?: number;
|
|
6
|
+
idFile: number;
|
|
7
|
+
idReminder: number;
|
|
8
|
+
createdAt?: Date | null;
|
|
9
|
+
updatedAt?: Date | null;
|
|
10
|
+
|
|
11
|
+
// associations
|
|
12
|
+
file: IFile;
|
|
13
|
+
invoiceReminder: IInvoiceReminder;
|
|
14
|
+
}
|
package/ts/types/index.ts
CHANGED
|
@@ -342,6 +342,7 @@ export * from './Interface/models/IUserHumanResourceLibrary';
|
|
|
342
342
|
export * from './Interface/models/ISaleEmail';
|
|
343
343
|
export * from './Interface/models/IGeneralConditionOfSale';
|
|
344
344
|
export * from './Interface/models/ISaleDocumentTemplate';
|
|
345
|
+
export * from './Interface/models/IInvoiceReminderAttachment';
|
|
345
346
|
|
|
346
347
|
// Schemas
|
|
347
348
|
export * from './Interface/schemas/IRegistrationDetail';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { emailTemplateVariableAffiliatedData, intersection } from '../../types';
|
|
2
|
+
import { integerToFormattedAmountString } from '../amount';
|
|
2
3
|
|
|
3
4
|
export type InfoToUseType = {
|
|
4
5
|
reference?: string;
|
|
@@ -36,6 +37,10 @@ export function transformModelWithCharcodeToString(datas: InfoToUseType, templat
|
|
|
36
37
|
if (!dataToInfer && char.data.length > 1) {
|
|
37
38
|
dataToInfer = datas[char.data[1]];
|
|
38
39
|
}
|
|
40
|
+
|
|
41
|
+
if (char.formatType && char.formatType === 'amount') {
|
|
42
|
+
dataToInfer = `${integerToFormattedAmountString(dataToInfer as number)} €`;
|
|
43
|
+
}
|
|
39
44
|
// if we don't find an occurence in the first part, then it means that we have an unknow occurence and then we pass to the next one
|
|
40
45
|
if (splitString.indexOf(`[${char.name}]`) === -1) {
|
|
41
46
|
newString = splitString + endOfString.replace(`[${char.name}]`, `${dataToInfer}`);
|