diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php
index 9d452ef52b3..374ab19e358 100644
--- a/htdocs/compta/paiement/card.php
+++ b/htdocs/compta/paiement/card.php
@@ -265,10 +265,8 @@ print '';
// Bank account
if (!empty($conf->banque->enabled))
{
- if ($object->fk_account > 0)
- {
- if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0)
- {
+ if ($object->fk_account > 0) {
+ if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) {
dol_include_once('/compta/paiement/cheque/class/remisecheque.class.php');
$bordereau = new RemiseCheque($db);
$bordereau->fetch($bankline->fk_bordereau);
@@ -285,7 +283,12 @@ if (!empty($conf->banque->enabled))
print '
';
print '| '.$langs->trans('BankTransactionLine').' | ';
print '';
- print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
+ if ($object->fk_account > 0) {
+ print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
+ } else {
+ $langs->load("admin");
+ print ''.$langs->trans("NoRecordFoundIBankcAccount", $langs->transnoentitiesnoconv("Module85Name")).'';
+ }
print ' | ';
print '
';
}
diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang
index 81a23238550..f0f5dfd0a8e 100644
--- a/htdocs/langs/en_US/banks.lang
+++ b/htdocs/langs/en_US/banks.lang
@@ -181,3 +181,4 @@ BankColorizeMovementName1=Background color for debit movement
BankColorizeMovementName2=Background color for credit movement
IfYouDontReconcileDisableProperty=If you don't make the bank reconciliations on some bank accounts, disable the property "%s" on them to remove this warning.
NoBankAccountDefined=No bank account defined
+NoRecordFoundIBankcAccount=No record found in bank account. Commonly, this occurs when a record has been deleted manually from the list of transaction in the bank account (for example during a reconciliation of the bank account). Another reason is that the payment was recorded when the module "%s" was disabled.