// Update supply order templates
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13068 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -264,19 +264,11 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
),
|
||||
'desc' => $this->l('The language of the order.')
|
||||
),
|
||||
array(
|
||||
'type' => 'date',
|
||||
'label' => $this->l('Delivery date:'),
|
||||
'name' => 'date_delivery_expected',
|
||||
'size' => 20,
|
||||
'required' => true,
|
||||
'desc' => $this->l('This is the expected delivery date for this order.'),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Global discount rate (%):'),
|
||||
'name' => 'discount_rate',
|
||||
'size' => 7,
|
||||
'size' => 10,
|
||||
'required' => true,
|
||||
'desc' => $this->l('This is the global discount rate in percents for the order.'),
|
||||
),
|
||||
@@ -284,7 +276,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Automatically load products:'),
|
||||
'name' => 'load_products',
|
||||
'size' => 7,
|
||||
'size' => 10,
|
||||
'required' => false,
|
||||
'hint' => $this->l('This will reset the order'),
|
||||
'desc' => $this->l('If specified, each product which quantity is less or equal to this value will be loaded.'),
|
||||
@@ -303,6 +295,22 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
'type' => 'hidden',
|
||||
'name' => 'is_template'
|
||||
);
|
||||
|
||||
$this->fields_form['input'][] = array(
|
||||
'type' => 'hidden',
|
||||
'name' => 'date_delivery_expected',
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->fields_form['input'][] = array(
|
||||
'type' => 'date',
|
||||
'label' => $this->l('Expected delivery date:'),
|
||||
'name' => 'date_delivery_expected',
|
||||
'size' => 10,
|
||||
'required' => true,
|
||||
'desc' => $this->l('This is the expected delivery date for this order.'),
|
||||
);
|
||||
}
|
||||
|
||||
//specific discount display
|
||||
@@ -994,6 +1002,10 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
if (Tools::isSubmit('submitBulkUpdatesupply_order_detail') && !($this->tabAccess['edit'] === '1'))
|
||||
$this->errors[] = Tools::displayError($this->l('You do not have the required permission to edit an order.'));
|
||||
|
||||
// Trick to use both Supply Order as template and actual orders
|
||||
if (Tools::isSubmit('is_template'))
|
||||
$_GET['mod'] = 'template';
|
||||
|
||||
// checks if supply order reference is unique
|
||||
if (Tools::isSubmit('reference'))
|
||||
{
|
||||
@@ -1045,6 +1057,10 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
|
||||
if (!count($this->errors))
|
||||
{
|
||||
// forces date for templates
|
||||
if (Tools::isSubmit('is_template') && !Tools::getValue('date_delivery_expected'))
|
||||
$_POST['date_delivery_expected'] = date('Y-m-d h:i:s');
|
||||
|
||||
// specify initial state
|
||||
$_POST['id_supply_order_state'] = 1; //defaut creation state
|
||||
|
||||
|
||||
+651
-659
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user