From 300d4e1603447f5c1f6aaa271255f849c3fe4135 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jan 2018 14:35:02 +0100 Subject: [PATCH] Fix disable direct debit request for replaced invoices --- htdocs/compta/facture/card.php | 10 +++++++--- htdocs/projet/ganttchart.inc.php | 2 +- htdocs/theme/eldy/style.css.php | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 98c06179368..c769b538d43 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -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 ''.$langs->trans("MakeWithdrawRequest").''; + if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice + { + print ''.$langs->trans("MakeWithdrawRequest").''; + } else { + print '
' . $langs->trans('MakeWithdrawRequest') . '
'; + } } else { diff --git a/htdocs/projet/ganttchart.inc.php b/htdocs/projet/ganttchart.inc.php index fc8ab9d7882..2777b59f032 100644 --- a/htdocs/projet/ganttchart.inc.php +++ b/htdocs/projet/ganttchart.inc.php @@ -111,7 +111,7 @@ if (g.getDivId() != null)