diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php
index 4f0056621bd..f673c24fe74 100644
--- a/htdocs/compta/bank/various_payment/card.php
+++ b/htdocs/compta/bank/various_payment/card.php
@@ -639,10 +639,10 @@ if ($id) {
print '';
if (isModEnabled('banque')) {
+ print '
';
+ print '| '.$langs->trans('BankTransactionLine').' | ';
+ print '';
if ($object->fk_account > 0) {
- print ' |
';
- print '| '.$langs->trans('BankTransactionLine').' | ';
- print '';
if ($object->fk_bank > 0) {
$bankline = new AccountLine($db);
$bankline->fetch($object->fk_bank);
@@ -651,9 +651,11 @@ if ($id) {
} else {
print ''.$langs->trans("NoRecordfound").'';
}
- print ' | ';
- print '
';
+ } else {
+ print ''.$langs->trans("NoRecordfound").'';
}
+ print '';
+ print '';
}
// Other attributes
diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql
index a33143f8aef..737ee1bf511 100644
--- a/htdocs/install/mysql/migration/repair.sql
+++ b/htdocs/install/mysql/migration/repair.sql
@@ -217,6 +217,10 @@ DELETE from llx_bank_url where type = 'company' and url_id not in (select rowid
--SELECT * from llx_bank where rappro = 0 and label LIKE '(CustomerInvoicePayment%)' and rowid not in (select fk_bank from llx_bank_url where type = 'payment');
--SELECT * from llx_bank where rappro = 0 and label LIKE '(SupplierInvoicePayment%)' and rowid not in (select fk_bank from llx_bank_url where type = 'payment_supplier');
+-- Fix: delete orphelins in llx_bank
+DELETE FROM llx_bank WHERE fk_account NOT IN (select rowid from llx_bank_account);
+
+
-- Fix link on parent that were removed
DROP table tmp_user;
CREATE TABLE tmp_user as (select * from llx_user);