Fix : duedate was not auto calculated + move calculation function to com...

...mon invoice class