Some refactoring of sales order to change how effective date works and f...

...ix mixin implementation.