Update card.php

This commit is contained in:
Frédéric FRANCE 2016-01-09 10:37:53 +01:00
parent c9176cd6b4
commit 0c6bd4e617

View File

@ -226,6 +226,7 @@ print '<tr><td class="tdtop">'.$form->editfieldkey("Note",'note',$object->note,$
print $form->editfieldval("Note",'note',$object->note,$object,$user->rights->facture->paiement,'textarea');
print '</td></tr>';
$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 '<tr>';
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
@ -274,7 +280,6 @@ print '</table>';
* 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 '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid")).'">'.$langs->trans('Delete').'</a>';
print '<a class="butActionRefused" href="#" title="'.$title_button.'">'.$langs->trans('Delete').'</a>';
}
}
}