Version Notes
Release Version 0.1.9
Fix:
- Arreglo en la paginacion de "estado de pedidos".
- Cambio en la ubicaciòn del menù a:
Ventas->Andreani
Download this release
Release Info
Developer | Gaspar Mac |
Extension | Andreani |
Version | 0.1.9 |
Comparing to | |
See all releases |
Code changes from version 0.1.8 to 0.1.9
- app/code/local/Ecloud/Andreani/Block/Adminhtml/Pedidos/Grid.php +163 -181
- app/code/local/Ecloud/Andreani/Model/Carrier/Andreani.php +0 -3
- app/code/local/Ecloud/Andreani/Model/Observer.php +1 -0
- app/code/local/Ecloud/Andreani/controllers/Adminhtml/PedidosController.php +186 -185
- app/code/local/Ecloud/Andreani/etc/adminhtml.xml +11 -9
- app/code/local/Ecloud/Andreani/etc/config.xml +14 -10
- app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.8-0.1.9.php +7 -0
- package.xml +10 -11
app/code/local/Ecloud/Andreani/Block/Adminhtml/Pedidos/Grid.php
CHANGED
@@ -1,182 +1,164 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
* @
|
5 |
-
* @
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
$this->
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
'
|
42 |
-
'
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
'
|
50 |
-
'
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
'
|
58 |
-
'
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
'
|
66 |
-
'
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
'
|
74 |
-
'
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
'
|
81 |
-
'
|
82 |
-
'
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
'
|
89 |
-
'
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
'
|
97 |
-
'
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
'
|
105 |
-
'
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
'
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
$this->
|
134 |
-
|
135 |
-
'
|
136 |
-
'
|
137 |
-
'
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
$this
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
'url' => $this->getUrl('*/*/massPendiente', array('' => '')),
|
165 |
-
'confirm' => Mage::helper('andreani')->__('¿Seguro que quieres modificar el estado de la orden?')
|
166 |
-
));
|
167 |
-
|
168 |
-
return $this;
|
169 |
-
}
|
170 |
-
|
171 |
-
public function getRowUrl($row)
|
172 |
-
{
|
173 |
-
return $this->getUrl('*/*/view', array('id' => $row->getId()));
|
174 |
-
}
|
175 |
-
|
176 |
-
public function getGridUrl()
|
177 |
-
{
|
178 |
-
return $this->getUrl('*/*/grid', array('_current'=>true));
|
179 |
-
}
|
180 |
-
|
181 |
-
}
|
182 |
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version 0.1.8 04.07.2014
|
4 |
+
* @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
|
5 |
+
* @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
class Ecloud_Andreani_Block_Adminhtml_Pedidos_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
10 |
+
{
|
11 |
+
|
12 |
+
public function __construct()
|
13 |
+
{
|
14 |
+
parent::__construct();
|
15 |
+
$this->setId('andreani_order');
|
16 |
+
$this->setDefaultSort('id');
|
17 |
+
$this->setDefaultDir('DESC');
|
18 |
+
$this->setSaveParametersInSession(true);
|
19 |
+
$this->setUseAjax(true);
|
20 |
+
}
|
21 |
+
|
22 |
+
protected function _prepareCollection()
|
23 |
+
{
|
24 |
+
$collection = Mage::getModel('andreani/order')->getCollection();
|
25 |
+
$this->setCollection($collection);
|
26 |
+
parent::_prepareCollection();
|
27 |
+
return $this;
|
28 |
+
}
|
29 |
+
|
30 |
+
protected function _prepareColumns()
|
31 |
+
{
|
32 |
+
/*
|
33 |
+
$this->addColumn('id', array(
|
34 |
+
'header' => Mage::helper('andreani')->__('ID'),
|
35 |
+
'sortable' => true,
|
36 |
+
'width' => '5',
|
37 |
+
'index' => 'id'
|
38 |
+
));*/
|
39 |
+
|
40 |
+
$this->addColumn('id_orden', array(
|
41 |
+
'header' => Mage::helper('andreani')->__('ID Orden'),
|
42 |
+
'sortable' => true,
|
43 |
+
'width' => '2%',
|
44 |
+
'index' => 'id_orden',
|
45 |
+
'type' => 'text'
|
46 |
+
));
|
47 |
+
|
48 |
+
$this->addColumn('nombre', array(
|
49 |
+
'header' => Mage::helper('andreani')->__('Nombre'),
|
50 |
+
'sortable' => true,
|
51 |
+
'width' => '5',
|
52 |
+
'index' => 'nombre',
|
53 |
+
'type' => 'text'
|
54 |
+
));
|
55 |
+
|
56 |
+
$this->addColumn('apellido', array(
|
57 |
+
'header' => Mage::helper('andreani')->__('Apellido'),
|
58 |
+
'sortable' => true,
|
59 |
+
'width' => '5',
|
60 |
+
'index' => 'apellido',
|
61 |
+
'type' => 'text'
|
62 |
+
));
|
63 |
+
|
64 |
+
$this->addColumn('sucursal_retiro', array(
|
65 |
+
'header' => Mage::helper('andreani')->__('Sucursal'),
|
66 |
+
'sortable' => false,
|
67 |
+
'width' => '5',
|
68 |
+
'index' => 'sucursal_retiro',
|
69 |
+
'type' => 'text'
|
70 |
+
));
|
71 |
+
|
72 |
+
$this->addColumn('detalle_productos', array(
|
73 |
+
'header' => Mage::helper('andreani')->__('Descripcion Productos'),
|
74 |
+
'sortable' => false,
|
75 |
+
'width' => '5',
|
76 |
+
'index' => 'detalle_productos',
|
77 |
+
'type' => 'text'
|
78 |
+
));
|
79 |
+
$this->addColumn('cliente', array(
|
80 |
+
'header' => Mage::helper('andreani')->__('Cliente Andreani'),
|
81 |
+
'sortable' => true,
|
82 |
+
'width' => '60',
|
83 |
+
'index' => 'cliente',
|
84 |
+
'type' => 'text'
|
85 |
+
));
|
86 |
+
|
87 |
+
$this->addColumn('contrato', array(
|
88 |
+
'header' => Mage::helper('andreani')->__('Contrato Andreani'),
|
89 |
+
'sortable' => true,
|
90 |
+
'width' => '60',
|
91 |
+
'index' => 'contrato',
|
92 |
+
'type' => 'text'
|
93 |
+
));
|
94 |
+
|
95 |
+
$this->addColumn('recibo_tracking', array(
|
96 |
+
'header' => Mage::helper('andreani')->__('Recibo'),
|
97 |
+
'sortable' => true,
|
98 |
+
'width' => '5',
|
99 |
+
'index' => 'recibo_tracking',
|
100 |
+
'type' => 'text'
|
101 |
+
));
|
102 |
+
|
103 |
+
$this->addColumn('cod_tracking', array(
|
104 |
+
'header' => Mage::helper('andreani')->__('Nro Andreani - Tracking'),
|
105 |
+
'sortable' => true,
|
106 |
+
'width' => '5',
|
107 |
+
'index' => 'cod_tracking',
|
108 |
+
'type' => 'text'
|
109 |
+
));
|
110 |
+
|
111 |
+
$this->addColumn('impresion', array(
|
112 |
+
'header'=> Mage::helper('catalog')->__('Imprimir Constancia'),
|
113 |
+
'sortable' => false,
|
114 |
+
'target' => '_blank',
|
115 |
+
'renderer' => 'andreani/adminhtml_Pedidos_Edit_Renderer_button'
|
116 |
+
));
|
117 |
+
|
118 |
+
$this->addColumn('estado', array(
|
119 |
+
'header' => Mage::helper('andreani')->__('Estado'),
|
120 |
+
'sortable' => false,
|
121 |
+
'width' => '5',
|
122 |
+
'index' => 'estado',
|
123 |
+
'type' => 'text',
|
124 |
+
|
125 |
+
));
|
126 |
+
|
127 |
+
return parent::_prepareColumns();
|
128 |
+
}
|
129 |
+
|
130 |
+
protected function _prepareMassaction()
|
131 |
+
{
|
132 |
+
$this->setMassactionIdField('id');
|
133 |
+
$this->getMassactionBlock()->setFormFieldName('id');
|
134 |
+
$this->getMassactionBlock()->addItem('eliminar', array(
|
135 |
+
'label'=> Mage::helper('andreani')->__('Eliminar'),
|
136 |
+
'url' => $this->getUrl('*/*/massEliminar', array('' => '')),
|
137 |
+
'confirm' => Mage::helper('andreani')->__('¿Seguro que quieres eliminar la orden?')
|
138 |
+
));
|
139 |
+
$this->getMassactionBlock()->addItem('entregado', array(
|
140 |
+
'label'=> Mage::helper('andreani')->__('Entregado'),
|
141 |
+
'url' => $this->getUrl('*/*/massEntregado', array('' => '')),
|
142 |
+
'confirm' => Mage::helper('andreani')->__('¿Seguro que quieres modificar el estado de la orden?')
|
143 |
+
));
|
144 |
+
$this->getMassactionBlock()->addItem('pendiente', array(
|
145 |
+
'label'=> Mage::helper('andreani')->__('Pendiente'),
|
146 |
+
'url' => $this->getUrl('*/*/massPendiente', array('' => '')),
|
147 |
+
'confirm' => Mage::helper('andreani')->__('¿Seguro que quieres modificar el estado de la orden?')
|
148 |
+
));
|
149 |
+
|
150 |
+
return $this;
|
151 |
+
}
|
152 |
+
|
153 |
+
public function getRowUrl($row)
|
154 |
+
{
|
155 |
+
return $this->getUrl('*/*/view', array('id' => $row->getId()));
|
156 |
+
}
|
157 |
+
|
158 |
+
public function getGridUrl()
|
159 |
+
{
|
160 |
+
return $this->getUrl('*/*/grid', array('_current'=>true));
|
161 |
+
}
|
162 |
+
|
163 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
?>
|
app/code/local/Ecloud/Andreani/Model/Carrier/Andreani.php
CHANGED
@@ -6,9 +6,6 @@
|
|
6 |
*/
|
7 |
?><?php require_once Mage::getBaseDir('lib') . '/Andreani/wsseAuth.php';
|
8 |
class Ecloud_Andreani_Model_Carrier_Andreani extends Mage_Shipping_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface {
|
9 |
-
|
10 |
-
//Activamos el almacenamiento en búfer de la salida
|
11 |
-
//ob_start();
|
12 |
|
13 |
protected $_code = '';
|
14 |
protected $distancia_final_txt = '';
|
6 |
*/
|
7 |
?><?php require_once Mage::getBaseDir('lib') . '/Andreani/wsseAuth.php';
|
8 |
class Ecloud_Andreani_Model_Carrier_Andreani extends Mage_Shipping_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface {
|
|
|
|
|
|
|
9 |
|
10 |
protected $_code = '';
|
11 |
protected $distancia_final_txt = '';
|
app/code/local/Ecloud/Andreani/Model/Observer.php
CHANGED
@@ -108,6 +108,7 @@ class Ecloud_Andreani_Model_Observer extends Mage_Core_Model_Session_Abstract {
|
|
108 |
$client = new SoapClient($datos["urlConfirmar"], $options);
|
109 |
$client->__setSoapHeaders(array($wsse_header));
|
110 |
|
|
|
111 |
if (strlen($datos["detalle_productos"]) >= 90){
|
112 |
$datos["detalle_productos"] = substr($datos["detalle_productos"],0,80) . "...";
|
113 |
}
|
108 |
$client = new SoapClient($datos["urlConfirmar"], $options);
|
109 |
$client->__setSoapHeaders(array($wsse_header));
|
110 |
|
111 |
+
// Limitamos el detalle de productos a 90 caracteres para que lo tome el WS de Andreani
|
112 |
if (strlen($datos["detalle_productos"]) >= 90){
|
113 |
$datos["detalle_productos"] = substr($datos["detalle_productos"],0,80) . "...";
|
114 |
}
|
app/code/local/Ecloud/Andreani/controllers/Adminhtml/PedidosController.php
CHANGED
@@ -1,186 +1,187 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @version 0.1.8 04.07.2014
|
4 |
-
* @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
|
5 |
-
* @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
|
6 |
-
*/
|
7 |
-
?><?php require_once Mage::getBaseDir('lib') . '/Andreani/wsseAuth.php';
|
8 |
-
class Ecloud_Andreani_Adminhtml_PedidosController extends Mage_Adminhtml_Controller_Action
|
9 |
-
{
|
10 |
-
|
11 |
-
public function indexAction()
|
12 |
-
{
|
13 |
-
$this->_title($this->__('Andreani'))->_title($this->__('Estado de pedidos'));
|
14 |
-
$this->loadLayout();
|
15 |
-
$this->_setActiveMenu('andreani/andreani');
|
16 |
-
$this->_addContent($this->getLayout()->createBlock('andreani/adminhtml_pedidos'));
|
17 |
-
$this->renderLayout();
|
18 |
-
}
|
19 |
-
|
20 |
-
public function gridAction()
|
21 |
-
{
|
22 |
-
|
23 |
-
$this->
|
24 |
-
|
25 |
-
)
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
$
|
33 |
-
$this->
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
$
|
40 |
-
$this->
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
Mage::getModel('andreani/order')->load($id)->
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
'
|
128 |
-
'
|
129 |
-
'
|
130 |
-
'
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
$optRequest
|
135 |
-
|
136 |
-
|
137 |
-
'
|
138 |
-
'
|
139 |
-
|
140 |
-
|
141 |
-
$
|
142 |
-
|
143 |
-
|
144 |
-
$texto
|
145 |
-
$texto .= "
|
146 |
-
$texto .= "
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
$texto .= "
|
153 |
-
$texto .= "
|
154 |
-
$texto .= "
|
155 |
-
$texto .= "
|
156 |
-
$texto .= "
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
$
|
181 |
-
$this->getLayout()->
|
182 |
-
$this->
|
183 |
-
|
184 |
-
|
185 |
-
|
|
|
186 |
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @version 0.1.8 04.07.2014
|
4 |
+
* @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
|
5 |
+
* @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
|
6 |
+
*/
|
7 |
+
?><?php require_once Mage::getBaseDir('lib') . '/Andreani/wsseAuth.php';
|
8 |
+
class Ecloud_Andreani_Adminhtml_PedidosController extends Mage_Adminhtml_Controller_Action
|
9 |
+
{
|
10 |
+
|
11 |
+
public function indexAction()
|
12 |
+
{
|
13 |
+
$this->_title($this->__('Andreani'))->_title($this->__('Estado de pedidos'));
|
14 |
+
$this->loadLayout();
|
15 |
+
$this->_setActiveMenu('andreani/andreani');
|
16 |
+
$this->_addContent($this->getLayout()->createBlock('andreani/adminhtml_pedidos'));
|
17 |
+
$this->renderLayout();
|
18 |
+
}
|
19 |
+
|
20 |
+
public function gridAction()
|
21 |
+
{
|
22 |
+
$this->_title($this->__('Andreani'))->_title($this->__('Estado de pedidos'));
|
23 |
+
$this->loadLayout();
|
24 |
+
$this->_setActiveMenu('andreani/andreani');
|
25 |
+
$this->getResponse()->setBody(
|
26 |
+
$this->getLayout()->createBlock('andreani/adminhtml_pedidos_grid')->toHtml()
|
27 |
+
);
|
28 |
+
}
|
29 |
+
|
30 |
+
public function exportEcloudCsvAction()
|
31 |
+
{
|
32 |
+
$fileName = 'pedidos_andreani.csv';
|
33 |
+
$grid = $this->getLayout()->createBlock('andreani/adminhtml_andreani_pedidos_grid');
|
34 |
+
$this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
|
35 |
+
}
|
36 |
+
|
37 |
+
public function exportEcloudExcelAction()
|
38 |
+
{
|
39 |
+
$fileName = 'pedidos_andreani.xml';
|
40 |
+
$grid = $this->getLayout()->createBlock('andreani/adminhtml_andreani_pedidos_grid');
|
41 |
+
$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
|
42 |
+
}
|
43 |
+
|
44 |
+
public function massEliminarAction()
|
45 |
+
{
|
46 |
+
$ids = $this->getRequest()->getParam('id');
|
47 |
+
if(!is_array($ids)) {
|
48 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('andreani')->__('Por favor seleccionar una orden!'));
|
49 |
+
} else {
|
50 |
+
try {
|
51 |
+
foreach ($ids as $id) {
|
52 |
+
//Mage::getModel('andreani/order')->load($id)->delete();
|
53 |
+
Mage::getModel('andreani/order')->load($id)->setData("estado","Eliminada")->save();
|
54 |
+
}
|
55 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('andreani')->__('Se han eliminado %d registro(s).', count($ids)));
|
56 |
+
} catch (Exception $e) {
|
57 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
58 |
+
}
|
59 |
+
}
|
60 |
+
$this->_redirect('*/*/index');
|
61 |
+
}
|
62 |
+
|
63 |
+
public function massEntregadoAction()
|
64 |
+
{
|
65 |
+
$ids = $this->getRequest()->getParam('id');
|
66 |
+
|
67 |
+
if(!is_array($ids)) {
|
68 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('andreani')->__('Por favor seleccionar una orden!'));
|
69 |
+
} else {
|
70 |
+
try {
|
71 |
+
foreach ($ids as $id) {
|
72 |
+
Mage::getModel('andreani/order')->load($id)->setData("estado","Entregado")->save();
|
73 |
+
}
|
74 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('andreani')->__('Se han actualizado %d registro(s).', count($ids)));
|
75 |
+
} catch (Exception $e) {
|
76 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
77 |
+
}
|
78 |
+
}
|
79 |
+
$this->_redirect('*/*/index');
|
80 |
+
}
|
81 |
+
|
82 |
+
public function massPendienteAction()
|
83 |
+
{
|
84 |
+
$ids = $this->getRequest()->getParam('id');
|
85 |
+
if(!is_array($ids)) {
|
86 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('andreani')->__('Por favor seleccionar una orden!'));
|
87 |
+
} else {
|
88 |
+
try {
|
89 |
+
foreach ($ids as $id) {
|
90 |
+
Mage::getModel('andreani/order')->load($id)->setData("estado","Pendiente")->save();
|
91 |
+
}
|
92 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('andreani')->__('Se han actualizado %d registro(s).', count($ids)));
|
93 |
+
} catch (Exception $e) {
|
94 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
95 |
+
}
|
96 |
+
}
|
97 |
+
$this->_redirect('*/*/index');
|
98 |
+
}
|
99 |
+
|
100 |
+
public function viewAction()
|
101 |
+
{
|
102 |
+
$id = (int) $this->getRequest()->getParam('id');
|
103 |
+
|
104 |
+
// 1. Traemos los datos de la tabla "andreani_order" según el OrderId[0] y asignarla a $datos
|
105 |
+
$collection = Mage::getModel('andreani/order')->getCollection()
|
106 |
+
->addFieldToFilter('id', $id);
|
107 |
+
$collection->getSelect()->limit(1);
|
108 |
+
|
109 |
+
if (!$collection) {
|
110 |
+
Mage::log("Andreani :: no existe la orden en la tabla andreani_order.");
|
111 |
+
return;
|
112 |
+
}
|
113 |
+
foreach($collection as $thing) {
|
114 |
+
$datos = $thing->getData();
|
115 |
+
}
|
116 |
+
|
117 |
+
// 2. Conectarse a eAndreani
|
118 |
+
if (Mage::getStoreConfig('carriers/andreaniconfig/testmode',Mage::app()->getStore()) == 1) {
|
119 |
+
$url = 'https://www.e-andreani.com/eAndreaniWSStaging/Service.svc?wsdl';
|
120 |
+
} else {
|
121 |
+
$url = "https://www.e-andreani.com/eAndreaniWS/Service.svc?wsdl";
|
122 |
+
}
|
123 |
+
|
124 |
+
if ( $datos['cod_tracking'] != '' ) {
|
125 |
+
try {
|
126 |
+
$options = array(
|
127 |
+
'soap_version' => SOAP_1_2,
|
128 |
+
'exceptions' => 1,
|
129 |
+
'trace' => 1,
|
130 |
+
'style' => SOAP_DOCUMENT,
|
131 |
+
'encoding' => SOAP_LITERAL,
|
132 |
+
);
|
133 |
+
|
134 |
+
$optRequest = array();
|
135 |
+
$optRequest["ObtenerTrazabilidad"] = array(
|
136 |
+
'Pieza' => array(
|
137 |
+
'NroPieza' => '',
|
138 |
+
'NroAndreani' => $datos['cod_tracking'],
|
139 |
+
'CodigoCliente' => $datos['cliente']
|
140 |
+
));
|
141 |
+
$client = new SoapClient($url, $options);
|
142 |
+
$request = $client->__soapCall("ObtenerTrazabilidad", $optRequest);
|
143 |
+
|
144 |
+
$texto = $request->Pieza->NroPieza . "\n";
|
145 |
+
$texto .= "Nombre del Envio: " . $request->Pieza->Envios->Envio->NombreEnvio . "\n";
|
146 |
+
$texto .= "Código de tracking: " . $request->Pieza->Envios->Envio->NroAndreani . "\n";
|
147 |
+
$texto .= "Fecha de alta: " . $request->Pieza->Envios->Envio->FechaAlta . "\n";
|
148 |
+
|
149 |
+
|
150 |
+
foreach( $request->Pieza->Envios->Envio->Eventos as $indice => $valor )
|
151 |
+
{
|
152 |
+
$texto .= "Eventos: " . "\n\n";
|
153 |
+
$texto .= "Fecha del evento: " . $valor->Fecha . "\n";
|
154 |
+
$texto .= "Estado del envio: " . $valor->Estado . "\n";
|
155 |
+
$texto .= "Motivo: " . $valor->Motivo . "\n";
|
156 |
+
$texto .= "Sucursal: " . $valor->Sucursal . "\n";
|
157 |
+
$texto .= "------------------ \n";
|
158 |
+
}
|
159 |
+
|
160 |
+
Mage::getModel('andreani/order')->load($id)->setData("tracking",$texto)->save();
|
161 |
+
|
162 |
+
} catch (SoapFault $e) {
|
163 |
+
Mage::log(print_r($e,true));
|
164 |
+
}
|
165 |
+
} else {
|
166 |
+
$texto = "El envío se encuentra pendiente. Diríjase a 'Ventas->Pedidos' para dar comienzo al proceso cuando el mismo se haya realizado";
|
167 |
+
Mage::getModel('andreani/order')->load($id)->setData("tracking",$texto)->save();
|
168 |
+
}
|
169 |
+
|
170 |
+
if ($id) {
|
171 |
+
$order = Mage::getModel('andreani/order')->load($id);
|
172 |
+
if (!$order || !$order->getId()) {
|
173 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('andreani')->__('No se encontró el ID de la orden'));
|
174 |
+
$this->_redirect('*/*/');
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
Mage::register('order_data', $order);
|
179 |
+
|
180 |
+
$this->loadLayout();
|
181 |
+
$block = $this->getLayout()->createBlock('andreani/adminhtml_pedidos_edit');
|
182 |
+
$this->getLayout()->getBlock('content')->append($block);
|
183 |
+
$this->renderLayout();
|
184 |
+
}
|
185 |
+
|
186 |
+
}
|
187 |
?>
|
app/code/local/Ecloud/Andreani/etc/adminhtml.xml
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<menu>
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
10 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<sales>
|
5 |
+
<andreani translate="title" module="andreani">
|
6 |
+
<sort_order>10</sort_order>
|
7 |
+
<title>Estado de pedidos</title>
|
8 |
+
<action>adminhtml/pedidos/</action>
|
9 |
+
</andreani>
|
10 |
+
</sales>
|
11 |
+
</menu>
|
12 |
</config>
|
app/code/local/Ecloud/Andreani/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Ecloud_Andreani>
|
5 |
-
<version>0.1.
|
6 |
</Ecloud_Andreani>
|
7 |
</modules>
|
8 |
<global>
|
@@ -114,17 +114,21 @@
|
|
114 |
</admin>
|
115 |
<adminhtml>
|
116 |
<menu>
|
117 |
-
<
|
118 |
-
<title>Andreani</title>
|
119 |
-
<sort_order>91</sort_order>
|
120 |
<children>
|
121 |
-
<
|
122 |
-
<title>
|
123 |
-
<sort_order>
|
124 |
-
<
|
125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
</children>
|
127 |
-
</
|
128 |
</menu>
|
129 |
<acl>
|
130 |
<resources>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Ecloud_Andreani>
|
5 |
+
<version>0.1.9</version>
|
6 |
</Ecloud_Andreani>
|
7 |
</modules>
|
8 |
<global>
|
114 |
</admin>
|
115 |
<adminhtml>
|
116 |
<menu>
|
117 |
+
<sales>
|
|
|
|
|
118 |
<children>
|
119 |
+
<andreani translate="title">
|
120 |
+
<title>Andreani</title>
|
121 |
+
<sort_order>91</sort_order>
|
122 |
+
<children>
|
123 |
+
<pedidos translate="title">
|
124 |
+
<title>Estado de Pedidos</title>
|
125 |
+
<sort_order>20</sort_order>
|
126 |
+
<action>adminhtml/pedidos/index</action>
|
127 |
+
</pedidos>
|
128 |
+
</children>
|
129 |
+
</andreani>
|
130 |
</children>
|
131 |
+
</sales>
|
132 |
</menu>
|
133 |
<acl>
|
134 |
<resources>
|
app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.8-0.1.9.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$setup = $this;
|
4 |
+
|
5 |
+
$setup->startSetup();
|
6 |
+
|
7 |
+
$setup->endSetup();
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Andreani</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
@@ -24,18 +24,17 @@ For Customers:
|
|
24 |
Location and distance y distance to the nearest branch for "Shipments to branch".
|
25 |
Express delivery service.
|
26 |
Tracking of shipments.</description>
|
27 |
-
<notes>Release Version 0.1.
|
28 |

