Corretto il pagato

- fix Group Add link
This commit is contained in:
Surya Paolo
2024-01-07 17:27:20 +01:00
parent fb16a1729e
commit db81980046
4 changed files with 30 additions and 14 deletions

View File

@@ -84,9 +84,6 @@ const CircuitSchema = new Schema({
totCircolante: {
type: Number,
},
showAlways: {
type: Boolean,
},
totTransato: {
type: Number,
},
@@ -227,6 +224,10 @@ const CircuitSchema = new Schema({
type: Number,
default: 0,
},
ignoreLimits: {
type: Boolean,
default: false,
},
});
CircuitSchema.pre('save', async function (next) {
@@ -695,15 +696,17 @@ CircuitSchema.statics.sendCoins = async function (onlycheck, idapp, usernameOrig
const circolantePrec = this.getCircolanteSingolaTransaz(accountorigTable, accountdestTable);
// Check if Sender has enough money
if (accountorigTable.saldo - myqty < -accountorigTable.fidoConcesso) {
ris.cansend = false;
ris.errormsg = i18n.__('CIRCUIT_AMOUNT_EXCEED_FIDO', usernameOrig);
}
if (!circuittable.ignoreLimits) {
// Check if Sender has enough money
if (accountorigTable.saldo - myqty < -accountorigTable.fidoConcesso) {
ris.cansend = false;
ris.errormsg = i18n.__('CIRCUIT_AMOUNT_EXCEED_FIDO', usernameOrig);
}
if (accountdestTable.saldo + myqty > accountdestTable.qta_maxConcessa) {
ris.cansend = false;
ris.errormsg = i18n.__('CIRCUIT_AMOUNT_EXCEED_QTAMAX', extrarec.dest);
if (accountdestTable.saldo + myqty > accountdestTable.qta_maxConcessa) {
ris.cansend = false;
ris.errormsg = i18n.__('CIRCUIT_AMOUNT_EXCEED_QTAMAX', extrarec.dest);
}
}
if (!onlycheck) {