FIX : display error when loan can't be deleted
This commit is contained in:
parent
3c22179183
commit
a4785adb3d
2 changed files with 3 additions and 2 deletions
|
|
@ -82,7 +82,7 @@ if (empty($reshook)) {
|
|||
if ($result > 0) {
|
||||
setEventMessages($langs->trans('LoanPaid'), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($loan->error, null, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ if (empty($reshook)) {
|
|||
header("Location: list.php");
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($loan->error, null, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -308,6 +308,7 @@ class Loan extends CommonObject
|
|||
$accountline->fetch($line_url['fk_bank']);
|
||||
$result = $accountline->delete_urls($user);
|
||||
if ($result < 0) {
|
||||
$this->errors = array_merge($this->errors, [$accountline->error], $accountline->errors);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue