Revert "Revert "fixed ordering dates for invoices""

This reverts commit 1fc03a68e6bdb951a0e304150b05766982752bea.