From: Guillaume Pellerin Date: Wed, 17 Mar 2021 15:37:59 +0000 (+0100) Subject: import: fix last bugs X-Git-Tag: 1.4.3~9^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=7eea83a06d7edce6e400f76ad1d05073ad4bb207;p=teleforma.git import: fix last bugs --- diff --git a/teleforma/views/crfpa.py b/teleforma/views/crfpa.py index 83da3cb5..006857fd 100644 --- a/teleforma/views/crfpa.py +++ b/teleforma/views/crfpa.py @@ -445,7 +445,7 @@ class UserXLSBook(object): student.level = level student.period = period student.iej = IEJ.objects.get(name=iej) - student.is_subscribed = False + student.is_subscribed = True student.save() @@ -467,7 +467,7 @@ class UserXLSBook(object): student.date_subscribed = self.date_str_to_datetime(register_date) if total_reduction: - discount = Discount(student=student, value=float(total_reduction), description=desc_reduction) + discount = Discount(student=student, value=-float(total_reduction), description=desc_reduction) discount.save() student.balance = float(balance) @@ -492,11 +492,12 @@ class UserXLSBook(object): amount = row[i] payment_type = row[i+1] payments = Payment.objects.filter(student=student, month=month[0]) + student.restricted = False if not payments and amount: payment = Payment(student=student, value=float(amount), month=month[0], type=payment_type, online_paid=True) print(last_name.encode('utf8') + ' : add payment') payment.save() - student.is_subscribed = True + student.restricted = True i += 2 student.save()