🐛 Invert membership date inequalities

This commit is contained in:
Yohann D'ANELLO 2020-08-06 12:36:28 +02:00
parent 6dcb82855d
commit 252ddb832d
2 changed files with 4 additions and 4 deletions

View File

@ -218,7 +218,7 @@ function consume(source, source_alias, dest, quantity, amount, reason, type, cat
addMsg("Attention, La transaction depuis la note " + source_alias + " a été réalisée avec " +
"succès, mais la note émettrice " + source_alias + " est en négatif.",
"warning", 30000);
if (source.note.membership && source.note.membership.date_end > new Date().toISOString())
if (source.note.membership && source.note.membership.date_end < new Date().toISOString())
addMsg("Attention : la note émettrice " + source.name + " n'est plus adhérente.",
"danger", 30000);
}

View File

@ -260,10 +260,10 @@ $("#btn_transfer").click(function() {
"destination": dest.note.id,
"destination_alias": dest.name
}).done(function () {
if (source.note.membership && source.note.membership.date_end > new Date().toISOString())
if (source.note.membership && source.note.membership.date_end < new Date().toISOString())
addMsg("Attention : la note émettrice " + source.name + " n'est plus adhérente.",
"danger", 30000);
if (dest.note.membership && dest.note.membership.date_end > new Date().toISOString())
if (dest.note.membership && dest.note.membership.date_end < new Date().toISOString())
addMsg("Attention : la note destination " + dest.name + " n'est plus adhérente.",
"danger", 30000);
@ -373,7 +373,7 @@ $("#btn_transfer").click(function() {
"bank": $("#bank").val()
}).done(function () {
addMsg("Le crédit/retrait a bien été effectué !", "success", 10000);
if (user_note.membership && user_note.membership.date_end > new Date().toISOString())
if (user_note.membership && user_note.membership.date_end < new Date().toISOString())
addMsg("Attention : la note " + alias + " n'est plus adhérente.", "danger", 10000);
reset();
}).fail(function (err) {