Hello,
Ok I found the problem. In 4.0.1 all hooks are in /includes/hooks there must be a file created. I solved it this way
<?php
function update_payment_date($invoiceid) {
update_query("tblinvoices",array("date"=>"now()"),array("id"=>$invoiceid));
}
add_hook("InvoicePaid",1,"update_payment_date","");
?>
It is working However I found a little annoying thing. The "due date" is now back in history
I think that I should not update it this way so the best option would be to edit template and in proforma show due date and in normal invoice show payment date as due date. What do you think ?