[+] BO : Add a note on invoice

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11253 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
jBreux
2011-12-15 11:38:01 +00:00
parent 29a90b29d1
commit cb984199fc
8 changed files with 65 additions and 9 deletions
@@ -588,6 +588,26 @@ class AdminOrdersControllerCore extends AdminController
else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
}
elseif (Tools::isSubmit('submitEditNote')) {
$id_order_invoice = (int)Tools::getValue('id_order_invoice');
$note = Tools::getValue('note');
$order_invoice = new OrderInvoice($id_order_invoice);
if (Validate::isLoadedObject($order_invoice) && Validate::isCleanHtml($note))
{
if ($this->tabAccess['edit'] === '1')
{
$order_invoice->note = $note;
if ($order_invoice->save())
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order_invoice->id_order.'&vieworder&conf=4&token='.$this->token);
else
$this->_errors[] = Tools::displayError('Unable to save invoice note.');
}
else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
}
else
$this->_errors[] = Tools::displayError('Unable to load invoice for edit note.');
}
elseif (Tools::isSubmit('submitAddOrder') == 1 && ($id_cart = Tools::getValue('id_cart')) && ($module_name = pSQL(Tools::getValue('payment_module_name'))) && ($id_order_state = Tools::getValue('id_order_state')))
{
if ($this->tabAccess['edit'] === '1')