예제 #1
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)
예제 #2
0
    def testAddMissingDefaut(self):
        lot = Lot('T2', 45, 500)
        charge = Charge(lot, self.defaut)
        type_ = Charge.charge_e.copropriete

        with self.assertRaises(LookupError):
            charge.add(type_, 1)
예제 #3
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)
예제 #4
0
    def testCharges(self):

        bi = Bien_Immo(50000, 0, 0, 0, 0)
        lot1 = Lot("T2", 50, 500)
        bi.add_lot(lot1)

        lot2 = Lot("T2", 50, 500)
        charge = Charge(lot2, None)

        charge.add(Charge.charge_e.copropriete, 51 * 12)
        charge.add(Charge.charge_e.prime_assurance, 90)
        charge.add(Charge.charge_e.vacance_locative, 1 / 12)
        charge.add(Charge.charge_e.agence_immo, 0.05)
        lot2.charge = charge
        bi.add_lot(lot2)

        self.assertEqual(bi.financement_total, 50000)
        self.assertEqual(bi.loyer_nu_brut_mensuel, 1000)
        self.assertEqual(bi.loyer_nu_brut_annuel, 12000)
        self.assertEqual(bi.loyer_nu_net_annuel, 11500)
        self.assertAlmostEqual(bi.loyer_nu_net_mensuel, 958.33, 2)
        self.assertEqual(bi.charges + bi.provisions, 1002)

        self.assertEqual(bi.get_charge(Charge.charge_e.taxe_fonciere), 0)
        self.assertEqual(bi.get_charge(Charge.charge_e.provision_travaux), 0)
        self.assertEqual(bi.get_charge(Charge.charge_e.vacance_locative), 500)
        self.assertEqual(bi.get_charge(Charge.charge_e.prime_assurance), 90)
        self.assertEqual(bi.get_charge(Charge.charge_e.agence_immo), 25 * 12)
        self.assertEqual(bi.get_charge(Charge.charge_e.copropriete), 51 * 12)
예제 #5
0
파일: test_lot.py 프로젝트: nboutin/immo
    def testLoyerNetMensuel(self):
        lot = Lot('T1', 30, 360)
        self.assertEqual(lot.loyer_nu_net_mensuel, 360)

        charge = Charge(lot, self.defaut)
        charge.add(Charge.charge_e.vacance_locative, 1)
        lot.charge = charge
        self.assertEqual(lot.loyer_nu_net_mensuel, 330.12)
예제 #6
0
    def testImpotTotal(self):
        bien_immo = Bien_Immo(0, 0, 0, 0, 0)
        lot = Lot("", 0, 500)
        bien_immo.add_lot(lot)
        charge = Charge(lot)
        lot.charge = charge

        irr = Annexe_2044(self._database, bien_immo, self.credit, 0.11)
        self.assertAlmostEqual(irr.impot_total, 1032 + 660)

        charge.add(charge.deductible_e.copropriete, 1000)
        self.assertAlmostEqual(irr.impot_total, 860 + 550)
예제 #7
0
    def testPrelevementSociaux(self):
        bien_immo = Bien_Immo(0, 0, 0, 0, 0)
        lot = Lot("", 0, 500)
        bien_immo.add_lot(lot)
        charge = Charge(lot)
        lot.charge = charge

        irr = Annexe_2044(self._database, bien_immo, self.credit, 0.11)
        self.assertAlmostEqual(irr.prelevement_sociaux_montant, 1032)

        charge.add(charge.deductible_e.copropriete, 1000)
        self.assertAlmostEqual(irr.prelevement_sociaux_montant, 860)
예제 #8
0
    def testRevenuFoncierImpossableA(self):
        bien_immo = Bien_Immo(0, 0, 0, 0, 0)
        lot = Lot("", 0, 500)
        bien_immo.add_lot(lot)
        charge = Charge(lot)
        lot.charge = charge

        irr = Annexe_2044(self._database, bien_immo, self.credit, 0)
        self.assertAlmostEqual(irr.revenu_foncier_impossable, 0)

        irr = Annexe_2044(self._database, bien_immo, self.credit, 0.11)
        self.assertAlmostEqual(irr.revenu_foncier_impossable, 660)

        charge.add(charge.deductible_e.copropriete, 1000)
        self.assertAlmostEqual(irr.revenu_foncier_impossable, 550)
예제 #9
0
    def testRendementNet(self):
        bi = Bien_Immo(0, 0, 0, 0, 0)
        rdt = Rendement(bi)
        self.assertEqual(rdt.rendement_net, 0)

        bi = Bien_Immo(50000, 0, 0, 0, 0)
        bi.add_lot(Lot("T2", 50, 500))
        rdt = Rendement(bi)
        self.assertEqual(rdt.rendement_net, 0.12)

        lot = Lot("T2", 50, 500)
        charge = Charge(lot, None)
        charge.add(Charge.charge_e.copropriete, 51 * 12)
        charge.add(Charge.charge_e.prime_assurance, 90)
        charge.add(Charge.charge_e.vacance_locative, 1 / 12)
        charge.add(Charge.charge_e.agence_immo, 0.05)
        lot.charge = charge
        bi.add_lot(lot)

        self.assertAlmostEqual(bi.charges + bi.provisions, 1002, 2)
        self.assertAlmostEqual(rdt.rendement_net, 0.21, 2)
