Projet

Général

Profil

Télécharger (28,1 ko) Statistiques
| Branche: | Tag: | Révision:

calebasse / calebasse / facturation / templates / facturation / detail.html @ d27b1de7

1
{% extends "facturation/base.html" %}
2
{% load url from future %}
3

    
4
{% block appbar %}
5
    <h2>
6

    
7
    {% if service_name == "CMPP" %}
8
        Facturation {{ invoicing.seq_id }}
9
        {% if invoicing.status == "open" %}
10
            ouverte et ayant débuté le {{ invoicing.start_date }}
11
        {% else %}
12
            {% if invoicing.status == "closed" %}
13
            fermée
14
            {% else %}
15
            validée
16
            {% endif %}
17
            couvrant la période du {{ invoicing.start_date }} au {{ invoicing.end_date }}
18
        {% endif %}
19
    {% else %}
20
        Décompte {{ invoicing.seq_id }}
21
        {% if invoicing.status == "validated" %}
22
        validé
23
        {% endif %}
24
        pour le trimestre allant du {{ invoicing.start_date }} au {{ invoicing.end_date }}
25
    {% endif %}</h2>
26
    <a href="..">Retourner à la liste</a>
27
    {% if service_name == "CMPP" %}
28
        {% if invoicing.status == "open" %}<button id="close-invoicing">Clore cette facturation</button>{% endif %}
29
        {% if invoicing.status == "closed" and previous_validated %}<button id="validate"">Valider cette facturation</button>{% endif %}
30
        {% if invoicing.status == "validated" %}
31
            <button onclick="window.location.href=window.location.href+'transmission/'">Télétransmission</button>
32
            <button onclick="window.location.href=window.location.href+'export/'">Export comptabilité</button>
33
            <button onclick="window.location.href=window.location.href+'download/'">Imprimer</button>
34
        {% endif %}
35
    {% else %}
36
        {% if show_validation_btn %}<button id="validate">Valider ce décompte</button>{% endif %}
37
        {% if invoicing.status == "validated" %}<button id="print-btn" onclick="window.location.href=window.location.href+'download/'">Imprimer</button>{% endif %}
38
    {% endif %}
39
{% endblock %}
40

    
41
{% block content %}
42

    
43
    <div id="facturation-contents">
44
    {% if days_not_locked %}
45
    <h3>Jours non verrouillés</h3>
46
        <ul>
47
        {% for day in days_not_locked %}
48
            <li><a href="../../agenda/{{ day.year }}-{{ day.month }}-{{ day.day }}/validation-des-actes" target="_blank">{{ day.day }}/{{ day.month }}/{{ day.year }}</a></li>
49
        {% endfor %}
50
        </ul>
51
    {% endif %}
52
    <h3>Résumé</h3>
53
    {% if service_name == "CMPP" %}
54
        {% if invoicing.status == "open" or invoicing.status == "closed" %}
55
        <ul>
56
            {% if len_acts_invoiced_hors_pause %}
57
              <li>Actes facturables maintenant : {{ len_acts_invoiced_hors_pause }}
58
                <ul>
59
                  <li>Dossiers concernés : {{ len_patient_invoiced_hors_pause }}</li>
60
                  <li>Nombre de factures : {{ len_invoices_hors_pause }}</li>
61
                </ul>
62
              </li>
63
            {% else %}
64
              <li>Pas d'actes facturables maintenant.</li>
65
            {% endif %}
66

    
67
            {% if len_acts_invoiced_pause %}
68
              <li>Actes facturables des dossiers en pause : {{ len_acts_invoiced_pause }}
69
                <ul>
70
                  <li>Dossiers concernés : {{ len_patient_invoiced_pause }}</li>
71
                  <li>Nombre de factures : {{ len_invoices_pause }}</li>
72
                </ul>
73
              </li>
74
            {% else %}
75
              <li>Pas d'actes facturables pour des dossiers en pause.</li>
76
            {% endif %}
77

    
78
            {% if len_acts_losts_missing_policy %}
79
              <li>Actes de dossiers avec des informations de sécurité sociale manquantes : {{ len_acts_losts_missing_policy }}
80
                <ul>
81
                  <li>Dossiers concernés : {{ len_patient_with_lost_acts_missing_policy }}</li>
82
                </ul>
83
              </li>
84
            {% else %}
85
              <li>Pas d'actes pour des dossiers avec des informations de sécurité sociale manquantes.</li>
86
            {% endif %}
87

    
88
            {% if len_acts_losts_missing_birthdate %}
89
              <li>Actes de dossiers dont le patient n'a pas de date de naissance d'indiquée : {{ len_acts_losts_missing_birthdate }}
90
                <ul>
91
                  <li>Dossiers concernés : {{ len_patient_with_lost_acts_missing_birthdate }}</li>
92
                </ul>
93
              </li>
94
            {% else %}
95
              <li>Pas d'actes pour des dossiers dont le patient n'a pas de date de naissance d'indiquée.</li>
96
            {% endif %}
97

    
98
            {% if len_acts_lost %}
99
              <li>Actes facturables mais non pris en charge : {{ len_acts_lost }}
100
                <ul>
101
                  <li>Dossiers concernés : {{ len_patient_with_lost_acts }}</li>
102
        <!--          <li>Quota des actes pris en charge dépassé : 2</li>-->
103
        <!--          <li>Prises en charge expirées : 2</li>-->
104
        <!--          <li>Pas de prise en charge : 1</li>-->
105
                </ul>
106
              </li>
107
            {% else %}
108
              <li>Pas d'actes facturables mais non pris en charge.</li>
109
            {% endif %}
110

    
111
            {% if len_acts_paused %}
112
              <li>Actes facturables en pause facturation : {{ len_acts_paused }}
113
                <ul>
114
                  <li>Dossiers concernés : {{ len_patient_acts_paused }}</li>
115
                </ul>
116
              </li>
117
            {% else %}
118
              <li>Pas d'actes facturables en pause facturation.</li>
119
            {% endif %}
120

    
121
        </ul>
122
        {% else %}
123
        <ul>
124
            {% if len_acts_invoiced %}
125
              <li>{{ len_acts_invoiced }} actes facturés pour un montant de {{ some_stats.total.1 }}.
126
                <ul>
127
                  <li>Dossiers concernés : {{ len_patients }}</li>
128
                  <li>Nombre de factures : {{ len_invoices }}</li>
129
                </ul>
130
              </li>
131
              <li>Détail par année et par tarif des actes :
132
                <table class="basic">
133
                  <thead><tr><th>Tarif</th><th>Année</th><th>Actes</th><th>Montant</th></tr></thead>
134
                  <tbody>
135
                  {% for year, x in some_stats.detail.items %}
136
                  {% for ppa, stats in x.items %}
137
                  <tr><td>{{ ppa }}</td><td>{{ year }}</td><td>{{ stats.0 }}</td><td>{{ stats.1 }}</td></tr>
138
                  {% endfor %}
139
                  {% endfor %}
140
                  </tbody>
141
                </table>
142
              </li>
143
              <li>Détail des lots :
144
                <table class="basic">
145
                  <thead><tr><th>Centre</th><th>Numéro de lot</th><th>Nombre de factures</th><th>Nombre d'actes</th><th>Montant facturé</th><th>Montant des rejets</th><th>Somme perçue</th></tr></thead>
146
                  <tbody>
147
                  {% for hc, batch, amount_rejected, versement in batches %}
148
                  <tr><td>{{ hc.name }}</td><td>{{ batch.number }}</td><td>{{ batch.number_of_invoices }}</td><td>{{ batch.number_of_acts }}</td><td>{{ batch.total }}</td><td>{{ amount_rejected }}</td><td>{{ versement }}</td></tr>
149
                  {% endfor %}
150
                  </tbody>
151
                </table>
152
              </li>
153
            {% else %}
154
              <li>Pas d'actes facturés pour cette facturation.</li>
155
            {% endif %}
156
        </ul>
157
      {% endif %}
158
    {% else %}
159
        {% if service_name == "CAMSP" %}
160
            {% if invoicing.status == "closed" %}
161
            <ul>
162
                {% if len_patient_hors_pause %}
163
                  <li>Actes décomptables hors dossiers en pause : {{ len_acts_hors_pause }}
164
                    <ul>
165
                      <li>Dossiers concernés : {{ len_patient_hors_pause }}</li>
166
                    </ul>
167
                  </li>
168
                {% else %}
169
                  <li>Pas d'actes décomptables pour les dossiers hors pause.</li>
170
                {% endif %}
171

    
172
                {% if len_patient_pause %}
173
                  <li>Actes décomptables des dossiers en pause : {{ len_acts_pause }}
174
                    <ul>
175
                      <li>Dossiers concernés : {{ len_patient_pause }}</li>
176
                    </ul>
177
                  </li>
178
                {% else %}
179
                  <li>Pas d'actes décomptables pour les dossiers en pause.</li>
180
                {% endif %}
181

    
182
                {% if len_acts_paused %}
183
                  <li>Actes décomptables en pause facturation : {{ len_acts_paused }}
184
                    <ul>
185
                      <li>Dossiers concernés : {{ len_patient_acts_paused }}</li>
186
                    </ul>
187
                  </li>
188
                {% else %}
189
                  <li>Pas d'actes décomptables en pause facturation.</li>
190
                {% endif %}
191

    
192
                {% if patients_missing_policy|length %}
193
                  <li>Dossiers avec information de sécurité sociale manquante : {{ patients_missing_policy|length }}
194
                  </li>
195
                {% endif %}
196

    
197
            </ul>
198
            {% else %}
199
            <ul>
200
                {% if len_patient_hors_pause %}
201
                  <li>Actes décomptés: {{ len_acts_hors_pause }}
202
                    <ul>
203
                      <li>Dossiers concernés : {{ len_patient_hors_pause }}</li>
204
                    </ul>
205
                  </li>
206
                {% else %}
207
                  <li>Pas d'actes décomptés pour ce décompte.</li>
208
                {% endif %}
209
            </ul>
210
            {% endif %}
211
        {% else %}
212
            {% if invoicing.status == "closed" %}
213
            <ul>
214
                {% if len_patient_hors_pause %}
215
                  <li>Actes décomptables hors dossiers en pause : {{ len_acts_hors_pause }}
216
                    <ul>
217
                      <li>Dossiers concernés : {{ len_patient_hors_pause }}</li>
218
                    </ul>
219
                  </li>
220
                {% else %}
221
                  <li>Pas d'actes décomptables pour les dossiers hors pause.</li>
222
                {% endif %}
223

    
224
                {% if len_patient_missing_notif %}
225
                  <li>Actes décomptables mais non couverts par une notification : {{ len_acts_missing_notif }}
226
                    <ul>
227
                      <li>Dossiers concernés : {{ len_patient_missing_notif }}</li>
228
                    </ul>
229
                  </li>
230
                {% else %}
231
                  <li>Pas d'actes décomptables avec une notification manquante.</li>
232
                {% endif %}
233

    
234
                {% if len_patient_pause %}
235
                  <li>Actes décomptables des dossiers en pause : {{ len_acts_pause }}
236
                    <ul>
237
                      <li>Dossiers concernés : {{ len_patient_pause }}</li>
238
                    </ul>
239
                  </li>
240
                {% else %}
241
                  <li>Pas d'actes décomptables pour les dossiers en pause.</li>
242
                {% endif %}
243

    
244
                {% if len_acts_paused %}
245
                  <li>Actes décomptables en pause facturation : {{ len_acts_paused }}
246
                    <ul>
247
                      <li>Dossiers concernés : {{ len_patient_acts_paused }}</li>
248
                    </ul>
249
                  </li>
250
                {% else %}
251
                  <li>Pas d'actes décomptables en pause facturation.</li>
252
                {% endif %}
253

    
254
                {% if patients_missing_policy|length %}
255
                  <li>Dossiers avec information de sécurité sociale manquante : {{ patients_missing_policy|length }}
256
                  </li>
257
                {% endif %}
258

    
259
            </ul>
260
            {% else %}
261
            <ul>
262
                {% if len_patient_hors_pause %}
263
                  <li>Actes décomptés : {{ len_acts_hors_pause }}
264
                    <ul>
265
                      <li>Dossiers concernés : {{ len_patient_hors_pause }}</li>
266
                    </ul>
267
                  </li>
268
                {% else %}
269
                  <li>Pas d'actes décomptés pour ce décompte.</li>
270
                {% endif %}
271
            </ul>
272
            {% endif %}
273

    
274
        {% endif %}
275
    {% endif %}
276
    </div>
277

    
278
    {% if service_name == "CMPP" and patients_stats %}
279
    <div id="dossiers">
280
        <h3>Dossiers concernés</h3>
281
        {% if invoicing.status == "open" or invoicing.status == "closed" %}
282
        <p id="filtre-dossiers">
283
         <input type="radio" name="dossiers_filter" value="pause" group="filter"><label>N'afficher que les dossiers présentant des actes facturables en pause facturation.</label></input><br/>
284
         <input type="radio" name="dossiers_filter" value="losts" group="filter"><label>N'afficher que les dossiers présentant des actes facturables non pris en charge.</label></input><br/>
285
         <input type="radio" name="dossiers_filter" value="acts_paused" group="filter"><label>N'afficher que les dossiers présentant des actes facturables en pause facturation.</label></input><br/>
286
         <input type="radio" name="dossiers_filter" value="missing_policy" group="filter"><label>N'afficher que les dossiers présentant des informations de sécurité sociale manquantes.</label></input><br/>
287
         <input type="radio" name="dossiers_filter" value="missing_birthdate" group="filter"><label>N'afficher que les dossiers pour lesquels il manque une date de naissance pour le patient.</label></input><br/>
288
         <input type="radio" name="dossiers_filter" value="all" group="filter" checked="checked"><label>Afficher tous les dossiers.</label></input>
289
        </p>
290
        <div id="dossiers-concernes">
291
        {% for patient, detail in patients_stats %}
292

    
293
            <div class="frame dossier{% if "invoices" in detail.keys and patient.pause%} not_facturable pause{% endif %}{% if "losts" in detail.keys %} not_facturable losts{% endif %}{% if "acts_paused" in detail.keys %} not_facturable acts_paused{% endif %}{% if "losts_missing_policy" in detail.keys %} not_facturable missing_policy{% endif %}{% if "losts_missing_birthdate" in detail.keys %} not_facturable missing_birthdate{% endif %}">
294

    
295
                <h3><span class="patient_pk">({{ patient.pk }})</span>
296
                  <a href="../../dossiers/{{ patient.pk }}/view" target="_blank">{% if patient.paper_id %}{{ patient.paper_id }} {% endif %} <span class="lastname">{{ patient.last_name }}</span> {{ patient.first_name }}</a></h3>
297
                <div class="info">
298
                </div>
299
                {% if patient.pause %}
300
                    <p id="pause-fac"><span class="hi-fact">Le dossier patient est en pause facturation.</span></p>
301
                    {% if patient.pause_comment %}<p>Commentaire : {{ patient.pause_comment }}</p>{% endif %}
302
                {% endif %}
303
                {% if "losts" in detail.keys %}<p id="pause-fac"><span class="hi-fact">Le dossier présente des actes facturables non pris en charge.</span></p>{% endif %}
304
                {% if "losts_missing_policy" in detail.keys %}<p id="pause-fac"><span class="hi-fact">Le dossier présente des informations de sécurité sociale manquantes.</span></p>{% endif %}
305
                {% if "losts_missing_birthdate" in detail.keys %}<p id="pause-fac"><span class="hi-fact">Date de naissance manquante pour le patient.</span></p>{% endif %}
306
                {% if "acts_paused" in detail.keys %}<p id="pause-fac"><span class="hi-fact">Le dossier présente des actes facturables en pause facturation.</span></p>{% endif %}
307
                <ul>
308
                {% for key, value in detail.items %}
309
                  {% if key == "invoices" %}
310
                  <li>Actes facturables <button class="blind">détails</button>
311
                    <ul>
312
                        {% for invoice in value %}
313
                        {% for k, v in invoice.items %}
314
                            {% if k == "acts" %}
315
                              {% for act, hc in v %}
316
                                <li>{{ act.date }} {{ act.act_type }}</li>
317
                              {% endfor %}
318
                            {% endif %}
319
                        {% endfor %}
320
                        {% endfor %}
321
                    </ul>
322
                  </li>
323
                  {% endif %}
324
                  {% if key == "losts" %}
