Skip to content
Snippets Groups Projects
Commit ae2e40e5 authored by De Coninck Laurent's avatar De Coninck Laurent
Browse files

mark expense report as paid if payement set the remaining sold to 0

parent aca1c194
No related branches found
No related tags found
No related merge requests found
...@@ -134,6 +134,18 @@ if ($action == 'add_payment') ...@@ -134,6 +134,18 @@ if ($action == 'add_payment')
} }
} }
if (!$error) {
$payment->fetch($paymentid);
if ($expensereport->total_ttc - $payment->amount == 0) {
$result = $expensereport->set_paid($expensereport->id, $user);
if (!$result > 0) {
$errmsg = $payment->error;
$error++;
}
}
}
if (! $error) if (! $error)
{ {
$db->commit(); $db->commit();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment