Fix can fix a corrupted lost bank account on bank account lines

This commit is contained in:
Laurent Destailleur 2022-05-12 11:06:22 +02:00
parent 1768c3d926
commit 85cddf638f

View File

@ -334,11 +334,12 @@ if ($result) {
// Bank account
print '<tr><td class="titlefieldcreate">'.$langs->trans("Account").'</td>';
print '<td>';
if (!$objp->rappro && !$bankline->getVentilExportCompta()) {
print img_picto('', 'bank_account', 'class="paddingright"');
print $form->select_comptes($acct->id, 'accountid', 0, '', 0, '', 0, '', 1);
} else {
// $objp->fk_account may be not > 0 if data was lost by an old bug. In such a case, we let a chance to user to fix it.
if (($objp->rappro || $bankline->getVentilExportCompta()) && $objp->fk_account > 0) {
print $acct->getNomUrl(1, 'transactions', 'reflabel');
} else {
print img_picto('', 'bank_account', 'class="paddingright"');
print $form->select_comptes($acct->id, 'accountid', 0, '', ($acct->id > 0 ? $acct->id : 1), '', 0, '', 1);
}
print '</td>';
print '</tr>';