325
                  <li>Actes facturables non pris en charge <button class="blind">détails</button>
326
                    <ul>
327
                      {% for act in value %}
328
                        <li>{{ act.date }} {{ act.act_type }}</li>
329
                      {% endfor %}
330
                    </ul>
331
                  </li>
332
                  {% endif %}
333
                  {% if key == "losts_missing_policy" %}
334
                  <li>Actes facturables mais le dossier présente des informations de sécurité sociale manquantes.<button class="blind">détails</button>
335
                    <ul>
336
                      {% for act in value %}
337
                        <li>{{ act.date }} {{ act.act_type }}</li>
338
                      {% endfor %}
339
                    </ul>
340
                  </li>
341
                  {% endif %}
342
                  {% if key == "losts_missing_birthdate" %}
343
                  <li>Actes facturables mais le patient n'a pas de date de naissance d'indiquée.<button class="blind">détails</button>
344
                    <ul>
345
                      {% for act in value %}
346
                        <li>{{ act.date }} {{ act.act_type }}</li>
347
                      {% endfor %}
348
                    </ul>
349
                  </li>
350
                  {% endif %}
351
                  {% if key == "acts_paused" %}
352
                  <li>Actes facturables en pause facturation <button class="blind">détails</button>
353
                    <ul>
354
                      {% for act in value %}
355
                        <li>{{ act.date }} {{ act.act_type }}</li>
356
                      {% endfor %}
357
                    </ul>
358
                  </li>
359
                  {% endif %}
360
                {% endfor %}
361
                </ul>
362
            </div>
363
        {% endfor %}
364
        </div>
365
        {% else %}
366
        <div id="dossiers-concernes">
367
        {% for patient, detail in patients_stats %}
368
            <div class="frame dossier" id="to-hide">
369
                <h3><span class="patient_pk">({{ patient.pk }})</span>{% if patient.pk %}<a href="../../dossiers/{{ patient.pk }}/view" target="_blank">{% endif %}
370
                {% if patient.paper_id %}{{ patient.paper_id }} {% endif %}<span class="lastname">{{ patient.last_name }}</span> {{ patient.first_name }}{% if patient.pk %}</a>{% endif %}</h3>
371
                <div class="info">
372
                </div>
373
                <ul>
374
                {% for key, value in detail.items %}
375
                  {% if key == "invoices" %}
376
                  <li>Actes facturés
377
                    <ul>
378
                        {% for invoice in value %}
379
                        <li>{% if invoice.rejected %}Facture {{ invoice.number }} <strong>rejetée</strong> <button class="blind">détails</button>
380
                          <ul>
381
                          {% for act in invoice.acts.all %}
382
                            <li>{{ act.date }} {{ act.act_type }} </li>
383
                          {% endfor %}
384
                          </ul>
385
                          {% else %}Facture {{ invoice.number }} <button data-id="{{ invoice.id }}" class="rebill-btn">Rejeter cette facture</button> <button class="blind">détails</button>
386
                          <ul>
387
                          {% for act in invoice.acts.all %}
388
                            <li>{{ act.get_hc_tag }} : {{ act.date }} {{ act.act_type }} </li>
389
                          {% endfor %}
390
                          </ul>
391
                          {% endif %}
392
                        </li>
393
                        {% endfor %}
394
                    </ul>
395
                  </li>
396
                  {% endif %}
397
                {% endfor %}
398
                </ul>
399
            </div>
400
        {% endfor %}
401
        </div>
402
        {% endif %}
403
    </div>
404
    {% endif %}
405
    {% if service_name == "CAMSP" and patients_stats %}
406
    <div id="dossiers">
407
        <h3>Dossiers concernés</h3>
408
        {% if invoicing.status == "closed" %}
409
            <p id="filtre-dossiers">
410
             <input type="checkbox" id="hide-dossiers-cb"><label for="hide-dossiers-cb">N'afficher que les dossiers en pause facturation, avec un acte en pause ou avec une information de sécurité sociale manquante.</label></input>
411
            </p>
412
        <div id="dossiers-concernes">
413
        {% for patient, detail in patients_stats %}
414
            {% if patient.pause or "acts_paused" in detail.keys or patient in patients_missing_policy %}
