FIX Bad label on delete button
This commit is contained in:
parent
70366e9d91
commit
08fa0deb24
@ -42,6 +42,13 @@ if ($user->societe_id) $socid=$user->societe_id;
|
|||||||
|
|
||||||
$object = new PaymentExpenseReport($db);
|
$object = new PaymentExpenseReport($db);
|
||||||
|
|
||||||
|
if ($id > 0)
|
||||||
|
{
|
||||||
|
$result=$object->fetch($id);
|
||||||
|
if (! $result) dol_print_error($db,'Failed to get payment id '.$id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -77,10 +84,10 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->expensere
|
|||||||
$db->commit();
|
$db->commit();
|
||||||
|
|
||||||
$factures=array(); // TODO Get all id of invoices linked to this payment
|
$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 = new Facture($db);
|
||||||
$fac->fetch($id);
|
$fac->fetch($invoiceid);
|
||||||
|
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
if (! empty($_REQUEST['lang_id']))
|
if (! empty($_REQUEST['lang_id']))
|
||||||
@ -110,12 +117,6 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->expensere
|
|||||||
|
|
||||||
llxHeader('', $langs->trans("ExpenseReportPayment"));
|
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);
|
$form = new Form($db);
|
||||||
|
|
||||||
$head = payment_expensereport_prepare_head($object);
|
$head = payment_expensereport_prepare_head($object);
|
||||||
@ -265,9 +266,11 @@ if ($resql)
|
|||||||
print '<td align="center">'.$expensereport->getLibStatut(4,$objp->amount).'</td>';
|
print '<td align="center">'.$expensereport->getLibStatut(4,$objp->amount).'</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
if ($objp->paid == 1) // If at least one invoice is paid, disable delete
|
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;
|
$total = $total + $objp->amount;
|
||||||
$i++;
|
$i++;
|
||||||
@ -303,7 +306,7 @@ if ($action == '')
|
|||||||
}
|
}
|
||||||
else
|
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>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user