oadam / proprio

A free property management software to manage your tenancies
MIT License
20 stars 13 forks source link

partial month rent, tests #30

Closed vectorien closed 8 years ago

vectorien commented 8 years ago

Hi I implemented a simpler version of the partial rent calculation. Plus a test for it.

Things changed in tests:

-To calculate the rent for a full single month, the rentrevision should have first day of the month as start date and last day of the month (before it was first day of next month) as end date

-The datatype of rent amounts i the tests must be float not int, because divisions of int values can lead to very funny results in python:

>>> print 100 /30
3
>>> print 100.0 /30.0
3.33333333333

Have a nice weekend!

oadam commented 8 years ago

Hi,

I've finally had the chance to merge your work. I've changed some things:

Thanks for you help !

vectorien commented 8 years ago

Hi I just deployed you code into my django installation, and noticed that you didnt merge the partial month rent logic from this pr as in https://github.com/oadam/proprio/blob/26a6d8ceb4b53a6afd83ac9cca86787038689600/main/models.py#L297

I now had to create my own independent repo to serve my specific needs . It is at https://github.com/vectorien/proprio_vec