Browse Source

Fix bad link

Laurent Destailleur 4 years ago
parent
commit
2acf2353a3
2 changed files with 8 additions and 5 deletions
  1. 7 5
      htdocs/compta/paiement/card.php
  2. 1 0
      htdocs/langs/en_US/banks.lang

+ 7 - 5
htdocs/compta/paiement/card.php

@@ -277,10 +277,8 @@ print '</td></tr>';
 // 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);
@@ -297,7 +295,11 @@ if (!empty($conf->banque->enabled))
 	print '<tr>';
 	print '<td>'.$langs->trans('BankTransactionLine').'</td>';
 	print '<td>';
-	print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
+	if ($object->fk_account > 0) {
+		print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
+	} else {
+		print $langs->trans("NoRecordFoundIBankcAccount", $langs->transnoentities("Module85Name"));
+	}
 	print '</td>';
 	print '</tr>';
 }

+ 1 - 0
htdocs/langs/en_US/banks.lang

@@ -176,3 +176,4 @@ BankColorizeMovement=Colorize movements
 BankColorizeMovementDesc=If this function is enable, you can choose specific background color for debit or credit movements
 BankColorizeMovementName1=Background color for debit movement
 BankColorizeMovementName2=Background color for credit movement
+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.