|
29 |
-
|
30 |
-
- Arreglo en
|
31 |
-
|
32 |
-
-
|
33 |
-
|
34 |
-
- Activaciòn de cache de sucursales para optimizar llamadas al WS</notes>
|
35 |
<authors><author><name>Gaspar Mac</name><user>ecloudsolutions</user><email>gaspar@ecloudsolutions.com</email></author><author><name>Nicolas Demayo</name><user>nikete</user><email>nicolas.demayo@ecloudsolutions.com</email></author><author><name>Franco Sabolo</name><user>kako_ecloud</user><email>franco.sabolo@ecloudsolutions.com</email></author><author><name>Mariano Botti</name><user>mbotti89</user><email>mariano.botti@ecloudsolutions.com</email></author></authors>
|
36 |
-
<date>2014-07-
|
37 |
-
<time>
|
38 |
-
<contents><target name="magelocal"><dir name="Ecloud"><dir name="Andreani"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><file name="Edit.php" hash="641bba2f29b24b971cf849e132799187"/><dir name="Form"><dir name="Field"><file name="Medida.php" hash="a42816e6aa4e0d8888d292ee35baf5bd"/></dir></dir></dir><dir name="Pedidos"><dir name="Edit"><file name="Form.php" hash="b8e6ec2ef089eb71d1ec262ef832531c"/><dir name="Renderer"><file name="Button.php" hash="be724d8798843b97dfb5a2d9f107abde"/></dir></dir><file name="Edit.php" hash="15055cc1f30b9e173c9ff6f5867e7785"/><file name="Grid.php" hash="
|
39 |
<compatible/>
|
40 |
<dependencies><required><php><min>5.2.0</min><max>5.4.25</max></php><extension><name>Core</name><min></min><max></max></extension><extension><name>soap</name><min></min><max></max></extension></required></dependencies>
|
41 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Andreani</name>
|
4 |
+
<version>0.1.9</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
24 |
Location and distance y distance to the nearest branch for "Shipments to branch".
|
25 |
Express delivery service.
|
26 |
Tracking of shipments.</description>
|
27 |
+
<notes>Release Version 0.1.9
|
28 |

