- corretto saldi pendenti sulla lista circuiti e anche il calcolo

This commit is contained in:
Surya Paolo
2024-02-17 15:07:21 +01:00
parent 8c471c0e81
commit 1268c961cf
2 changed files with 24 additions and 6 deletions

View File

@@ -1149,16 +1149,19 @@ sendNotifSchema.statics.getSumPendingTransactionsMittente = async function (idap
const SendNotif = this;
try {
const query = {
let query = {
idapp,
sender: username,
sendergroup: groupname,
typedir: shared_consts.TypeNotifs.TYPEDIR_CIRCUITS,
typeid: shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ,
status: 0,
'extrarec.circuitname': circuitname,
};
if (groupname) {
query.sendergroup = groupname;
}
return await SendNotif.find(query).lean();
} catch (e) {
@@ -1171,18 +1174,21 @@ sendNotifSchema.statics.getSumPendingTransactionsDest = async function (idapp, u
const SendNotif = this;
try {
const query = {
let query = {
idapp,
sender: username,
sendergroup: groupname,
typedir: shared_consts.TypeNotifs.TYPEDIR_CIRCUITS,
typeid: shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ,
status: 0,
'extrarec.circuitname': circuitname,
'extrarec.dest': username,
'extrarec.groupdest': groupname,
};
if (groupname) {
query.sendergroup = groupname;
query.extrarec.groupdest = groupname;
}
return await SendNotif.find(query).lean();
} catch (e) {