FIX Bad label on delete button

This commit is contained in:
Laurent Destailleur 2018-10-16 18:41:50 +02:00
parent 70366e9d91
commit 08fa0deb24

View File

@ -42,6 +42,13 @@ if ($user->societe_id) $socid=$user->societe_id;
$object = new PaymentExpenseReport($db);
if ($id > 0)
{
$result=$object->fetch($id);
if (! $result) dol_print_error($db,'Failed to get payment id '.$id);
}
/*
* Actions
*/
@ -77,10 +84,10 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->expensere
$db->commit();
$factures=array(); // TODO Get all id of invoices linked to this payment
foreach($factures as $id)
foreach($factures as $invoiceid)
{
$fac = new Facture($db);
$fac->fetch($id);
$fac->fetch($invoiceid);
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
@ -110,12 +117,6 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->expensere
llxHeader('', $langs->trans("ExpenseReportPayment"));
if ($id > 0)
{
$result=$object->fetch($id);
if (! $result) dol_print_error($db,'Failed to get payment id '.$id);
}
$form = new Form($db);
$head = payment_expensereport_prepare_head($object);
@ -265,9 +266,11 @@ if ($resql)
print '<td align="center">'.$expensereport->getLibStatut(4,$objp->amount).'</td>';
print "</tr>\n";
if ($objp->paid == 1) // If at least one invoice is paid, disable delete
{
$disable_delete = 1;
$disable_delete = 2;
$title_button = $langs->trans("CantRemovePaymentWithOneInvoicePaid");
}
$total = $total + $objp->amount;
$i++;
@ -303,7 +306,7 @@ if ($action == '')
}
else
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("CantRemovePaymentWithOneInvoicePaid")).'">'.$langs->trans('Delete').'</a>';
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($title_button).'">'.$langs->trans('Delete').'</a>';
}
}
}