Andreani - Version 0.1.7

Version Notes

Release Version 0.1.7.

Fix 'detalle_productos' en ConfirmarCompra.

Download this release

Release Info

Developer Gaspar Mac
Extension Andreani
Version 0.1.7
Comparing to
See all releases


Code changes from version 0.1.6 to 0.1.7

Files changed (39) hide show
  1. app/code/local/Ecloud/Andreani/Block/Adminhtml/Config/Edit.php +26 -0
  2. app/code/local/Ecloud/Andreani/Block/Adminhtml/Config/Form/Field/Medida.php +23 -0
  3. app/code/local/Ecloud/Andreani/Block/Adminhtml/Pedidos.php +21 -0
  4. app/code/local/Ecloud/Andreani/Block/Adminhtml/Pedidos/Edit.php +42 -0
  5. app/code/local/Ecloud/Andreani/Block/Adminhtml/Pedidos/Edit/Form.php +189 -0
  6. app/code/local/Ecloud/Andreani/Block/Adminhtml/Pedidos/Edit/Renderer/Button.php +35 -0
  7. app/code/local/Ecloud/Andreani/Block/Adminhtml/Pedidos/Grid.php +182 -0
  8. app/code/local/Ecloud/Andreani/Block/Andreani.php +26 -0
  9. app/code/local/Ecloud/Andreani/Helper/Data.php +91 -0
  10. app/code/local/Ecloud/Andreani/Model/Andreani.php +17 -0
  11. app/code/local/Ecloud/Andreani/Model/Carrier/Andreani.php +504 -0
  12. app/code/local/Ecloud/Andreani/Model/Carrier/Andreaniestandar.php +12 -0
  13. app/code/local/Ecloud/Andreani/Model/Carrier/Andreanisucursal.php +12 -0
  14. app/code/local/Ecloud/Andreani/Model/Carrier/Andreaniurgente.php +12 -0
  15. app/code/local/Ecloud/Andreani/Model/Config/Medida.php +37 -0
  16. app/code/local/Ecloud/Andreani/Model/Config/TestMode.php +40 -0
  17. app/code/local/Ecloud/Andreani/Model/Observer.php +180 -0
  18. app/code/local/Ecloud/Andreani/Model/Order.php +24 -0
  19. app/code/local/Ecloud/Andreani/Model/Resource/Order.php +14 -0
  20. app/code/local/Ecloud/Andreani/Model/Resource/Order/Collection.php +15 -0
  21. app/code/local/Ecloud/Andreani/controllers/Adminhtml/Pedidos/PedidosController.php +19 -0
  22. app/code/local/Ecloud/Andreani/controllers/Adminhtml/PedidosController.php +186 -0
  23. app/code/local/Ecloud/Andreani/etc/adminhtml.xml +10 -0
  24. app/code/local/Ecloud/Andreani/etc/config.xml +188 -0
  25. app/code/local/Ecloud/Andreani/etc/system.xml +348 -0
  26. app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-install-0.1.0.php +108 -0
  27. app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-install-0.1.1.php +112 -0
  28. app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.1-0.1.2.php +7 -0
  29. app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.2-0.1.3.php +15 -0
  30. app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.3-0.1.4.php +7 -0
  31. app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.4-0.1.5.php +7 -0
  32. app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.5-0.1.6.php +7 -0
  33. app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.6-0.1.7.php +7 -0
  34. app/design/frontend/default/default/template/checkout/onepage/shipping.phtml +148 -0
  35. app/design/frontend/default/default/template/customer/address/edit.phtml +158 -0
  36. app/design/frontend/default/default/template/persistent/checkout/onepage/billing.phtml +0 -0
  37. app/design/frontend/default/default/template/shipping/tracking/popup.phtml +201 -0
  38. app/etc/modules/Ecloud_Andreani.xml +13 -0
  39. package.xml +7 -5
