invoice logic pushed into invoice object