415
             <div class="frame dossier facturable">
416
            {% else %}
417
            <div class="frame dossier">
418
            {% endif %}
419
                <h3><span class="patient_pk">({{ patient.pk }})</span><a href="../../dossiers/{{ patient.pk }}/view" target="_blank">
420
                {% if patient.paper_id %}{{ patient.paper_id }} {% endif %} <span class="lastname">{{ patient.last_name }}</span> {{ patient.first_name }}</a></h3>
421
                <div class="info">
422
                </div>
423
                {% if patient.pause %}
424
                    <p id="pause-fac"><span class="hi-fact">Le dossier patient est en pause facturation.</span></p>
425
                    {% if patient.pause_comment %}<p>Commentaire : {{ patient.pause_comment }}</p>{% endif %}
426
                {% endif %}
427
                {% if "acts_paused" in detail.keys %}<p id="pause-fac"><span class="hi-fact">Le dossier présente des actes facturables en pause facturation.</span></p>{% endif %}
428
                {% if patient in patients_missing_policy %}<p id="pause-fac"><span class="hi-fact">Le dossier présente une information de sécurité sociale manquante.</span></p>{% endif %}
429
                <ul>
430
                {% for key, value in detail.items %}
431
                  {% if key == "accepted" %}
432
                  <li>Actes décomptables <button class="blind">détails</button>
433
                    <ul>
434
                      {% for act in value %}
435
                        <li>{{ act.date }} {{ act.act_type }}</li>
436
                      {% endfor %}
437
                    </ul>
438
                  </li>
439
                  {% endif %}
440
                  {% if key == "acts_paused" %}
441
                  <li>Actes décomptables en pause facturation <button class="blind">détails</button>
442
                    <ul>
443
                      {% for act in value %}
444
                        <li>{{ act.date }} {{ act.act_type }}</li>
445
                      {% endfor %}
446
                    </ul>
447
                  </li>
448
                  {% endif %}
449
                {% endfor %}
450
                </ul>
451
            </div>
452
        {% endfor %}
453
        </div>
454
        {% else %}
455
        <div id="dossiers-concernes">
456
        {% for patient, detail in patients_stats %}
457
            <div class="frame dossier" id="to-hide">
458
                <h3><span class="patient_pk">({{ patient.pk }})</span><a href="../../dossiers/{{ patient.pk }}/view" target="_blank">
459
                {% if patient.paper_id %}{{ patient.paper_id }} {% endif %} <span class="lastname">{{ patient.last_name }}</span> {{ patient.first_name }}</a></h3>
460
                <div class="info">
461
                </div>
462
                <ul>
463
                {% for key, value in detail.items %}
464
                  {% if key == "accepted" %}
465
                  <li>Actes décomptés <button class="blind">détails</button>
466
                    <ul>
467
                      {% for act in value %}
468
                        <li>{{ act.date }} {{ act.act_type }}</li>
469
                      {% endfor %}
470
                    </ul>
471
                  </li>
472
                  {% endif %}
473
                {% endfor %}
474
                </ul>
475
            </div>
476
        {% endfor %}
477
        </div>
478
        {% endif %}
479
    </div>
480
    {% endif %}
481
    {% if service_name == "SESSAD DYS" or service_name == "SESSAD TED" %}
482
        {% if patients_stats %}
483
    <div id="dossiers">
484
        <h3>Dossiers concernés</h3>
485
        {% if invoicing.status == "closed" %}
486
            <p id="filtre-dossiers">
487
             <input type="checkbox" id="hide-dossiers-cb"><label for="hide-dossiers-cb">N'afficher que les dossiers avec une notification manquante, en pause facturation, avec un acte en pause ou avec une information de sécurité sociale manquante.</label></input>
488
            </p>
489
        <div id="dossiers-concernes">
490
        {% for patient, detail in patients_stats %}
491
            {% if patient.pause or "acts_paused" in detail.keys or patient in patients_missing_policy or patient in patients_missing_notif %}
492
             <div class="frame dossier facturable">
493
            {% else %}
494
            <div class="frame dossier">
495
            {% endif %}
496
                <h3><span class="patient_pk">({{ patient.pk }})</span><a href="../../dossiers/{{ patient.pk }}/view" target="_blank">