app/code/local/Ecloud/Andreani/Block/Adminhtml/Config/Edit.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.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_Config_Edit extends Mage_Adminhtml_Block_Widget_Form_Container{
10
+
11
+ public function __construct(){
12
+ parent::__construct();
13
+ $this->_blockGroup = 'andreani';
14
+ $this->_controller = 'adminhtml_config';
15
+ $this->_updateButton('save', 'label', Mage::helper('andreani')->__('Save Changes'));
16
+ $this->_removeButton('reset');
17
+ $this->_removeButton('delete');
18
+ $this->_removeButton('back');
19
+ }
20
+
21
+ public function getHeaderText(){
22
+ return Mage::helper('andreani')->__('Andreani Configuration');
23
+ }
24
+
25
+ }
26
+ ?>
app/code/local/Ecloud/Andreani/Block/Adminhtml/Config/Form/Field/Medida.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.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
+ /**
10
+ * @version 0.1.7 03.07.2014
11
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
12
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
13
+ */
14
+ ?>
15
+ <?php
16
+ class Ecloud_Andreani_Block_Adminhtml_Config_Form_Field_Medida extends Mage_Adminhtml_Block_System_Config_Form_Field {
17
+
18
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element){
19
+ return parent::_getElementHtml($element);;
20
+ }
21
+
22
+ }
23
+ ?>
app/code/local/Ecloud/Andreani/Block/Adminhtml/Pedidos.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.07.2014
4
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
5
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
6
+ */
7
+ ?><?php
8
+ class Ecloud_Andreani_Block_Adminhtml_Pedidos extends Mage_Adminhtml_Block_Widget_Grid_Container
9
+ {
10
+ public function __construct()
11
+ {
12
+ $this->_blockGroup = 'andreani';
13
+ $this->_controller = 'adminhtml_pedidos';
14
+ $this->_headerText = Mage::helper('adminhtml')->__('Estado de Pedidos');
15
+
16
+ parent::__construct();
17
+ $this->_removeButton('add');
18
+ }
19
+
20
+ }
21
+ ?>
app/code/local/Ecloud/Andreani/Block/Adminhtml/Pedidos/Edit.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.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_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
10
+ {
11
+
12
+ public function __construct()
13
+ {
14
+ parent::__construct();
15
+ $this->_objectId = 'id';
16
+ //we assign the same blockGroup as the Grid Container
17
+ $this->_blockGroup = 'andreani';
18
+ //and the same controller
19
+ $this->_controller = 'adminhtml_pedidos';
20
+ //define the label for the save and delete button
21
+ $this->_headerText = Mage::helper('andreani')->__('Edit Form');
22
+
23
+ //$this->_updateButton('save', 'label','Guardar');
24
+ //$this->_updateButton('delete', 'label', 'Delete');
25
+ $this->_removeButton('save');
26
+ $this->_removeButton('reset');
27
+ $this->_removeButton('delete');
28
+
29
+ $this->_mode = 'edit';
30
+ }
31
+
32
+ public function getHeaderText()
33
+ {
34
+ if( Mage::registry('order_data') OR Mage::registry('order_data')->getId() ) {
35
+ return $this->helper('andreani')->__("Ver el estado del pedido: #") . $this->htmlEscape(Mage::registry('order_data')->getData("id_orden")) . '<br />';
36
+ } else {
37
+ return $this->helper('andreani')->__("El administrador no puede agregar pedidos con el módulo de Andreani");
38
+ }
39
+ }
40
+
41
+ }
42
+ ?>
app/code/local/Ecloud/Andreani/Block/Adminhtml/Pedidos/Edit/Form.php ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.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_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
10
+ {
11
+
12
+ protected function _prepareForm()
13
+ {
14
+ $form = new Varien_Data_Form(
15
+ array(
16
+ 'id' => 'edit_form',
17
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
18
+ 'method' => 'post'
19
+ ));
20
+
21
+ $form = new Varien_Data_Form();
22
+ $this->setForm($form);
23
+ $fieldset = $form->addFieldset('edit_form', array('legend'=>Mage::helper('andreani')->__('Datos del pedido')));
24
+
25
+ $fieldset->addField('nombre', 'text', array(
26
+ 'label' => Mage::helper('andreani')->__('Nombre de Cliente'),
27
+ 'required' => false,
28
+ 'name' => 'nombre',
29
+ 'readonly' => true,
30
+ ));
31
+
32
+ $fieldset->addField('apellido', 'text', array(
33
+ 'label' => Mage::helper('andreani')->__('Apellido'),
34
+ 'required' => false,
35
+ 'name' => 'apellido',
36
+ 'readonly' => true,
37
+ 'tabindex' => 1,
38
+ ));
39
+ $fieldset->addField('dni', 'text', array(
40
+ 'label' => Mage::helper('andreani')->__('DNI'),
41
+ 'required' => false,
42
+ 'name' => 'dni',
43
+ 'readonly' => true,
44
+ ));
45
+ $fieldset->addField('telefono', 'text', array(
46
+ 'label' => Mage::helper('andreani')->__('Telefono'),
47
+ 'required' => false,
48
+ 'name' => 'telefono',
49
+ 'readonly' => true,
50
+ ));
51
+ $fieldset->addField('email', 'text', array(
52
+ 'label' => Mage::helper('andreani')->__('E-mail'),
53
+ 'required' => false,
54
+ 'name' => 'email',
55
+ 'readonly' => true,
56
+ ));
57
+
58
+ $fieldset->addField('provincia', 'text', array(
59
+ 'label' => Mage::helper('andreani')->__('Provincia'),
60
+ 'required' => false,
61
+ 'name' => 'provincia',
62
+ 'readonly' => true,
63
+ ));
64
+ $fieldset->addField('localidad', 'text', array(
65
+ 'label' => Mage::helper('andreani')->__('Localidad'),
66
+ 'required' => false,
67
+ 'name' => 'localidad',
68
+ 'readonly' => true,
69
+ ));
70
+ $fieldset->addField('cp_destino', 'text', array(
71
+ 'label' => Mage::helper('andreani')->__('Codigo postal'),
72
+ 'required' => false,
73
+ 'name' => 'cp_destino',
74
+ 'readonly' => true,
75
+ ));
76
+ $fieldset->addField('direccion', 'text', array(
77
+ 'label' => Mage::helper('andreani')->__('Direccion'),
78
+ 'required' => false,
79
+ 'name' => 'direccion',
80
+ 'readonly' => true,
81
+ ));
82
+
83
+ $fieldset->addField('detalle_productos', 'textarea', array(
84
+ 'label' => Mage::helper('andreani')->__('Detalle Productos'),
85
+ 'required' => false,
86
+ 'name' => 'detalle_productos',
87
+ 'readonly' => true,
88
+ ));
89
+
90
+ $fieldset->addField('valor_declarado', 'text', array(
91
+ 'label' => Mage::helper('andreani')->__('Valor Declarado'),
92
+ 'required' => false,
93
+ 'name' => 'valor_declarado',
94
+ 'readonly' => true,
95
+ ));
96
+ $fieldset->addField('volumen', 'text', array(
97
+ 'label' => Mage::helper('andreani')->__('Volumen'),
98
+ 'required' => false,
99
+ 'name' => 'volumen',
100
+ 'readonly' => true,
101
+ ));
102
+ $fieldset->addField('peso', 'text', array(
103
+ 'label' => Mage::helper('andreani')->__('Peso'),
104
+ 'required' => false,
105
+ 'name' => 'peso',
106
+ 'readonly' => true,
107
+ ));
108
+ $fieldset->addField('categoria_distancia_id', 'text', array(
109
+ 'label' => Mage::helper('andreani')->__('Categoria Distancia'),
110
+ 'required' => false,
111
+ 'name' => 'categoria_distancia_id',
112
+ 'readonly' => true,
113
+ ));
114
+ $fieldset->addField('categoria_peso', 'text', array(
115
+ 'label' => Mage::helper('andreani')->__('Categoria Peso'),
116
+ 'required' => false,
117
+ 'name' => 'categoria_peso',
118
+ 'readonly' => true,
119
+ ));
120
+ $fieldset->addField('precio', 'text', array(
121
+ 'label' => Mage::helper('andreani')->__('Precio de Envio'),
122
+ 'required' => false,
123
+ 'name' => 'precio',
124
+ 'readonly' => true,
125
+ ));
126
+ $fieldset->addField('cliente', 'text', array(
127
+ 'label' => Mage::helper('andreani')->__('Nro. Cliente Andreani'),
128
+ 'required' => false,
129
+ 'name' => 'cliente',
130
+ 'readonly' => true,
131
+ 'sort_order'=> 30,
132
+ ));
133
+
134
+ $fieldset->addField('contrato', 'text', array(
135
+ 'label' => Mage::helper('andreani')->__('Contrato Andreani'),
136
+ 'required' => false,
137
+ 'name' => 'contrato',
138
+ 'readonly' => true,
139
+ 'sort_order'=> 30,
140
+ ));
141
+
142
+ $fieldset->addField('id_orden', 'text', array(
143
+ 'label' => Mage::helper('andreani')->__('Id Orden'),
144
+ 'required' => false,
145
+ 'name' => 'id_orden',
146
+ 'readonly' => true,
147
+ ));
148
+
149
+ $fieldset->addField('recibo_tracking', 'text', array(
150
+ 'label' => Mage::helper('andreani')->__('Recibo Andreani'),
151
+ 'required' => false,
152
+ 'name' => 'recibo_tracking',
153
+ 'readonly' => true,
154
+ ));
155
+
156
+ $fieldset->addField('sucursal_retiro', 'text', array(
157
+ 'label' => Mage::helper('andreani')->__('Sucursal de Retiro'),
158
+ 'required' => false,
159
+ 'name' => 'sucursal_retiro',
160
+ 'readonly' => true,
161
+ ));
162
+ $fieldset->addField('estado', 'text', array(
163
+ 'label' => Mage::helper('andreani')->__('Estado del envio'),
164
+ 'required' => false,
165
+ 'name' => 'estado',
166
+ 'readonly' => true,
167
+ ));
168
+
169
+ //muestro "tracking", los detalles del estado del envio.
170
+
171
+ $fieldset->addField('tracking', 'textarea', array(
172
+ 'label' => Mage::helper('andreani')->__('Detalles del Envio'),
173
+ 'required' => false,
174
+ 'name' => 'tracking',
175
+ 'readonly' => true
176
+ ));
177
+
178
+ if (Mage::registry('order_data')){
179
+ $form->setValues(Mage::registry('order_data')->getData());
180
+ }
181
+
182
+ $form->setUseContainer(true);
183
+ $this->setForm($form);
184
+
185
+ return parent::_prepareForm();
186
+ }
187
+
188
+ }
189
+ ?>
app/code/local/Ecloud/Andreani/Block/Adminhtml/Pedidos/Edit/Renderer/Button.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.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_Edit_Renderer_Button extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
10
+
11
+ public function render(Varien_Object $row) {
12
+ $columnaID = $row->getId();
13
+ //You can write html for your button here
14
+ $model = Mage::getModel('andreani/order')->load($columnaID);
15
+ $constanciaURL = $model->getData('constancia');
16
+ $constancia = $model->getData('constancia');
17
+ $estadoenvio = $model->getData('estado');
18
+
19
+ if ($constancia != '') {
20
+ $html = '<a href="'.$constanciaURL.'" target="_blank"><button >Imprimir Constancia</button></a>';
21
+ }
22
+ else{
23
+ $html = '<span>No hay ninguna constancia para ser impresa.</span>';
24
+ if ($estadoenvio != 'Enviado') {
25
+
26
+ $html = $html . "El Pedido no ha sido Enviado.";
27
+
28
+ }
29
+ }
30
+
31
+ return $html;
32
+
33
+ }
34
+ }
35
+ ?>
app/code/local/Ecloud/Andreani/Block/Adminhtml/Pedidos/Grid.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php
3
+ /**
4
+ * @version 0.1.7 03.07.2014
5
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
6
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
7
+ */
8
+ ?>
9
+ <?php
10
+ class Ecloud_Andreani_Block_Adminhtml_Pedidos_Grid extends Mage_Adminhtml_Block_Widget_Grid
11
+ {
12
+
13
+
14
+ public function __construct()
15
+ {
16
+
17
+
18
+ parent::__construct();
19
+ $this->setId('andreani_order');
20
+ $this->setDefaultSort('id');
21
+ $this->setDefaultDir('DESC');
22
+ $this->setSaveParametersInSession(true);
23
+ $this->setUseAjax(true);
24
+ }
25
+
26
+ protected function _prepareCollection()
27
+ {
28
+ $collection = Mage::getModel('andreani/order')->getCollection();
29
+ $this->setCollection($collection);
30
+ parent::_prepareCollection();
31
+ return $this;
32
+ }
33
+
34
+
35
+ protected function _prepareColumns()
36
+ {
37
+ /*
38
+ $this->addColumn('id', array(
39
+ 'header' => Mage::helper('andreani')->__('ID'),
40
+ 'sortable' => true,
41
+ 'width' => '5',
42
+ 'index' => 'id'
43
+ ));*/
44
+
45
+ $this->addColumn('id_orden', array(
46
+ 'header' => Mage::helper('andreani')->__('ID Orden'),
47
+ 'sortable' => true,
48
+ 'width' => '2%',
49
+ 'index' => 'id_orden',
50
+ 'type' => 'text'
51
+ ));
52
+
53
+ $this->addColumn('nombre', array(
54
+ 'header' => Mage::helper('andreani')->__('Nombre'),
55
+ 'sortable' => true,
56
+ 'width' => '5',
57
+ 'index' => 'nombre',
58
+ 'type' => 'text'
59
+ ));
60
+
61
+ $this->addColumn('apellido', array(
62
+ 'header' => Mage::helper('andreani')->__('Apellido'),
63
+ 'sortable' => true,
64
+ 'width' => '5',
65
+ 'index' => 'apellido',
66
+ 'type' => 'text'
67
+ ));
68
+
69
+ $this->addColumn('sucursal_retiro', array(
70
+ 'header' => Mage::helper('andreani')->__('Sucursal'),
71
+ 'sortable' => true,
72
+ 'width' => '5',
73
+ 'index' => 'sucursal_retiro',
74
+ 'type' => 'text'
75
+ ));
76
+
77
+ $this->addColumn('detalle_productos', array(
78
+ 'header' => Mage::helper('andreani')->__('Descripcion Productos'),
79
+ 'sortable' => true,
80
+ 'width' => '5',
81
+ 'index' => 'detalle_productos',
82
+ 'type' => 'text'
83
+ ));
84
+ $this->addColumn('cliente', array(
85
+ 'header' => Mage::helper('andreani')->__('Cliente Andreani'),
86
+ 'sortable' => true,
87
+ 'width' => '60',
88
+ 'index' => 'cliente',
89
+ 'type' => 'text'
90
+ ));
91
+
92
+ $this->addColumn('contrato', array(
93
+ 'header' => Mage::helper('andreani')->__('Contrato Andreani'),
94
+ 'sortable' => true,
95
+ 'width' => '60',
96
+ 'index' => 'contrato',
97
+ 'type' => 'text'
98
+ ));
99
+
100
+ $this->addColumn('recibo_tracking', array(
101
+ 'header' => Mage::helper('andreani')->__('Recibo'),
102
+ 'sortable' => true,
103
+ 'width' => '5',
104
+ 'index' => 'recibo_tracking',
105
+ 'type' => 'text'
106
+ ));
107
+
108
+ $this->addColumn('cod_tracking', array(
109
+ 'header' => Mage::helper('andreani')->__('Nro Andreani - Tracking'),
110
+ 'sortable' => true,
111
+ 'width' => '5',
112
+ 'index' => 'cod_tracking',
113
+ 'type' => 'text'
114
+ ));
115
+
116
+ $this->addColumn('impresion', array(
117
+ 'header'=> Mage::helper('catalog')->__('Imprimir Constancia'),
118
+ 'target' => '_blank',
119
+
120
+ 'renderer' => 'andreani/adminhtml_Pedidos_Edit_Renderer_button'
121
+
122
+ ));
123
+
124
+ $this->addColumn('estado', array(
125
+ 'header' => Mage::helper('andreani')->__('Estado'),
126
+ 'sortable' => false,
127
+ 'width' => '5',
128
+ 'index' => 'estado',
129
+ 'type' => 'text',
130
+
131
+ ));
132
+
133
+ $this->addColumn('action_edit', array(
134
+ 'header' => $this->helper('andreani')->__('Action'),
135
+ 'width' => 15,
136
+ 'sortable' => false,
137
+ 'filter' => false,
138
+ 'type' => 'action',
139
+ 'actions' => array(
140
+ array(
141
+ 'caption' => $this->helper('andreani')->__('View'),
142
+ ))
143
+ ));
144
+
145
+ return parent::_prepareColumns();
146
+ }
147
+
148
+ protected function _prepareMassaction()
149
+ {
150
+ $this->setMassactionIdField('id');
151
+ $this->getMassactionBlock()->setFormFieldName('id');
152
+ $this->getMassactionBlock()->addItem('eliminar', array(
153
+ 'label'=> Mage::helper('andreani')->__('Eliminar'),
154
+ 'url' => $this->getUrl('*/*/massEliminar', array('' => '')),
155
+ 'confirm' => Mage::helper('andreani')->__('¿Seguro que quieres eliminar la orden?')
156
+ ));
157
+ $this->getMassactionBlock()->addItem('entregado', array(
158
+ 'label'=> Mage::helper('andreani')->__('Entregado'),
159
+ 'url' => $this->getUrl('*/*/massEntregado', array('' => '')),
160
+ 'confirm' => Mage::helper('andreani')->__('¿Seguro que quieres modificar el estado de la orden?')
161
+ ));
162
+ $this->getMassactionBlock()->addItem('pendiente', array(
163
+ 'label'=> Mage::helper('andreani')->__('Pendiente'),
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
+ ?>
app/code/local/Ecloud/Andreani/Block/Andreani.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.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_Andreani
10
+ extends Mage_Core_Block_Abstract
11
+ implements Mage_Widget_Block_Interface
12
+ {
13
+
14
+ protected function _toHtml()
15
+ {
16
+ $html ='';
17
+ $html .= 'andreani parameter1 = '.$this->getData('parameter1').'<br/>';
18
+ $html .= 'andreani parameter2 = '.$this->getData('parameter2').'<br/>';
19
+ $html .= 'andreani parameter3 = '.$this->getData('parameter3').'<br/>';
20
+ $html .= 'andreani parameter4 = '.$this->getData('parameter4').'<br/>';
21
+ $html .= 'andreani parameter5 = '.$this->getData('parameter5').'<br/>';
22
+ return $html;
23
+ }
24
+
25
+ }
26
+ ?>
app/code/local/Ecloud/Andreani/Helper/Data.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.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 require_once Mage::getBaseDir('lib') . '/Andreani/wsseAuth.php';
9
+ class Ecloud_Andreani_Helper_Data extends Mage_Core_Helper_Abstract
10
+ {
11
+ public function getTrackingpopup($tracking) {
12
+
13
+ $collection = Mage::getModel('andreani/order')->getCollection()
14
+ ->addFieldToFilter('cod_tracking', $tracking);
15
+ $collection->getSelect()->limit(1);
16
+
17
+ if (!$collection) {
18
+ Mage::log("Andreani :: no existe la orden en la tabla andreani_order.");
19
+ return false;
20
+ }
21
+
22
+ foreach($collection as $thing) {
23
+ $datos = $thing->getData();
24
+ }
25
+
26
+ if (Mage::getStoreConfig('carriers/andreaniconfig/testmode',Mage::app()->getStore()) == 1) {
27
+ $url = "https://www.e-andreani.com/eAndreaniWSStaging/Service.svc?wsdl";
28
+ } else {
29
+ $url = "https://www.e-andreani.com/eAndreaniWS/Service.svc?wsdl";
30
+ }
31
+
32
+ $datos["username"] = Mage::getStoreConfig('carriers/andreaniconfig/usuario',Mage::app()->getStore());
33
+ $datos["password"] = Mage::getStoreConfig('carriers/andreaniconfig/password',Mage::app()->getStore());
34
+
35
+ if ($datos["username"] == "" OR $datos["password"] == "") {
36
+ Mage::log("Andreani :: no existe nombre de usuario o contraseña para eAndreani");
37
+ return;
38
+ }
39
+
40
+ try {
41
+ $options = array(
42
+ 'soap_version' => SOAP_1_2,
43
+ 'exceptions' => 1,
44
+ 'trace' => 1,
45
+ 'style' => SOAP_DOCUMENT,
46
+ 'encoding' => SOAP_LITERAL
47
+ );
48
+
49
+ $optRequest["ObtenerTrazabilidad"] = array(
50
+ 'Pieza' => array(
51
+ 'NroPieza' => '',
52
+ 'NroAndreani' => $tracking,
53
+ 'CodigoCliente' => $datos['cliente']
54
+ ));
55
+
56
+ $client = new SoapClient($url, $options);
57
+ $request = $client->__soapCall("ObtenerTrazabilidad", $optRequest);
58
+
59
+ foreach( $request->Pieza->Envios->Envio->Eventos as $indice => $valor )
60
+ {
61
+ $eventos[$indice]["Fecha"] = $valor->Fecha;
62
+ $eventos[$indice]["Estado"] = $valor->Estado;
63
+ $eventos[$indice]["Motivo"] = $valor->Motivo;
64
+ $eventos[$indice]["Sucursal"] = $valor->Sucursal;
65
+ }
66
+
67
+ $estadoenvio = array(
68
+ "Nropieza" => $request->Pieza->NroPieza,
69
+ "NombreEnvio" => $request->Pieza->Envios->Envio->NombreEnvio,
70
+ "Codigotracking" => $request->Pieza->Envios->Envio->NroAndreani,
71
+ "FechAlta" => $request->Pieza->Envios->Envio->FechaAlta,
72
+ "Eventos" => $eventos
73
+ );
74
+
75
+ return $estadoenvio;
76
+
77
+ } catch (SoapFault $e) {
78
+ Mage::log(print_r($e,true));
79
+ }
80
+
81
+ }
82
+
83
+ }
84
+ ?>
85
+
86
+
87
+
88
+
89
+
90
+
91
+
app/code/local/Ecloud/Andreani/Model/Andreani.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.07.2014
4
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
5
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
6
+ */
7
+ ?><?php
8
+ class Ecloud_Andreani_Model_Andreani extends Mage_Core_Model_Abstract
9
+ {
10
+ public function _construct()
11
+ {
12
+ parent::_construct();
13
+ $this->_init('andreani/andreani');
14
+ }
15
+
16
+ }
17
+ ?>
app/code/local/Ecloud/Andreani/Model/Carrier/Andreani.php ADDED
@@ -0,0 +1,504 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.6 20.02.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_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 = '';
15
+ protected $duracion_final = '';
16
+ protected $mode = '';
17
+ protected $envio = '';
18
+
19
+ /**
20
+ * Recoge las tarifas del método de envío basados ​​en la información que recibe de $request
21
+ *
22
+ * @param Mage_Shipping_Model_Rate_Request $data
23
+ * @return Mage_Shipping_Model_Rate_Result
24
+ */
25
+
26
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request) {
27
+ $datos["peso"] = 0;
28
+ $datos["valorDeclarado"] = 0;
29
+ $datos["volumen"] = 0;
30
+ $datos["DetalleProductos"] = "";
31
+ Mage::getSingleton('core/session')->unsAndreani();
32
+ // Reiniciar variable Sucursales si cambio la dirección, ciudad, provincia o cp.
33
+ //Mage::getSingleton('core/session')->unsSucursales();
34
+
35
+ foreach ($request->getAllItems() as $_item) {
36
+ // Tomamos el attr "medida" segun la configuracion del cliente
37
+ if (Mage::getStoreConfig('carriers/andreaniconfig/medida',Mage::app()->getStore())=="") {
38
+ $datos["medida"] = "gramos";
39
+ } else {
40
+ $datos["medida"] = Mage::getStoreConfig('carriers/andreaniconfig/medida',Mage::app()->getStore());
41
+ }
42
+
43
+ if ($datos["medida"]=="kilos") {
44
+ $datos["medida"] = 1000;
45
+ } elseif ($datos["medida"]=="gramos") {
46
+ $datos["medida"] = 1;
47
+ } else {
48
+ $datos["medida"] = 1; //si está vacio: "gramos"
49
+ }
50
+ $datos["peso"] = ($_item->getQty() * $_item->getWeight() * $datos["medida"]) + $datos["peso"];
51
+ $datos["valorDeclarado"] = ($_item->getQty() * $_item->getPrice()) + $datos["valorDeclarado"];
52
+
53
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $_item->getSku(), array('volumen'));
54
+ $datos["volumen"] = ($_item->getQty() * $product->getVolumen() * $datos["medida"]) + $datos["volumen"];
55
+
56
+ // Creamos un string con el detalle de cada producto
57
+ $datos["DetalleProductos"] = "(" . $_item->getQty() . ") " .$_item->getName() . " + " . $datos["DetalleProductos"];
58
+ }
59
+
60
+ $cart = Mage::getSingleton('checkout/cart');
61
+ $quote = $cart->getQuote();
62
+ $shippingAddress = $quote->getShippingAddress();
63
+ $datos["cpDestino"] = intval($shippingAddress->getPostcode());
64
+ $datos["localidad"] = $shippingAddress->getData('city');
65
+ $datos["provincia"] = $shippingAddress->getData('region');
66
+ $datos["direccion"] = $shippingAddress->getData('street');
67
+ $datos["nombre"] = $shippingAddress->getData('firstname');
68
+ $datos["apellido"] = $shippingAddress->getData('lastname');
69
+ $datos["telefono"] = $shippingAddress->getData('telephone');
70
+ $datos["email"] = $shippingAddress->getData('email');
71
+ $datos["dni"] = $shippingAddress->getData('dni');
72
+
73
+ $datos["username"] = Mage::getStoreConfig('carriers/andreaniconfig/usuario',Mage::app()->getStore());
74
+ $datos["password"] = Mage::getStoreConfig('carriers/andreaniconfig/password',Mage::app()->getStore());
75
+ $datos["cliente"] = Mage::getStoreConfig('carriers/andreaniconfig/nrocliente',Mage::app()->getStore());
76
+ $datos["contrato"] = Mage::getStoreConfig('carriers/andreaniconfig/contrato',Mage::app()->getStore());
77
+
78
+ $result = Mage::getModel('shipping/rate_result');
79
+ $method = Mage::getModel('shipping/rate_result_method');
80
+
81
+ if ($this->_code == "andreaniestandar" & Mage::getStoreConfig('carriers/andreaniestandar/active',Mage::app()->getStore()) == 1) {
82
+ $result->append($this->_getAndreaniEstandar($datos));
83
+ }
84
+ if ($this->_code == "andreaniurgente" & Mage::getStoreConfig('carriers/andreaniurgente/active',Mage::app()->getStore()) == 1) {
85
+ $result->append($this->_getAndreaniUrgente($datos));
86
+ }
87
+ if ($this->_code == "andreanisucursal" & Mage::getStoreConfig('carriers/andreanisucursal/active',Mage::app()->getStore()) == 1) {
88
+ $result->append($this->_getAndreaniSucursal($datos));
89
+ }
90
+
91
+ return $result;
92
+ }
93
+
94
+ /**
95
+ * Arma el precio y la información del servicio "Estandar" de Andreani según el parametro $data
96
+ *
97
+ * @param Datos del usuario y el carrito de compras $data
98
+ * @return Los datos para armar el Método de envío $rate
99
+ */
100
+ protected function _getAndreaniEstandar($datos){
101
+ Mage::log("Andreani Estandar");
102
+
103
+ $rate = Mage::getModel('shipping/rate_result_method');
104
+ /* @var $rate Mage_Shipping_Model_Rate_Result_Method */
105
+ $rate->setCarrier($this->_code);
106
+ $rate->setCarrierTitle("Andreani");
107
+ $rate->setMethod($this->_code);
108
+
109
+ $datos["contrato"] = Mage::getStoreConfig('carriers/andreaniestandar/contrato',Mage::app()->getStore());
110
+
111
+ if (Mage::getStoreConfig('carriers/andreaniconfig/testmode',Mage::app()->getStore()) == 1) {
112
+ $datos["urlCotizar"] = 'https://www.e-andreani.com/CasaStaging/eCommerce/CotizacionEnvio.svc?wsdl';
113
+ $datos["urlSucursal"] = 'https://www.e-andreani.com/CasaStaging/ecommerce/ConsultaSucursales.svc?wsdl';
114
+ } else {
115
+ $datos["urlCotizar"] = 'https://www.e-andreani.com/CASAWS/eCommerce/CotizacionEnvio.svc?wsdl';
116
+ $datos["urlSucursal"] = 'https://www.e-andreani.com/CASAWS/ecommerce/ConsultaSucursales.svc?wsdl';
117
+ }
118
+
119
+ // Buscamos la sucursal mas cercana del cliente segun el CP ingresado
120
+ $sucursales = $this->consultarSucursales($datos,"estandar");
121
+ $datos["sucursalRetiro"]= $sucursales->Sucursal;
122
+ $datos["DireccionSucursal"] = $sucursales->Direccion;
123
+
124
+ // Buscamos en eAndreani el costo del envio segun los parametros enviados
125
+ $datos["precio"] = $this->cotizarEnvio($datos);
126
+ $datos["CategoriaDistanciaId"] = $this->envio->CategoriaDistanciaId;
127
+ $datos["CategoriaPeso"] = $this->envio->CategoriaPeso;
128
+
129
+ Mage::getSingleton('core/session')->setAndreani($datos);
130
+
131
+ if ($datos["precio"] == 0) {
132
+ $texto = "Error en la conexión con eAndreani. Por favor chequear los datos ingresados en la información de envio.";
133
+ } else {
134
+ $texto = Mage::getStoreConfig('carriers/andreaniestandar/description',Mage::app()->getStore()) . " {$this->envio->CategoriaDistancia}.";
135
+ }
136
+
137
+ $rate->setMethodTitle($texto);
138
+
139
+ $rate->setPrice($datos["precio"]);
140
+ $rate->setCost($datos["precio"]);
141
+
142
+ return $rate;
143
+ }
144
+
145
+ /**
146
+ * Arma el precio y la información del servicio "Urgente" de Andreani según el parametro $data
147
+ *
148
+ * @param Datos del usuario y el carrito de compras $data
149
+ * @return Los datos para armar el Método de envío $rate
150
+ */
151
+ protected function _getAndreaniUrgente($datos){
152
+ Mage::log("Andreani Urgente");
153
+
154
+ $rate = Mage::getModel('shipping/rate_result_method');
155
+ /* @var $rate Mage_Shipping_Model_Rate_Result_Method */
156
+ $rate->setCarrier($this->_code);
157
+ $rate->setCarrierTitle("Andreani");
158
+ $rate->setMethod($this->_code);
159
+
160
+ $datos["contrato"] = Mage::getStoreConfig('carriers/andreaniurgente/contrato',Mage::app()->getStore());
161
+
162
+ if (Mage::getStoreConfig('carriers/andreaniconfig/testmode',Mage::app()->getStore()) == 1) {
163
+ $datos["urlCotizar"] = 'https://www.e-andreani.com/CasaStaging/eCommerce/CotizacionEnvio.svc?wsdl';
164
+ $datos["urlSucursal"] = 'https://www.e-andreani.com/CasaStaging/ecommerce/ConsultaSucursales.svc?wsdl';
165
+ } else {
166
+ $datos["urlCotizar"] = 'https://www.e-andreani.com/CASAWS/eCommerce/CotizacionEnvio.svc?wsdl';
167
+ $datos["urlSucursal"] = 'https://www.e-andreani.com/CASAWS/ecommerce/ConsultaSucursales.svc?wsdl';
168
+ }
169
+
170
+ // Buscamos la sucursal mas cercana del cliente segun el CP ingresado
171
+ $sucursales = $this->consultarSucursales($datos,"urgente");
172
+ $datos["sucursalRetiro"]= $sucursales->Sucursal;
173
+ $datos["DireccionSucursal"] = $sucursales->Direccion;
174
+
175
+ // Buscamos en eAndreani el costo del envio segun los parametros enviados
176
+ $datos["precio"] = $this->cotizarEnvio($datos);
177
+ $datos["CategoriaDistanciaId"] = $this->envio->CategoriaDistanciaId;
178
+ $datos["CategoriaPeso"] = $this->envio->CategoriaPeso;
179
+
180
+ Mage::getSingleton('core/session')->setAndreani($datos);
181
+
182
+ if ($datos["precio"] == 0) {
183
+ $texto = "Error en la conexión con eAndreani. Por favor chequear los datos ingresados en la información de envio.";
184
+ } else {
185
+ $texto = Mage::getStoreConfig('carriers/andreaniurgente/description',Mage::app()->getStore()) . " {$this->envio->CategoriaDistancia}.";
186
+ }
187
+
188
+ $rate->setMethodTitle($texto);
189
+ $rate->setPrice($datos["precio"]);
190
+ $rate->setCost($datos["precio"]);
191
+
192
+ return $rate;
193
+ }
194
+
195
+ /**
196
+ * Arma el precio y la información del servicio "Sucursal" de Andreani según el parametro $data
197
+ *
198
+ * @param Datos del usuario y el carrito de compras $data
199
+ * @return Los datos para armar el Método de envío $rate
200
+ */
201
+ protected function _getAndreaniSucursal($datos){
202
+ Mage::log("Andreani Sucursal");
203
+
204
+ $rate = Mage::getModel('shipping/rate_result_method');
205
+ /* @var $rate Mage_Shipping_Model_Rate_Result_Method */
206
+ $rate->setCarrier($this->_code);
207
+ $rate->setCarrierTitle("Andreani");
208
+ $rate->setMethod($this->_code);
209
+
210
+ $datos["contrato"] = Mage::getStoreConfig('carriers/andreanisucursal/contrato',Mage::app()->getStore());
211
+
212
+ if (Mage::getStoreConfig('carriers/andreaniconfig/testmode',Mage::app()->getStore()) == 1) {
213
+ $datos["urlCotizar"] = 'https://www.e-andreani.com/CasaStaging/eCommerce/CotizacionEnvio.svc?wsdl';
214
+ $datos["urlSucursal"] = 'https://www.e-andreani.com/CasaStaging/ecommerce/ConsultaSucursales.svc?wsdl';
215
+ } else {
216
+ $datos["urlCotizar"] = 'https://www.e-andreani.com/CASAWS/eCommerce/CotizacionEnvio.svc?wsdl';
217
+ $datos["urlSucursal"] = 'https://www.e-andreani.com/CASAWS/ecommerce/ConsultaSucursales.svc?wsdl';
218
+ }
219
+
220
+ // Buscamos la sucursal mas cercana del cliente segun el CP ingresado
221
+ $sucursales = $this->consultarSucursales($datos,"sucursal");
222
+ $datos["sucursalRetiro"]= $sucursales->Sucursal;
223
+ $datos["DireccionSucursal"] = $sucursales->Direccion;
224
+
225
+ // Buscamos en eAndreani el costo del envio segun los parametros enviados
226
+ $datos["precio"] = $this->cotizarEnvio($datos);
227
+
228
+ if ($datos["precio"] == 0) {
229
+ $texto = "Error en la conexión con eAndreani. Por favor chequear los datos ingresados en la información de envio.";
230
+ } else {
231
+ $texto = Mage::getStoreConfig('carriers/andreanisucursal/description',Mage::app()->getStore()) . " {$sucursales->Descripcion} ({$sucursales->Direccion}). Estas a {$this->distancia_final_txt} {$this->mode} ({$this->duracion_final}).";
232
+ }
233
+
234
+ $datos["CategoriaDistanciaId"] = $this->envio->CategoriaDistanciaId;
235
+ $datos["CategoriaPeso"] = $this->envio->CategoriaPeso;
236
+
237
+ Mage::getSingleton('core/session')->setAndreani($datos);
238
+
239
+ $rate->setMethodTitle($texto);
240
+
241
+ $rate->setPrice($datos["precio"]);
242
+ $rate->setCost($datos["precio"]);
243
+
244
+ return $rate;
245
+ }
246
+
247
+ /**
248
+ * Get allowed shipping methods
249
+ *
250
+ * @return array
251
+ */
252
+ public function getAllowedMethods() {
253
+ return array($this->_code => $this->getConfigData('name'));
254
+ }
255
+
256
+ /**
257
+ * Cotiza el envio de los productos segun los parametros
258
+ *
259
+ * @param $params
260
+ * @return $costoEnvio
261
+ */
262
+ public function cotizarEnvio($params) {
263
+ try {
264
+
265
+ $options = array(
266
+ 'soap_version' => SOAP_1_2,
267
+ 'exceptions' => true,
268
+ 'trace' => 1,
269
+ 'wdsl_local_copy' => true
270
+ );
271
+
272
+ $wsse_header = new WsseAuthHeader($params["username"], $params["password"]);
273
+ $client = new SoapClient($params["urlCotizar"], $options);
274
+ $client->__setSoapHeaders(array($wsse_header));
275
+
276
+ $phpresponse = $client->CotizarEnvio(array(
277
+ 'cotizacionEnvio' =>array(
278
+ 'CPDestino' =>$params["cpDestino"],
279
+ 'Cliente' =>$params["cliente"],
280
+ 'Contrato' =>$params["contrato"],
281
+ 'Peso' =>$params["peso"],
282
+ 'SucursalRetiro'=>$params["sucursalRetiro"],
283
+ 'ValorDeclarado'=>$params["valorDeclarado"],
284
+ 'Volumen' =>$params["volumen"]
285
+ )));
286
+
287
+ $costoEnvio = floatval($phpresponse->CotizarEnvioResult->Tarifa);
288
+ $this->envio = $phpresponse->CotizarEnvioResult;
289
+
290
+ Mage::log("Cotizar envio: " . print_r($phpresponse->CotizarEnvioResult,true));
291
+
292
+ return $costoEnvio;
293
+
294
+ } catch (SoapFault $e) {
295
+ Mage::log("Error: " . $e);
296
+ //Mage::getSingleton('core/session')->addError('Error en la conexión con eAndreani. Disculpe las molestias.. vuelva a intentar! <br> En caso de persistir el error contacte al administrador de la tienda.');
297
+ }
298
+ }
299
+
300
+ /**
301
+ * Trae las sucursales de Andreani segun los parametros
302
+ *
303
+ * @param $params
304
+ * @return $costoEnvio
305
+ */
306
+ public function consultarSucursales($params,$metodo) {
307
+ try {
308
+ // Nos fijamos si ya consultamos la sucursal en Andreani
309
+ if(is_object(Mage::getSingleton('core/session')->getSucursales())) {
310
+ if($metodo != "sucursal") {
311
+ Mage::log("Ya buscó la sucursal en Andreani");
312
+ return Mage::getSingleton('core/session')->getSucursales();
313
+ } else {
314
+ //Mage::getSingleton('core/session')->unsGoogleDistance();
315
+ Mage::log("Google Distance: " . print_r(Mage::getSingleton('core/session')->getGoogleDistance(),true));
316
+ if(is_object(Mage::getSingleton('core/session')->getGoogleDistance())) {
317
+ Mage::log("Ya buscó la sucursal en Google Maps");
318
+ $this->distancia_final_txt = Mage::getSingleton('core/session')->getDistancia();
319
+ $this->duracion_final = Mage::getSingleton('core/session')->getDuracion();
320
+ $this->mode = Mage::getSingleton('core/session')->getMode();
321
+
322
+ return Mage::getSingleton('core/session')->getGoogleDistance();
323
+ }
324
+ }
325
+ }
326
+
327
+ $options = array(
328
+ 'soap_version' => SOAP_1_2,
329
+ 'exceptions' => true,
330
+ 'trace' => 1,
331
+ 'wdsl_local_copy' => true
332
+ );
333
+
334
+ $wsse_header = new WsseAuthHeader($params["username"], $params["password"]);
335
+ $client = new SoapClient($params["urlSucursal"], $options);
336
+ $client->__setSoapHeaders(array($wsse_header));
337
+
338
+ if ($params["cpDestino"] == "") { $params["cpDestino"] = "00000000"; }
339
+ $phpresponse = $client->ConsultarSucursales(array(
340
+ 'consulta' => array(
341
+ 'CodigoPostal' => $params["cpDestino"],
342
+ 'Localidad' => NULL,
343
+ 'Provincia' => NULL
344
+ )));
345
+
346
+ if (is_object($phpresponse->ConsultarSucursalesResult->ResultadoConsultarSucursales)) {
347
+ Mage::log("Entra si encuentra el CP");
348
+ // Si no tenemos la direccion del cliente pero SI el CP, deberia mostrarnos la sucursal de nuestra localidad sin calcular la distancia a la misma.
349
+ $sucursales = $phpresponse->ConsultarSucursalesResult->ResultadoConsultarSucursales;
350
+ if ($this->_code == "andreanisucursal") { $sucursales = $this->distancematrix(array('0' => $sucursales),$params["direccion"],$params["localidad"],$params["provincia"]); }
351
+ } else {
352
+ Mage::log("No encontro el CP y busca por localidad: " . $params["localidad"]);
353
+ $phpresponse = $client->ConsultarSucursales(array(
354
+ 'consulta' => array(
355
+ 'CodigoPostal' => NULL,
356
+ 'Localidad' => $params["localidad"],
357
+ 'Provincia' => NULL
358
+ )));
359
+ if (is_object($phpresponse->ConsultarSucursalesResult->ResultadoConsultarSucursales) OR is_array($phpresponse->ConsultarSucursalesResult->ResultadoConsultarSucursales)) {
360
+ Mage::log("Encontro localidad");
361
+ $sucursales = $phpresponse->ConsultarSucursalesResult->ResultadoConsultarSucursales;
362
+ if (is_array($sucursales)) {
363
+ Mage::log("Encontro mas de una localidad");
364
+ // Consultamos por "localidad" y encontro varios resultados
365
+ // buscamos en GoogleAPI cual es la sucursal mas cercana segun la direccion del cliente
366
+ $sucursales = $this->distancematrix($sucursales,$params["direccion"],$params["localidad"],$params["provincia"]);
367
+ } else {
368
+ if ($this->_code == "andreanisucursal") { $sucursales = $this->distancematrix(array('0' => $sucursales),$params["direccion"],$params["localidad"],$params["provincia"]); }
369
+ }
370
+ } else {
371
+ Mage::log("No encontro la localidad busca por provincia");
372
+ if ($params["provincia"]=="") {
373
+ $params["provincia"] = NULL;
374
+ Mage::log("Entra si la provincia esta vacia");
375
+ }
376
+ $phpresponse = $client->ConsultarSucursales(array(
377
+ 'consulta' => array(
378
+ 'CodigoPostal' => NULL,
379
+ 'Localidad' => NULL,
380
+ 'Provincia' => $params["provincia"]
381
+ )));
382
+
383
+
384
+ if (is_object($phpresponse->ConsultarSucursalesResult->ResultadoConsultarSucursales) OR is_array($phpresponse->ConsultarSucursalesResult->ResultadoConsultarSucursales)) {
385
+ Mage::log("Encontro sucursales en la provincia. Si está vacia.. nos trae todas las provincias");
386
+ $sucursales = $phpresponse->ConsultarSucursalesResult->ResultadoConsultarSucursales;
387
+ if (is_array($sucursales)) {
388
+ Mage::log("Encontro muchas sucursales en la provincia");
389
+ // Consultamos por "provincia" y encontro varios resultados
390
+ // buscamos en GoogleAPI cual es la sucursal mas cercana segun la direccion del cliente
391
+ $sucursales = $this->distancematrix($sucursales,$params["direccion"],$params["localidad"],$params["provincia"]);
392
+ } else {
393
+ if ($this->_code == "andreanisucursal") { $sucursales = $this->distancematrix(array('0' => $sucursales),$params["direccion"],$params["localidad"],$params["provincia"]); }
394
+ }
395
+ } else {
396
+ Mage::log("No encontro la provincia y busca todas las localidades para determinar la mas cercana");
397
+ // buscar todas las sucursales
398
+ // buscamos en GoogleAPI cual es la sucursal mas cercana segun la direccion del cliente
399
+ $phpresponse = $client->ConsultarSucursales(array(
400
+ 'consulta' => array(
401
+ 'CodigoPostal' => NULL,
402
+ 'Localidad' => NULL,
403
+ 'Provincia' => NULL
404
+ )));
405
+ $sucursales = $phpresponse->ConsultarSucursalesResult->ResultadoConsultarSucursales;
406
+
407
+ $sucursales = $this->distancematrix($sucursales,$params["direccion"],$params["localidad"],$params["provincia"]);
408
+ }
409
+ }
410
+ }
411
+
412
+ Mage::log("Sucursal: " . print_r($sucursales, true));
413
+ Mage::getSingleton('core/session')->setSucursales($sucursales);
414
+
415
+ return $sucursales;
416
+
417
+ } catch (SoapFault $e) {
418
+ Mage::log("Error: " . $e);
419
+ //Mage::getSingleton('core/session')->addError('Error en la conexión con eAndreani. Disculpe las molestias.. vuelva a intentar! <br> En caso de persistir el error contacte al administrador de la tienda.');
420
+ }
421
+ }
422
+
423
+ /**
424
+ * Determina la menor distancia entre un array de sucursales y la direccion del cliente
425
+ *
426
+ * @param $sucursales,$direccion,$localidad,$provincia
427
+ * @return $sucursales
428
+ */
429
+ public function distancematrix($sucursales,$direccion,$localidad,$provincia) {
430
+ try {
431
+ $direccion_cliente = $direccion . "+" . $localidad . "+" . $provincia;
432
+
433
+ Mage::log("Direccion del cliente: " . $direccion_cliente);
434
+ //Mage::log("Array sucursales: " . print_r($sucursales,true));
435
+
436
+ $distancia_final = 100000000;
437
+ $posicion = "default";
438
+ foreach ($sucursales as $key => $sucursal) {
439
+ $direccion = explode(',', $sucursal->Direccion);
440
+ $direccion_sucursal = $direccion[0] . "+" . $direccion[2] . "+" . $direccion[3];
441
+
442
+ Mage::log("Data: " . print_r($sucursal , true));
443
+ Mage::log("Sucursal: " . $sucursal->Direccion);
444
+ Mage::log("Direccion del cliente: " . str_replace(" ","%20",$direccion_cliente));
445
+ Mage::log("Direccion de sucursal: " . str_replace(" ","%20",$direccion_sucursal));
446
+
447
+ $originales = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿŔŕ';
448
+ $modificadas = 'aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr';
449
+ $direccion_cliente = utf8_decode($direccion_cliente);
450
+ $direccion_cliente = strtr($direccion_cliente, utf8_decode($originales), $modificadas);
451
+ $direccion_cliente = strtolower($direccion_cliente);
452
+ $direccion_cliente = utf8_encode($direccion_cliente);
453
+ $direccion_sucursal = utf8_decode($direccion_sucursal);
454
+ $direccion_sucursal = strtr($direccion_sucursal, utf8_decode($originales), $modificadas);
455
+ $direccion_sucursal = strtolower($direccion_sucursal);
456
+ $direccion_sucursal = utf8_encode($direccion_sucursal);
457
+
458
+ //$mode = "walking";
459
+ //$mode = "bicycling";
460
+ $mode = "driving";
461
+ $url = "https://maps.googleapis.com/maps/api/distancematrix/json?origins=" . str_replace(" ","%20",$direccion_cliente) . "&destinations=" . str_replace(" ","%20",$direccion_sucursal) . "&mode={$mode}&language=es-ES&sensor=false";
462
+
463
+ $api = file_get_contents($url);
464
+ $data = json_decode(utf8_encode($api),true);
465
+
466
+ $rows = $data["rows"][0];
467
+ $elements = $rows["elements"][0];
468
+
469
+ $distancia = $elements["distance"]["value"];
470
+ $distancia_txt = $elements["distance"]["text"];
471
+ $duracion = $elements["duration"]["text"];
472
+
473
+ if ($distancia_final >= $distancia && !empty($distancia)) {
474
+ $distancia_final = $distancia;
475
+ $distancia_final_txt = $distancia_txt;
476
+ $duracion_final = $duracion;
477
+ $posicion = $key;
478
+ }
479
+ }
480
+
481
+ // Desahbiltar método sucursal en el Shipping Method
482
+ if($posicion === "default") {
483
+ Mage::log("No se encontro la sucursal.");
484
+ return false;
485
+ }
486
+
487
+ $this->distancia_final_txt = $distancia_final_txt;
488
+ $this->duracion_final = $duracion_final;
489
+ if($mode=="driving") $this->mode="en auto";
490
+
491
+ // Guardamos las variables en session para no tener que volver a llamar a la API de Google
492
+ Mage::getSingleton('core/session')->setGoogleDistance($sucursales[$posicion]);
493
+ Mage::getSingleton('core/session')->setDistancia($distancia_final_txt);
494
+ Mage::getSingleton('core/session')->setDuracion($duracion_final);
495
+ Mage::getSingleton('core/session')->setMode($this->mode);
496
+ return $sucursales[$posicion];
497
+
498
+ } catch (SoapFault $e) {
499
+ Mage::log("Error: " . $e);
500
+ }
501
+ }
502
+
503
+ }
504
+ ?>
app/code/local/Ecloud/Andreani/Model/Carrier/Andreaniestandar.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.07.2014
4
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
5
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
6
+ */
7
+ ?><?php
8
+ class Ecloud_Andreani_Model_Carrier_Andreaniestandar extends Ecloud_Andreani_Model_Carrier_Andreani
9
+ {
10
+ protected $_code = 'andreaniestandar';
11
+ }
12
+ ?>
app/code/local/Ecloud/Andreani/Model/Carrier/Andreanisucursal.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.07.2014
4
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
5
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
6
+ */
7
+ ?><?php
8
+ class Ecloud_Andreani_Model_Carrier_Andreanisucursal extends Ecloud_Andreani_Model_Carrier_Andreani
9
+ {
10
+ protected $_code = 'andreanisucursal';
11
+ }
12
+ ?>
app/code/local/Ecloud/Andreani/Model/Carrier/Andreaniurgente.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.07.2014
4
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
5
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
6
+ */
7
+ ?><?php
8
+ class Ecloud_Andreani_Model_Carrier_Andreaniurgente extends Ecloud_Andreani_Model_Carrier_Andreani
9
+ {
10
+ protected $_code = 'andreaniurgente';
11
+ }
12
+ ?>
app/code/local/Ecloud/Andreani/Model/Config/Medida.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.07.2014
4
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
5
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
6
+ */
7
+ ?><?php
8
+ class Ecloud_Andreani_Model_Config_Medida
9
+ {
10
+
11
+ /**
12
+ * Options getter
13
+ *
14
+ * @return array
15
+ */
16
+ public function toOptionArray()
17
+ {
18
+ return array(
19
+ array('value' => 'gramos', 'label'=>Mage::helper('adminhtml')->__('gramos / cm3')),
20
+ array('value' => 'kilos', 'label'=>Mage::helper('adminhtml')->__('kg / m3')),
21
+ );
22
+ }
23
+
24
+ /**
25
+ * Get options in "key-value" format
26
+ *
27
+ * @return array
28
+ */
29
+ public function toArray()
30
+ {
31
+ return array(
32
+ 'gramos' => Mage::helper('adminhtml')->__('gramos / cm3'),
33
+ 'kilos' => Mage::helper('adminhtml')->__('kg / m3'),
34
+ );
35
+ }
36
+
37
+ }
app/code/local/Ecloud/Andreani/Model/Config/TestMode.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.07.2014
4
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
5
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
6
+ */
7
+ ?>
8
+
9
+ <?php
10
+
11
+ class Ecloud_Andreani_Model_Config_TestMode
12
+ {
13
+
14
+ /**
15
+ * Options getter
16
+ *
17
+ * @return array
18
+ */
19
+ public function toOptionArray()
20
+ {
21
+ return array(
22
+ array('value' => '1', 'label'=>Mage::helper('adminhtml')->__('Habilitado')),
23
+ array('value' => '0', 'label'=>Mage::helper('adminhtml')->__('Deshabilitado')),
24
+ );
25
+ }
26
+
27
+ /**
28
+ * Get options in "key-value" format
29
+ *
30
+ * @return array
31
+ */
32
+ public function toArray()
33
+ {
34
+ return array(
35
+ '1' => Mage::helper('adminhtml')->__('Habilitado'),
36
+ '0' => Mage::helper('adminhtml')->__('Deshabilitado'),
37
+ );
38
+ }
39
+
40
+ }
app/code/local/Ecloud/Andreani/Model/Observer.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.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_Model_Observer extends Mage_Core_Model_Session_Abstract {
9
+
10
+ /**
11
+ * Event: checkout_type_onepage_save_order
12
+ * @param $observer Varien_Event_Observer
13
+ */
14
+
15
+ /**
16
+ * NOTA:
17
+ * - Llama a la funcion cuando la orden fue creada luego del Checkout y almacena los datos en la tabla "andreani_order"
18
+ */
19
+ public function andreaniObserver($observer) {
20
+ try {
21
+ // 1. Tomamos todos los datos de la orden
22
+ $datos = Mage::getSingleton('core/session')->getAndreani();
23
+ // 2. Buscamos el ID de la orden
24
+ $OrderId = $observer->getEvent()->getOrder()->getId();
25
+ // 3. Los almacenamos en la tabla "andreani_order"
26
+ $_dataSave = (array(
27
+ 'id_orden' => intval($OrderId),
28
+ 'contrato' => $datos["contrato"],
29
+ 'cliente' => $datos["cliente"],
30
+ 'direccion' => $datos["direccion"],
31
+ 'localidad' => $datos["localidad"],
32
+ 'provincia' => $datos["provincia"],
33
+ 'cp_destino' => $datos["cpDestino"],
34
+ 'sucursal_retiro' => $datos["sucursalRetiro"],
35
+ 'direccion_sucursal' => $datos["DireccionSucursal"],
36
+ 'nombre' => $datos["nombre"],
37
+ 'apellido' => $datos["apellido"],
38
+ 'telefono' => $datos["telefono"],
39
+ 'dni' => $datos["dni"],
40
+ 'email' => $datos["email"],
41
+ 'precio' => $datos["precio"],
42
+ 'valor_declarado' => $datos["valorDeclarado"],
43
+ 'volumen' => $datos["volumen"],
44
+ 'peso' => $datos["peso"],
45
+ 'detalle_productos' => $datos["DetalleProductos"],
46
+ 'categoria_distancia_id'=> $datos["CategoriaDistanciaId"],
47
+ 'categoria_peso' => $datos["CategoriaPeso"],
48
+ 'direccion_sucursal' => $datos["DireccionSucursal"],
49
+ 'estado' => 'Pendiente'
50
+ ));
51
+ $model = Mage::getModel('andreani/order')->addData($_dataSave);
52
+ $model->save();
53
+
54
+ } catch (Exception $e) {
55
+ Mage::log("Error: " . $e);
56
+ }
57
+ }
58
+
59
+ /**
60
+ * NOTA: Llama a la funcion cuando desde el Admin Panel se ejecuta el "Ship" y luego "Submit Shipment"
61
+ */
62
+ public function salesOrderShipmentSaveBefore($observer) {
63
+
64
+ // 1. Tomamos los datos de la orden segun el ID en la tabla "andreani_order"
65
+ $shipment = $observer->getEvent()->getShipment();
66
+ $order = $shipment->getOrder();
67
+ $OrderId = $order->getId();
68
+
69
+
70
+ // Traemos los datos de la tabla "andreani_order" según el OrderId[0] y asignarla a $datos
71
+ $collection = Mage::getModel('andreani/order')->getCollection()
72
+ ->addFieldToFilter('id_orden', $OrderId);
73
+ $collection->getSelect()->limit(1);
74
+
75
+ if (!$collection) {
76
+ Mage::log("Andreani :: no existe la orden en la tabla andreani_order.");
77
+ return;
78
+ }
79
+
80
+ foreach($collection as $thing) {
81
+ $datos = $thing->getData();
82
+ }
83
+
84
+ if (Mage::getStoreConfig('carriers/andreaniconfig/testmode',Mage::app()->getStore()) == 1) {
85
+ $datos["urlConfirmar"] = "https://www.e-andreani.com/CASAStaging/eCommerce/ImposicionRemota.svc?wsdl";
86
+ } else {
87
+ $datos["urlConfirmar"] = "https://www.e-andreani.com/CASAWS/eCommerce/ImposicionRemota.svc?wsdl";
88
+ }
89
+
90
+
91
+ $datos["username"] = Mage::getStoreConfig('carriers/andreaniconfig/usuario',Mage::app()->getStore());
92
+ $datos["password"] = Mage::getStoreConfig('carriers/andreaniconfig/password',Mage::app()->getStore());
93
+
94
+
95
+ if ($datos["username"] == "" OR $datos["password"] == "") {
96
+ Mage::log("Andreani :: no existe nombre de usuario o contraseña para eAndreani");
97
+ return;
98
+ }
99
+ // 2. Conectarse a eAndreani
100
+ try {
101
+ $options = array(
102
+ 'soap_version' => SOAP_1_2,
103
+ 'exceptions' => true,
104
+ 'trace' => 1,
105
+ 'wdsl_local_copy' => true
106
+ );
107
+ $wsse_header = new WsseAuthHeader($datos["username"], $datos["password"]);
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
+ }
114
+
115
+ $phpresponse = $client->ConfirmarCompra(array(
116
+ 'compra' =>array(
117
+ 'Calle' => $datos["direccion"],
118
+ 'CategoriaDistancia' => $datos["categoria_distancia_id"],
119
+ 'CategoriaFacturacion' => NULL,
120
+ 'CategoriaPeso' => $datos["categoria_peso"],
121
+ 'CodigoPostalDestino' => $datos["cp_destino"],
122
+ 'Contrato' => $datos["contrato"],
123
+ 'Departamento' => NULL,
124
+ 'DetalleProductosEntrega'=> $datos["detalle_productos"],
125
+ 'DetalleProductosRetiro' => $datos["detalle_productos"],
126
+ 'Email' => $datos["email"],
127
+ 'Localidad' => $datos["localidad"],
128
+ 'NombreApellido' => $datos["nombre"] . " " . $datos["apellido"],
129
+ 'NombreApellidoAlternativo' => NULL,
130
+ 'Numero' => $datos["direccion"],
131
+ 'NumeroCelular' => $datos["telefono"],
132
+ 'NumeroDocumento' => $datos["dni"],
133
+ 'NumeroTelefono' => $datos["telefono"],
134
+ 'NumeroTransaccion' => "Transacción nro: " . $datos["id_orden"],
135
+ 'Peso' => $datos["peso"],
136
+ 'Piso' => NULL,
137
+ 'Provincia' => $datos["provincia"],
138
+ 'SucursalCliente' => NULL,
139
+ 'SucursalRetiro' => $datos["sucursal_retiro"],
140
+ 'Tarifa' => $datos["precio"],
141
+ 'TipoDocumento' => "DNI",
142
+ 'ValorACobrar' => $datos["precio"], // Si es contrarembolso deberiamos sumar el "ValorDeclarado"
143
+ 'ValorDeclarado' => $datos["valor_declarado"],
144
+ 'Volumen' => $datos["volumen"]
145
+ )));
146
+
147
+ // 4. Tomamos "NroAndreani" y lo almacenamos como "Tracking number"
148
+ $shipment = $observer->getEvent()->getShipment();
149
+ $track = Mage::getModel('sales/order_shipment_track')
150
+ ->setNumber($phpresponse->ConfirmarCompraResult->NumeroAndreani)
151
+ ->setCarrierCode('andreani') //carrier code
152
+ ->setTitle('Andreani');
153
+ $shipment->addTrack($track);
154
+
155
+ //Enviamos numero Andreani, nos devolvera el url de la constancia que lo almacenaremos en la tabla andreani_order.
156
+ $NroAndreani = $phpresponse->ConfirmarCompraResult->NumeroAndreani;
157
+ $constanciaResponse = $client->ImprimirConstancia(array(
158
+ 'entities' =>array(
159
+ 'ParamImprimirConstancia' =>array(
160
+ 'NumeroAndreani' => $NroAndreani
161
+ ))));
162
+ $ConstanciaURL = $constanciaResponse->ImprimirConstanciaResult->ResultadoImprimirConstancia->PdfLinkFile;
163
+ Mage::log("Constancia de entrega URL " . print_r($ConstanciaURL,true));
164
+
165
+ $id = intval($datos["id"]);
166
+ Mage::getModel('andreani/order')->load($id)->setData('cod_tracking',$phpresponse->ConfirmarCompraResult->NumeroAndreani)->save();
167
+ Mage::getModel('andreani/order')->load($id)->setData('recibo_tracking',$phpresponse->ConfirmarCompraResult->Recibo)->save();
168
+ Mage::getModel('andreani/order')->load($id)->setData('estado','Enviado')->save();
169
+ Mage::getModel('andreani/order')->load($id)->setData('constancia',$ConstanciaURL)->save();
170
+
171
+
172
+ } catch (SoapFault $e) {
173
+ Mage::log("Error: " . $e);
174
+ }
175
+
176
+
177
+ }
178
+
179
+ }
180
+ ?>
app/code/local/Ecloud/Andreani/Model/Order.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.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
+ /**
10
+ *
11
+ */
12
+ class Ecloud_Andreani_Model_Order extends Mage_Core_Model_Abstract
13
+ {
14
+
15
+ /**
16
+ *
17
+ */
18
+ protected function _construct()
19
+ {
20
+ $this->_init('andreani/order');
21
+ }
22
+
23
+ }
24
+ ?>
app/code/local/Ecloud/Andreani/Model/Resource/Order.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.07.2014
4
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
5
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
6
+ */
7
+ ?><?php
8
+ class Ecloud_Andreani_Model_Resource_Order extends Mage_Core_Model_Mysql4_Abstract
9
+ {
10
+ public function _construct()
11
+ {
12
+ $this->_init('andreani/order', 'id');
13
+ }
14
+ }
app/code/local/Ecloud/Andreani/Model/Resource/Order/Collection.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.07.2014
4
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
5
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
6
+ */
7
+ ?><?php
8
+ class Ecloud_Andreani_Model_Resource_Order_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
9
+ {
10
+ public function _construct()
11
+ {
12
+ parent::_construct();
13
+ $this->_init('andreani/order');
14
+ }
15
+ }
app/code/local/Ecloud/Andreani/controllers/Adminhtml/Pedidos/PedidosController.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.07.2014
4
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
5
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
6
+ */
7
+ ?><?php
8
+ class Ecloud_Andreani_Adminhtml_Tracking_PedidosController extends Mage_Adminhtml_Controller_Action
9
+ {
10
+
11
+ public function indexAction()
12
+ {
13
+ $this->loadLayout()->_setActiveMenu('andreani/pedidos');
14
+ $this->_addContent($this->getLayout()->createBlock('andreani/adminhtml_pedidos'));
15
+ $this->renderLayout();
16
+ }
17
+
18
+ }
19
+ ?>
app/code/local/Ecloud/Andreani/controllers/Adminhtml/PedidosController.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 0.1.7 03.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->loadLayout();
23
+ $this->getResponse()->setBody(
24
+ $this->getLayout()->createBlock('andreani/adminhtml_andreani_pedidos_grid')->toHtml()
25
+ );
26
+
27
+ }
28
+
29
+ public function exportEcloudCsvAction()
30
+ {
31
+ $fileName = 'pedidos_andreani.csv';
32
+ $grid = $this->getLayout()->createBlock('andreani/adminhtml_andreani_pedidos_grid');
33
+ $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
34
+ }
35
+
36
+ public function exportEcloudExcelAction()
37
+ {
38
+ $fileName = 'pedidos_andreani.xml';
39
+ $grid = $this->getLayout()->createBlock('andreani/adminhtml_andreani_pedidos_grid');
40
+ $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
41
+ }
42
+
43
+ public function massEliminarAction()
44
+ {
45
+ $ids = $this->getRequest()->getParam('id');
46
+ if(!is_array($ids)) {
47
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('andreani')->__('Por favor seleccionar una orden!'));
48
+ } else {
49
+ try {
50
+ foreach ($ids as $id) {
51
+ //Mage::getModel('andreani/order')->load($id)->delete();
52
+ Mage::getModel('andreani/order')->load($id)->setData("estado","Eliminada")->save();
53
+ }
54
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('andreani')->__('Se han eliminado %d registro(s).', count($ids)));
55
+ } catch (Exception $e) {
56
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
57
+ }
58
+ }
59
+ $this->_redirect('*/*/index');
60
+ }
61
+
62
+ public function massEntregadoAction()
63
+ {
64
+ $ids = $this->getRequest()->getParam('id');
65
+
66
+ if(!is_array($ids)) {
67
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('andreani')->__('Por favor seleccionar una orden!'));
68
+ } else {
69
+ try {
70
+ foreach ($ids as $id) {
71
+ Mage::getModel('andreani/order')->load($id)->setData("estado","Entregado")->save();
72
+ }
73
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('andreani')->__('Se han actualizado %d registro(s).', count($ids)));
74
+ } catch (Exception $e) {
75
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
76
+ }
77
+ }
78
+ $this->_redirect('*/*/index');
79
+ }
80
+
81
+ public function massPendienteAction()
82
+ {
83
+ $ids = $this->getRequest()->getParam('id');
84
+ if(!is_array($ids)) {
85
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('andreani')->__('Por favor seleccionar una orden!'));
86
+ } else {
87
+ try {
88
+ foreach ($ids as $id) {
89
+ Mage::getModel('andreani/order')->load($id)->setData("estado","Pendiente")->save();
90
+ }
91
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('andreani')->__('Se han actualizado %d registro(s).', count($ids)));
92
+ } catch (Exception $e) {
93
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
94
+ }
95
+ }
96
+ $this->_redirect('*/*/index');
97
+ }
98
+
99
+ public function viewAction()
100
+ {
101
+ $id = (int) $this->getRequest()->getParam('id');
102
+
103
+ // 1. Traemos los datos de la tabla "andreani_order" según el OrderId[0] y asignarla a $datos
104
+ $collection = Mage::getModel('andreani/order')->getCollection()
105
+ ->addFieldToFilter('id', $id);
106
+ $collection->getSelect()->limit(1);
107
+
108
+ if (!$collection) {
109
+ Mage::log("Andreani :: no existe la orden en la tabla andreani_order.");
110
+ return;
111
+ }
112
+ foreach($collection as $thing) {
113
+ $datos = $thing->getData();
114
+ }
115
+
116
+ // 2. Conectarse a eAndreani
117
+ if (Mage::getStoreConfig('carriers/andreaniconfig/testmode',Mage::app()->getStore()) == 1) {
118
+ $url = 'https://www.e-andreani.com/eAndreaniWSStaging/Service.svc?wsdl';
119
+ } else {
120
+ $url = "https://www.e-andreani.com/eAndreaniWS/Service.svc?wsdl";
121
+ }
122
+
123
+ if ( $datos['cod_tracking'] != '' ) {
124
+ try {
125
+ $options = array(
126
+ 'soap_version' => SOAP_1_2,
127
+ 'exceptions' => 1,
128
+ 'trace' => 1,
129
+ 'style' => SOAP_DOCUMENT,
130
+ 'encoding' => SOAP_LITERAL,
131
+ );
132
+
133
+ $optRequest = array();
134
+ $optRequest["ObtenerTrazabilidad"] = array(
135
+ 'Pieza' => array(
136
+ 'NroPieza' => '',
137
+ 'NroAndreani' => $datos['cod_tracking'],
138
+ 'CodigoCliente' => $datos['cliente']
139
+ ));
140
+ $client = new SoapClient($url, $options);
141
+ $request = $client->__soapCall("ObtenerTrazabilidad", $optRequest);
142
+
143
+ $texto = $request->Pieza->NroPieza . "\n";
144
+ $texto .= "Nombre del Envio: " . $request->Pieza->Envios->Envio->NombreEnvio . "\n";
145
+ $texto .= "Código de tracking: " . $request->Pieza->Envios->Envio->NroAndreani . "\n";
146
+ $texto .= "Fecha de alta: " . $request->Pieza->Envios->Envio->FechaAlta . "\n";
147
+
148
+
149
+ foreach( $request->Pieza->Envios->Envio->Eventos as $indice => $valor )
150
+ {
151
+ $texto .= "Eventos: " . "\n\n";
152
+ $texto .= "Fecha del evento: " . $valor->Fecha . "\n";
153
+ $texto .= "Estado del envio: " . $valor->Estado . "\n";
154
+ $texto .= "Motivo: " . $valor->Motivo . "\n";
155
+ $texto .= "Sucursal: " . $valor->Sucursal . "\n";
156
+ $texto .= "------------------ \n";
157
+ }
158
+
159
+ Mage::getModel('andreani/order')->load($id)->setData("tracking",$texto)->save();
160
+
161
+ } catch (SoapFault $e) {
162
+ Mage::log(print_r($e,true));
163
+ }
164
+ } else {
165
+ $texto = "El envío se encuentra pendiente. Diríjase a 'Ventas->Pedidos' para dar comienzo al proceso cuando el mismo se haya realizado";
166
+ Mage::getModel('andreani/order')->load($id)->setData("tracking",$texto)->save();
167
+ }
168
+
169
+ if ($id) {
170
+ $order = Mage::getModel('andreani/order')->load($id);
171
+ if (!$order || !$order->getId()) {
172
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('andreani')->__('No se encontró el ID de la orden'));
173
+ $this->_redirect('*/*/');
174
+ }
175
+ }
176
+
177
+ Mage::register('order_data', $order);
178
+
179
+ $this->loadLayout();
180
+ $block = $this->getLayout()->createBlock('andreani/adminhtml_pedidos_edit');
181
+ $this->getLayout()->getBlock('content')->append($block);
182
+ $this->renderLayout();
183
+ }
184
+
185
+ }
186
+ ?>
app/code/local/Ecloud/Andreani/etc/adminhtml.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <menu>
4
+ <andreani translate="title" module="andreani">
5
+ <sort_order>10</sort_order>
6
+ <title>Estado de pedidos</title>
7
+ <action>adminhtml/pedidos/</action>
8
+ </andreani>
9
+ </menu>
10
+ </config>
app/code/local/Ecloud/Andreani/etc/config.xml ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Ecloud_Andreani>
5
+ <version>0.1.7</version>
6
+ </Ecloud_Andreani>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <andreani>
11
+ <class>Ecloud_Andreani_Helper</class>
12
+ </andreani>
13
+ </helpers>
14
+ <blocks>
15
+ <andreani>
16
+ <class>Ecloud_Andreani_Block</class>
17
+ </andreani>
18
+ </blocks>
19
+ <models>
20
+ <andreani>
21
+ <class>Ecloud_Andreani_Model</class>
22
+ <resourceModel>andreani_resource</resourceModel>
23
+ </andreani>
24
+ <andreani_resource>
25
+ <class>Ecloud_Andreani_Model_Resource</class>
26
+ <entities>
27
+ <order>
28
+ <table>andreani_order</table>
29
+ </order>
30
+ </entities>
31
+ </andreani_resource>
32
+ </models>
33
+ <resources>
34
+ <andreani_setup>
35
+ <setup>
36
+ <module>Ecloud_Andreani</module>
37
+ <class>Mage_Eav_Model_Entity_Setup</class>
38
+ </setup>
39
+ <connection>
40
+ <use>core_setup</use>
41
+ </connection>
42
+ </andreani_setup>
43
+ <andreani_write>
44
+ <connection>
45
+ <use>core_write</use>
46
+ </connection>
47
+ </andreani_write>
48
+ <andreani_read>
49
+ <connection>
50
+ <use>core_read</use>
51
+ </connection>
52
+ </andreani_read>
53
+ </resources>
54
+ <fieldsets>
55
+ <sales_copy_order_billing_address>
56
+ <dni><to_order>*</to_order></dni>
57
+ </sales_copy_order_billing_address>
58
+ <sales_copy_order_shipping_address>
59
+ <dni><to_order>*</to_order></dni>
60
+ </sales_copy_order_shipping_address>
61
+ <sales_convert_quote_address>
62
+ <dni><to_order_address>*</to_order_address><to_customer_address>*</to_customer_address></dni>
63
+ </sales_convert_quote_address>
64
+ <sales_convert_order_address>
65
+ <dni><to_quote_address>*</to_quote_address></dni>
66
+ </sales_convert_order_address>
67
+
68
+ <customer_address>
69
+ <dni><to_quote_address>*</to_quote_address></dni>
70
+ </customer_address>
71
+ <checkout_onepage_billing>
72
+ <dni><to_customer>*</to_customer></dni>
73
+ </checkout_onepage_billing>
74
+ </fieldsets>
75
+ <events>
76
+ <sales_order_place_after>
77
+ <observers>
78
+ <andreani_order_success>
79
+ <type>singleton</type>
80
+ <class>andreani/observer</class>
81
+ <method>andreaniObserver</method>
82
+ </andreani_order_success>
83
+ </observers>
84
+ </sales_order_place_after>
85
+ <sales_order_shipment_save_before>
86
+ <observers>
87
+ <andreani>
88
+ <type>singleton</type>
89
+ <class>andreani/observer</class>
90
+ <method>salesOrderShipmentSaveBefore</method>
91
+ </andreani>
92
+ </observers>
93
+ </sales_order_shipment_save_before>
94
+ </events>
95
+ </global>
96
+ <admin>
97
+ <routers>
98
+ <adminhtml>
99
+ <args>
100
+ <modules>
101
+ <andreani before="Mage_Adminhtml">Ecloud_Andreani_Adminhtml</andreani>
102
+ </modules>
103
+ </args>
104
+ </adminhtml>
105
+ </routers>
106
+ <fieldsets>
107
+ <customer_dataflow>
108
+ <dni>
109
+ <billing>1</billing>
110
+ <shipping>1</shipping>
111
+ </dni>
112
+ </customer_dataflow>
113
+ </fieldsets>
114
+ </admin>
115
+ <adminhtml>
116
+ <menu>
117
+ <andreani translate="title" module="andreani">
118
+ <title>Andreani</title>
119
+ <sort_order>91</sort_order>
120
+ <children>
121
+ <pedidos translate="title">
122
+ <title>Estado de Pedidos</title>
123
+ <sort_order>20</sort_order>
124
+ <action>adminhtml/pedidos/index</action>
125
+ </pedidos>
126
+ </children>
127
+ </andreani>
128
+ </menu>
129
+ <acl>
130
+ <resources>
131
+ <all>
132
+ <title>Allow Everything</title>
133
+ </all>
134
+ <admin>
135
+ <children>
136
+ <andreani translate="title" module="andreani">
137
+ <title>Andreani</title>
138
+ <sort_order>1000</sort_order>
139
+ <children>
140
+ <andreanibackend translate="title">
141
+ <title>Andreani</title>
142
+ </andreanibackend>
143
+ </children>
144
+ </andreani>
145
+ </children>
146
+ </admin>
147
+ </resources>
148
+ </acl>
149
+ <layout>
150
+ <updates>
151
+ <andreani>
152
+ <file>Ecloud/andreani.xml</file>
153
+ </andreani>
154
+ </updates>
155
+ </layout>
156
+ </adminhtml>
157
+ <default>
158
+ <carriers>
159
+ <andreaniestandar>
160
+ <active>0</active>
161
+ <model>andreani/carrier_andreaniestandar</model>
162
+ <name>andreani</name>
163
+ <title>Andreani Estandar</title>
164
+ <description><![CDATA[Recibí el pedido en tu casa.]]></description>
165
+ <sort_order>0</sort_order>
166
+ <medida>kilos</medida>
167
+ </andreaniestandar>
168
+ <andreaniurgente>
169
+ <active>0</active>
170
+ <model>andreani/carrier_andreaniurgente</model>
171
+ <name>andreaniurgente</name>
172
+ <title>Andreani Urgente</title>
173
+ <description><![CDATA[Recibí el pedido en tu casa en 24 hs!]]></description>
174
+ <sort_order>10</sort_order>
175
+ <medida>kilos</medida>
176
+ </andreaniurgente>
177
+ <andreanisucursal>
178
+ <active>0</active>
179
+ <model>andreani/carrier_andreanisucursal</model>
180
+ <name>andreanisucursal</name>
181
+ <title>Andreani Sucursal</title>
182
+ <description><![CDATA[Busca el pedido en la sucursal más cercana: ]]></description>
183
+ <sort_order>10</sort_order>
184
+ <medida>kilos</medida>
185
+ </andreanisucursal>
186
+ </carriers>
187
+ </default>
188
+ </config>
app/code/local/Ecloud/Andreani/etc/system.xml ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <carriers translate="label" module="andreani">
5
+ <label>Shipping Methods</label>
6
+ <tab>sales</tab>
7
+ <frontend_type>text</frontend_type>
8
+ <sort_order>330</sort_order>
9
+ <show_in_default>1</show_in_default>
10
+ <show_in_website>1</show_in_website>
11
+ <show_in_store>1</show_in_store>
12
+ <groups>
13
+ <andreaniconfig translate="label">
14
+ <label>Configuración Andreani</label>
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>5</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ <model>andreani/carrier_andreani</model>
21
+ <comment><![CDATA[Contactate con un representante <strong>Andreani</strong> para obtener tus datos de cliente y empezar a utilizar nuestros servicios!<br /><a href="http://www.andreani.com/Contacts" target="_blank">www.andreani.com</a>]]></comment>
22
+ <fields>
23
+ <usuario translate="label">
24
+ <label>Nombre de Usuario: </label>
25
+ <default></default>
26
+ <frontend_type>text</frontend_type>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ <sort_order>40</sort_order>
31
+ </usuario>
32
+ <password translate="label">
33
+ <label>Contraseña:</label>
34
+ <default></default>
35
+ <frontend_type>password</frontend_type>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ <sort_order>45</sort_order>
40
+ </password>
41
+ <nrocliente translate="label">
42
+ <label>Numero de Cliente:</label>
43
+ <default></default>
44
+ <frontend_type>text</frontend_type>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
+ <sort_order>50</sort_order>
49
+ </nrocliente>
50
+ <medida translate="label">
51
+ <label>Unidad de medida:</label>
52
+ <default></default>
53
+ <frontend_type>select</frontend_type>
54
+ <frontend_model>andreani/adminhtml_config_form_field_medida</frontend_model>
55
+ <source_model>andreani/config_medida</source_model>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_website>1</show_in_website>
58
+ <show_in_store>1</show_in_store>
59
+ <sort_order>60</sort_order>
60
+ </medida>
61
+ <testmode translate="label">
62
+ <label>Test Mode:</label>
63
+ <frontend_type>select</frontend_type>
64
+ <source_model>andreani/config_TestMode</source_model>
65
+ <sort_order>20</sort_order>
66
+ <show_in_default>1</show_in_default>
67
+ <show_in_website>1</show_in_website>
68
+ <show_in_store>1</show_in_store>
69
+ </testmode>
70
+ </fields>
71
+ </andreaniconfig>
72
+ <andreanisucursal translate="label">
73
+ <label>Andreani Sucursal</label>
74
+ <frontend_type>text</frontend_type>
75
+ <sort_order>10</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>1</show_in_store>
79
+ <model>andreani/carrier_andreani</model>
80
+ <fields>
81
+ <active translate="label">
82
+ <label>Habilitado</label>
83
+ <frontend_type>select</frontend_type>
84
+ <source_model>adminhtml/system_config_source_yesno</source_model>
85
+ <sort_order>2</sort_order>
86
+ <show_in_default>1</show_in_default>
87
+ <show_in_website>1</show_in_website>
88
+ <show_in_store>1</show_in_store>
89
+ <sort_order>10</sort_order>
90
+ </active>
91
+ <title translate="label">
92
+ <label>Titulo</label>
93
+ <frontend_type>text</frontend_type>
94
+ <sort_order>2</sort_order>
95
+ <show_in_default>1</show_in_default>
96
+ <show_in_website>1</show_in_website>
97
+ <show_in_store>1</show_in_store>
98
+ <sort_order>20</sort_order>
99
+ </title>
100
+ <description translate="label">
101
+ <label>Descripción</label>
102
+ <frontend_type>textarea</frontend_type>
103
+ <sort_order>3</sort_order>
104
+ <show_in_default>1</show_in_default>
105
+ <show_in_website>1</show_in_website>
106
+ <show_in_store>1</show_in_store>
107
+ <sort_order>25</sort_order>
108
+ </description>
109
+ <sallowspecific translate="label">
110
+ <label><![CDATA[Env&iacute;o a pa&iacute;ses]]></label>
111
+ <frontend_type>select</frontend_type>
112
+ <frontend_class>shipping-applicable-country</frontend_class>
113
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
114
+ <show_in_default>1</show_in_default>
115
+ <show_in_website>1</show_in_website>
116
+ <show_in_store>0</show_in_store>
117
+ <sort_order>30</sort_order>
118
+ </sallowspecific>
119
+ <specificcountry translate="label">
120
+ <label><![CDATA[Pa&iacute;ses de env&iacute;o]]></label>
121
+ <frontend_type>multiselect</frontend_type>
122
+ <source_model>adminhtml/system_config_source_country</source_model>
123
+ <show_in_default>1</show_in_default>
124
+ <show_in_website>1</show_in_website>
125
+ <show_in_store>0</show_in_store>
126
+ <can_be_empty>1</can_be_empty>
127
+ <sort_order>35</sort_order>
128
+ </specificcountry>
129
+ <contrato translate="label">
130
+ <label>Contrato:</label>
131
+ <default></default>
132
+ <frontend_type>text</frontend_type>
133
+ <show_in_default>1</show_in_default>
134
+ <show_in_website>1</show_in_website>
135
+ <show_in_store>1</show_in_store>
136
+ <sort_order>55</sort_order>
137
+ </contrato>
138
+ <gestioncobranza translate="label">
139
+ <label>Contrareembolso Andreani:</label>
140
+ <comment>
141
+ <![CDATA[Habilitar o deshabilitar el servicio. <br> <span class="notice">Tu cliente podra pagar todo en su destino!</span>]]>
142
+ </comment>
143
+ <frontend_type>select</frontend_type>
144
+ <source_model>adminhtml/system_config_source_yesno</source_model>
145
+ <sort_order>2</sort_order>
146
+ <show_in_default>1</show_in_default>
147
+ <show_in_website>1</show_in_website>
148
+ <show_in_store>1</show_in_store>
149
+ <sort_order>85</sort_order>
150
+ </gestioncobranza>
151
+ <gccontrato translate="label">
152
+ <label>Contrato Contrareembolso:</label>
153
+ <default></default>
154
+ <frontend_type>text</frontend_type>
155
+ <show_in_default>1</show_in_default>
156
+ <show_in_website>1</show_in_website>
157
+ <show_in_store>1</show_in_store>
158
+ <sort_order>90</sort_order>
159
+ </gccontrato>
160
+ </fields>
161
+ </andreanisucursal>
162
+ <andreaniurgente translate="label">
163
+ <label>Andreani Urgente</label>
164
+ <frontend_type>text</frontend_type>
165
+ <sort_order>10</sort_order>
166
+ <show_in_default>1</show_in_default>
167
+ <show_in_website>1</show_in_website>
168
+ <show_in_store>1</show_in_store>
169
+ <model>andreani/carrier_andreani</model>
170
+ <fields>
171
+ <active translate="label">
172
+ <label>Habilitado</label>
173
+ <frontend_type>select</frontend_type>
174
+ <source_model>adminhtml/system_config_source_yesno</source_model>
175
+ <sort_order>2</sort_order>
176
+ <show_in_default>1</show_in_default>
177
+ <show_in_website>1</show_in_website>
178
+ <show_in_store>1</show_in_store>
179
+ <sort_order>11</sort_order>
180
+ </active>
181
+ <title translate="label">
182
+ <label>Titulo</label>
183
+ <frontend_type>text</frontend_type>
184
+ <sort_order>2</sort_order>
185
+ <show_in_default>1</show_in_default>
186
+ <show_in_website>1</show_in_website>
187
+ <show_in_store>1</show_in_store>
188
+ <sort_order>20</sort_order>
189
+ </title>
190
+ <description translate="label">
191
+ <label>Descripción</label>
192
+ <frontend_type>textarea</frontend_type>
193
+ <sort_order>3</sort_order>
194
+ <show_in_default>1</show_in_default>
195
+ <show_in_website>1</show_in_website>
196
+ <show_in_store>1</show_in_store>
197
+ <sort_order>25</sort_order>
198
+ </description>
199
+ <sallowspecific translate="label">
200
+ <label><![CDATA[Env&iacute;o a pa&iacute;ses]]></label>
201
+ <frontend_type>select</frontend_type>
202
+ <frontend_class>shipping-applicable-country</frontend_class>
203
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
204
+ <show_in_default>1</show_in_default>
205
+ <show_in_website>1</show_in_website>
206
+ <show_in_store>0</show_in_store>
207
+ <sort_order>30</sort_order>
208
+ </sallowspecific>
209
+ <specificcountry translate="label">
210
+ <label><![CDATA[Pa&iacute;ses de env&iacute;o]]></label>
211
+ <frontend_type>multiselect</frontend_type>
212
+ <source_model>adminhtml/system_config_source_country</source_model>
213
+ <show_in_default>1</show_in_default>
214
+ <show_in_website>1</show_in_website>
215
+ <show_in_store>0</show_in_store>
216
+ <can_be_empty>1</can_be_empty>
217
+ <sort_order>35</sort_order>
218
+ </specificcountry>
219
+ <contrato translate="label">
220
+ <label>Contrato:</label>
221
+ <default></default>
222
+ <frontend_type>text</frontend_type>
223
+ <show_in_default>1</show_in_default>
224
+ <show_in_website>1</show_in_website>
225
+ <show_in_store>1</show_in_store>
226
+ <sort_order>55</sort_order>
227
+ </contrato>
228
+ <gestioncobranza translate="label">
229
+ <label>Contrareembolso Andreani:</label>
230
+ <comment>
231
+ <![CDATA[Habilitar o deshabilitar el servicio. <br> <span class="notice">Tu cliente podra pagar todo en su destino!</span>]]>
232
+ </comment>
233
+ <frontend_type>select</frontend_type>
234
+ <source_model>adminhtml/system_config_source_yesno</source_model>
235
+ <sort_order>2</sort_order>
236
+ <show_in_default>1</show_in_default>
237
+ <show_in_website>1</show_in_website>
238
+ <show_in_store>1</show_in_store>
239
+ <sort_order>85</sort_order>
240
+ </gestioncobranza>
241
+ <gccontrato translate="label">
242
+ <label>Contrato Contrareembolso:</label>
243
+ <default></default>
244
+ <frontend_type>text</frontend_type>
245
+ <show_in_default>1</show_in_default>
246
+ <show_in_website>1</show_in_website>
247
+ <show_in_store>1</show_in_store>
248
+ <sort_order>90</sort_order>
249
+ </gccontrato>
250
+ </fields>
251
+ </andreaniurgente>
252
+ <andreaniestandar translate="label">
253
+ <label>Andreani Estandar</label>
254
+ <frontend_type>text</frontend_type>
255
+ <sort_order>10</sort_order>
256
+ <show_in_default>1</show_in_default>
257
+ <show_in_website>1</show_in_website>
258
+ <show_in_store>1</show_in_store>
259
+ <model>andreani/carrier_andreani</model>
260
+ <fields>
261
+ <active translate="label">
262
+ <label>Habilitado</label>
263
+ <comment>
264
+ <![CDATA[Habilitar o deshabilitar el servicio. <br> <span class="notice">Ojo! tu cliente no va a poder recibir el pedido en su casa si no lo tenes habilitado.</span>]]>
265
+ </comment>
266
+ <frontend_type>select</frontend_type>
267
+ <source_model>adminhtml/system_config_source_yesno</source_model>
268
+ <sort_order>2</sort_order>
269
+ <show_in_default>1</show_in_default>
270
+ <show_in_website>1</show_in_website>
271
+ <show_in_store>1</show_in_store>
272
+ <sort_order>10</sort_order>
273
+ </active>
274
+ <title translate="label">
275
+ <label>Titulo</label>
276
+ <frontend_type>text</frontend_type>
277
+ <sort_order>2</sort_order>
278
+ <show_in_default>1</show_in_default>
279
+ <show_in_website>1</show_in_website>
280
+ <show_in_store>1</show_in_store>
281
+ <sort_order>20</sort_order>
282
+ </title>
283
+ <description translate="label">
284
+ <label>Descripción</label>
285
+ <frontend_type>textarea</frontend_type>
286
+ <sort_order>3</sort_order>
287
+ <show_in_default>1</show_in_default>
288
+ <show_in_website>1</show_in_website>
289
+ <show_in_store>1</show_in_store>
290
+ <sort_order>25</sort_order>
291
+ </description>
292
+ <sallowspecific translate="label">
293
+ <label><![CDATA[Env&iacute;o a pa&iacute;ses]]></label>
294
+ <frontend_type>select</frontend_type>
295
+ <frontend_class>shipping-applicable-country</frontend_class>
296
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
297
+ <show_in_default>1</show_in_default>
298
+ <show_in_website>1</show_in_website>
299
+ <show_in_store>0</show_in_store>
300
+ <sort_order>30</sort_order>
301
+ </sallowspecific>
302
+ <specificcountry translate="label">
303
+ <label><![CDATA[Pa&iacute;ses de env&iacute;o]]></label>
304
+ <frontend_type>multiselect</frontend_type>
305
+ <source_model>adminhtml/system_config_source_country</source_model>
306
+ <show_in_default>1</show_in_default>
307
+ <show_in_website>1</show_in_website>
308
+ <show_in_store>0</show_in_store>
309
+ <can_be_empty>1</can_be_empty>
310
+ <sort_order>35</sort_order>
311
+ </specificcountry>
312
+ <contrato translate="label">
313
+ <label>Contrato:</label>
314
+ <default></default>
315
+ <frontend_type>text</frontend_type>
316
+ <show_in_default>1</show_in_default>
317
+ <show_in_website>1</show_in_website>
318
+ <show_in_store>1</show_in_store>
319
+ <sort_order>55</sort_order>
320
+ </contrato>
321
+ <gestioncobranza translate="label">
322
+ <label>Contrareembolso Andreani:</label>
323
+ <comment>
324
+ <![CDATA[Habilitar o deshabilitar el servicio. <br> <span class="notice">Tu cliente podra pagar todo en su destino!</span>]]>
325
+ </comment>
326
+ <frontend_type>select</frontend_type>
327
+ <source_model>adminhtml/system_config_source_yesno</source_model>
328
+ <sort_order>2</sort_order>
329
+ <show_in_default>1</show_in_default>
330
+ <show_in_website>1</show_in_website>
331
+ <show_in_store>1</show_in_store>
332
+ <sort_order>85</sort_order>
333
+ </gestioncobranza>
334
+ <gccontrato translate="label">
335
+ <label>Contrato Contrareembolso:</label>
336
+ <default></default>
337
+ <frontend_type>text</frontend_type>
338
+ <show_in_default>1</show_in_default>
339
+ <show_in_website>1</show_in_website>
340
+ <show_in_store>1</show_in_store>
341
+ <sort_order>90</sort_order>
342
+ </gccontrato>
343
+ </fields>
344
+ </andreaniestandar>
345
+ </groups>
346
+ </carriers>
347
+ </sections>
348
+ </config>
app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // @var $setup Mage_Eav_Model_Entity_Setup
3
+ $setup = $this;
4
+
5
+ $setup->startSetup();
6
+
7
+ $setup->addAttribute('customer_address', 'dni', array(
8
+ 'type' => 'varchar',
9
+ 'input' => 'text',
10
+ 'label' => 'DNI',
11
+ 'visible' => true,
12
+ 'required' => true,
13
+ 'unique' => false,
14
+ 'sort_order' => 75, // Positions of the other attributes are listed in
15
+ 'position' => 75, // Mage_Customer_Model_Resource_Setup
16
+ 'is_user_defined' => 1,
17
+ 'is_system' => 0,
18
+ 'validate_rules' => array(
19
+ 'max_text_length' => 255,
20
+ ),
21
+ )
22
+ );
23
+
24
+ // Change the column name into your own attribute name
25
+ $setup->run("
26
+ ALTER TABLE {$this->getTable('sales_flat_quote_address')} ADD COLUMN `dni` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL;
27
+ ALTER TABLE {$this->getTable('sales_flat_order_address')} ADD COLUMN `dni` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL;
28
+ ");
29
+
30
+ $eavConfig = Mage::getSingleton('eav/config');
31
+
32
+ $store = Mage::app()->getStore(Mage_Core_Model_App::ADMIN_STORE_ID);
33
+ $attribute = $eavConfig->getAttribute('customer_address', 'dni');
34
+ $attribute->setWebsite($store->getWebsite());
35
+
36
+ $usedInForms = array(
37
+ 'adminhtml_customer_address',
38
+ 'customer_address_edit',
39
+ 'customer_register_address'
40
+ );
41
+ $attribute->setData('used_in_forms', $usedInForms);
42
+ $attribute->save();
43
+
44
+ /*
45
+ * CREA LOS ATRIBUTOS MEDIDAS Y VOLUMEN EN LOS PRODUCTOS
46
+ */
47
+
48
+ $applyTo = array(
49
+ Mage_Catalog_Model_Product_Type::TYPE_SIMPLE,
50
+ Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE
51
+ );
52
+
53
+ $setup->addAttribute('catalog_product', 'volumen', array(
54
+ 'group' => 'General',
55
+ 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL,
56
+ 'backend' => '',
57
+ 'frontend' => '',
58
+ 'class' => '',
59
+ 'default' => '',
60
+ 'label' => 'Volumen',
61
+ 'input' => 'text',
62
+ 'source' => '',
63
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
64
+ 'visible' => 1,
65
+ 'required' => 1,
66
+ 'searchable' => 0,
67
+ 'filterable' => 1,
68
+ 'unique' => 0,
69
+ 'comparable' => 0,
70
+ 'visible_on_front' => 0,
71
+ 'is_html_allowed_on_front' => 1,
72
+ 'user_defined' => 1,
73
+ 'apply_to' => implode(',',$applyTo)
74
+ ));
75
+
76
+
77
+ $setup->run("
78
+ CREATE TABLE IF NOT EXISTS `{$setup->getTable('andreani_order')}` (
79
+ `id` int(11) NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY,
80
+ `id_orden` int(11) NOT NULL,
81
+ `contrato` int(11) NOT NULL,
82
+ `direccion` varchar(255) NOT NULL,
83
+ `cliente` varchar(255) NOT NULL,
84
+ `localidad` varchar(255) NOT NULL,
85
+ `provincia` varchar(255) NOT NULL,
86
+ `cp_destino` varchar(255) NOT NULL,
87
+ `sucursal_retiro` int(11) NOT NULL,
88
+ `direccion_sucursal` varchar(255) NOT NULL,
89
+ `nombre` varchar(255) NOT NULL,
90
+ `apellido` varchar(255) NOT NULL,
91
+ `telefono` varchar(255) NOT NULL,
92
+ `dni` varchar(255) NOT NULL,
93
+ `email` varchar(255) NOT NULL,
94
+ `precio` float NOT NULL,
95
+ `valor_declarado` float NOT NULL,
96
+ `volumen` float NOT NULL,
97
+ `peso` float NOT NULL,
98
+ `detalle_productos` TEXT NOT NULL,
99
+ `categoria_distancia_id` int(11) NOT NULL,
100
+ `categoria_peso` int(11) NOT NULL,
101
+ `cod_tracking` VARCHAR( 255 ) NOT NULL,
102
+ `recibo_tracking` VARCHAR( 255 ) NOT NULL,
103
+ `estado` VARCHAR( 255 ) NOT NULL,
104
+ `tracking` TEXT NOT NULL
105
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
106
+ ");
107
+
108
+ $setup->endSetup();
app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-install-0.1.1.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // @var $setup Mage_Eav_Model_Entity_Setup
3
+ $setup = $this;
4
+
5
+ $setup->startSetup();
6
+
7
+ $setup->addAttribute('customer_address', 'dni', array(
8
+ 'type' => 'varchar',
9
+ 'input' => 'text',
10
+ 'label' => 'DNI',
11
+ 'visible' => true,
12
+ 'required' => true,
13
+ 'unique' => false,
14
+ 'sort_order' => 75, // Positions of the other attributes are listed in
15
+ 'position' => 75, // Mage_Customer_Model_Resource_Setup
16
+ 'is_user_defined' => 1,
17
+ 'is_system' => 0,
18
+ 'validate_rules' => array(
19
+ 'max_text_length' => 255,
20
+ ),
21
+ )
22
+ );
23
+
24
+ $eavConfig = Mage::getSingleton('eav/config');
25
+
26
+ $store = Mage::app()->getStore(Mage_Core_Model_App::ADMIN_STORE_ID);
27
+ $attribute = $eavConfig->getAttribute('customer_address', 'dni');
28
+ $attribute->setWebsite($store->getWebsite());
29
+
30
+ $usedInForms = array(
31
+ 'adminhtml_customer_address',
32
+ 'customer_address_edit',
33
+ 'customer_register_address'
34
+ );
35
+ $attribute->setData('used_in_forms', $usedInForms);
36
+ $attribute->save();
37
+
38
+ /*
39
+ * CREA LOS ATRIBUTOS MEDIDAS Y VOLUMEN EN LOS PRODUCTOS
40
+ */
41
+
42
+ $applyTo = array(
43
+ Mage_Catalog_Model_Product_Type::TYPE_SIMPLE,
44
+ Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE
45
+ );
46
+
47
+ $setup->addAttribute('catalog_product', 'volumen', array(
48
+ 'group' => 'General',
49
+ 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL,
50
+ 'backend' => '',
51
+ 'frontend' => '',
52
+ 'class' => '',
53
+ 'default' => '',
54
+ 'label' => 'Volumen',
55
+ 'input' => 'text',
56
+ 'source' => '',
57
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
58
+ 'visible' => 1,
59
+ 'required' => 1,
60
+ 'searchable' => 0,
61
+ 'filterable' => 1,
62
+ 'unique' => 0,
63
+ 'comparable' => 0,
64
+ 'visible_on_front' => 0,
65
+ 'is_html_allowed_on_front' => 1,
66
+ 'user_defined' => 1,
67
+ 'apply_to' => implode(',',$applyTo)
68
+ ));
69
+
70
+
71
+ $setup->run("
72
+ CREATE TABLE IF NOT EXISTS `{$setup->getTable('andreani_order')}` (
73
+ `id` int(11) NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY,
74
+ `id_orden` int(11) NOT NULL,
75
+ `contrato` int(11) NOT NULL,
76
+ `direccion` varchar(255) NOT NULL,
77
+ `cliente` varchar(255) NOT NULL,
78
+ `localidad` varchar(255) NOT NULL,
79
+ `provincia` varchar(255) NOT NULL,
80
+ `cp_destino` varchar(255) NOT NULL,
81
+ `sucursal_retiro` int(11) NOT NULL,
82
+ `direccion_sucursal` varchar(255) NOT NULL,
83
+ `nombre` varchar(255) NOT NULL,
84
+ `apellido` varchar(255) NOT NULL,
85
+ `telefono` varchar(255) NOT NULL,
86
+ `dni` varchar(255) NOT NULL,
87
+ `email` varchar(255) NOT NULL,
88
+ `precio` float NOT NULL,
89
+ `valor_declarado` float NOT NULL,
90
+ `volumen` float NOT NULL,
91
+ `peso` float NOT NULL,
92
+ `detalle_productos` TEXT NOT NULL,
93
+ `categoria_distancia_id` int(11) NOT NULL,
94
+ `categoria_peso` int(11) NOT NULL,
95
+ `cod_tracking` VARCHAR( 255 ) NOT NULL,
96
+ `recibo_tracking` VARCHAR( 255 ) NOT NULL,
97
+ `estado` VARCHAR( 255 ) NOT NULL,
98
+ `tracking` TEXT NOT NULL
99
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
100
+ ");
101
+
102
+ // Change the column name into your own attribute name
103
+ try{
104
+ $setup->run("
105
+ ALTER TABLE {$this->getTable('sales_flat_quote_address')} ADD COLUMN `dni` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL;
106
+ ALTER TABLE {$this->getTable('sales_flat_order_address')} ADD COLUMN `dni` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL;
107
+ ");
108
+ } catch (Exception $e) {
109
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
110
+ }
111
+
112
+ $setup->endSetup();
app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.1-0.1.2.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $setup = $this;
4
+
5
+ $setup->startSetup();
6
+
7
+ $setup->endSetup();
app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.2-0.1.3.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $setup = $this;
4
+
5
+ $setup->startSetup();
6
+
7
+ try{
8
+ $setup->run("
9
+ ALTER TABLE {$this->getTable('andreani_order')} ADD COLUMN `constancia` VARCHAR(600) NOT NULL;
10
+ ");
11
+ } catch (Exception $e) {
12
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
13
+ }
14
+
15
+ $setup->endSetup();
app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.3-0.1.4.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $setup = $this;
4
+
5
+ $setup->startSetup();
6
+
7
+ $setup->endSetup();
app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.4-0.1.5.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $setup = $this;
4
+
5
+ $setup->startSetup();
6
+
7
+ $setup->endSetup();
app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.5-0.1.6.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $setup = $this;
4
+
5
+ $setup->startSetup();
6
+
7
+ $setup->endSetup();
app/code/local/Ecloud/Andreani/sql/andreani_setup/mysql4-upgrade-0.1.6-0.1.7.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $setup = $this;
4
+
5
+ $setup->startSetup();
6
+
7
+ $setup->endSetup();
app/design/frontend/default/default/template/checkout/onepage/shipping.phtml ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 1.0 20.02.2014
4
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
5
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
6
+ */
7
+ ?>
8
+ <form action="" id="co-shipping-form">
9
+ <ul class="form-list">
10
+ <?php if ($this->customerHasAddresses()): ?>
11
+ <li class="wide">
12
+ <label for="shipping-address-select"><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></label>
13
+ <div class="input-box">
14
+ <?php echo $this->getAddressesHtmlSelect('shipping') ?>
15
+ </div>
16
+ </li>
17
+ <?php endif ?>
18
+ <li id="shipping-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif ?>>
19
+ <fieldset>
20
+ <input type="hidden" name="shipping[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="shipping:address_id" />
21
+ <ul>
22
+ <li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())->setFieldIdFormat('shipping:%s')->setFieldNameFormat('shipping[%s]')->setFieldParams('onchange="shipping.setSameAsBilling(false)"')->toHtml() ?></li>
23
+ <li class="fields">
24
+ <div class="fields">
25
+ <label for="shipping:company"><?php echo $this->__('Company') ?></label>
26
+ <div class="input-box">
27
+ <input type="text" id="shipping:company" name="shipping[company]" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" onchange="shipping.setSameAsBilling(false);" />
28
+ </div>
29
+ </div>
30
+ </li>
31
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
32
+ <li class="wide">
33
+ <label for="shipping:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
34
+ <div class="input-box">
35
+ <input type="text" title="<?php echo $this->__('Street Address') ?>" name="shipping[street][]" id="shipping:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" onchange="shipping.setSameAsBilling(false);" />
36
+ </div>
37
+ </li>
38
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
39
+ <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
40
+ <li class="wide">
41
+ <div class="input-box">
42
+ <input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="shipping[street][]" id="shipping:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" onchange="shipping.setSameAsBilling(false);" />
43
+ </div>
44
+ </li>
45
+ <?php endfor; ?>
46
+ <?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
47
+ <li class="wide">
48
+ <label for="billing:vat_id"><?php echo $this->__('VAT Number'); ?></label>
49
+ <div class="input-box">
50
+ <input type="text" id="shipping:vat_id" name="shipping[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()); ?>" title="<?php echo $this->__('VAT Number'); ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
51
+ </div>
52
+ </li>
53
+ <?php endif; ?>
54
+ <li class="fields">
55
+ <div class="field">
56
+ <label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
57
+ <div class="input-box">
58
+ <input type="text" title="<?php echo $this->__('City') ?>" name="shipping[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="shipping:city" onchange="shipping.setSameAsBilling(false);" />
59
+ </div>
60
+ </div>
61
+ <div class="field">
62
+ <label for="shipping:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
63
+ <div class="input-box">
64
+ <select id="shipping:region_id" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
65
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
66
+ </select>
67
+ <script type="text/javascript">
68
+ //<![CDATA[
69
+ $('shipping:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
70
+ //]]>
71
+ </script>
72
+ <input type="text" id="shipping:region" name="shipping[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
73
+ </div>
74
+ </div>
75
+ </li>
76
+ <li class="fields">
77
+ <div class="field">
78
+ <label for="shipping:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
79
+ <div class="input-box">
80
+ <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="shipping[postcode]" id="shipping:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" onchange="shipping.setSameAsBilling(false);" />
81
+ </div>
82
+ </div>
83
+ <div class="field">
84
+ <label for="shipping:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
85
+ <div class="input-box">
86
+ <?php echo $this->getCountryHtmlSelect('shipping') ?>
87
+ </div>
88
+ </div>
89
+ </li>
90
+ <li class="fields">
91
+ <div class="field">
92
+ <label for="shipping:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
93
+ <div class="input-box">
94
+ <input type="text" name="shipping[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="shipping:telephone" onchange="shipping.setSameAsBilling(false);" />
95
+ </div>
96
+ </div>
97
+ <div class="field">
98
+ <label for="shipping:fax"><?php echo $this->__('Fax') ?></label>
99
+ <div class="input-box">
100
+ <input type="text" name="shipping[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="shipping:fax" onchange="shipping.setSameAsBilling(false);" />
101
+ </div>
102
+ </div>
103
+ </li>
104
+
105
+ <!-- Requerido para Enviar con eAndreani -->
106
+ <li class="fields">
107
+ <div class="field">
108
+ <label for="shipping:dni" class="required"><em>*</em><?php echo $this->__('DNI') ?></label>
109
+ <div class="input-box">
110
+ <input type="text" name="shipping[dni]" value="<?php echo $this->escapeHtml($this->getAddress()->getDni()) ?>" title="<?php echo $this->__('DNI') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('dni') ?>" id="shipping:dni" onchange="shipping.setSameAsBilling(false);" />
111
+ </div>
112
+ </div>
113
+ </li>
114
+
115
+ <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
116
+ <li class="control">
117
+ <input type="checkbox" name="shipping[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="shipping:save_in_address_book" onchange="shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="shipping:save_in_address_book"><?php echo $this->__('Save in address book') ?></label></li>
118
+ <?php else:?>
119
+ <li class="no-display"><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>
120
+ <?php endif;?>
121
+ </ul>
122
+ </fieldset>
123
+ </li>
124
+ <li class="control">
125
+ <input type="checkbox" name="shipping[same_as_billing]" id="shipping:same_as_billing" value="1"<?php if($this->getAddress()->getSameAsBilling()): ?> checked="checked"<?php endif; ?> title="<?php echo $this->__('Use Billing Address') ?>" onclick="shipping.setSameAsBilling(this.checked)" class="checkbox" /><label for="shipping:same_as_billing"><?php echo $this->__('Use Billing Address') ?></label>
126
+ </li>
127
+ </ul>
128
+ <div class="buttons-set" id="shipping-buttons-container">
129
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
130
+ <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
131
+ <button type="button" class="button" title="<?php echo $this->__('Continue') ?>" onclick="shipping.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
132
+ <span id="shipping-please-wait" class="please-wait" style="display:none;">
133
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
134
+ </span>
135
+ </div>
136
+ </form>
137
+ <script type="text/javascript">
138
+ //<![CDATA[
139
+ var shipping = new Shipping('co-shipping-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveShipping') ?>',
140
+ '<?php echo $this->getUrl('checkout/onepage/shippingMethod') ?>');
141
+ var shippingForm = new VarienForm('co-shipping-form');
142
+ shippingForm.extraChildParams = ' onchange="shipping.setSameAsBilling(false);"';
143
+ //shippingForm.setElementsRelation('shipping:country_id', 'shipping:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
144
+ $('shipping-address-select') && shipping.newAddress(!$('shipping-address-select').value);
145
+
146
+ var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'shipping:postcode');
147
+ //]]>
148
+ </script>
app/design/frontend/default/default/template/customer/address/edit.phtml ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 1.0 20.02.2014
4
+ * @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
5
+ * @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
6
+ */
7
+ ?>
8
+
9
+ <?php
10
+ /**
11
+ * Edit customer address template
12
+ *
13
+ * @see Mage_Customer_Block_Address_Edit
14
+ */
15
+ ?>
16
+ <?php if($this->getTitle()): ?>
17
+ <div class="page-title">
18
+ <h1><?php echo $this->getTitle() ?></h1>
19
+ </div>
20
+ <?php endif; ?>
21
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
22
+ <form action="<?php echo $this->getSaveUrl() ?>" method="post" id="form-validate">
23
+ <div class="fieldset">
24
+ <?php echo $this->getBlockHtml('formkey')?>
25
+ <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
26
+ <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
27
+ <h2 class="legend"><?php echo $this->__('Contact Information') ?></h2>
28
+ <ul class="form-list">
29
+ <li class="fields">
30
+ <?php echo $this->getNameBlockHtml() ?>
31
+ </li>
32
+ <li class="wide">
33
+ <label for="company"><?php echo $this->__('Company') ?></label>
34
+ <div class="input-box">
35
+ <input type="text" name="company" id="company" title="<?php echo $this->__('Company') ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
36
+ </div>
37
+ </li>
38
+ <li class="fields">
39
+ <div class="field">
40
+ <label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
41
+ <div class="input-box">
42
+ <input type="text" name="telephone" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="telephone" />
43
+ </div>
44
+ </div>
45
+ <div class="field">
46
+ <label for="fax"><?php echo $this->__('Fax') ?></label>
47
+ <div class="input-box">
48
+ <input type="text" name="fax" id="fax" title="<?php echo $this->__('Fax') ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" />
49
+ </div>
50
+ </div>
51
+ </li>
52
+ </ul>
53
+ </div>
54
+ <div class="fieldset">
55
+ <h2 class="legend"><?php echo $this->__('Address') ?></h2>
56
+ <ul class="form-list">
57
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
58
+ <li class="wide">
59
+ <label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
60
+ <div class="input-box">
61
+ <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" />
62
+ </div>
63
+ </li>
64
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
65
+ <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
66
+ <li class="wide">
67
+ <div class="input-box">
68
+ <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" />
69
+ </div>
70
+ </li>
71
+ <?php endfor; ?>
72
+ <?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
73
+ <li class="wide">
74
+ <label for="vat_id"><?php echo $this->__('VAT Number') ?></label>
75
+ <div class="input-box">
76
+ <input type="text" name="vat_id" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" id="vat_id" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
77
+ </div>
78
+ </li>
79
+ <?php endif; ?>
80
+ <li class="fields">
81
+ <div class="field">
82
+ <label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
83
+ <div class="input-box">
84
+ <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="city" />
85
+ </div>
86
+ </div>
87
+ <div class="field">
88
+ <label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
89
+ <div class="input-box">
90
+ <select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
91
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
92
+ </select>
93
+ <script type="text/javascript">
94
+ //<![CDATA[
95
+ $('region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
96
+ //]]>
97
+ </script>
98
+ <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" />
99
+ </div>
100
+ </div>
101
+ </li>
102
+ <li class="fields">
103
+ <div class="field">
104
+ <label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
105
+ <div class="input-box">
106
+ <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
107
+ </div>
108
+ </div>
109
+ <div class="field">
110
+ <label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
111
+ <div class="input-box">
112
+ <?php echo $this->getCountryHtmlSelect() ?>
113
+ </div>
114
+ </div>
115
+ </li>
116
+
117
+ <!-- Requerido para Enviar con eAndreani -->
118
+ <li class="fields">
119
+ <div class="field">
120
+ <label for="dni" class="required"><em>*</em><?php echo $this->__('DNI') ?></label>
121
+ <div class="input-box">
122
+ <input type="text" name="dni" value="<?php echo $this->escapeHtml($this->getAddress()->getDni()) ?>" title="<?php echo $this->__('DNI') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('dni') ?>" />
123
+ </div>
124
+ </div>
125
+ </li>
126
+
127
+ <li<?php if($this->canSetAsDefaultBilling()) echo ' class="control"' ?>>
128
+ <?php if($this->isDefaultBilling()): ?>
129
+ <strong><?php echo $this->__('Default Billing Address') ?></strong>
130
+ <?php elseif($this->canSetAsDefaultBilling()): ?>
131
+ <input type="checkbox" id="primary_billing" name="default_billing" value="1" title="<?php echo $this->__('Use as My Default Billing Address') ?>" class="checkbox" /><label for="primary_billing"><?php echo $this->__('Use as my default billing address') ?></label>
132
+ <?php else: ?>
133
+ <input type="hidden" name="default_billing" value="1" />
134
+ <?php endif; ?>
135
+ </li>
136
+ <li<?php if($this->canSetAsDefaultShipping()) echo ' class="control"' ?>>
137
+ <?php if($this->isDefaultShipping()): ?>
138
+ <strong><?php echo $this->__('Default Shipping Address') ?></strong>
139
+ <?php elseif($this->canSetAsDefaultShipping()): ?>
140
+ <input type="checkbox" id="primary_shipping" name="default_shipping" value="1" title="<?php echo $this->__('Use as My Default Shipping Address') ?>" class="checkbox" /><label for="primary_shipping"><?php echo $this->__('Use as my default shipping address') ?></label>
141
+ <?php else: ?>
142
+ <input type="hidden" name="default_shipping" value="1" />
143
+ <?php endif; ?>
144
+ </li>
145
+ </ul>
146
+ </div>
147
+ <div class="buttons-set">
148
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
149
+ <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
150
+ <button type="submit" title="<?php echo $this->__('Save Address') ?>" class="button"><span><span><?php echo $this->__('Save Address') ?></span></span></button>
151
+ </div>
152
+ </form>
153
+ <script type="text/javascript">
154
+ //<![CDATA[
155
+ var dataForm = new VarienForm('form-validate', true);
156
+ new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
157
+ //]]>
158
+ </script>
app/design/frontend/default/default/template/persistent/checkout/onepage/billing.phtml ADDED
File without changes
app/design/frontend/default/default/template/shipping/tracking/popup.phtml ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /** @var $this Mage_Shipping_Block_Tracking_Popup */
28
+
29
+
30
+ ?>
31
+ <?php $_results = $this->getTrackingInfo(); ?>
32
+ <div class="page-title title-buttons">
33
+ <h1><?php echo $this->__('Tracking Information'); ?></h1>
34
+ </div>
35
+ <?php if(sizeof($_results)>0): ?>
36
+ <?php foreach($_results as $shipid => $_result): ?>
37
+ <?php if($shipid): ?>
38
+ <h2 class="sub-title"><?php echo $this->__('Shipment #').$shipid; ?></h2>
39
+ <?php endif; ?>
40
+ <?php if(sizeof($_result)>0): ?>
41
+ <?php $rowCount = sizeof($_result); $counter = 1; ?>
42
+ <?php $_id = 0; foreach($_result as $track): ?>
43
+ <table class="tracking-table-popup data-table" id="tracking-table-popup-<?php echo $_id ?>">
44
+ <col width="15%" />
45
+ <col />
46
+ <tbody>
47
+ <?php if(is_object($track)): ?>
48
+ <tr>
49
+ <th class="label"><?php echo $this->__('Tracking Number:'); ?></th>
50
+ <td class="value"><?php echo $this->escapeHtml($track->getTracking()); ?></td>
51
+ </tr>
52
+ <?php if ($track->getCarrierTitle()): ?>
53
+ <tr>
54
+ <th class="label"><?php echo $this->__('Carrier:'); ?></th>
55
+ <td class="value"><?php echo $this->escapeHtml($track->getCarrierTitle()); ?></td>
56
+ </tr>
57
+ <?php endif; ?>
58
+ <?php if($track->getErrorMessage()): ?>
59
+ <tr>
60
+ <th class="label"><?php echo $this->__('Error:'); ?></th>
61
+ <td class="error"><?php echo $this->__('Tracking information is currently not available. Please '); if ($this->getContactUsEnabled()) : ?><a href="<?php echo $this->getContactUs() ?>" title="<?php echo $this->__('contact us') ?>" onclick="this.target='_blank'"><?php echo $this->__('contact us') ?></a><?php echo $this->__(' for more information or '); endif; echo $this->__('email us at '); ?><a href="mailto:<?php echo $this->getStoreSupportEmail() ?>"><?php echo $this->getStoreSupportEmail() ?></a></td>
62
+ </tr>
63
+ <?php elseif($track->getTrackSummary()): ?>
64
+ <tr>
65
+ <th class="label"><?php echo $this->__('Info:'); ?></th>
66
+ <td class="value"><?php echo $track->getTrackSummary(); ?></td>
67
+ </tr>
68
+ <?php elseif($track->getUrl()): ?>
69
+ <tr>
70
+ <th class="label"><?php echo $this->__('Track:'); ?></th>
71
+ <td class="value"><a href="<?php echo $this->escapeHtml($track->getUrl()); ?>" onclick="this.target='_blank'"><?php echo $this->escapeHtml($track->getUrl()); ?></a></td>
72
+ </tr>
73
+ <?php else: ?>
74
+ <?php if ($track->getStatus()): ?>
75
+ <tr>
76
+ <th class="label"><?php echo $this->__('Status:'); ?></th>
77
+ <td class="value"><?php echo $track->getStatus(); ?></td>
78
+ </tr>
79
+ <?php endif; ?>
80
+
81
+ <?php if ($track->getDeliverydate()): ?>
82
+ <tr>
83
+ <th class="label"><?php echo $this->__('Delivered on:'); ?></th>
84
+ <td class="value"><?php echo $this->formatDeliveryDateTime($track->getDeliverydate(),$track->getDeliverytime()); ?></td>
85
+ </tr>
86
+ <?php endif; ?>
87
+
88
+ <?php if ($track->getSignedby()): ?>
89
+ <tr>
90
+ <th class="label"><?php echo $this->__('Signed by:'); ?></th>
91
+ <td class="value"><?php echo $track->getSignedby(); ?></td>
92
+ </tr>
93
+ <?php endif; ?>
94
+
95
+ <?php if ($track->getDeliveryLocation()): ?>
96
+ <tr>
97
+ <th class="label"><?php echo $this->__('Delivered to:'); ?></th>
98
+ <td class="value"><?php echo $track->getDeliveryLocation(); ?></td>
99
+ </tr>
100
+ <?php endif; ?>
101
+
102
+ <?php if ($track->getShippedDate()): ?>
103
+ <tr>
104
+ <th class="label"><?php echo $this->__('Shipped or billed on:'); ?></th>
105
+ <td class="value"><?php echo $track->getShippedDate(); ?></td>
106
+ </tr>
107
+ <?php endif; ?>
108
+
109
+ <?php if ($track->getService()): ?>
110
+ <tr>
111
+ <th class="label"><?php echo $this->__('Service Type:'); ?></th>
112
+ <td class="value"><?php echo $track->getService(); ?></td>
113
+ </tr>
114
+ <?php endif; ?>
115
+
116
+ <?php if ($track->getWeight()): ?>
117
+ <tr>
118
+ <th class="label"><?php echo $this->__('Weight:'); ?></th>
119
+ <td class="value"><?php echo $track->getWeight(); ?></td>
120
+ </tr>
121
+ <?php endif; ?>
122
+ <?php endif; ?>
123
+ <?php elseif(isset($track['title']) && isset($track['number']) && $track['number']): ?>
124
+ <!--if the tracking is custom value-->
125
+ <tr>
126
+ <th class="label"><?php echo ($track['title'] ? $this->escapeHtml($track['title']) : $this->__('N/A')); ?>:</th>
127
+
128
+ <h2><?php echo $this->helper('andreani')->__("Número Andreani: ") . $track['number']; ?></h2>
129
+ <br />
130
+ <td class="value">
131
+ <?php /** @var $this Mage_Shipping_Block_Tracking_Popup */
132
+
133
+ $result = $this->helper('andreani')->getTrackingpopup($track['number']);
134
+
135
+ echo $this->helper('andreani')->__($result["Nropieza"]) . "<br/>";
136
+ echo $this->helper('andreani')->__("Identificación: ") . $result["NombreEnvio"] . "<br/>";
137
+ echo "<hr>";
138
+ $cont = 1;
139
+ foreach ($result["Eventos"] as $value) {
140
+ echo "<strong>" . $this->helper('andreani')->__("Evento N°: ") . $cont . "</strong><br/>";
141
+ echo $this->helper('andreani')->__("Fecha del evento: ") . $value["Fecha"] . "<br/>";
142
+ echo $this->helper('andreani')->__("Estado: ") . $value["Estado"] . "<br/>";
143
+ echo $this->helper('andreani')->__("Motivo: ") . $value["Motivo"] . "<br/>";
144
+ echo $this->helper('andreani')->__("Sucursal: ") . $value["Sucursal"] . "<br/>";
145
+ echo "<hr>";
146
+ $cont++;
147
+ }
148
+ ?>
149
+ </td>
150
+ </tr>
151
+ <?php endif; ?>
152
+ </tbody>
153
+ </table>
154
+ <script type="text/javascript">decorateTable('tracking-table-popup-<?php echo $_id++ ?>');</script>
155
+ <?php if (is_object($track) && sizeof($track->getProgressdetail())>0): ?>
156
+ <br />
157
+ <table class="data-table" id="track-history-table-<?php echo $track->getTracking(); ?>">
158
+ <col />
159
+ <col width="1" />
160
+ <col width="1" />
161
+ <col />
162
+ <thead>
163
+ <tr>
164
+ <th><?php echo $this->__('Location') ?></th>
165
+ <th><?php echo $this->__('Date') ?></th>
166
+ <th><?php echo $this->__('Local Time') ?></th>
167
+ <th><?php echo $this->__('Description') ?></th>
168
+ </tr>
169
+ </thead>
170
+ <tbody>
171
+ <?php foreach($track->getProgressdetail() as $_detail): ?>
172
+ <?php $_detailDate = (isset($_detail['deliverydate']) ? $this->formatDeliveryDate($_detail['deliverydate']) : '') ?>
173
+ <?php $_detailTime = (isset($_detail['deliverytime']) ? $this->formatDeliveryTime($_detail['deliverytime'], $_detail['deliverydate']) : '') ?>
174
+ <tr>
175
+ <td><?php echo (isset($_detail['deliverylocation']) ? $_detail['deliverylocation'] : ''); ?></td>
176
+ <td><span class="nobr"><?php echo $_detailDate ?></span></td>
177
+ <td><span class="nobr"><?php echo $_detailTime ?></span></td>
178
+ <td><?php echo (isset($_detail['activity']) ? $_detail['activity'] : '') ?></td>
179
+ </tr>
180
+ <?php endforeach; ?>
181
+ </tbody>
182
+ </table>
183
+ <script type="text/javascript">decorateTable('track-history-table-<?php echo $track->getTracking(); ?>');</script>
184
+ <?php endif; ?>
185
+ <div class="divider"></div>
186
+ <?php if($counter!=$rowCount): ?>
187
+ <?php endif; ?>
188
+ <?php $counter++; ?>
189
+ <!--end for each tracking information-->
190
+ <?php endforeach; ?>
191
+ <?php else: ?>
192
+ <p><?php echo $this->__('There is no tracking available for this shipment.'); ?></p>
193
+ <?php endif; ?>
194
+
195
+ <?php endforeach; ?>
196
+ <?php else: ?>
197
+ <p><?php echo $this->__('There is no tracking available.'); ?></p>
198
+ <?php endif; ?>
199
+ <div class="buttons-set">
200
+ <button type="button" title="<?php echo $this->__('Close Window') ?>" class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
201
+ </div>
app/etc/modules/Ecloud_Andreani.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Ecloud_Andreani>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ <depends>
8
+ <Mage_Shipping />
9
+ </depends>
10
+ <version>0.1.2</version>
11
+ </Ecloud_Andreani>
12
+ </modules>
13
+ </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Andreani</name>
4
- <version>0.1.6</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,11 +24,13 @@ For Customers:&#xD;
24
  Location and distance y distance to the nearest branch for "Shipments to branch".&#xD;
25
  Express delivery service.&#xD;
26
  Tracking of shipments.</description>
27
- <notes>Release Version.</notes>
 
 
28
  <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>
29
- <date>2014-07-01</date>
30
- <time>13:40:19</time>
31
- <contents><target name="mageetc"><dir name="."><file name="Ecloud_Andreani.xml" hash=""/></dir></target><target name="magelib"><dir name="Andreani"><file name="wsseAuth.php" hash="7f7c0dcac241e7422a6bc657638fc5df"/></dir></target></contents>
32
  <compatible/>
33
  <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>
34
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Andreani</name>
4
+ <version>0.1.7</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".&#xD;
25
  Express delivery service.&#xD;
26
  Tracking of shipments.</description>
27
+ <notes>Release Version 0.1.7.&#xD;
28
+ &#xD;
29
+ Fix 'detalle_productos' en ConfirmarCompra.</notes>
30
  <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>
31
+ <date>2014-07-03</date>
32
+ <time>18:21:04</time>
33
+ <contents><target name="magelocal"><dir name="Ecloud"><dir name="Andreani"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><file name="Edit.php" hash="0af1265c985ff7c6825d52bdcacc9bb5"/><dir name="Form"><dir name="Field"><file name="Medida.php" hash="73fc1384aac7ec077dd1c4b1f9a2acab"/></dir></dir></dir><dir name="Pedidos"><dir name="Edit"><file name="Form.php" hash="64884b5c67b8e153a1334aad7466e59a"/><dir name="Renderer"><file name="Button.php" hash="56dc256b470bb8cdecf16b907ad55bb5"/></dir></dir><file name="Edit.php" hash="cae525d3fdf69ced8d145c53d8c42f7b"/><file name="Grid.php" hash="445e205248ff3c187cba5da289bd1be7"/></dir><file name="Pedidos.php" hash="d7387a43459987bc0caffd02d1b44bd0"/></dir><file name="Andreani.php" hash="4ce366bd38afab460cda0efac94fed7a"/></dir><dir name="Helper"><file name="Data.php" hash="308ca1558be1af432edc7c3b5bdf6380"/></dir><dir name="Model"><file name="Andreani.php" hash="251cc45cf2e27a416e703bae78f6b7ed"/><dir name="Carrier"><file name="Andreani.php" hash="8468b25ea365a9ab6c0b8a8da494d5f8"/><file name="Andreaniestandar.php" hash="3eca0f7593e0989b6329c3e2519c5c6e"/><file name="Andreanisucursal.php" hash="2c34d0138d349eea5500e33adf1435c0"/><file name="Andreaniurgente.php" hash="36dcc70bd509e3d0bb110d2745f1a058"/></dir><dir name="Config"><file name="Medida.php" hash="1fc6e47f85c8b4c70f95385dd8a979f3"/><file name="TestMode.php" hash="c159fe76948f268999ba1af375a0854a"/></dir><file name="Observer.php" hash="49702c06e69e2ffbfa578c379b27f820"/><file name="Order.php" hash="c117f3c65c88fb2b56c535b3470f9535"/><dir name="Resource"><dir name="Order"><file name="Collection.php" hash="bd152386b13214a70a26bc06e4d9103f"/></dir><file name="Order.php" hash="9e107a1711a9081d4fd476369495cc34"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Pedidos"><file name="PedidosController.php" hash="da993ba8fed3055d3abef977dab25141"/></dir><file name="PedidosController.php" hash="f0e9d6ad79ece1a2ae8d2f9d258bb4e7"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="8f0a993a42b9844f15056ffd0d7b6312"/><file name="config.xml" hash="4f0385f766be6bb3fde562d6dc5b8ac3"/><file name="system.xml" hash="304609a84b1a4dbd6045b0f4bdb3c77b"/></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"/></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="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir><dir name="shipping"><dir name="tracking"><file name="popup.phtml" hash="cab9a1b01c732d7553be9b47e1e1b542"/></dir></dir></dir></dir></dir></dir></target></contents>
34
  <compatible/>
35
  <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>
36
  </package>