Version Notes
None
Download this release
Release Info
Developer | Magento Core Team |
Extension | Fianet_Sac |
Version | 0.6.0 |
Comparing to | |
See all releases |
Code changes from version 0.5.8 to 0.6.0
- app/code/community/Fianet/Sac/Block/Payment/Edit/Form.php +1 -1
- app/code/community/Fianet/Sac/Model/Action.php +59 -41
- app/code/community/Fianet/Sac/controllers/OrderController.php +2 -163
- app/code/community/Fianet/Sac/etc/config.xml +14 -1
- app/code/community/Fianet/Sac/sql/sac_setup/mysql4-upgrade-0.5.0-0.5.2.php +6 -21
- app/code/community/Fianet/Sac/sql/sac_setup/mysql4-upgrade-0.5.2-0.5.9.php +20 -0
- app/code/community/Fianet/Sac/sql/sac_setup/mysql4-upgrade-0.5.8-0.5.9.php +20 -0
- app/design/adminhtml/default/default/layout/sac.xml +1 -9
- app/etc/modules/{Zfianet_Sac.xml → ZFianet_Sac.xml} +1 -1
- package.xml +9 -9
app/code/community/Fianet/Sac/Block/Payment/Edit/Form.php
CHANGED
@@ -23,7 +23,7 @@ class Fianet_Sac_Block_Payment_Edit_Form extends Mage_Adminhtml_Block_Widget_For
|
|
23 |
|
24 |
foreach ($Payments as $code => $name)
|
25 |
{
|
26 |
-
if (!
|
27 |
{
|
28 |
$current_payment_association = Mage::getModel('sac/payment_association')->load($code);
|
29 |
|
23 |
|
24 |
foreach ($Payments as $code => $name)
|
25 |
{
|
26 |
+
if (!preg_match('receiveandpay', $code))
|
27 |
{
|
28 |
$current_payment_association = Mage::getModel('sac/payment_association')->load($code);
|
29 |
|
app/code/community/Fianet/Sac/Model/Action.php
CHANGED
@@ -9,11 +9,11 @@ class Fianet_Sac_Model_Action
|
|
9 |
$event = $observer->getEvent();
|
10 |
//Mage::getModel('fianet/log')->log('success : ' .Mage::getSingleton('checkout/session')->getLastRealOrderId());
|
11 |
$order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
|
12 |
-
if (
|
13 |
{
|
14 |
return $this;
|
15 |
}
|
16 |
-
$config =
|
17 |
|
18 |
$statut = $config->load('SAC_STATUS')->getValue();
|
19 |
if ($statut == null || $statut == '')
|
@@ -56,7 +56,7 @@ class Fianet_Sac_Model_Action
|
|
56 |
{
|
57 |
$order = Mage::getModel('sales/order')->loadByIncrementId($response['refid']);
|
58 |
}
|
59 |
-
$config =
|
60 |
|
61 |
$statut = $config->load('SAC_STATUS')->getValue();
|
62 |
if ($statut == null || $statut == '')
|
@@ -86,7 +86,7 @@ class Fianet_Sac_Model_Action
|
|
86 |
return ($nb);
|
87 |
}
|
88 |
|
89 |
-
protected function GetConfigurationData(Mage_Sales_Model_Order $order)
|
90 |
{
|
91 |
$scope_field = Mage::getModel('fianet/configuration')->getGlobalValue('CONFIGURATION_SCOPE');
|
92 |
switch ($scope_field)
|
@@ -112,9 +112,10 @@ class Fianet_Sac_Model_Action
|
|
112 |
return ($configurationData);
|
113 |
}
|
114 |
|
115 |
-
public function getEvaluation()
|
116 |
{
|
117 |
$nb = 0;
|
|
|
118 |
$collection = Mage::getResourceModel('sales/order_collection')
|
119 |
->addAttributeToSelect('fianet_sac_sent')
|
120 |
->addAttributeToSelect('fianet_sac_evaluation')
|
@@ -128,7 +129,7 @@ class Fianet_Sac_Model_Action
|
|
128 |
//Zend_Debug::dump($order->Fianet_sac_evaluation);
|
129 |
if ($order->Fianet_sac_evaluation == null || $order->Fianet_sac_evaluation == 'error'|| $order->Fianet_sac_evaluation == 'encours')
|
130 |
{
|
131 |
-
$config =
|
132 |
|
133 |
$siteid = $config->load('SAC_SITEID')->Value;
|
134 |
$login = $config->load('SAC_LOGIN')->Value;
|
@@ -164,58 +165,75 @@ class Fianet_Sac_Model_Action
|
|
164 |
return ($nb);
|
165 |
}
|
166 |
|
167 |
-
public function
|
168 |
{
|
169 |
$nb = 0;
|
|
|
170 |
$reevaluations = Mage::getModel('fianet/fianet_sender')->get_reevaluation();
|
|
|
|
|
171 |
//Zend_Debug::dump($evaluations);
|
172 |
foreach ($reevaluations as $reevaluation)
|
173 |
{
|
174 |
if (isset($reevaluation['eval']))
|
175 |
{
|
176 |
-
$notification = Mage::getModel('adminnotification/inbox');
|
177 |
-
$notification->setseverity(Mage_AdminNotification_Model_Inbox::SEVERITY_MINOR);
|
178 |
-
$notification->setTitle($this->__('Order %s has been reevaluated', $reevaluation['refid']));
|
179 |
-
$notification->setDate_added(date('Y-m-d H:i:s'));
|
180 |
-
switch ($reevaluation['eval'])
|
181 |
-
{
|
182 |
-
case('error'):
|
183 |
-
$icon = 'attention.gif';
|
184 |
-
break;
|
185 |
-
case('100'):
|
186 |
-
$icon = 'rond_vert.gif';
|
187 |
-
break;
|
188 |
-
case('-1'):
|
189 |
-
$icon = 'rond_vertclair.gif';
|
190 |
-
break;
|
191 |
-
case('0'):
|
192 |
-
$icon = 'rond_rouge.gif';
|
193 |
-
break;
|
194 |
-
default:
|
195 |
-
$icon = 'fianet_SAC_icon.gif';
|
196 |
-
break;
|
197 |
-
}
|
198 |
-
$img = '<img src="'.$this->getSkinUrl('images/fianet/'.$icon).'">';
|
199 |
-
$message = Mage::helper('fianet')->__('The order %s has now evaluation %s', $reevaluation['refid'], $img);
|
200 |
-
|
201 |
-
$notification->setDescription($message);
|
202 |
-
|
203 |
-
|
204 |
-
//Zend_Debug::dump($notification);
|
205 |
-
|
206 |
$order = Mage::getModel('sales/order')->loadByIncrementId($reevaluation['refid']);
|
207 |
$order->setData('fianet_sac_reevaluation', $reevaluation['eval']);
|
208 |
$order->save();
|
209 |
|
210 |
-
|
211 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
$nb++;
|
213 |
}
|
214 |
}
|
|
|
215 |
return ($nb);
|
216 |
}
|
217 |
|
218 |
-
protected function getUrlBO(Mage_Sales_Model_Order $order)
|
219 |
{
|
220 |
$url = '';
|
221 |
$url = $url = Mage::getModel('fianet/configuration')->getGlobalValue('SAC_BASEURL_TEST');
|
@@ -226,7 +244,7 @@ class Fianet_Sac_Model_Action
|
|
226 |
$url .= Mage::getModel('fianet/configuration')->getGlobalValue('SAC_URL_BOMERCHANT');
|
227 |
|
228 |
|
229 |
-
$config =
|
230 |
$siteid = $config->load('SAC_SITEID')->Value;
|
231 |
$login = $config->load('SAC_LOGIN')->Value;
|
232 |
$password = $config->load('SAC_PASSWORD')->Value;
|
9 |
$event = $observer->getEvent();
|
10 |
//Mage::getModel('fianet/log')->log('success : ' .Mage::getSingleton('checkout/session')->getLastRealOrderId());
|
11 |
$order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
|
12 |
+
if (preg_match('receiveandpay', $order->getPayment()->getMethod()))
|
13 |
{
|
14 |
return $this;
|
15 |
}
|
16 |
+
$config = self::GetConfigurationData($order);
|
17 |
|
18 |
$statut = $config->load('SAC_STATUS')->getValue();
|
19 |
if ($statut == null || $statut == '')
|
56 |
{
|
57 |
$order = Mage::getModel('sales/order')->loadByIncrementId($response['refid']);
|
58 |
}
|
59 |
+
$config = self::GetConfigurationData($order);
|
60 |
|
61 |
$statut = $config->load('SAC_STATUS')->getValue();
|
62 |
if ($statut == null || $statut == '')
|
86 |
return ($nb);
|
87 |
}
|
88 |
|
89 |
+
protected static function GetConfigurationData(Mage_Sales_Model_Order $order)
|
90 |
{
|
91 |
$scope_field = Mage::getModel('fianet/configuration')->getGlobalValue('CONFIGURATION_SCOPE');
|
92 |
switch ($scope_field)
|
112 |
return ($configurationData);
|
113 |
}
|
114 |
|
115 |
+
public static function getEvaluation()
|
116 |
{
|
117 |
$nb = 0;
|
118 |
+
//$actionModel = Mage::getModel('sac/action');
|
119 |
$collection = Mage::getResourceModel('sales/order_collection')
|
120 |
->addAttributeToSelect('fianet_sac_sent')
|
121 |
->addAttributeToSelect('fianet_sac_evaluation')
|
129 |
//Zend_Debug::dump($order->Fianet_sac_evaluation);
|
130 |
if ($order->Fianet_sac_evaluation == null || $order->Fianet_sac_evaluation == 'error'|| $order->Fianet_sac_evaluation == 'encours')
|
131 |
{
|
132 |
+
$config = self::GetConfigurationData($order);
|
133 |
|
134 |
$siteid = $config->load('SAC_SITEID')->Value;
|
135 |
$login = $config->load('SAC_LOGIN')->Value;
|
165 |
return ($nb);
|
166 |
}
|
167 |
|
168 |
+
public static function getReevaluation()
|
169 |
{
|
170 |
$nb = 0;
|
171 |
+
Mage::getModel('fianet/log')->Log(Mage::helper('fianet')->__('Attempt to retrieve Reevaluation...'));
|
172 |
$reevaluations = Mage::getModel('fianet/fianet_sender')->get_reevaluation();
|
173 |
+
Mage::getModel('fianet/log')->Log(Mage::helper('fianet')->__('%s reevaluation found.', count($reevaluations)));
|
174 |
+
|
175 |
//Zend_Debug::dump($evaluations);
|
176 |
foreach ($reevaluations as $reevaluation)
|
177 |
{
|
178 |
if (isset($reevaluation['eval']))
|
179 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
$order = Mage::getModel('sales/order')->loadByIncrementId($reevaluation['refid']);
|
181 |
$order->setData('fianet_sac_reevaluation', $reevaluation['eval']);
|
182 |
$order->save();
|
183 |
|
184 |
+
Mage::getModel('fianet/log')->Log(Mage::helper('fianet')->__('Order %s updated to eval %s', $reevaluation['refid'], $reevaluation['eval']));
|
185 |
+
|
186 |
+
try
|
187 |
+
{
|
188 |
+
$notification = Mage::getModel('adminnotification/inbox');
|
189 |
+
$notification->setseverity(Mage_AdminNotification_Model_Inbox::SEVERITY_MINOR);
|
190 |
+
$notification->setTitle(Mage::helper('fianet')->__('Order %s has been reevaluated', $reevaluation['refid']));
|
191 |
+
$notification->setDate_added(date('Y-m-d H:i:s'));
|
192 |
+
|
193 |
+
switch ($reevaluation['eval'])
|
194 |
+
{
|
195 |
+
case('error'):
|
196 |
+
$icon = 'attention.gif';
|
197 |
+
break;
|
198 |
+
case('100'):
|
199 |
+
$icon = 'rond_vert.gif';
|
200 |
+
break;
|
201 |
+
case('-1'):
|
202 |
+
$icon = 'rond_vertclair.gif';
|
203 |
+
break;
|
204 |
+
case('0'):
|
205 |
+
$icon = 'rond_rouge.gif';
|
206 |
+
break;
|
207 |
+
default:
|
208 |
+
$icon = 'fianet_SAC_icon.gif';
|
209 |
+
break;
|
210 |
+
}
|
211 |
+
|
212 |
+
$img = '<img src="'.Mage::getDesign()->getSkinUrl('images/fianet/'.$icon).'">';
|
213 |
+
$message = Mage::helper('fianet')->__('The order %s has now evaluation %s', $reevaluation['refid'], $img);
|
214 |
+
|
215 |
+
$notification->setDescription($message);
|
216 |
+
|
217 |
+
|
218 |
+
//Zend_Debug::dump($notification);
|
219 |
+
|
220 |
+
|
221 |
+
|
222 |
+
$notification->setUrl(self::getUrlBO($order));
|
223 |
+
$notification->save();
|
224 |
+
}
|
225 |
+
catch (Exception $e)
|
226 |
+
{
|
227 |
+
|
228 |
+
}
|
229 |
$nb++;
|
230 |
}
|
231 |
}
|
232 |
+
Mage::getModel('fianet/log')->Log(Mage::helper('fianet')->__('Retrieving reevaluation ended.'));
|
233 |
return ($nb);
|
234 |
}
|
235 |
|
236 |
+
protected static function getUrlBO(Mage_Sales_Model_Order $order)
|
237 |
{
|
238 |
$url = '';
|
239 |
$url = $url = Mage::getModel('fianet/configuration')->getGlobalValue('SAC_BASEURL_TEST');
|
244 |
$url .= Mage::getModel('fianet/configuration')->getGlobalValue('SAC_URL_BOMERCHANT');
|
245 |
|
246 |
|
247 |
+
$config = self::GetConfigurationData($order);
|
248 |
$siteid = $config->load('SAC_SITEID')->Value;
|
249 |
$login = $config->load('SAC_LOGIN')->Value;
|
250 |
$password = $config->load('SAC_PASSWORD')->Value;
|
app/code/community/Fianet/Sac/controllers/OrderController.php
CHANGED
@@ -11,7 +11,7 @@ class Fianet_Sac_OrderController extends Mage_Adminhtml_Controller_Action
|
|
11 |
{
|
12 |
try
|
13 |
{
|
14 |
-
|
15 |
}
|
16 |
catch (Exception $e)
|
17 |
{
|
@@ -33,7 +33,7 @@ class Fianet_Sac_OrderController extends Mage_Adminhtml_Controller_Action
|
|
33 |
$order = Mage::getModel('sales/order')->load($orderId);
|
34 |
$payment = $order->getPayment()->getMethod();
|
35 |
$sent = $order->getData('fianet_sac_sent');
|
36 |
-
if (!
|
37 |
{
|
38 |
$SacOrder = Fianet_Core_Model_Fianet_Order_Sac::GenerateSacOrder($order);
|
39 |
//Zend_Debug::dump($SacOrder->get_xml());
|
@@ -59,166 +59,5 @@ class Fianet_Sac_OrderController extends Mage_Adminhtml_Controller_Action
|
|
59 |
}
|
60 |
|
61 |
|
62 |
-
/*
|
63 |
-
protected function GenerateSacOrder(Mage_Sales_Model_Order $order)
|
64 |
-
{
|
65 |
-
$scope_field = Mage::getModel('fianet/configuration')->getGlobalValue('CONFIGURATION_SCOPE');
|
66 |
-
switch ($scope_field)
|
67 |
-
{
|
68 |
-
case ('store_id'):
|
69 |
-
$id = $order->getStore()->getId();
|
70 |
-
break;
|
71 |
-
case ('group_id'):
|
72 |
-
$id = $order->getStore()->getGroup()->getId();
|
73 |
-
break;
|
74 |
-
case ('website_id'):
|
75 |
-
$id = $order->getStore()->getWebsite()->getId();
|
76 |
-
break;
|
77 |
-
default:
|
78 |
-
$id = $order->getStore()->getGroup()->getId();
|
79 |
-
break;
|
80 |
-
}
|
81 |
-
$configurationData = Mage::getModel('fianet/configuration_value');
|
82 |
-
$configurationData->_scope_field = $scope_field;
|
83 |
-
$configurationData->setScope($id);
|
84 |
-
|
85 |
-
$SacOrder = Mage::getModel('fianet/fianet_order_sac');
|
86 |
-
|
87 |
-
$SacOrder->scope_field = $scope_field;
|
88 |
-
$SacOrder->scope_id = $id;
|
89 |
-
|
90 |
-
$billing_address = $order->getBillingAddress();
|
91 |
-
$shipping_address = $order->getShippingAddress();
|
92 |
-
|
93 |
-
$SacOrder->billing_user->nom = $billing_address->getLastname();
|
94 |
-
$SacOrder->billing_user->prenom = $billing_address->getFirstname();
|
95 |
-
$SacOrder->billing_user->telhome = eregi_replace("[^0-9]", "", $billing_address->getTelephone());
|
96 |
-
$SacOrder->billing_user->telfax = eregi_replace("[^0-9]", "", $billing_address->getFax());
|
97 |
-
$SacOrder->billing_user->email = $billing_address->getEmail();
|
98 |
-
$SacOrder->billing_user->societe = $billing_address->getCompany();
|
99 |
-
|
100 |
-
if (trim($billing_address->getCompany()) != '')
|
101 |
-
{
|
102 |
-
$SacOrder->billing_user->set_quality_professional();
|
103 |
-
}
|
104 |
-
|
105 |
-
$SacOrder->billing_adress->rue1 = $billing_address->getStreet(1);
|
106 |
-
$SacOrder->billing_adress->rue2 = $billing_address->getStreet(2);
|
107 |
-
$SacOrder->billing_adress->cpostal = $billing_address->getPostcode();
|
108 |
-
$SacOrder->billing_adress->ville = $billing_address->getCity();
|
109 |
-
$SacOrder->billing_adress->pays = $billing_address->getCountry();
|
110 |
-
|
111 |
-
if (!$this->compare_billing_and_shipping($billing_address, $shipping_address))
|
112 |
-
{
|
113 |
-
$SacOrder->delivery_user = Mage::getModel('fianet/fianet_order_user_delivery');
|
114 |
-
$SacOrder->delivery_adress = Mage::getModel('fianet/fianet_order_adress_delivery');
|
115 |
-
|
116 |
-
$SacOrder->delivery_user->qualite = $SacOrder->billing_user->qualite;
|
117 |
-
|
118 |
-
$SacOrder->delivery_user->nom = $shipping_address->getLastname();
|
119 |
-
$SacOrder->delivery_user->prenom = $shipping_address->getFirstname();
|
120 |
-
$SacOrder->delivery_user->telhome = eregi_replace("[^0-9]", "", $shipping_address->getTelephone());
|
121 |
-
$SacOrder->delivery_user->telfax = eregi_replace("[^0-9]", "", $shipping_address->getFax());
|
122 |
-
$SacOrder->delivery_user->email = $shipping_address->getEmail();
|
123 |
-
$SacOrder->delivery_user->societe = $shipping_address->getCompany();
|
124 |
-
|
125 |
-
$SacOrder->delivery_adress->rue1 = $shipping_address->getStreet(1);
|
126 |
-
$SacOrder->delivery_adress->rue2 = $shipping_address->getStreet(2);
|
127 |
-
$SacOrder->delivery_adress->cpostal = $shipping_address->getPostcode();
|
128 |
-
$SacOrder->delivery_adress->ville = $shipping_address->getCity();
|
129 |
-
$SacOrder->delivery_adress->pays = $shipping_address->getCountry();
|
130 |
-
}
|
131 |
-
|
132 |
-
$SacOrder->info_commande->refid = $order->getRealOrderId();
|
133 |
-
$SacOrder->info_commande->devise = $order->getBaseCurrencyCode();
|
134 |
-
$SacOrder->info_commande->montant = $order->getBaseGrandTotal();
|
135 |
-
$SacOrder->info_commande->ip = $order->getRemoteIp();
|
136 |
-
$SacOrder->info_commande->timestamp = $order->getCreatedAt();
|
137 |
-
|
138 |
-
$SacOrder->info_commande->siteid = $configurationData->load('SAC_SITEID')->Value;
|
139 |
-
if ($SacOrder->info_commande->siteid == null)
|
140 |
-
{
|
141 |
-
$configurationData->setScope(0);
|
142 |
-
$SacOrder->info_commande->siteid = $configurationData->load('SAC_SITEID')->Value;
|
143 |
-
}
|
144 |
-
|
145 |
-
|
146 |
-
$shipping_code = $order->getShippingCarrier()->getAllowedMethods();
|
147 |
-
foreach ($shipping_code as $code => $val)
|
148 |
-
{
|
149 |
-
$shipping_code = $code;
|
150 |
-
}
|
151 |
-
$shipping = Mage::getModel('fianet/shipping_association')->load($shipping_code);
|
152 |
-
$SacOrder->info_commande->transport->type = $shipping->fianet_shipping_type;
|
153 |
-
$SacOrder->info_commande->transport->nom = $shipping->conveyor_name;
|
154 |
-
$SacOrder->info_commande->transport->rapidite = $shipping->delivery_times ;
|
155 |
-
|
156 |
-
foreach($order->getItemsCollection() as $item)
|
157 |
-
{
|
158 |
-
$product = Mage::getModel('fianet/fianet_order_info_productList_product');
|
159 |
-
|
160 |
-
$product->type = Mage::getModel('fianet/product')->load($item->getProduct_id())->getFianetProductType();
|
161 |
-
$product->prixunit = $item->getPrice();
|
162 |
-
$product->name = $item->getName();
|
163 |
-
$product->nb = (int)$item->getQtyOrdered();
|
164 |
-
$product->ref = $item->getProduct_id();
|
165 |
-
$SacOrder->info_commande->list->add_product($product);
|
166 |
-
}
|
167 |
-
$SacOrder->payment->type = Mage::getModel('sac/payment_association')->load($order->getPayment()->getMethod())->getValue();
|
168 |
-
|
169 |
-
//Zend_Debug::dump($SacOrder);
|
170 |
-
return ($SacOrder);
|
171 |
-
}
|
172 |
|
173 |
-
protected function compare_billing_and_shipping($billing, $shipping)
|
174 |
-
{
|
175 |
-
$identical = true;
|
176 |
-
if ($billing->getLastname() != $shipping->getLastname())
|
177 |
-
{
|
178 |
-
$identical = false;
|
179 |
-
}
|
180 |
-
if ($billing->getFirstname() != $shipping->getFirstname())
|
181 |
-
{
|
182 |
-
$identical = false;
|
183 |
-
}
|
184 |
-
if ($billing->getTelephone() != $shipping->getTelephone())
|
185 |
-
{
|
186 |
-
$identical = false;
|
187 |
-
}
|
188 |
-
if ($billing->getFax() != $shipping->getFax())
|
189 |
-
{
|
190 |
-
$identical = false;
|
191 |
-
}
|
192 |
-
if ($billing->getEmail() != $shipping->getEmail())
|
193 |
-
{
|
194 |
-
$identical = false;
|
195 |
-
}
|
196 |
-
if ($billing->getStreet(1) != $shipping->getStreet(1))
|
197 |
-
{
|
198 |
-
$identical = false;
|
199 |
-
}
|
200 |
-
if ($billing->getStreet(2) != $shipping->getStreet(2))
|
201 |
-
{
|
202 |
-
$identical = false;
|
203 |
-
}
|
204 |
-
if ($billing->getPostcode() != $shipping->getPostcode())
|
205 |
-
{
|
206 |
-
$identical = false;
|
207 |
-
}
|
208 |
-
if ($billing->getCity() != $shipping->getCity())
|
209 |
-
{
|
210 |
-
$identical = false;
|
211 |
-
}
|
212 |
-
if ($billing->getCountry() != $shipping->getCountry())
|
213 |
-
{
|
214 |
-
$identical = false;
|
215 |
-
}
|
216 |
-
if ($billing->getCompany() != $shipping->getCompany())
|
217 |
-
{
|
218 |
-
$identical = false;
|
219 |
-
}
|
220 |
-
|
221 |
-
return ($identical);
|
222 |
-
}
|
223 |
-
*/
|
224 |
}
|
11 |
{
|
12 |
try
|
13 |
{
|
14 |
+
Fianet_Sac_Model_Action::getEvaluation();
|
15 |
}
|
16 |
catch (Exception $e)
|
17 |
{
|
33 |
$order = Mage::getModel('sales/order')->load($orderId);
|
34 |
$payment = $order->getPayment()->getMethod();
|
35 |
$sent = $order->getData('fianet_sac_sent');
|
36 |
+
if (!preg_match('receiveandpay', $payment) && $sent != '1' && $order->getBaseGrandTotal() > 0)
|
37 |
{
|
38 |
$SacOrder = Fianet_Core_Model_Fianet_Order_Sac::GenerateSacOrder($order);
|
39 |
//Zend_Debug::dump($SacOrder->get_xml());
|
59 |
}
|
60 |
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
app/code/community/Fianet/Sac/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Fianet_Sac>
|
5 |
-
<version>0.
|
6 |
</Fianet_Sac>
|
7 |
</modules>
|
8 |
<admin>
|
@@ -124,4 +124,17 @@
|
|
124 |
</updates>
|
125 |
</layout>
|
126 |
</adminhtml>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
</config>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Fianet_Sac>
|
5 |
+
<version>0.6.0</version>
|
6 |
</Fianet_Sac>
|
7 |
</modules>
|
8 |
<admin>
|
124 |
</updates>
|
125 |
</layout>
|
126 |
</adminhtml>
|
127 |
+
<crontab>
|
128 |
+
<jobs>
|
129 |
+
<fianetsac_get_evaluation>
|
130 |
+
<schedule><cron_expr>*/10 * * * *</cron_expr></schedule>
|
131 |
+
<run><model>sac/action::getEvaluation</model></run>
|
132 |
+
</fianetsac_get_evaluation>
|
133 |
+
<fianetsac_get_reevaluation>
|
134 |
+
<schedule><cron_expr>0 0,12 * * *</cron_expr></schedule>
|
135 |
+
<run><model>sac/action::getReevaluation</model></run>
|
136 |
+
</fianetsac_get_reevaluation>
|
137 |
+
|
138 |
+
</jobs>
|
139 |
+
</crontab>
|
140 |
</config>
|
app/code/community/Fianet/Sac/sql/sac_setup/mysql4-upgrade-0.5.0-0.5.2.php
CHANGED
@@ -1,43 +1,28 @@
|
|
1 |
<?php
|
2 |
$installer = $this;
|
3 |
$installer->startSetup();
|
4 |
-
|
5 |
-
$config = array(
|
6 |
-
'SAC_BASEURL_PRODUCTION'=>'https://secure.fia-net.com/fscreener/',
|
7 |
-
'SAC_BASEURL_TEST'=>'https://secure.fia-net.com/pprod/',
|
8 |
-
'SAC_URL_STACKING'=>'engine/stacking.cgi',
|
9 |
-
'SAC_URL_VALIDSTACK'=>'engine/get_validstack.cgi',
|
10 |
-
'SAC_URL_GETALERT'=>'engine/get_alert.cgi',
|
11 |
-
'SAC_URL_BOMERCHANT'=>'commun/visucheck_detail.php',
|
12 |
-
'SAC_URL_CHECKXML'=>'marchand/checkxml.php',
|
13 |
-
'SAC_STATUS'=>'0',
|
14 |
-
'SAC_SITEID'=>'',
|
15 |
-
'SAC_LOGIN'=>'',
|
16 |
-
'SAC_PASSWORD'=>''
|
17 |
-
);
|
18 |
-
Fianet_Core_Model_Configuration::SetDefaultConfig($config);
|
19 |
-
*/
|
20 |
$Payments = Mage::getModel('fianet/MageConfiguration')
|
21 |
->getPaymentMethods();
|
22 |
|
23 |
foreach ($Payments as $code => $name)
|
24 |
{
|
25 |
-
if (!
|
26 |
{
|
27 |
$val = 'carte';
|
28 |
-
if (
|
29 |
{
|
30 |
$val = 'cheque';
|
31 |
}
|
32 |
-
if (
|
33 |
{
|
34 |
$val = 'paypal';
|
35 |
}
|
36 |
-
if (
|
37 |
{
|
38 |
$val = 'virement';
|
39 |
}
|
40 |
-
if (
|
41 |
{
|
42 |
$val = 'virement';
|
43 |
}
|
1 |
<?php
|
2 |
$installer = $this;
|
3 |
$installer->startSetup();
|
4 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
$Payments = Mage::getModel('fianet/MageConfiguration')
|
6 |
->getPaymentMethods();
|
7 |
|
8 |
foreach ($Payments as $code => $name)
|
9 |
{
|
10 |
+
if (!preg_match('receiveandpay', $code))
|
11 |
{
|
12 |
$val = 'carte';
|
13 |
+
if (preg_match('checkmo', $code))
|
14 |
{
|
15 |
$val = 'cheque';
|
16 |
}
|
17 |
+
if (preg_match('paypal', $code))
|
18 |
{
|
19 |
$val = 'paypal';
|
20 |
}
|
21 |
+
if (preg_match('purchaseorder', $code))
|
22 |
{
|
23 |
$val = 'virement';
|
24 |
}
|
25 |
+
if (preg_match('free', $code))
|
26 |
{
|
27 |
$val = 'virement';
|
28 |
}
|
app/code/community/Fianet/Sac/sql/sac_setup/mysql4-upgrade-0.5.2-0.5.9.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sac_evaluation', 'varchar(255) default NULL');
|
5 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sac_mode', 'varchar(255) default NULL');
|
6 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sac_reevaluation', 'varchar(255) default NULL');
|
7 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sac_sent', 'int(11) default 0');
|
8 |
+
|
9 |
+
$installer->run("
|
10 |
+
UPDATE {$this->getTable('sales_flat_order_grid')} sfog, {$this->getTable('sales_flat_order')} sfo
|
11 |
+
SET sfog.fianet_sac_evaluation = sfo.fianet_sac_evaluation,
|
12 |
+
sfog.fianet_sac_mode = sfo.fianet_sac_mode,
|
13 |
+
sfog.fianet_sac_reevaluation = sfo.fianet_sac_reevaluation,
|
14 |
+
sfog.fianet_sac_sent = sfo.fianet_sac_sent
|
15 |
+
WHERE sfog.entity_id = sfo.entity_id;
|
16 |
+
");
|
17 |
+
|
18 |
+
$installer->endSetup();
|
19 |
+
|
20 |
+
?>
|
app/code/community/Fianet/Sac/sql/sac_setup/mysql4-upgrade-0.5.8-0.5.9.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sac_evaluation', 'varchar(255) default NULL');
|
5 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sac_mode', 'varchar(255) default NULL');
|
6 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sac_reevaluation', 'varchar(255) default NULL');
|
7 |
+
$installer->getConnection()->addColumn($installer->getTable('sales_flat_order_grid'), 'fianet_sac_sent', 'int(11) default 0');
|
8 |
+
|
9 |
+
$installer->run("
|
10 |
+
UPDATE {$this->getTable('sales_flat_order_grid')} sfog, {$this->getTable('sales_flat_order')} sfo
|
11 |
+
SET sfog.fianet_sac_evaluation = sfo.fianet_sac_evaluation,
|
12 |
+
sfog.fianet_sac_mode = sfo.fianet_sac_mode,
|
13 |
+
sfog.fianet_sac_reevaluation = sfo.fianet_sac_reevaluation,
|
14 |
+
sfog.fianet_sac_sent = sfo.fianet_sac_sent
|
15 |
+
WHERE sfog.entity_id = sfo.entity_id;
|
16 |
+
");
|
17 |
+
|
18 |
+
$installer->endSetup();
|
19 |
+
|
20 |
+
?>
|
app/design/adminhtml/default/default/layout/sac.xml
CHANGED
@@ -16,13 +16,5 @@
|
|
16 |
</action>
|
17 |
</reference>
|
18 |
</fianet_configuration_index>
|
19 |
-
|
20 |
-
<reference name="sales_order.grid">
|
21 |
-
<action method="addMassAction">
|
22 |
-
<code>code</code>
|
23 |
-
<label>label</label>
|
24 |
-
<url>url</url>
|
25 |
-
</action>
|
26 |
-
</reference>
|
27 |
-
</adminhtml_sales_order_index>
|
28 |
</layout>
|
16 |
</action>
|
17 |
</reference>
|
18 |
</fianet_configuration_index>
|
19 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
</layout>
|
app/etc/modules/{Zfianet_Sac.xml → ZFianet_Sac.xml}
RENAMED
@@ -7,7 +7,7 @@
|
|
7 |
<depends>
|
8 |
<Fianet_Core />
|
9 |
</depends>
|
10 |
-
<version>0.
|
11 |
</Fianet_Sac>
|
12 |
</modules>
|
13 |
</config>
|
7 |
<depends>
|
8 |
<Fianet_Core />
|
9 |
</depends>
|
10 |
+
<version>0.6.0</version>
|
11 |
</Fianet_Sac>
|
12 |
</modules>
|
13 |
</config>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fianet_Sac</name>
|
4 |
-
<version>0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>
|
11 |
-
<notes>
|
12 |
-
<authors><author><name>Fabrice Beck</name><user>auto-converted</user><email>kalliser@gmail.com</email></author
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="sac.xml" hash="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><package><name>Fianet_Core</name><channel>community</channel><min>0.
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fianet_Sac</name>
|
4 |
+
<version>0.6.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Fia-Net Sac</summary>
|
10 |
+
<description>Fia-Net Sac</description>
|
11 |
+
<notes>None</notes>
|
12 |
+
<authors><author><name>Fabrice Beck</name><user>auto-converted</user><email>kalliser@gmail.com</email></author></authors>
|
13 |
+
<date>2011-01-04</date>
|
14 |
+
<time>18:41:09</time>
|
15 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="sac.xml" hash="8a986ae5ecd29adc10d95eaa0fd8c591"/></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Fianet"><dir name="Sac"><dir name="Block"><dir name="Payment"><file name="Configuration.php" hash="b68a94d906d276b84332db6df9b3d30a"/><dir name="Edit"><file name="Form.php" hash="a4ee0a0487c43803785a941b390894e0"/></dir></dir></dir><dir name="controllers"><file name="OrderController.php" hash="abc7ee38e2d595e47ea85de0ea264e33"/><file name="PaymentController.php" hash="097868ee72a1e3613e45911e98f0f70e"/></dir><dir name="etc"><file name="config.xml" hash="eb2d851da2772fdccade013e5fe6f1a3"/></dir><dir name="Helper"><file name="Data.php" hash="90567ad29b5a627e8aa019d47c90f0f3"/></dir><dir name="Model"><file name="Action.php" hash="748a7bbb29c146677f4efe2deadb61e0"/><dir name="Mysql4"><dir name="Payment"><file name="Association.php" hash="3054892def6781498201d2bb8e90bb2d"/><dir name="Association"><file name="Collection.php" hash="6414dca05a614c3740bcfc2ffe6aab0e"/></dir></dir></dir><dir name="Payment"><file name="Association.php" hash="c704a7b25c13bd70e1d713dd34851413"/></dir><dir name="Source"><dir name="Payment"><file name="Type.php" hash="d4971c33314ccc3497e278b4714ca33b"/></dir></dir></dir><dir name="sql"><dir name="sac_setup"><file name="mysql4-install-0.5.0.php" hash="1074cf9a18671a0c1f2749c9e439674f"/><file name="mysql4-upgrade-0.5.0-0.5.2.php" hash="9a3e73e76b142334b7f326dc55093a5f"/><file name="mysql4-upgrade-0.5.2-0.5.9.php" hash="b63562bb448aaeb76b875737d25caf17"/><file name="mysql4-upgrade-0.5.8-0.5.9.php" hash="b63562bb448aaeb76b875737d25caf17"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="ZFianet_Sac.xml" hash="80a0200c451866035f8020360e9f81ab"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><package><name>Fianet_Core</name><channel>community</channel><min>0.8.0</min><max>0.8.0</max></package></required></dependencies>
|
18 |
</package>
|