Use more apropiate date for commissions
Currently the invoice module sets the commission date based on the method:
* On posting: The date is set to today when the invoice is posted.
* On payment: The date is set to today when the invoice is paid.
This works well when the system is receiving the data in real time but it may be some delay (specially when paying an invoice) which may cause inconsistence.
So I think it will be better to use:
* On posting: Set the commission date to invoice date (fallback to today if empty)
* On payment: Set the commission date to the reconcile date of the invoice (max date of payments).
This way, the commission date always reflects the date when the commission its due and not when the due condition was encoded on the system.