Corretto Ordini e visualizzazione dei Totali
This commit is contained in:
@@ -742,57 +742,76 @@ module.exports = {
|
||||
|
||||
sendEmail_OrderProduct: async function (lang, idapp, orders, user) {
|
||||
|
||||
const msginizio = 'Ordine n: ' + orders.numorder + ' ' + user.name + ' ' + user.surname;
|
||||
console.log(msginizio);
|
||||
try {
|
||||
const msginizio = 'Ordine n: ' + orders.numorder + ' ' + user.name + ' ' + user.surname;
|
||||
console.log(msginizio);
|
||||
|
||||
await telegrambot.sendMsgTelegramToTheManagers(idapp, msginizio);
|
||||
if (process.env.SEND_EMAIL_ORDERS === '1') {
|
||||
|
||||
let mylocalsconf = {
|
||||
idapp,
|
||||
locale: lang,
|
||||
nomeapp: tools.getNomeAppByIdApp(idapp),
|
||||
orders,
|
||||
baseurl: tools.getHostByIdApp(idapp),
|
||||
dataemail: await this.getdataemail(idapp),
|
||||
ordernumber: orders.numorder,
|
||||
user,
|
||||
};
|
||||
await telegrambot.sendMsgTelegramToTheManagers(idapp, msginizio);
|
||||
|
||||
mylocalsconf = this.setParamsForTemplate(user, mylocalsconf);
|
||||
let mylocalsconf = {
|
||||
idapp,
|
||||
locale: lang,
|
||||
nomeapp: tools.getNomeAppByIdApp(idapp),
|
||||
orders,
|
||||
baseurl: tools.getHostByIdApp(idapp),
|
||||
dataemail: await this.getdataemail(idapp),
|
||||
ordernumber: orders.numorder,
|
||||
user,
|
||||
};
|
||||
|
||||
this.sendEmail_base_e_manager(idapp, 'ecommerce/makeorder/' + lang, mylocalsconf.emailto, mylocalsconf,
|
||||
mylocalsconf.dataemail.email_reply);
|
||||
mylocalsconf = this.setParamsForTemplate(user, mylocalsconf);
|
||||
|
||||
this.sendEmail_base_e_manager(idapp, 'ecommerce/makeorder/' + lang, mylocalsconf.emailto, mylocalsconf,
|
||||
mylocalsconf.dataemail.email_reply);
|
||||
} else {
|
||||
console.log('Invio Email non eseguito perchè sei in TEST !');
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Err:', e);
|
||||
}
|
||||
|
||||
},
|
||||
sendEmail_Order: async function (lang, idapp, orders, user, ordertype, status) {
|
||||
|
||||
const msginizio = 'INIZIO - sendEmail_Order ' + ordertype + ': ' + tools.getNomeAppByIdApp(idapp);
|
||||
console.log(msginizio);
|
||||
try {
|
||||
const msginizio = 'INIZIO - sendEmail_Order ' + ordertype + ': ' + tools.getNomeAppByIdApp(idapp);
|
||||
console.log(msginizio);
|
||||
|
||||
await telegrambot.sendMsgTelegramToTheManagers(idapp, msginizio);
|
||||
if (process.env.SEND_EMAIL_ORDERS === '1') {
|
||||
|
||||
let mylocalsconf = {
|
||||
idapp,
|
||||
locale: lang,
|
||||
nomeapp: tools.getNomeAppByIdApp(idapp),
|
||||
orders,
|
||||
baseurl: tools.getHostByIdApp(idapp),
|
||||
dataemail: await this.getdataemail(idapp),
|
||||
ordernumber: orders.numorder,
|
||||
user,
|
||||
};
|
||||
await telegrambot.sendMsgTelegramToTheManagers(idapp, msginizio);
|
||||
|
||||
mylocalsconf = this.setParamsForTemplate(user, mylocalsconf);
|
||||
let mylocalsconf = {
|
||||
idapp,
|
||||
locale: lang,
|
||||
nomeapp: tools.getNomeAppByIdApp(idapp),
|
||||
orders,
|
||||
baseurl: tools.getHostByIdApp(idapp),
|
||||
dataemail: await this.getdataemail(idapp),
|
||||
ordernumber: orders.numorder,
|
||||
user,
|
||||
};
|
||||
|
||||
if ((status !== shared_consts.OrderStatus.CANCELED) && (status !== shared_consts.OrderStatus.COMPLETED)) {
|
||||
const esito = this.sendEmail_base('ecommerce/' + ordertype + '/' + lang, mylocalsconf.emailto, mylocalsconf,
|
||||
mylocalsconf.dataemail.email_reply);
|
||||
mylocalsconf = this.setParamsForTemplate(user, mylocalsconf);
|
||||
|
||||
this.sendEmail_base('ecommerce/' + ordertype + '/' + lang, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||
if ((status !== shared_consts.OrderStatus.CANCELED) && (status !== shared_consts.OrderStatus.COMPLETED)) {
|
||||
const esito = this.sendEmail_base('ecommerce/' + ordertype + '/' + lang, mylocalsconf.emailto, mylocalsconf,
|
||||
mylocalsconf.dataemail.email_reply);
|
||||
|
||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||
this.sendEmail_base('ecommerce/' + ordertype + '/' + lang, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||
this.sendEmail_base('ecommerce/' + ordertype + '/' + lang, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||
|
||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||
this.sendEmail_base('ecommerce/' + ordertype + '/' + lang, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('Invio Email non eseguito perchè sei in TEST !');
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error('Err:', e);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user