Projet

Général

Profil

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

calebasse / calebasse / facturation / templates / facturation / detail.html @ 1ccf354b

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 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
            {% if patient.pause %}
293
            <div class="frame dossier not_facturable pause">
294
            {% else %}
295
              {% if "losts" in detail.keys %}
296
              <div class="frame dossier not_facturable losts">
297
              {% else %}
298
                {% if "acts_paused" in detail.keys %}
299
                <div class="frame dossier not_facturable acts_paused">
300
                {% else %}
301
                  {% if "losts_missing_policy" in detail.keys %}
302
                  <div class="frame dossier not_facturable missing_policy">
303
                  {% else %}
304
                    {% if "losts_missing_birthdate" in detail.keys %}
305
                    <div class="frame dossier not_facturable missing_birthdate">
306
                    {% else %}
307
                    <div class="frame dossier">
308
                    {% endif %}
309
                  {% endif %}
310
                {% endif %}
311
              {% endif %}
312
            {% endif %}
313

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

    
589
{% endblock %}
590

    
591
{% block dialogs %}
592
<div id="change-record" style="display: none;" data-id="{{ invoicing.id }}" data-service-name="{{ service_name }}">
593
 </div>
594

    
595
<div id="rebill" style="display: none;"  data-id="">
596
 </div>
597

    
598
<div id="validate-dialog" title="Validation {% if service_name == "CMPP" %}de la facturation{% else %}du décompte{% endif %}">
599
  <div id="validate-dialog-content">
600
  </div>
601
  <form method="post" action="validate/">
602
    {% csrf_token %}
603
    <input type="hidden" name="Close" value="1">
604
  </form>
605
</div>
606
{% endblock %}
(7-7/17)