From 252ddb832d4de5f43a43ffebc03e815c8ef638d3 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Thu, 6 Aug 2020 12:36:28 +0200 Subject: [PATCH] :bug: Invert membership date inequalities --- static/js/consos.js | 2 +- static/js/transfer.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/consos.js b/static/js/consos.js index a953eee3..652b0901 100644 --- a/static/js/consos.js +++ b/static/js/consos.js @@ -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); } diff --git a/static/js/transfer.js b/static/js/transfer.js index 6e2f183c..db467a31 100644 --- a/static/js/transfer.js +++ b/static/js/transfer.js @@ -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) {