- transazioni pendenti errore fixed (Elena)

This commit is contained in:
Surya Paolo
2023-06-15 23:30:48 +02:00
parent aff50b03d4
commit 95a812f002
3 changed files with 8 additions and 2 deletions

View File

@@ -398,7 +398,7 @@ AccountSchema.statics.getUserAccounts = async function (idapp, username) {
if (ris) {
for (const account of ris) {
const pendingtransactions = await SendNotif.getSumPendingTransactions(idapp, username, account.circuit.name);
const saldopending = pendingtransactions.reduce((sum, rec) => sum + rec.result.extrarec.qty, 0);
const saldopending = pendingtransactions.reduce((sum, rec) => sum + rec.extrarec.qty, 0);
account.saldo -= saldopending;
account.totTransato = account.totTransato || 0;
}

View File

@@ -1049,6 +1049,12 @@ sendNotifSchema.statics.sendToTheDestinations = async function (myrecnotifpass,
send = true;
}
}
} else if (myrecnotifpass.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS) {
if (shared_consts.TABLES_CIRCUITS_NOTIFICATION.includes(myrecnotifpass.tablerec)) {
if (usernotifprofile && tools.isBitActive(usernotifprofile.value, shared_consts.CircuitsNotif.STATUS_NEW)) {
send = true;
}
}
}
if (send) {