Esempio n. 1
0
    def testAdd0(self):
        lot = Lot('T2', 45, 450)
        charge = Charge(lot)
        type_ = Charge.charge_e.taxe_fonciere
        charge.add(type_, 0)

        self.assertEqual(charge.get_montant_annuel(type_), 0)
Esempio n. 2
0
    def testAddVacanceLocative0(self):
        lot = Lot('T2', 45, 450)
        charge = Charge(lot)
        type_ = Charge.charge_e.vacance_locative
        charge.add(type_, 0)

        self.assertEqual(charge.get_montant_annuel(type_), 0)
Esempio n. 3
0
    def testAddTravauxProvision(self):
        '''default'''
        lot = Lot('T2', 45, 500)
        charge = Charge(lot, self.defaut)
        type_ = Charge.charge_e.provision_travaux
        charge.add(type_, 1)

        self.assertEqual(charge.get_taux(type_), 0.01)
        self.assertEqual(charge.get_montant_annuel(type_), 60)
Esempio n. 4
0
class Lot:

    def __init__(self, type_, surface, loyer_nu_mensuel):
        self._type = type_
        self._surface = surface
        self._loyer_nu_mensuel = loyer_nu_mensuel
        self.charge = Charge(self, None)

    @property
    def type(self):
        return self._type

    @property
    def surface(self):
        return self._surface

    @property
    def loyer_nu_brut_mensuel(self):
        return self._loyer_nu_mensuel

    @property
    def loyer_nu_brut_annuel(self):
        return self.loyer_nu_brut_mensuel * 12

    @property
    def loyer_nu_net_mensuel(self):
        return self.loyer_nu_net_annuel / 12

    @property
    def loyer_nu_net_annuel(self):
        '''
        Provision sur loyer nu brut de:
            - vacance locative
        '''
        vacance_locative = self.charge.get_montant_annuel(Charge.charge_e.vacance_locative)
        return self.loyer_nu_brut_annuel - vacance_locative

    @property
    def charge(self):
        return self._charge

    @charge.setter
    def charge(self, value):
        self._charge = value