Merge pull request #6646 from laudeco/feature/expense_report_paid

NEW mark expense report as paid if payement set the remaining sold to 0
This commit is contained in:
Laurent Destailleur 2017-04-06 22:01:28 +02:00 committed by GitHub
commit 87368908f6

View File

@ -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)
{
$db->commit();