Fix disable direct debit request for replaced invoices

This commit is contained in:
Laurent Destailleur 2018-01-04 14:35:02 +01:00
parent c4eba665d0
commit 300d4e1603
3 changed files with 10 additions and 4 deletions

View File

@ -64,7 +64,7 @@ if (! empty($conf->accounting->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
}
$langs->loadLangs(array('bills','companies','compta','products','banks','main'));
$langs->loadLangs(array('bills','companies','compta','products','banks','main','withdrawals'));
if (! empty($conf->incoterm->enabled)) $langs->load('incoterm');
if (! empty($conf->margin->enabled)) $langs->load('margins');
@ -4293,8 +4293,12 @@ else if ($id > 0 || ! empty($ref))
{
if ($user->rights->prelevement->bons->creer)
{
$langs->load("withdrawals");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id.'" title="'.dol_escape_htmltag($langs->trans("MakeWithdrawRequest")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id.'" title="'.dol_escape_htmltag($langs->trans("MakeWithdrawRequest")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
} else {
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('MakeWithdrawRequest') . '</span></div>';
}
}
else
{

View File

@ -111,7 +111,7 @@ if (g.getDivId() != null)
<?php
echo "\n";
echo "/* g.AddTaskItem(new JSGantt.TaskItem(task_id, 'label', 'start_date', 'end_date', 'css', 'link', milestone, 'Resources', Compl%, Group, Parent, 1, 'Dependency', 'label','note', g)); */\n";
echo "/* g.AddTaskItem(new JSGantt.TaskItem(task_id, 'label', 'start_date', 'end_date', 'css', 'link', milestone, 'Resources', Compl%, Group, Parent, Open, 'Dependency', 'label','note', g)); */\n";
$level=0;
$tnums = count($tasks);

View File

@ -4954,6 +4954,7 @@ div.tabsElem a.tab {
.mainmenuaspan {
/*display: none;*/
font-size: 10px;
padding-right: 0;
}
.topmenuimage {
background-size: 22px auto;
@ -4990,6 +4991,7 @@ div.tabsElem a.tab {
.mainmenuaspan {
/*display: none;*/
font-size: 10px;
padding-right: 0;
}
.topmenuimage {
background-size: 20px auto;