Fix : duedate was not auto calculated + move calculation function to common invoice class