improve date handler
invoice charges first, add sql base