Project

General

Profile

Download (1.41 KB) Statistics
| Branch: | Tag: | Revision:

calebasse / calebasse / actes / forms.py @ d3eeac81

1
# -*- coding: utf-8 -*-
2

    
3
from django import forms
4

    
5
from calebasse.actes.models import Act
6
from ajax_select import make_ajax_field
7

    
8
class ActSearchForm(forms.Form):
9
    STATES = (
10
            ('pointe', u'Pointés'),
11
            ('non-pointe', u'Non pointés'),
12
            ('valide', u'Validés'),
13
            ('absent-or-canceled', u'Absent ou annulés'),
14
            ('is-billable', u'Facturable'),
15
            ('non-invoicable', u'Non facturable'),
16
            ('switch-billable', u'Inversion de facturabilité'),
17
            ('lost', u'Perdus'),
18
            ('pause-invoicing', u'Pause facturation'),
19
            ('invoiced', u'Facturé'),
20
#            ('current-invoicing', u'Facturation en cours')
21
            )
22

    
23
    INITIAL = [x[0] for x in STATES]
24

    
25
    last_name = forms.CharField(required=False)
26
    patient_record_id = forms.IntegerField(required=False)
27
    social_security_number = forms.CharField(required=False)
28

    
29
    doctor_name = forms.CharField(required=False)
30
    filters = forms.MultipleChoiceField(choices=STATES,
31
            widget=forms.CheckboxSelectMultiple)
32

    
33
class ActUpdate(forms.ModelForm):
34
    doctors = make_ajax_field(Act, 'doctors', 'intervenant', True)
35
    class Meta:
36
        model = Act
37
        fields = ('act_type', 'doctors', 'is_lost', 'pause', 'switch_billable', 'comment',
38
                'valide')
39
        widgets = {
40
                'comment': forms.Textarea(attrs={'cols': 52, 'rows': 4}),
41
                }
(3-3/9)