|
29 |
+
Fix:
|
30 |
+
- Arreglo en la paginacion de "estado de pedidos".
|
31 |
+

|
32 |
+
- Cambio en la ubicaciòn del menù a:
|
33 |
+
Ventas->Andreani</notes>
|
|
|
34 |
<authors><author><name>Gaspar Mac</name><user>ecloudsolutions</user><email>gaspar@ecloudsolutions.com</email></author><author><name>Nicolas Demayo</name><user>nikete</user><email>nicolas.demayo@ecloudsolutions.com</email></author><author><name>Franco Sabolo</name><user>kako_ecloud</user><email>franco.sabolo@ecloudsolutions.com</email></author><author><name>Mariano Botti</name><user>mbotti89</user><email>mariano.botti@ecloudsolutions.com</email></author></authors>
|
35 |
+
<date>2014-07-23</date>
|
36 |
+
<time>16:15:10</time>
|
37 |
+
<contents><target name="magelocal"><dir name="Ecloud"><dir name="Andreani"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><file name="Edit.php" hash="641bba2f29b24b971cf849e132799187"/><dir name="Form"><dir name="Field"><file name="Medida.php" hash="a42816e6aa4e0d8888d292ee35baf5bd"/></dir></dir></dir><dir name="Pedidos"><dir name="Edit"><file name="Form.php" hash="b8e6ec2ef089eb71d1ec262ef832531c"/><dir name="Renderer"><file name="Button.php" hash="be724d8798843b97dfb5a2d9f107abde"/></dir></dir><file name="Edit.php" hash="15055cc1f30b9e173c9ff6f5867e7785"/><file name="Grid.php" hash="4ed8da91e1f38f86d232c8f0b95f19c3"/></dir><file name="Pedidos.php" hash="c92fc91f2e1658b0db2d593fe4eb88b7"/></dir><file name="Andreani.php" hash="c25934ba95ab9d308e7dc71314bcec33"/></dir><dir name="Helper"><file name="Data.php" hash="44776b6d6ede13161ed89cb2c57a75bb"/></dir><dir name="Model"><file name="Andreani.php" hash="1c21ed28b766361188e2e88ea9a40827"/><dir name="Carrier"><file name="Andreani.php" hash="c121c40f4b5e34e998be4898cf5a1af9"/><file name="Andreaniestandar.php" hash="4b437809ac6ab904c5ccd04258536c5b"/><file name="Andreanisucursal.php" hash="dde8b46c16d7df1f87c3b0482d9ba578"/><file name="Andreaniurgente.php" hash="563e3cdc813bc4a5b430433c4b40b03f"/></dir><dir name="Config"><file name="Medida.php" hash="f1f08e98acdf9e31c8c269bb673bfdd4"/><file name="TestMode.php" hash="3f68f671445173f0cbbb5b69a360ff9f"/></dir><file name="Observer.php" hash="4f0a71a6dd3ece1e0ba9147543996f6c"/><file name="Order.php" hash="69c1469c3de5522810e4dfa6f42164c9"/><dir name="Resource"><dir name="Order"><file name="Collection.php" hash="59fbc843342805a3b8f0ea0f6b8b6504"/></dir><file name="Order.php" hash="4a7d26f63f80bb939873f6032bae1a2a"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Pedidos"><file name="PedidosController.php" hash="462649aad4dc7d05b9f880bfb1c1bdc6"/></dir><file name="PedidosController.php" hash="725ea09dc3c48d2e66276785234580f4"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="572688a74a8eb634953c6bf59d2635f2"/><file name="config.xml" hash="9a90e92f8df23abd4b49ce0f23f44afe"/><file name="system.xml" hash="ec1bf9a3739d671995cea0afb9289725"/></dir><dir name="sql"><dir name="andreani_setup"><file name="mysql4-install-0.1.0.php" hash="23b5ff1bb77faa3394279983279ef508"/><file name="mysql4-install-0.1.1.php" hash="af9c6884b1ef1e106f598e84d5ac97d5"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="19bbe941b87c48a7c976099f26b6df87"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="31485210af28297146e193090d0ae586"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="19bbe941b87c48a7c976099f26b6df87"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="19bbe941b87c48a7c976099f26b6df87"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="2e5071273633e63d487fa573dc2a33d9"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="2e5071273633e63d487fa573dc2a33d9"/><file name="mysql4-upgrade-0.1.7-0.1.8.php" hash="2e5071273633e63d487fa573dc2a33d9"/><file name="mysql4-upgrade-0.1.8-0.1.9.php" hash="2e5071273633e63d487fa573dc2a33d9"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ecloud_Andreani.xml" hash="fb71162c7850ff07ee057cc012a609ad"/></dir></target><target name="magelib"><dir name="Andreani"><file name="wsseAuth.php" hash="7f7c0dcac241e7422a6bc657638fc5df"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="checkout"><dir name="onepage"><file name="shipping.phtml" hash="dd07d8ad6a22cd9e2553109498057439"/></dir></dir><dir name="customer"><dir name="address"><file name="edit.phtml" hash="c6a693c55bec274da69b12839a5f4ef1"/></dir></dir><dir name="persistent"><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="c4c0a62c21e9e1a6d2b1b872d0f8bdfc"/></dir></dir></dir><dir name="shipping"><dir name="tracking"><file name="popup.phtml" hash="cab9a1b01c732d7553be9b47e1e1b542"/></dir></dir></dir></dir></dir></dir></target></contents>
|
38 |
<compatible/>
|
39 |
<dependencies><required><php><min>5.2.0</min><max>5.4.25</max></php><extension><name>Core</name><min></min><max></max></extension><extension><name>soap</name><min></min><max></max></extension></required></dependencies>
|
40 |
</package>
|