Add invoice model and logic behind it as requested in #24

Add invoice model and logic behind it as requested in #24

Ps : Sorry for all the horribles mistakes I made in the commit title