From 88c6156f3e680391017479ed64369d84efac0bb3 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Wed, 1 Dec 2021 11:26:55 +0100 Subject: [PATCH] update payment update condition --- lib/pdfannotator | 2 +- .../commands/teleforma-copy-students.py | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/pdfannotator b/lib/pdfannotator index ce69eca1..c6b95327 160000 --- a/lib/pdfannotator +++ b/lib/pdfannotator @@ -1 +1 @@ -Subproject commit ce69eca18a6f5b8774215725fd6b42534f13412f +Subproject commit c6b953270e4e8a7d97853d7a784f8e6df9ed9c53 diff --git a/teleforma/management/commands/teleforma-copy-students.py b/teleforma/management/commands/teleforma-copy-students.py index f4bae30b..35775bef 100644 --- a/teleforma/management/commands/teleforma-copy-students.py +++ b/teleforma/management/commands/teleforma-copy-students.py @@ -92,15 +92,16 @@ class Command(BaseCommand): if date_paid: if payments_to: payment_to = payments_to[0] - payment_to.online_paid = payment.online_paid - payment_to.date_paid = payment.date_paid - payment_to.save() - self.logger.logger.info('payment updated: ' + student.user.username + \ - ', mois:' + str(month) + \ - ', date de création:' + str(date_created) + \ - ', date échéance:' + str(scheduled) + \ - ', date paid:' + str(date_paid) + \ - ', value: ' + str(payment.value)) + if date_paid != payment_to.date_paid: + payment_to.online_paid = payment.online_paid + payment_to.date_paid = payment.date_paid + payment_to.save() + self.logger.logger.info('payment updated: ' + student.user.username + \ + ', mois:' + str(month) + \ + ', date de création:' + str(date_created) + \ + ', date échéance:' + str(scheduled) + \ + ', date paid:' + str(date_paid) + \ + ', value: ' + str(payment.value)) if new: for discount in discounts: -- 2.39.5