From d27b1de75b2f4da21224e7567243ff31065e735e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Ates?= Date: Fri, 28 Nov 2014 00:17:20 +0100 Subject: [PATCH] facturation: fix not billable patients details and filtering (fixes #3137). --- calebasse/facturation/models.py | 5 +-- .../templates/facturation/detail.html | 33 ++++--------------- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/calebasse/facturation/models.py b/calebasse/facturation/models.py index 6b5c84cf..f35fc76f 100644 --- a/calebasse/facturation/models.py +++ b/calebasse/facturation/models.py @@ -300,8 +300,7 @@ class Invoicing(models.Model): if not patient.pause: len_patient_invoiced_hors_pause = len_patient_invoiced_hors_pause + 1 - patients = set(acts_not_locked.keys() + acts_not_valide.keys() + \ - acts_not_billable.keys() + acts_diagnostic.keys() + acts_treatment.keys() + \ + patients = set(acts_diagnostic.keys() + acts_treatment.keys() + \ acts_losts.keys() + acts_pause.keys() + acts_losts_missing_policy.keys() + \ acts_losts_missing_birthdate.keys()) @@ -395,7 +394,6 @@ class Invoicing(models.Model): in_o.batch = b['batch'] in_o.save() - pass if patient in acts_losts.keys(): # TODO: More details about healthcare dic['losts'] = acts_losts[patient] @@ -417,7 +415,6 @@ class Invoicing(models.Model): if dic: patients_stats.append((patient, dic)) patients_stats = sorted(patients_stats, key=lambda patient: (patient[0].last_name, patient[0].first_name)) - len_patients = len(patients_stats) if commit: diff --git a/calebasse/facturation/templates/facturation/detail.html b/calebasse/facturation/templates/facturation/detail.html index 8b4e1d12..6bdebc3a 100644 --- a/calebasse/facturation/templates/facturation/detail.html +++ b/calebasse/facturation/templates/facturation/detail.html @@ -280,36 +280,17 @@

Dossiers concernés

{% if invoicing.status == "open" or invoicing.status == "closed" %}

-
-
-
-
-
+
+
+
+
+

{% for patient, detail in patients_stats %} - {% if patient.pause %} -
- {% else %} - {% if "losts" in detail.keys %} -
- {% else %} - {% if "acts_paused" in detail.keys %} -
- {% else %} - {% if "losts_missing_policy" in detail.keys %} -
- {% else %} - {% if "losts_missing_birthdate" in detail.keys %} -
- {% else %} -
- {% endif %} - {% endif %} - {% endif %} - {% endif %} - {% endif %} + +