Formatted the datepicker to "yyyy-mm-dd".
Changed the format of the datepicker for dinamically added forms.
Fixed the redirection.
Changed the function to write the reminder number.
This was necessary after changing the format of the datepicker from "dd/mm/yyyy" to "yyyy-mm-dd".
Bugfix for "rejected" or "paid on" invoices.
Due an error in the dynamic form creation, if the first item to post had status "rejected" or
"paid on", no added values (reject reason and payment date) were added to DB.
The problem was fixed adding the correct order number to "paidon" and "rejectreason" elements.
Small correction for giving some elements the correct order.