Aggiunto comune, + filtro regione e provincia

aggiunto Visibilità (da fare check)
This commit is contained in:
Paolo Arena
2022-09-18 20:17:24 +02:00
parent 9d072d4d0d
commit bcb276518f
12 changed files with 127 additions and 19 deletions

View File

@@ -53,6 +53,9 @@ const AccountSchema = new Schema({
saldo: {
type: Number,
},
totTransato: {
type: Number,
},
deleted: {
type: Boolean,
default: false,
@@ -116,6 +119,10 @@ AccountSchema.methods.addtoSaldo = async function(amount) {
if (account) {
account.saldo = account.saldo + amount;
if (!account.totTransato) {
account.totTransato = 0;
}
account.totTransato += Math.abs(amount);
account.date_updated = new Date();
return await account.save();
}