497
                {% if patient.paper_id %}{{ patient.paper_id }} {% endif %} <span class="lastname">{{ patient.last_name }}</span> {{ patient.first_name }}</a></h3>
498
                <div class="info">
499
                </div>
500
                {% if patient.pause %}
501
                    <p id="pause-fac"><span class="hi-fact">Le dossier patient est en pause facturation.</span></p>
502
                    {% if patient.pause_comment %}<p>Commentaire : {{ patient.pause_comment }}</p>{% endif %}
503
                {% endif %}
504
                {% if "acts_paused" in detail.keys %}<p id="pause-fac"><span class="hi-fact">Le dossier présente des actes facturables en pause facturation.</span></p>{% endif %}
505
                {% if patient in patients_missing_policy %}<p id="pause-fac"><span class="hi-fact">Le dossier présente une information de sécurité sociale manquante.</span></p>{% endif %}
506
                {% if patient in patients_missing_notif %}<p id="pause-fac"><span class="hi-fact">Le dossier n'a pas de notification couvrant tous les actes.</span></p>{% endif %}
507
                <ul>
508
                {% for key, value in detail.items %}
509
                  {% if key == "accepted" %}
510
                  <li>Actes décomptables <button class="blind">détails</button>
511
                    <ul>
512
                      {% for act in value %}
513
                        <li>{{ act.date }} {{ act.act_type }}</li>
514
                      {% endfor %}
515
                    </ul>
516
                  </li>
517
                  {% endif %}
518
                  {% if key == "missings" %}
519
                  <li>Actes décomptables non couverts par une notification <button class="blind">détails</button>
520
                    <ul>
521
                      {% for act in value %}
522
                        <li>{{ act.date }} {{ act.act_type }}</li>
523
                      {% endfor %}
524
                    </ul>
525
                  </li>
526
                  {% endif %}
527
                  {% if key == "acts_paused" %}
528
                  <li>Actes décomptables en pause facturation <button class="blind">détails</button>
529
                    <ul>
530
                      {% for act in value %}
531
                        <li>{{ act.date }} {{ act.act_type }}</li>
532
                      {% endfor %}
533
                    </ul>
534
                  </li>
535
                  {% endif %}
536
                {% endfor %}
537
                </ul>
538
            </div>
539
        {% endfor %}
540
        </div>
541
        {% else %}
542
        <div id="dossiers-concernes">
543
        {% for patient, detail in patients_stats %}
544
            <div class="frame dossier" id="to-hide">
545
                <h3><span class="patient_pk">({{ patient.pk }})</span><a href="../../dossiers/{{ patient.pk }}/view" target="_blank">
546
                {% if patient.paper_id %}{{ patient.paper_id }} {% endif %} <span class="lastname">{{ patient.last_name }}</span> {{ patient.first_name }}</a></h3>
547
                <div class="info">
548
                </div>
549
                <ul>
550
                {% for key, value in detail.items %}
551
                  {% if key == "accepted" %}
552
                  <li>Actes décomptés <button class="blind">détails</button>
553
                    <ul>
554
                      {% for act in value %}
555
                        <li>{{ act.date }} {{ act.act_type }}</li>
556
                      {% endfor %}
557
                    </ul>
558
                  </li>
559
                  {% endif %}
560
                {% endfor %}
561
                </ul>
562
            </div>
563
        {% endfor %}
564
        </div>
565
        {% endif %}
566
    </div>
567
        {% endif %}
568
    {% endif %}
569

    
570
{% endblock %}
571

    
572
{% block dialogs %}
573
<div id="change-record" style="display: none;" data-id="{{ invoicing.id }}" data-service-name="{{ service_name }}">
574
 </div>
575

    
576
<div id="rebill" style="display: none;"  data-id="">
577
 </div>
578

    
579
<div id="validate-dialog" title="Validation {% if service_name == "CMPP" %}de la facturation{% else %}du décompte{% endif %}">
580
  <div id="validate-dialog-content">
581
  </div>
582
  <form method="post" action="validate/">
583
    {% csrf_token %}
584
    <input type="hidden" name="Close" value="1">
585
  </form>
586
</div>
587
{% endblock %}
(7-7/17)