Project

General

Profile

« Previous | Next » 

Revision 33375338

Added by Mikaël Ates over 12 years ago

actes: add function to Act to determine if an act is billable.

View differences:

calebasse/actes/models.py
1 1
# -*- coding: utf-8 -*-
2

  
3 2
from django.db import models
4 3
from django.contrib.auth.models import User
5 4

  
......
39 38
            verbose_name=u'Type d\'acte')
40 39
    validation_locked = models.BooleanField(default=False,
41 40
            verbose_name=u'Vérouillage')
41
    is_billed = models.BooleanField(default=False,
42
            verbose_name=u'Facturé')
43
    switch_billable = models.BooleanField(default=False,
44
            verbose_name=u'Inverser type facturable')
42 45
    transport_company = models.ForeignKey('ressources.TransportCompany',
43 46
            blank=True,
44 47
            null=True,
......
76 79
        ActValidationState(act=self, state_name=state_name,
77 80
            author=author, previous_state=current_state).save()
78 81

  
82
    def is_billable(self):
83
        if (self.act_type.billable and not self.switch_billable) or \
84
                (not self.act_type.billable and self.switch_billable):
85
            return True
86

  
79 87
    # START Specific to sessad healthcare
80 88
    def was_covered_by_notification(self):
81 89
        notifications = \

Also available in: Unified diff