Browse Source

màj script de transparence

Élie Bouttier 7 years ago
parent
commit
62552afe48
1 changed files with 5 additions and 5 deletions
  1. 5 5
      banking/management/commands/transparence.py

+ 5 - 5
banking/management/commands/transparence.py

@@ -48,15 +48,15 @@ class Command(BaseCommand):
             assert(nadh == npay + nfree + nmiss)
             total = list(map(add, total, [ntotal, ninf, nadh, npay, nfree, nmiss, income]))
             lines += [(str(service_type), ntotal, ninf, nadh, npay, nfree, nmiss, income)]
-        self.stdout.write("%-18s%12s%12s%12s%12s%12s%12s%12s" % ('Service', 'total', 'infra', 'adhérents', 'gratuit', 'manquant', 'euros', 'pourcent'))
+        self.stdout.write("%-18s%12s%12s%12s%12s%12s%12s%12s" % ('Service', 'total', 'infra', 'adhérents', 'gratuits', 'payés', 'euros', 'pourcent'))
         lines += [('TOTAL',) + tuple(total)]
-        total_income = total[5]
+        total_income = total[6]
         for service_type, ntotal, ninf, nadh, npay, nfree, nmiss, income in lines:
             if total_income:
                 percent = income / total_income * 100
             else:
                 percent = 0
-            self.stdout.write("%-18s%12d%12d%12d%12d%12d%12.2f%12.1f" % (service_type, ntotal, ninf, nadh, nfree, nmiss, income, percent))
+            self.stdout.write("%-18s%12d%12d%12d%12d%12d%12.2f%12.1f" % (service_type, ntotal, ninf, nadh, nfree + nmiss, npay, income, percent))
 
     def handle_adhesions(self):
         adhesions = Adhesion.objects.filter(Q(active__isnull=True) | Q(active=True))
@@ -72,5 +72,5 @@ class Command(BaseCommand):
                 assert(payment.payment_method != PaymentUpdate.STOP)
                 ppay += 1
                 income += float(payment.amount) / payment.period
-        self.stdout.write("%12s%12s%12s%12s%12s" % ('Adhesions', 'payant', 'gratuit', 'manquante', 'euros'))
-        self.stdout.write("%12d%12d%12d%12d%12d" % (nadh, ppay, pgra, pmiss, income))
+        self.stdout.write("%12s%12s%12s%12s" % ('Adhesions', 'gratuites', 'payées', 'euros'))
+        self.stdout.write("%12d%12d%12d%12d" % (nadh, pgra + pmiss, ppay, income))