[-] BO : fixed bug #PSFV-504 - Even if the invoices management is disabled, you can create an invoice

This commit is contained in:
aFolletete
2012-04-13 10:01:21 +00:00
parent 9be1cb186a
commit 874849038c
2 changed files with 7 additions and 2 deletions
+4 -1
View File
@@ -825,7 +825,9 @@ class AdminOrdersControllerCore extends AdminController
}
elseif (Tools::isSubmit('submitGenerateInvoice') && isset($order))
{
if ($order->hasInvoice())
if (!Configuration::get('PS_INVOICE'))
$this->errors[] = Tools::displayError('Invoice management has been disabled');
elseif ($order->hasInvoice())
$this->errors[] = Tools::displayError('This order already has an invoice');
else
{
@@ -1179,6 +1181,7 @@ class AdminOrdersControllerCore extends AdminController
'invoices_collection' => $order->getInvoicesCollection(),
'not_paid_invoices_collection' => $order->getNotPaidInvoicesCollection(),
'payment_methods' => $payment_methods,
'invoice_management_active' => Configuration::get('PS_INVOICE')
);
return parent::renderView();