예제 #10
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)
예제 #11
0
    def testCashflow(self):
        bi = Bien_Immo(50000, 0, 0, 0, 0)

        lot1 = Lot("T2", 50, 500)
        bi.add_lot(lot1)
        cr = Credit(50000, 240, 0.02, Credit.taux_e.periodique, 0,
                    Credit.mode_e.fixe_CI, 0, 0)
        rdt = Rendement(bi, cr)
        self.assertAlmostEqual(rdt.cashflow_net_mensuel, 247.06, 2)

        lot2 = Lot("T2", 50, 500)
        charge = Charge(lot2, None)
        charge.add(Charge.charge_e.copropriete, 51 * 12)
        charge.add(Charge.charge_e.prime_assurance, 90)
        charge.add(Charge.charge_e.vacance_locative, 1 / 12)
        charge.add(Charge.charge_e.agence_immo, 0.05)
        lot2.charge = charge
        bi.add_lot(lot2)

        self.assertAlmostEqual(bi.loyer_nu_brut_annuel, 12000, 2)
        self.assertAlmostEqual(bi.charges + bi.provisions, 1002, 2)
        self.assertAlmostEqual(cr.get_mensualite_avec_assurance(), 252.94, 2)
        self.assertAlmostEqual(rdt.cashflow_net_mensuel, 621.89, 2)
        self.assertAlmostEqual(rdt.cashflow_net_annuel, 7462.70, 2)
예제 #12
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
예제 #13
0
    def testBaseImpossable(self):

        bien_immo = Bien_Immo(0, 0, 0, 0, 0)
        lot = Lot("", 0, 500)
        bien_immo.add_lot(lot)

        irr = Annexe_2044(self._database, bien_immo, self.credit, 0)

        # Pas de charges
        self.assertAlmostEqual(irr.base_impossable, 6000)

        charge = Charge(lot)
        lot.charge = charge

        # Copropriete
        charge.add(charge.deductible_e.copropriete, 1000)
        self.assertAlmostEqual(irr.base_impossable, 5000)

        # Taxe fonciere
        charge.add(charge.deductible_e.copropriete, 800)
        self.assertAlmostEqual(irr.base_impossable, 4200)

        # PNO
        charge.add(charge.deductible_e.prime_assurance, 100)
        self.assertAlmostEqual(irr.base_impossable, 4100)

        # Autres
        charge.add(Charge.charge_e.provision_travaux, 0.01)
        charge.add(Charge.charge_e.vacance_locative, 1 / 12)
        self.assertAlmostEqual(irr.base_impossable, 4100)

        # Gestion agence locative
        charge.add(Charge.charge_e.agence_immo, 0.05)
        self.assertAlmostEqual(irr.base_impossable, 3800)
예제 #14
0
 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)
예제 #15
0
파일: factory.py 프로젝트: nboutin/immo
    def make_bien_immo(achat_data, lots_data, defaut=Defaut(0, 0, 0, 0)):

        bien_immo = Bien_Immo(achat_data['prix_net_vendeur'],
                              achat_data['frais_agence'],
                              achat_data['frais_notaire'],
                              achat_data['budget_travaux'],
                              achat_data['apport'])

        for lot_data in lots_data:

            lot = Lot(lot_data['type'], lot_data['surface'],
                      lot_data['loyer_nu_mensuel'])

            charges_data = lot_data['charges']
            charge = Charge(lot, defaut)
            charge.add(Charge.charge_e.charge_locative,
                       charges_data['provision_charge_mensuel'])

            charge.add(Charge.charge_e.copropriete,
                       charges_data['copropriete'])
            charge.add(Charge.charge_e.taxe_fonciere,
                       charges_data['taxe_fonciere'])
            charge.add(Charge.charge_e.prime_assurance, charges_data['PNO'])
            charge.add(Charge.charge_e.agence_immo,
                       charges_data['agence_immo'])

            charge.add(Charge.charge_e.provision_travaux,
                       charges_data['travaux_provision_taux'])
            charge.add(Charge.charge_e.vacance_locative,
                       charges_data['vacance_locative_taux'])
            lot.charge = charge

            bien_immo.add_lot(lot)

        return bien_immo
예제 #16
0
 def testAddVacanceLocative1B(self):
     lot = Lot('T2', 45, 450)
     charge = Charge(lot, self.defaut)
     type_ = Charge.charge_e.vacance_locative
     charge.add(type_, 1)
예제 #17
0
 def testInit(self):
     _ = Charge(None)
     _ = Charge(None, None)