Invoice creation refactored: create and order record for every day