// 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:
bMancone
2012-02-07 13:25:12 +00:00
parent 610a454a1d
commit c8145aeca4
2 changed files with 677 additions and 669 deletions
@@ -264,19 +264,11 @@ class AdminSupplyOrdersControllerCore extends AdminController
), ),
'desc' => $this->l('The language of the order.') '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( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Global discount rate (%):'), 'label' => $this->l('Global discount rate (%):'),
'name' => 'discount_rate', 'name' => 'discount_rate',
'size' => 7, 'size' => 10,
'required' => true, 'required' => true,
'desc' => $this->l('This is the global discount rate in percents for the order.'), 'desc' => $this->l('This is the global discount rate in percents for the order.'),
), ),
@@ -284,7 +276,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
'type' => 'text', 'type' => 'text',
'label' => $this->l('Automatically load products:'), 'label' => $this->l('Automatically load products:'),
'name' => 'load_products', 'name' => 'load_products',
'size' => 7, 'size' => 10,
'required' => false, 'required' => false,
'hint' => $this->l('This will reset the order'), '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.'), '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', 'type' => 'hidden',
'name' => 'is_template' '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 //specific discount display
@@ -994,6 +1002,10 @@ class AdminSupplyOrdersControllerCore extends AdminController
if (Tools::isSubmit('submitBulkUpdatesupply_order_detail') && !($this->tabAccess['edit'] === '1')) 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.')); $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 // checks if supply order reference is unique
if (Tools::isSubmit('reference')) if (Tools::isSubmit('reference'))
{ {
@@ -1045,6 +1057,10 @@ class AdminSupplyOrdersControllerCore extends AdminController
if (!count($this->errors)) 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 // specify initial state
$_POST['id_supply_order_state'] = 1; //defaut creation state $_POST['id_supply_order_state'] = 1; //defaut creation state
+651 -659
View File
File diff suppressed because it is too large Load Diff