diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php
index ba65669aca4..1ee9fe9b582 100644
--- a/htdocs/compta/paiement/card.php
+++ b/htdocs/compta/paiement/card.php
@@ -226,6 +226,7 @@ print '
| '.$form->editfieldkey("Note",'note',$object->note,$
print $form->editfieldval("Note",'note',$object->note,$object,$user->rights->facture->paiement,'textarea');
print ' |
';
+$disable_delete = 0;
// Bank account
if (! empty($conf->banque->enabled))
{
@@ -233,6 +234,11 @@ if (! empty($conf->banque->enabled))
{
$bankline=new AccountLine($db);
$bankline->fetch($object->bank_line);
+ if ($bankline->rappro)
+ {
+ $disable_delete = 1;
+ $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemoveConciliatedPayment"));
+ }
print '';
print '| '.$langs->trans('BankTransactionLine').' | ';
@@ -274,7 +280,6 @@ print '';
* List of invoices
*/
-$disable_delete = 0;
$sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.total_ttc, f.paye, f.fk_statut, pf.amount, s.nom as name, s.rowid as socid';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
$sql.= ' WHERE pf.fk_facture = f.rowid';
@@ -344,6 +349,7 @@ if ($resql)
if ($objp->paye == 1) // If at least one invoice is paid, disable delete
{
$disable_delete = 1;
+ $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid"));
}
$total = $total + $objp->amount;
$i++;
@@ -389,7 +395,7 @@ if ($user->societe_id == 0 && $action == '')
}
else
{
- print ''.$langs->trans('Delete').'';
+ print ''.$langs->trans('Delete').'';
}
}
}