Version Notes
New release from BlockThatProxy with many new functionalities.
- If an order is detected as proxy, the system automatically sets the order status as "possible fraud", so you can manually review it before shipping.
- You can choose to redirect a user to a specific page if the user is detected as proxy during checkout (after payment!). In this way you can automatically ask the customer to contact you to confirm his details.
- The system looks up the users IP in our global IP to address database and provide you with the country and city the IP belongs to.
- It calculates the distance between the shipping address entered by the user, and the address matching the IP, so you can see if its a very high distance (possible fraud).
- Adds an page to your admin panel, where you easily can see all orders marked as possible fraud.
Release Info
Developer | Magento Core Team |
Extension | BlockThatProxy |
Version | 2.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.1 to 2.0
- app/code/local/BlockThatProxy/Proxy/Adminhtml/Block/Page.php +0 -11
- app/code/local/BlockThatProxy/Proxy/Adminhtml/Block/System/Config/Edit.php +0 -59
- app/code/local/BlockThatProxy/Proxy/Block/Adminhtml/page.php +22 -0
- app/code/local/BlockThatProxy/Proxy/Block/Feed.php +133 -13
- app/code/local/BlockThatProxy/Proxy/Block/Order/Edit.php +86 -0
- app/code/local/BlockThatProxy/Proxy/Block/Order/Edit/Form.php +46 -0
- app/code/local/BlockThatProxy/Proxy/Block/Order/Edit/Tabs.php +108 -0
- app/code/local/BlockThatProxy/Proxy/Block/Order/Edit/Tabs/Deliveries.php +47 -0
- app/code/local/BlockThatProxy/Proxy/Block/Order/Edit/Tabs/Info.php +159 -0
- app/code/local/BlockThatProxy/Proxy/Block/Order/Edit/Tabs/ProductSelection.php +140 -0
- app/code/local/BlockThatProxy/Proxy/Block/Order/Edit/Tabs/Products.php +71 -0
- app/code/local/BlockThatProxy/Proxy/Block/Order/Edit/Tabs/SendToSupplier.php +49 -0
- app/code/local/BlockThatProxy/Proxy/Block/Order/Grid.php +123 -0
- app/code/local/BlockThatProxy/Proxy/Block/Order/New.php +55 -0
- app/code/local/BlockThatProxy/Proxy/Block/left.php +0 -8
- app/code/local/BlockThatProxy/Proxy/Helper/Data.php +19 -3
- app/code/local/BlockThatProxy/Proxy/Model/Config/Redirectpage.php +26 -0
- app/code/local/BlockThatProxy/Proxy/Model/Mysql4/Feed.php +1 -1
- app/code/local/BlockThatProxy/Proxy/Model/Mysql4/Feed/Collection.php +1 -1
- app/code/local/BlockThatProxy/Proxy/Model/Mysql4/Order.php +23 -0
- app/code/local/BlockThatProxy/Proxy/Model/Mysql4/Order/Collection.php +44 -0
- app/code/local/BlockThatProxy/Proxy/Model/Order.php +52 -0
- app/code/local/BlockThatProxy/Proxy/Model/Status.php +69 -0
- app/code/local/BlockThatProxy/Proxy/controllers/OrdersController.php +34 -0
- app/code/local/BlockThatProxy/Proxy/etc/config.xml +133 -100
- app/code/local/BlockThatProxy/Proxy/etc/system.xml +53 -18
- app/code/local/BlockThatProxy/Proxy/sql/proxy_setup/mysql4-install-0.1.0.php +25 -0
- app/code/local/BlockThatProxy/Proxy/sql/proxy_setup/mysql4-upgrade-0.1.0-0.2.0.php +19 -0
- app/design/adminhtml/default/default/layout/proxy.xml +9 -0
- app/design/adminhtml/default/default/template/proxy/Misc/Errors.phtml +42 -0
- app/design/adminhtml/default/default/template/proxy/Order/Edit/Tab/Deliveries.phtml +146 -0
- app/design/adminhtml/default/default/template/proxy/Order/Edit/Tab/Info.phtml +293 -0
- app/design/adminhtml/default/default/template/proxy/Order/Edit/Tab/ProductSelection.phtml +3 -0
- app/design/adminhtml/default/default/template/proxy/Order/Edit/Tab/Products.phtml +114 -0
- app/design/adminhtml/default/default/template/proxy/Order/Edit/Tab/SendToSupplier.phtml +30 -0
- app/design/adminhtml/default/default/template/proxy/Order/Grid.phtml +3 -0
- app/design/adminhtml/default/default/template/proxy/Order/ImportFromSupplyNeeds.phtml +181 -0
- app/design/adminhtml/default/default/template/proxy/Order/New.phtml +26 -0
- app/design/frontend/{default → base}/default/layout/proxy.xml +0 -0
- app/design/frontend/base/default/template/proxy/feed.phtml +15 -0
- app/design/frontend/default/default/template/proxy/feed.phtml +0 -5
- app/etc/modules/BlockThatProxy_Proxy.xml +1 -1
- package.xml +20 -10
@@ -1,11 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class BlockThatProxy_Proxy_Adminhtml_Block_Page extends Mage_Adminhtml_Block_Template
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
// get the original theme
|
9 |
-
$origTheme = Mage::getDesign()->getTheme('default');
|
10 |
-
}
|
11 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class BlockThatProxy_Proxy_Adminhtml_Block_System_Config_Edit extends Mage_Adminhtml_Block_System_Config_Edit
|
3 |
-
{
|
4 |
-
const DEFAULT_SECTION_BLOCK = 'adminhtml/system_config_form';
|
5 |
-
|
6 |
-
protected $_section;
|
7 |
-
|
8 |
-
public function __construct()
|
9 |
-
{
|
10 |
-
parent::__construct();
|
11 |
-
$this->setTemplate('system/config/edit.phtml');
|
12 |
-
|
13 |
-
$sectionCode = $this->getRequest()->getParam('section');
|
14 |
-
$sections = Mage::getSingleton('adminhtml/config')->getSections();
|
15 |
-
|
16 |
-
$this->_section = $sections->$sectionCode;
|
17 |
-
|
18 |
-
$this->setTitle((string)$this->_section->label);
|
19 |
-
}
|
20 |
-
|
21 |
-
protected function _prepareLayout()
|
22 |
-
{
|
23 |
-
$this->setChild('save_button',
|
24 |
-
$this->getLayout()->createBlock('adminhtml/widget_button')
|
25 |
-
->setData(array(
|
26 |
-
'label' => Mage::helper('adminhtml')->__('Save Config'),
|
27 |
-
'onclick' => 'configForm.submit()',
|
28 |
-
'class' => 'save',
|
29 |
-
))
|
30 |
-
);
|
31 |
-
|
32 |
-
return parent::_prepareLayout();
|
33 |
-
}
|
34 |
-
|
35 |
-
public function getSaveButtonHtml()
|
36 |
-
{
|
37 |
-
return $this->getChildHtml('save_button');
|
38 |
-
}
|
39 |
-
|
40 |
-
public function getSaveUrl()
|
41 |
-
{
|
42 |
-
return $this->getUrl('*/*/save', array('_current' => true));
|
43 |
-
}
|
44 |
-
|
45 |
-
public function initForm()
|
46 |
-
{
|
47 |
-
$blockName = (string)$this->_section->frontend_model;
|
48 |
-
if (empty($blockName)) {
|
49 |
-
$blockName = self::DEFAULT_SECTION_BLOCK;
|
50 |
-
}
|
51 |
-
$this->setChild('form',
|
52 |
-
$this->getLayout()
|
53 |
-
->createBlock($blockName)
|
54 |
-
->initForm()
|
55 |
-
);
|
56 |
-
return $this;
|
57 |
-
}
|
58 |
-
|
59 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
surcharge pour activer le theme mdn
|
5 |
+
*/
|
6 |
+
class BlockThatProxy_Proxy_Block_Adminhtml_Page extends Mage_Adminhtml_Block_Page
|
7 |
+
{
|
8 |
+
|
9 |
+
public function __construct()
|
10 |
+
{
|
11 |
+
parent::__construct();
|
12 |
+
|
13 |
+
//Active le theme mdn
|
14 |
+
Mage::getDesign()
|
15 |
+
->setTheme('mdn')
|
16 |
+
->setArea('adminhtml')
|
17 |
+
->setPackageName('default');
|
18 |
+
}
|
19 |
+
|
20 |
+
}
|
21 |
+
|
22 |
+
?>
|
@@ -1,41 +1,77 @@
|
|
1 |
<?php
|
|
|
2 |
class BlockThatProxy_Proxy_Block_Feed extends Mage_Core_Block_Template
|
3 |
{
|
4 |
-
public function retrieveFeed($orderId)
|
5 |
{
|
6 |
|
7 |
$ip=$_SERVER['REMOTE_ADDR'];
|
8 |
//$returnvalue=$this->check4proxy($data[0]['value']);
|
9 |
-
$XML_hashKey= '
|
10 |
-
$XML_bodyMess='
|
11 |
-
$XML_bodySub='
|
12 |
-
$XML_PATH_EMAIL_RECIPIENT = '
|
13 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
/***************************************************************/
|
15 |
|
16 |
$senderemail=Mage::getStoreConfig($XML_PATH_EMAIL_SENDER);
|
17 |
$Recieveremail=Mage::getStoreConfig($XML_PATH_EMAIL_RECIPIENT);
|
18 |
|
19 |
$bodyMess=Mage::getStoreConfig($XML_bodyMess);
|
|
|
|
|
20 |
$mailSub=Mage::getStoreConfig($XML_bodySub);
|
21 |
$hashKey=Mage::getStoreConfig($XML_hashKey);
|
|
|
22 |
|
23 |
$bodyMess=str_replace("[ORDERID]",$orderId,$bodyMess);
|
24 |
|
25 |
$bodyMess=str_replace("[IP]",$ip,$bodyMess);
|
26 |
-
|
|
|
|
|
|
|
27 |
|
28 |
/**************************************************************/
|
29 |
|
30 |
$returnvalue=$this->check4proxy($hashKey);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
if($returnvalue==true)
|
33 |
-
|
34 |
|
35 |
$mail = new Zend_Mail();
|
36 |
$mail->setBodyText($bodyMess);
|
37 |
|
38 |
-
$mail->setFrom($senderemail);
|
39 |
|
40 |
$mail->addTo($Recieveremail, 'BlockThatProxy');
|
41 |
$mail->setSubject($mailSub);
|
@@ -46,6 +82,26 @@ class BlockThatProxy_Proxy_Block_Feed extends Mage_Core_Block_Template
|
|
46 |
Mage::getSingleton('core/session')->addError('Unable to send email.');
|
47 |
|
48 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
}
|
@@ -82,13 +138,77 @@ class BlockThatProxy_Proxy_Block_Feed extends Mage_Core_Block_Template
|
|
82 |
curl_close($ch);
|
83 |
|
84 |
$proxy_level = intval(substr($contents, -2));
|
85 |
-
|
86 |
if ($proxy_level > 3)
|
87 |
return true;
|
88 |
else
|
89 |
return false;
|
90 |
}
|
91 |
-
|
92 |
-
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
}
|
1 |
<?php
|
2 |
+
|
3 |
class BlockThatProxy_Proxy_Block_Feed extends Mage_Core_Block_Template
|
4 |
{
|
5 |
+
public function retrieveFeed($orderId,$addcity,$countryName,$cname,$cemail,$incId)
|
6 |
{
|
7 |
|
8 |
$ip=$_SERVER['REMOTE_ADDR'];
|
9 |
//$returnvalue=$this->check4proxy($data[0]['value']);
|
10 |
+
$XML_hashKey= 'proxy/feed/blockthatproxy_hashkey';
|
11 |
+
$XML_bodyMess='proxy/feed/blockthatproxy_message';
|
12 |
+
$XML_bodySub='proxy/feed/blockthatproxy_subject';
|
13 |
+
$XML_PATH_EMAIL_RECIPIENT = 'proxy/feed/blockthatproxy_toemail';
|
14 |
+
$Proxydetected="Proxy Detected";
|
15 |
+
$XML_PATH_EMAIL_SENDER = 'proxy/feed/blockthatproxy_fromemail';
|
16 |
+
$XML_Redirect = 'proxy/feed/blockthatproxy_redirectpage';
|
17 |
+
$XML_RedirectEnable='proxy/feed/blockthatproxy_redirectpageenable';
|
18 |
+
|
19 |
+
$redirectPageE=Mage::getStoreConfig($XML_RedirectEnable);
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
/***************************************************************/
|
24 |
|
25 |
$senderemail=Mage::getStoreConfig($XML_PATH_EMAIL_SENDER);
|
26 |
$Recieveremail=Mage::getStoreConfig($XML_PATH_EMAIL_RECIPIENT);
|
27 |
|
28 |
$bodyMess=Mage::getStoreConfig($XML_bodyMess);
|
29 |
+
|
30 |
+
|
31 |
$mailSub=Mage::getStoreConfig($XML_bodySub);
|
32 |
$hashKey=Mage::getStoreConfig($XML_hashKey);
|
33 |
+
$rPage=Mage::getStoreConfig($XML_Redirect);
|
34 |
|
35 |
$bodyMess=str_replace("[ORDERID]",$orderId,$bodyMess);
|
36 |
|
37 |
$bodyMess=str_replace("[IP]",$ip,$bodyMess);
|
38 |
+
|
39 |
+
|
40 |
+
//$orderSuspect = Mage::getModel('proxy/status');
|
41 |
+
// $orderSuspect->setFraud($orderId);
|
42 |
|
43 |
/**************************************************************/
|
44 |
|
45 |
$returnvalue=$this->check4proxy($hashKey);
|
46 |
+
|
47 |
+
$distance=$this->checkDistanceApi($hashKey,$addcity,$countryName);
|
48 |
+
|
49 |
+
// Mage::getSingleton('');
|
50 |
+
/* $model
|
51 |
+
->po_order_id($orderId)
|
52 |
+
->po_flag("Flag")
|
53 |
+
->save();*/
|
54 |
+
|
55 |
+
if($distance>=0)
|
56 |
+
{
|
57 |
+
$bodyMess=str_replace("[Distance]",$distance,$bodyMess);
|
58 |
+
// $bodyMess.="\n Distance of the customer is :".$distance;
|
59 |
+
|
60 |
+
|
61 |
+
}else{
|
62 |
+
|
63 |
+
$bodyMess=str_replace("[Distance]",$distance,$bodyMess);
|
64 |
+
|
65 |
+
// $bodyMess.="\n Unable to calculate distance.";
|
66 |
+
}
|
67 |
|
68 |
if($returnvalue==true)
|
69 |
+
{
|
70 |
|
71 |
$mail = new Zend_Mail();
|
72 |
$mail->setBodyText($bodyMess);
|
73 |
|
74 |
+
// $mail->setFrom($senderemail);
|
75 |
|
76 |
$mail->addTo($Recieveremail, 'BlockThatProxy');
|
77 |
$mail->setSubject($mailSub);
|
82 |
Mage::getSingleton('core/session')->addError('Unable to send email.');
|
83 |
|
84 |
}
|
85 |
+
|
86 |
+
$orderSuspect = Mage::getModel('proxy/status');
|
87 |
+
$orderSuspect->setFraud($incId);
|
88 |
+
|
89 |
+
$model = mage::getModel('proxy/Order');
|
90 |
+
$distance=$distance."Km";
|
91 |
+
$model ->addnewProxy($orderId,$Proxydetected,$distance,$cemail,$cname,$countryName,$addcity);
|
92 |
+
if($redirectPageE==1)
|
93 |
+
{
|
94 |
+
|
95 |
+
header("Location:".$rPage);
|
96 |
+
exit();
|
97 |
+
/* if($rPage=="shoppingcart")
|
98 |
+
{
|
99 |
+
Mage::app()->getResponse()->setRedirect(Mage::getBaseUrl() . 'checkout/cart/');
|
100 |
+
}elseif($rPage=="homepage")
|
101 |
+
{
|
102 |
+
Mage::app()->getResponse()->setRedirect(Mage::getBaseUrl());
|
103 |
+
}*/
|
104 |
+
}
|
105 |
}
|
106 |
|
107 |
}
|
138 |
curl_close($ch);
|
139 |
|
140 |
$proxy_level = intval(substr($contents, -2));
|
141 |
+
|
142 |
if ($proxy_level > 3)
|
143 |
return true;
|
144 |
else
|
145 |
return false;
|
146 |
}
|
147 |
+
|
148 |
+
function checkDistanceApi($hash,$addcity,$countryName)
|
149 |
+
{
|
150 |
+
$headers = array();
|
151 |
+
|
152 |
+
foreach(array_keys($_SERVER) as $skey)
|
153 |
+
{
|
154 |
+
$headers[$skey] = $_SERVER[$skey];
|
155 |
+
}
|
156 |
+
$header_str='';
|
157 |
+
foreach ($headers as $header => $value)
|
158 |
+
{
|
159 |
+
|
160 |
+
if ($header == "REMOTE_ADDR")
|
161 |
+
{
|
162 |
+
$ip = "ip=".$value;
|
163 |
+
}
|
164 |
+
// $header_str .= $header."=".$value."~\n";
|
165 |
+
|
166 |
+
|
167 |
+
}
|
168 |
+
if(isset($addcity) && $addcity!="")
|
169 |
+
{
|
170 |
+
$cityparam=$addcity;
|
171 |
+
|
172 |
+
}else{
|
173 |
+
$cityparam="-";
|
174 |
+
}
|
175 |
+
|
176 |
+
if(isset($countryName) && $countryName!="")
|
177 |
+
{
|
178 |
+
$countryparam=$countryName;
|
179 |
+
|
180 |
+
}else{
|
181 |
+
$countryparam="-";
|
182 |
+
}
|
183 |
+
//echo $ip."<br />";
|
184 |
+
// echo $hash;
|
185 |
+
// $post_string = "address=".$cityparam.",".$countryparam."&ip=".$ip."&hash=".$hash;
|
186 |
+
//echo $post_string;
|
187 |
+
//$post_string = "address=Delhi,India&ip=123.236.63.222&hash=94370CC0C8C000FEF4D7FD4D0BF389EB8E186119";
|
188 |
+
//address=Delhi,India&ip=ip=123.236.63.222&hash=94370CC0C8C000FEF4D7FD4D0BF389EB8E186119-
|
189 |
+
$post_string = "address=".$cityparam.",".$countryparam."&".$ip."&hash=".$hash;
|
190 |
+
$ch = curl_init();
|
191 |
+
curl_setopt($ch, CURLOPT_URL, "http://www.blockthatproxy.com/detect_distance.aspx");
|
192 |
+
curl_setopt($ch, CURLOPT_POST, 1);
|
193 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
|
194 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
195 |
+
curl_setopt($ch, CURLOPT_USERAGENT, "");
|
196 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
|
197 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
198 |
+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
199 |
+
curl_setopt($ch, CURLOPT_HEADER, true);
|
200 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
201 |
+
$contents = curl_exec($ch);
|
202 |
+
curl_close($ch);
|
203 |
+
$lines = explode("\n",$contents);
|
204 |
+
foreach($lines as $line){
|
205 |
+
$lastline=$line;
|
206 |
+
//echo $line;
|
207 |
+
}
|
208 |
+
$distance =$lastline;
|
209 |
+
if ($distance >= 0)
|
210 |
+
return $distance;
|
211 |
+
else
|
212 |
+
return -1;
|
213 |
+
}
|
214 |
}
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
class BlockThatProxy_Proxy_Block_Order_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
16 |
+
{
|
17 |
+
private $_order;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Constructeur: on charge le devis
|
21 |
+
*
|
22 |
+
*/
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->_objectId = 'id';
|
26 |
+
$this->_controller = 'order';
|
27 |
+
$this->_blockGroup = 'Proxy';
|
28 |
+
|
29 |
+
parent::__construct();
|
30 |
+
|
31 |
+
$this->_addButton(
|
32 |
+
'print',
|
33 |
+
array(
|
34 |
+
'label' => Mage::helper('proxy')->__('Print'),
|
35 |
+
'onclick' => "window.location.href='".$this->getUrl('Proxy/Orders/Print').'po_num/'.$this->getOrder()->getId()."'",
|
36 |
+
'level' => -1
|
37 |
+
)
|
38 |
+
);
|
39 |
+
|
40 |
+
$this->_addButton(
|
41 |
+
'import',
|
42 |
+
array(
|
43 |
+
'label' => Mage::helper('proxy')->__('Import from Supply Needs'),
|
44 |
+
'onclick' => "window.open('".$this->getUrl('Proxy/Orders/ImportFromSupplyNeeds', array('po_num' => $this->getOrder()->getId()))."', '');",
|
45 |
+
'level' => -1
|
46 |
+
)
|
47 |
+
);
|
48 |
+
|
49 |
+
$this->_addButton(
|
50 |
+
'delete',
|
51 |
+
array(
|
52 |
+
'label' => Mage::helper('proxy')->__('Delete'),
|
53 |
+
'onclick' => "if (window.confirm('".Mage::helper('proxy')->__('Are you sure ?')."')) {document.location.href='".$this->getUrl('Proxy/Orders/delete', array('po_num' => $this->getOrder()->getId()))."';}",
|
54 |
+
'level' => -1,
|
55 |
+
'class' => 'delete'
|
56 |
+
)
|
57 |
+
);
|
58 |
+
}
|
59 |
+
|
60 |
+
public function getHeaderText()
|
61 |
+
{
|
62 |
+
return $this->__('Proxy Order #').$this->getOrder()->getpo_order_id();
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Retourne l'url pour retourner a la liste des manufacturers
|
67 |
+
*/
|
68 |
+
public function GetBackUrl()
|
69 |
+
{
|
70 |
+
return $this->getUrl('Proxy/Orders/List', array());
|
71 |
+
}
|
72 |
+
|
73 |
+
public function getOrder()
|
74 |
+
{
|
75 |
+
if ($this->_order == null)
|
76 |
+
{
|
77 |
+
$this->_order = mage::getModel('Proxy/Order')->load($this->getRequest()->getParam('po_num'));
|
78 |
+
}
|
79 |
+
return $this->_order;
|
80 |
+
}
|
81 |
+
|
82 |
+
public function getSaveUrl()
|
83 |
+
{
|
84 |
+
return $this->getUrl('Proxy/Orders/Save');
|
85 |
+
}
|
86 |
+
}
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 Mage
|
22 |
+
* @package Mage_Adminhtml
|
23 |
+
* @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Adminhtml cms page edit form block
|
30 |
+
*
|
31 |
+
* @category Mage
|
32 |
+
* @package Mage_Adminhtml
|
33 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
34 |
+
*/
|
35 |
+
class BlockThatProxy_Proxy_Block_Order_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
36 |
+
{
|
37 |
+
|
38 |
+
protected function _prepareForm()
|
39 |
+
{
|
40 |
+
$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
|
41 |
+
$form->setUseContainer(true);
|
42 |
+
$this->setForm($form);
|
43 |
+
return parent::_prepareForm();
|
44 |
+
}
|
45 |
+
|
46 |
+
}
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 Mage
|
22 |
+
* @package Mage_Adminhtml
|
23 |
+
* @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* admin product edit tabs
|
29 |
+
*
|
30 |
+
* @category Mage
|
31 |
+
* @package Mage_Adminhtml
|
32 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
+
*/
|
34 |
+
class BlockThatProxy_Proxy_Block_Order_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
35 |
+
{
|
36 |
+
private $_proxyOrder = null;
|
37 |
+
|
38 |
+
public function __construct()
|
39 |
+
{
|
40 |
+
parent::__construct();
|
41 |
+
$this->setId('proxy_order_tabs');
|
42 |
+
$this->setDestElementId('edit_form');
|
43 |
+
$this->setTitle('');
|
44 |
+
}
|
45 |
+
|
46 |
+
protected function _beforeToHtml()
|
47 |
+
{
|
48 |
+
$product = $this->getProduct();
|
49 |
+
|
50 |
+
$this->addTab('tab_info', array(
|
51 |
+
'label' => Mage::helper('proxy')->__('Summary'),
|
52 |
+
'content' => $this->getLayout()->createBlock('Proxy/Order_Edit_Tabs_Info')->toHtml(),
|
53 |
+
));
|
54 |
+
|
55 |
+
$this->addTab('tab_products', array(
|
56 |
+
'label' => Mage::helper('proxy')->__('Products'),
|
57 |
+
'content' => $this->getLayout()->createBlock('Proxy/Order_Edit_Tabs_Products')->toHtml(),
|
58 |
+
));
|
59 |
+
|
60 |
+
if ($this->getProxyOrder()->getpo_status() == BlockThatProxy_Proxy_Model_Order::STATUS_WAITING_FOR_DELIVERY)
|
61 |
+
{
|
62 |
+
$this->addTab('tab_deliveries', array(
|
63 |
+
'label' => Mage::helper('proxy')->__('Deliveries'),
|
64 |
+
'content' => $this->getLayout()->createBlock('Proxy/Order_Edit_Tabs_Deliveries')->toHtml(),
|
65 |
+
));
|
66 |
+
}
|
67 |
+
|
68 |
+
if ($this->getProxyOrder()->getpo_status() == BlockThatProxy_Proxy_Model_Order::STATUS_NEW)
|
69 |
+
{
|
70 |
+
$this->addTab('tab_add_products', array(
|
71 |
+
'label' => Mage::helper('proxy')->__('Add Products'),
|
72 |
+
'url' => $this->getUrl('*/*/ProductSelectionGrid', array('_current'=>true, 'po_num' => $this->getProxyOrder()->getId())),
|
73 |
+
'class' => 'ajax',
|
74 |
+
));
|
75 |
+
}
|
76 |
+
|
77 |
+
if ($this->getProxyOrder()->getpo_status() != BlockThatProxy_Proxy_Model_Order::STATUS_COMPLETE)
|
78 |
+
{
|
79 |
+
$this->addTab('tab_send_to_supplier', array(
|
80 |
+
'label' => Mage::helper('proxy')->__('Send to supplier'),
|
81 |
+
'content' => $this->getLayout()->createBlock('Proxy/Order_Edit_Tabs_SendToSupplier')->setOrderId($this->getProxyOrder()->getId())->toHtml(),
|
82 |
+
));
|
83 |
+
}
|
84 |
+
|
85 |
+
//set active tab
|
86 |
+
$defaultTab = $this->getRequest()->getParam('tab');
|
87 |
+
if ($defaultTab == null)
|
88 |
+
$defaultTab = 'tab_info';
|
89 |
+
$this->setActiveTab($defaultTab);
|
90 |
+
|
91 |
+
return parent::_beforeToHtml();
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Retrive product object from object if not from registry
|
96 |
+
*
|
97 |
+
* @return Mage_Catalog_Model_Product
|
98 |
+
*/
|
99 |
+
public function getProxyOrder()
|
100 |
+
{
|
101 |
+
if ($this->_proxyOrder == null)
|
102 |
+
{
|
103 |
+
$this->_proxyOrder = mage::getModel('Proxy/Order')->load($this->getRequest()->getParam('po_num'));
|
104 |
+
}
|
105 |
+
return $this->_proxyOrder;
|
106 |
+
}
|
107 |
+
|
108 |
+
}
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
class BlockThatProxy_Proxy_Block_Order_Edit_Tabs_Deliveries extends Mage_Adminhtml_Block_Widget_Form
|
16 |
+
{
|
17 |
+
private $_order = null;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Constructeur: on charge
|
21 |
+
*
|
22 |
+
*/
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
|
26 |
+
parent::__construct();
|
27 |
+
|
28 |
+
$this->setTemplate('Proxy/Order/Edit/Tab/Deliveries.phtml');
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Retourne l'objet
|
34 |
+
*
|
35 |
+
* @return unknown
|
36 |
+
*/
|
37 |
+
public function getOrder()
|
38 |
+
{
|
39 |
+
if ($this->_order == null)
|
40 |
+
{
|
41 |
+
$po_num = Mage::app()->getRequest()->getParam('po_num', false);
|
42 |
+
$model = Mage::getModel('Proxy/Order');
|
43 |
+
$this->_order = $model->load($po_num);
|
44 |
+
}
|
45 |
+
return $this->_order;
|
46 |
+
}
|
47 |
+
}
|
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
class BlockThatProxy_Proxy_Block_Order_Edit_Tabs_Info extends Mage_Adminhtml_Block_Widget_Form
|
16 |
+
{
|
17 |
+
|
18 |
+
private $_order = null;
|
19 |
+
private $_supplier = null;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Constructeur: on charge
|
23 |
+
*
|
24 |
+
*/
|
25 |
+
public function __construct()
|
26 |
+
{
|
27 |
+
|
28 |
+
$this->_blockGroup = 'Proxy';
|
29 |
+
$this->_objectId = 'id';
|
30 |
+
$this->_controller = 'order';
|
31 |
+
|
32 |
+
parent::__construct();
|
33 |
+
|
34 |
+
//charge le manufacturer
|
35 |
+
$po_num = Mage::app()->getRequest()->getParam('po_num', false);
|
36 |
+
$model = Mage::getModel('Proxy/Order');
|
37 |
+
$this->_order = $model->load($po_num);
|
38 |
+
$this->_supplier = mage::getModel('Proxy/Supplier')->load($this->_order->getpo_sup_num());
|
39 |
+
|
40 |
+
$this->setTemplate('Proxy/Order/Edit/Tab/Info.phtml');
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Retourne l'url pour delete
|
45 |
+
*
|
46 |
+
*/
|
47 |
+
public function getDeleteUrl()
|
48 |
+
{
|
49 |
+
return $this->getUrl('Proxy/Orders/Delete').'po_num/'.$this->getOrder()->getId();
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Retourne l'objet
|
54 |
+
*
|
55 |
+
* @return unknown
|
56 |
+
*/
|
57 |
+
public function getOrder()
|
58 |
+
{
|
59 |
+
return $this->_order;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Retourne le fournisseur
|
64 |
+
*
|
65 |
+
*/
|
66 |
+
public function getSupplier()
|
67 |
+
{
|
68 |
+
return $this->_supplier;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Retourne la liste des devises sous la forme d'un combo
|
73 |
+
*
|
74 |
+
* @param unknown_type $name
|
75 |
+
* @param unknown_type $value
|
76 |
+
*/
|
77 |
+
public function getCurrencyAsCombo($name = 'currency', $value = '')
|
78 |
+
{
|
79 |
+
$retour = '<select id="'.$name.'" name="'.$name.'">';
|
80 |
+
$collection = Mage::app()->getLocale()->getOptionAllCurrencies();
|
81 |
+
foreach($collection as $item)
|
82 |
+
{
|
83 |
+
if ($value == $item['value'])
|
84 |
+
$selected = ' selected ';
|
85 |
+
else
|
86 |
+
$selected = '';
|
87 |
+
$retour .= '<option value="'.$item['value'].'" '.$selected.'>'.$item['label'].'</option>';
|
88 |
+
}
|
89 |
+
$retour .= '</select>';
|
90 |
+
return $retour;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Retourne la liste des transporteur sous la forme d'un combo
|
95 |
+
*
|
96 |
+
* @param unknown_type $name
|
97 |
+
* @param unknown_type $value
|
98 |
+
*/
|
99 |
+
public function getCarriersAsCombo($name = 'carriers', $value = '')
|
100 |
+
{
|
101 |
+
$retour = '<select id="'.$name.'" name="'.$name.'">';
|
102 |
+
$collection = split(',', Mage::getStoreConfig('proxy/configuration/order_carrier'));
|
103 |
+
foreach($collection as $item)
|
104 |
+
{
|
105 |
+
if (strtolower($value) == strtolower($item))
|
106 |
+
$selected = ' selected ';
|
107 |
+
else
|
108 |
+
$selected = '';
|
109 |
+
$retour .= '<option value="'.$item.'" '.$selected.'>'.$item.'</option>';
|
110 |
+
}
|
111 |
+
$retour .= '</select>';
|
112 |
+
return $retour;
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Retourne la liste des modes de paiement sous la forme d'un combo
|
117 |
+
*
|
118 |
+
* @param unknown_type $name
|
119 |
+
* @param unknown_type $value
|
120 |
+
*/
|
121 |
+
public function getPaymentModeAsCombo($name = 'carriers', $value = '')
|
122 |
+
{
|
123 |
+
$retour = '<select id="'.$name.'" name="'.$name.'">';
|
124 |
+
$collection = split(',', Mage::getStoreConfig('proxy/configuration/order_payment_method'));
|
125 |
+
foreach($collection as $item)
|
126 |
+
{
|
127 |
+
if (strtolower($value) == strtolower($item))
|
128 |
+
$selected = ' selected ';
|
129 |
+
else
|
130 |
+
$selected = '';
|
131 |
+
$retour .= '<option value="'.$item.'" '.$selected.'>'.$item.'</option>';
|
132 |
+
}
|
133 |
+
$retour .= '</select>';
|
134 |
+
return $retour;
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Return statuses as combo
|
139 |
+
*
|
140 |
+
* @param unknown_type $name
|
141 |
+
* @param unknown_type $value
|
142 |
+
*/
|
143 |
+
public function getStatusAsCombo($name, $defaultValue = '')
|
144 |
+
{
|
145 |
+
$retour = '<select id="'.$name.'" name="'.$name.'">';
|
146 |
+
$statuses = $this->getOrder()->getStatuses();
|
147 |
+
foreach($statuses as $key => $value)
|
148 |
+
{
|
149 |
+
if ($key == $defaultValue)
|
150 |
+
$selected = ' selected ';
|
151 |
+
else
|
152 |
+
$selected = '';
|
153 |
+
$retour .= '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
|
154 |
+
}
|
155 |
+
$retour .= '</select>';
|
156 |
+
return $retour;
|
157 |
+
|
158 |
+
}
|
159 |
+
}
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
class BlockThatProxy_Proxy_Block_Order_Edit_Tabs_ProductSelection extends Mage_Adminhtml_Block_Widget_Grid
|
16 |
+
{
|
17 |
+
private $_order = null;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* D�finit l'order
|
21 |
+
*
|
22 |
+
*/
|
23 |
+
public function setOrderId($value)
|
24 |
+
{
|
25 |
+
$this->_order = mage::getModel('Proxy/Order')->load($value);
|
26 |
+
return $this;
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Retourne la commande
|
31 |
+
*
|
32 |
+
*/
|
33 |
+
public function getOrder()
|
34 |
+
{
|
35 |
+
return $this->_order;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function __construct()
|
39 |
+
{
|
40 |
+
parent::__construct();
|
41 |
+
$this->setId('ProductSelection');
|
42 |
+
//$this->_parentTemplate = $this->getTemplate();
|
43 |
+
//$this->setSaveParametersInSession(true);
|
44 |
+
$this->setUseAjax(true);
|
45 |
+
//$this->setVarNameFilter('product_selection');
|
46 |
+
//$this->setTemplate('Shipping/List.phtml');
|
47 |
+
$this->setEmptyText('Aucun elt');
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Charge la collection des devis
|
52 |
+
*
|
53 |
+
* @return unknown
|
54 |
+
*/
|
55 |
+
protected function _prepareCollection()
|
56 |
+
{
|
57 |
+
$allowProductTypes = array();
|
58 |
+
$allowProductTypes[] = 'simple';
|
59 |
+
$allowProductTypes[] = 'virtual';
|
60 |
+
|
61 |
+
$alreadyAddedProducts = array();
|
62 |
+
foreach ($this->getOrder()->getProducts() as $item)
|
63 |
+
{
|
64 |
+
$alreadyAddedProducts[] = $item->getpop_product_id();
|
65 |
+
}
|
66 |
+
|
67 |
+
$collection = Mage::getModel('catalog/product')
|
68 |
+
->getCollection()
|
69 |
+
->addAttributeToSelect('name')
|
70 |
+
->addAttributeToSelect('manufacturer')
|
71 |
+
->addFieldToFilter('type_id', $allowProductTypes);
|
72 |
+
|
73 |
+
if (count($alreadyAddedProducts) > 0)
|
74 |
+
$collection->addFieldToFilter('entity_id', array('nin' => $alreadyAddedProducts));
|
75 |
+
|
76 |
+
$this->setCollection($collection);
|
77 |
+
return parent::_prepareCollection();
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* D�fini les colonnes du grid
|
82 |
+
*
|
83 |
+
* @return unknown
|
84 |
+
*/
|
85 |
+
protected function _prepareColumns()
|
86 |
+
{
|
87 |
+
|
88 |
+
$this->addColumn('in_products', array(
|
89 |
+
'header_css_class' => 'a-center',
|
90 |
+
'type' => 'checkbox',
|
91 |
+
'name' => 'in_products',
|
92 |
+
'values' => $this->getSelectedProducts(),
|
93 |
+
'align' => 'center',
|
94 |
+
'index' => 'entity_id'
|
95 |
+
));
|
96 |
+
|
97 |
+
$this->addColumn('entity_id', array(
|
98 |
+
'header' => Mage::helper('catalog')->__('ID'),
|
99 |
+
'sortable' => true,
|
100 |
+
'width' => '60px',
|
101 |
+
'index' => 'entity_id'
|
102 |
+
));
|
103 |
+
|
104 |
+
$this->addColumn('Sku', array(
|
105 |
+
'header'=> Mage::helper('proxy')->__('Sku'),
|
106 |
+
'index' => 'sku',
|
107 |
+
));
|
108 |
+
|
109 |
+
$this->addColumn('Name', array(
|
110 |
+
'header'=> Mage::helper('proxy')->__('Name'),
|
111 |
+
'index' => 'name'
|
112 |
+
));
|
113 |
+
|
114 |
+
$this->addColumn('qty', array(
|
115 |
+
'header' => Mage::helper('proxy')->__('Qty'),
|
116 |
+
'name' => 'qty',
|
117 |
+
'type' => 'number',
|
118 |
+
'index' => 'qty',
|
119 |
+
'width' => '70',
|
120 |
+
'editable' => true,
|
121 |
+
'edit_only' => false
|
122 |
+
));
|
123 |
+
|
124 |
+
return parent::_prepareColumns();
|
125 |
+
}
|
126 |
+
|
127 |
+
public function getGridUrl()
|
128 |
+
{
|
129 |
+
return $this->getData('grid_url') ? $this->getData('grid_url') : $this->getUrl('*/*/ProductSelectionGrid', array('_current'=>true, 'po_num' => $this->getOrder()->getId()));
|
130 |
+
}
|
131 |
+
|
132 |
+
public function getSelectedProducts()
|
133 |
+
{
|
134 |
+
$products = $this->getRequest()->getPost('products', null);
|
135 |
+
if (!is_array($products)) {
|
136 |
+
$products = array();
|
137 |
+
}
|
138 |
+
return $products;
|
139 |
+
}
|
140 |
+
}
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
class BlockThatProxy_Proxy_Block_Order_Edit_Tabs_Products extends Mage_Adminhtml_Block_Widget_Form
|
16 |
+
{
|
17 |
+
private $_order = null;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Constructeur: on charge
|
21 |
+
*
|
22 |
+
*/
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
|
26 |
+
parent::__construct();
|
27 |
+
|
28 |
+
$this->setTemplate('Proxy/Order/Edit/Tab/Products.phtml');
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Retourne l'objet
|
34 |
+
*
|
35 |
+
* @return unknown
|
36 |
+
*/
|
37 |
+
public function getOrder()
|
38 |
+
{
|
39 |
+
if ($this->_order == null)
|
40 |
+
{
|
41 |
+
$po_num = Mage::app()->getRequest()->getParam('po_num', false);
|
42 |
+
$model = Mage::getModel('Proxy/Order');
|
43 |
+
$this->_order = $model->load($po_num);
|
44 |
+
}
|
45 |
+
return $this->_order;
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Retourne la liste des produits de la commande
|
50 |
+
*
|
51 |
+
*/
|
52 |
+
public function getProducts()
|
53 |
+
{
|
54 |
+
return $this->getOrder()->getProducts();
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Retourne le dernier prix d'achat sans frais d'approche pour un produit
|
59 |
+
*
|
60 |
+
* @param unknown_type $ProductId
|
61 |
+
*/
|
62 |
+
public function GetLastPriceWithoutFees($ProductId)
|
63 |
+
{
|
64 |
+
$sql = 'select pop_price_ht_base from '.mage::getModel('Proxy/Constant')->getTablePrefix().'proxy_order_product, '.mage::getModel('Proxy/Constant')->getTablePrefix().'proxy_order where pop_order_num = po_num and po_status = \''.BlockThatProxy_Proxy_Model_Order::STATUS_COMPLETE.'\' and pop_price_ht_base > 0 and pop_product_id = '.$ProductId.' order by po_num DESC LIMIT 1';
|
65 |
+
$retour = mage::getResourceModel('sales/order_item_collection')->getConnection()->fetchOne($sql);
|
66 |
+
$retour = number_format($retour, 2);
|
67 |
+
return $retour;
|
68 |
+
}
|
69 |
+
|
70 |
+
}
|
71 |
+
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
class BlockThatProxy_Proxy_Block_Order_Edit_Tabs_SendToSupplier extends Mage_Adminhtml_Block_Widget_Form
|
16 |
+
{
|
17 |
+
private $_order = null;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Constructeur: on charge le devis
|
21 |
+
*
|
22 |
+
*/
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
parent::__construct();
|
26 |
+
|
27 |
+
$this->setTemplate('Proxy/Order/Edit/Tab/SendToSupplier.phtml');
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* D�finit l'order
|
32 |
+
*
|
33 |
+
*/
|
34 |
+
public function setOrderId($value)
|
35 |
+
{
|
36 |
+
$this->_order = mage::getModel('Proxy/Order')->load($value);
|
37 |
+
return $this;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Retourne la commande
|
42 |
+
*
|
43 |
+
*/
|
44 |
+
public function getOrder()
|
45 |
+
{
|
46 |
+
return $this->_order;
|
47 |
+
}
|
48 |
+
|
49 |
+
}
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
class BlockThatProxy_Proxy_Block_Order_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
16 |
+
{
|
17 |
+
|
18 |
+
|
19 |
+
public function __construct()
|
20 |
+
{
|
21 |
+
parent::__construct();
|
22 |
+
// $this->setId('OrderGrid');
|
23 |
+
$this->_parentTemplate = $this->getTemplate();
|
24 |
+
$this->setVarNameFilter('proxy_order');
|
25 |
+
//$this->setTemplate('Shipping/List.phtml');
|
26 |
+
$this->setEmptyText('No Proxy Record Found');
|
27 |
+
|
28 |
+
$this->setDefaultSort('po_order_id', 'desc');
|
29 |
+
$this->setSaveParametersInSession(true);
|
30 |
+
}
|
31 |
+
/**
|
32 |
+
* Charge la collection des devis
|
33 |
+
*
|
34 |
+
* @return unknown
|
35 |
+
*/
|
36 |
+
protected function _prepareCollection()
|
37 |
+
{
|
38 |
+
$collection = Mage::getModel('proxy/Order')
|
39 |
+
->getCollection();
|
40 |
+
$this->setCollection($collection);
|
41 |
+
return parent::_prepareCollection();
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* D�fini les colonnes du grid
|
46 |
+
*
|
47 |
+
* @return unknown
|
48 |
+
*/
|
49 |
+
protected function _prepareColumns()
|
50 |
+
{
|
51 |
+
|
52 |
+
$this->addColumn('po_order_id', array(
|
53 |
+
'header'=> Mage::helper('proxy')->__('OrderId'),
|
54 |
+
'index' => 'po_order_id',
|
55 |
+
'type' => 'text',
|
56 |
+
));
|
57 |
+
|
58 |
+
$this->addColumn('country', array(
|
59 |
+
'header'=> Mage::helper('proxy')->__('Country'),
|
60 |
+
'index' => 'country',
|
61 |
+
|
62 |
+
|
63 |
+
));
|
64 |
+
|
65 |
+
$this->addColumn('city', array(
|
66 |
+
'header'=> Mage::helper('proxy')->__('City'),
|
67 |
+
'index' => 'city',
|
68 |
+
|
69 |
+
));
|
70 |
+
|
71 |
+
$this->addColumn('distance', array(
|
72 |
+
'header'=> Mage::helper('proxy')->__('Distance'),
|
73 |
+
'default' => '--',
|
74 |
+
'index' => 'distance',
|
75 |
+
|
76 |
+
));
|
77 |
+
|
78 |
+
$this->addColumn('name', array(
|
79 |
+
'header'=> Mage::helper('proxy')->__('Name'),
|
80 |
+
'index' => 'name',
|
81 |
+
|
82 |
+
));
|
83 |
+
|
84 |
+
$this->addColumn('email', array(
|
85 |
+
'header'=> Mage::helper('proxy')->__('Email'),
|
86 |
+
'index' => 'email',
|
87 |
+
|
88 |
+
));
|
89 |
+
|
90 |
+
$this->addColumn('po_flag', array(
|
91 |
+
'header'=> Mage::helper('proxy')->__('Proxy Detected'),
|
92 |
+
'index' => 'po_flag',
|
93 |
+
|
94 |
+
));
|
95 |
+
|
96 |
+
|
97 |
+
|
98 |
+
return parent::_prepareColumns();
|
99 |
+
}
|
100 |
+
|
101 |
+
public function getRowUrl($row)
|
102 |
+
{
|
103 |
+
//return Mage::helper("adminhtml")->getUrl("sales_order/view",array('order_id' => $row->getpo_order_id()));
|
104 |
+
return $this->getUrl('adminhtml/sales_order/view', array('order_id' => $row->getpo_order_id()));
|
105 |
+
|
106 |
+
// return $this->getUrl('/sales_order/view', array('order_id' => $row->getpo_order_id()));
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
public function getGridUrl()
|
111 |
+
{
|
112 |
+
return '';
|
113 |
+
}
|
114 |
+
|
115 |
+
public function getGridParentHtml()
|
116 |
+
{
|
117 |
+
|
118 |
+
$templateName = Mage::getDesign()->getTemplateFilename($this->_parentTemplate, array('_relative'=>true));
|
119 |
+
return $this->fetchView($templateName);
|
120 |
+
}
|
121 |
+
|
122 |
+
|
123 |
+
}
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
class BlockThatProxy_Proxy_Block_Order_New extends Mage_Adminhtml_Block_Widget_Form
|
16 |
+
{
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Constructeur: on charge le devis
|
20 |
+
*
|
21 |
+
*/
|
22 |
+
public function __construct()
|
23 |
+
{
|
24 |
+
parent::__construct();
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Retourne l'url pour retourner a la liste des commandes
|
30 |
+
*/
|
31 |
+
public function GetBackUrl()
|
32 |
+
{
|
33 |
+
return $this->getUrl('Proxy/Orders/List', array());
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Retourne la liste des fournisseur ssous la forme d'un combo
|
38 |
+
*/
|
39 |
+
public function getSuppliersAsCombo($name='supplier')
|
40 |
+
{
|
41 |
+
$retour = '<select id="'.$name.'" name="'.$name.'">';
|
42 |
+
|
43 |
+
//charge la liste des pays
|
44 |
+
$collection = Mage::getModel('Proxy/Supplier')
|
45 |
+
->getCollection()
|
46 |
+
->setOrder('sup_name', 'asc');
|
47 |
+
foreach ($collection as $item)
|
48 |
+
{
|
49 |
+
$retour .= '<option value="'.$item->getsup_id().'">'.$item->getsup_name().'</option>';
|
50 |
+
}
|
51 |
+
|
52 |
+
$retour .= '</select>';
|
53 |
+
return $retour;
|
54 |
+
}
|
55 |
+
}
|
@@ -1,8 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class BlockThatProxy_Proxy_Block_left extends Mage_Core_Block_Template{
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,5 +1,21 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
{
|
5 |
-
}
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
class BlockThatProxy_Proxy_Helper_Data extends Mage_Core_Helper_Abstract
|
16 |
+
{
|
17 |
+
|
18 |
+
|
19 |
+
}
|
20 |
|
21 |
+
?>
|
|
|
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
class BlockThatProxy_Proxy_Model_Config_Redirectpage
|
16 |
+
{
|
17 |
+
|
18 |
+
public function toOptionArray()
|
19 |
+
{
|
20 |
+
return array(
|
21 |
+
array('value'=>'shoppingcart', 'label'=>Mage::helper('adminhtml')->__('Shoppingcart')),
|
22 |
+
array('value'=>'homepage', 'label'=>Mage::helper('adminhtml')->__('HomePage')),
|
23 |
+
);
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
@@ -4,6 +4,6 @@
|
|
4 |
{
|
5 |
protected function _construct()
|
6 |
{
|
7 |
-
$this->_init('
|
8 |
}
|
9 |
}
|
4 |
{
|
5 |
protected function _construct()
|
6 |
{
|
7 |
+
$this->_init('proxy/feed', 'item_id');
|
8 |
}
|
9 |
}
|
@@ -5,7 +5,7 @@
|
|
5 |
protected function _construct()
|
6 |
{
|
7 |
parent::_construct();
|
8 |
-
$this->_init('
|
9 |
}
|
10 |
|
11 |
}
|
5 |
protected function _construct()
|
6 |
{
|
7 |
parent::_construct();
|
8 |
+
$this->_init('proxy/feed');
|
9 |
}
|
10 |
|
11 |
}
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
class BlockThatProxy_Proxy_Model_Mysql4_Order extends Mage_Core_Model_Mysql4_Abstract
|
16 |
+
{
|
17 |
+
public function _construct()
|
18 |
+
{
|
19 |
+
|
20 |
+
$this->_init('proxy/Order', 'po_num');
|
21 |
+
}
|
22 |
+
}
|
23 |
+
?>
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
/**
|
16 |
+
* Collection de quotation
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
class BlockThatProxy_Proxy_Model_Mysql4_Order_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
20 |
+
{
|
21 |
+
public function _construct()
|
22 |
+
{
|
23 |
+
parent::_construct();
|
24 |
+
$this->_init('proxy/Order');
|
25 |
+
}
|
26 |
+
|
27 |
+
public function getFullList()
|
28 |
+
{
|
29 |
+
|
30 |
+
$this->getSelect()
|
31 |
+
->join('proxy_supplier', 'po_sup_num=sup_id')
|
32 |
+
->joinLeft('proxy_order_product', 'po_num=pop_order_num', array('SUM(pop_qty-pop_supplied_qty)'=>'SUM(pop_qty-pop_supplied_qty)'))
|
33 |
+
->group('po_num');
|
34 |
+
|
35 |
+
return $this;
|
36 |
+
}
|
37 |
+
|
38 |
+
|
39 |
+
public function getSelect()
|
40 |
+
{
|
41 |
+
return $this->_select;
|
42 |
+
}
|
43 |
+
|
44 |
+
}
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
class BlockThatProxy_Proxy_Model_Order extends Mage_Core_Model_Abstract
|
16 |
+
{
|
17 |
+
|
18 |
+
private $_products = null;
|
19 |
+
private $_currency = null;
|
20 |
+
|
21 |
+
|
22 |
+
/*****************************************************************************************************************************
|
23 |
+
* ***************************************************************************************************************************
|
24 |
+
* Constructeur
|
25 |
+
*
|
26 |
+
*/
|
27 |
+
public function _construct()
|
28 |
+
{
|
29 |
+
parent::_construct();
|
30 |
+
$this->_init('proxy/Order');
|
31 |
+
}
|
32 |
+
|
33 |
+
public function addnewProxy($orderId,$Proxydetected,$distance,$email,$name,$country,$city)
|
34 |
+
{
|
35 |
+
|
36 |
+
mage::getModel('proxy/Order')
|
37 |
+
->setpo_order_id($orderId)
|
38 |
+
->setpo_flag($Proxydetected)
|
39 |
+
->setdistance($distance)
|
40 |
+
->setemail($email)
|
41 |
+
->setname($name)
|
42 |
+
->setcountry($country)
|
43 |
+
->setcity($city)
|
44 |
+
->save();
|
45 |
+
|
46 |
+
}
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
|
52 |
+
}
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class BlockThatProxy_Proxy_Model_Status extends Mage_Adminhtml_Block_Sales_Order_Grid
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
}
|
10 |
+
|
11 |
+
public function setFraud($orderID)
|
12 |
+
{
|
13 |
+
$w = Mage::getSingleton('core/resource')->getConnection('core_write');
|
14 |
+
$tableName = Mage::getSingleton('core/resource')->getTableName('sales_flat_order_grid');
|
15 |
+
|
16 |
+
|
17 |
+
// $w->query("UPDATE `{$tableName}` SET status='fraud' WHERE `increment_id`={$orderID}");
|
18 |
+
$w->query("UPDATE `{$tableName}` SET status='fraud' WHERE `increment_id`={$orderID}");
|
19 |
+
|
20 |
+
|
21 |
+
// $this->load($orderID);
|
22 |
+
|
23 |
+
///$this->setState('fraud',true);
|
24 |
+
// $this->save();
|
25 |
+
//echo "sdfsdfs";
|
26 |
+
/*$order = Mage::getModel('sales/order')
|
27 |
+
->load($orderId);
|
28 |
+
echo $order->getId()."Lalit";
|
29 |
+
$data = array('status'=>'fraud');
|
30 |
+
|
31 |
+
$model = $order->addData($data);*/
|
32 |
+
|
33 |
+
|
34 |
+
/*$myShipment=Mage::getModel('sales/order');
|
35 |
+
$myShipment->setState("fraud");
|
36 |
+
$myShipment->save();*/
|
37 |
+
|
38 |
+
//$model->getOrderId($orderID)->save();
|
39 |
+
}
|
40 |
+
|
41 |
+
|
42 |
+
/* public function fraud()
|
43 |
+
{
|
44 |
+
if (!$this->canFraud()) {
|
45 |
+
Mage::throwException(Mage::helper('sales')->__('Hold action is not available.'));
|
46 |
+
}
|
47 |
+
// $this->setHoldBeforeState($this->getState());
|
48 |
+
/// $this->setHoldBeforeStatus($this->getStatus());
|
49 |
+
// $this->setState(self::STATE_HOLDED, true);
|
50 |
+
return $this;
|
51 |
+
}
|
52 |
+
|
53 |
+
public function canFraud()
|
54 |
+
{
|
55 |
+
$state = $this->getState();
|
56 |
+
if ($this->isCanceled() || $this->isPaymentReview() || $state === self::STATE_COMPLETE || $state === self::STATE_CLOSED || $state === self::STATE_FRAUD) {
|
57 |
+
return false;
|
58 |
+
}
|
59 |
+
|
60 |
+
/* if ($this->getActionFlag(self::ACTION_FLAG_HOLD) === false) {
|
61 |
+
return false;
|
62 |
+
}
|
63 |
+
return true;
|
64 |
+
}*/
|
65 |
+
|
66 |
+
|
67 |
+
}
|
68 |
+
|
69 |
+
?>
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @copyright Copyright (c) 2009 Konstant Info Solution Pvt Ltd (http://www.konstantinfo.com)
|
12 |
+
* @author : Lalit Kumar Jain
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
class BlockThatProxy_Proxy_OrdersController extends Mage_Adminhtml_Controller_Action
|
16 |
+
{
|
17 |
+
|
18 |
+
public function indexAction()
|
19 |
+
{
|
20 |
+
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Affiche la liste
|
25 |
+
*
|
26 |
+
*/
|
27 |
+
public function ListAction()
|
28 |
+
{
|
29 |
+
|
30 |
+
$this->loadLayout();
|
31 |
+
$this->renderLayout();
|
32 |
+
}
|
33 |
+
|
34 |
+
}
|
@@ -1,87 +1,14 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
7 |
<!-- no dependencies -->
|
8 |
</depends>
|
9 |
-
|
10 |
-
|
11 |
-
<global>
|
12 |
-
<models>
|
13 |
-
<Proxy>
|
14 |
-
<class>BlockThatProxy_Proxy_Model</class>
|
15 |
-
<resourceModel>Proxy_mysql4</resourceModel>
|
16 |
-
</Proxy>
|
17 |
-
<Proxy_mysql4>
|
18 |
-
<class>BlockThatProxy_Proxy_Model_Mysql4</class>
|
19 |
-
<entities>
|
20 |
-
<feed>
|
21 |
-
<table>Proxy</table>
|
22 |
-
</feed>
|
23 |
-
</entities>
|
24 |
-
</Proxy_mysql4>
|
25 |
-
</models>
|
26 |
-
<blocks>
|
27 |
-
<adminhtml>
|
28 |
-
<rewrite>
|
29 |
-
</rewrite>
|
30 |
-
</adminhtml>
|
31 |
-
</blocks>
|
32 |
-
<blocks>
|
33 |
-
<proxy><class>BlockThatProxy_Proxy_Block</class></proxy>
|
34 |
-
</blocks>
|
35 |
-
<resources>
|
36 |
-
<Proxy_setup>
|
37 |
-
<setup>
|
38 |
-
<module>BlockThatProxy_Proxy</module>
|
39 |
-
</setup>
|
40 |
-
<connection>
|
41 |
-
<use>core_setup</use>
|
42 |
-
</connection>
|
43 |
-
</Proxy_setup>
|
44 |
-
<Proxy_write>
|
45 |
-
<connection>
|
46 |
-
<use>core_write</use>
|
47 |
-
</connection>
|
48 |
-
</Proxy_write>
|
49 |
-
<Proxy_read>
|
50 |
-
<connection>
|
51 |
-
<use>core_read</use>
|
52 |
-
</connection>
|
53 |
-
</Proxy_read>
|
54 |
-
</resources>
|
55 |
-
<helpers>
|
56 |
-
<Proxy>
|
57 |
-
<class>BlockThatProxy_Proxy_Helper</class>
|
58 |
-
</Proxy>
|
59 |
-
</helpers>
|
60 |
-
</global>
|
61 |
-
<adminhtml>
|
62 |
-
<acl>
|
63 |
-
<resources>
|
64 |
-
<admin>
|
65 |
-
<children>
|
66 |
-
<system>
|
67 |
-
<children>
|
68 |
-
<config>
|
69 |
-
<children>
|
70 |
-
<Proxy>
|
71 |
-
<title>Proxy Settings</title>
|
72 |
-
</Proxy>
|
73 |
-
</children>
|
74 |
-
</config>
|
75 |
-
</children>
|
76 |
-
</system>
|
77 |
-
</children>
|
78 |
-
</admin>
|
79 |
-
</resources>
|
80 |
-
</acl>
|
81 |
-
<events></events>
|
82 |
-
<translate></translate>
|
83 |
-
</adminhtml>
|
84 |
-
<frontend>
|
85 |
<routers>
|
86 |
<proxy>
|
87 |
<use>standard</use>
|
@@ -99,31 +26,137 @@
|
|
99 |
</updates>
|
100 |
</layout>
|
101 |
</frontend>
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
<
|
115 |
<feed>
|
116 |
<blockthatproxy_subject>A suspicious order has been completed</blockthatproxy_subject>
|
|
|
117 |
<blockthatproxy_message><![CDATA[Hi,
|
118 |
-
The order [ORDERID] was completed by a user behind a proxy server.The users IP was IP [IP].
|
119 |
|
120 |
-
|
|
|
|
|
|
|
|
|
121 |
|
122 |
Regards,
|
123 |
BlockThatProxy.com.]]></blockthatproxy_message>
|
124 |
</feed>
|
125 |
-
</
|
126 |
</default>
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
+
<modules>
|
4 |
+
<BlockThatProxy_Proxy>
|
5 |
+
<version>0.2.0</version>
|
6 |
+
</BlockThatProxy_Proxy>
|
7 |
+
<depends>
|
8 |
<!-- no dependencies -->
|
9 |
</depends>
|
10 |
+
</modules>
|
11 |
+
<frontend>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
<routers>
|
13 |
<proxy>
|
14 |
<use>standard</use>
|
26 |
</updates>
|
27 |
</layout>
|
28 |
</frontend>
|
29 |
+
<admin>
|
30 |
+
<routers>
|
31 |
+
<proxy>
|
32 |
+
<use>admin</use>
|
33 |
+
<args>
|
34 |
+
<module>BlockThatProxy_Proxy</module>
|
35 |
+
<frontName>proxy</frontName>
|
36 |
+
</args>
|
37 |
+
</proxy>
|
38 |
+
</routers>
|
39 |
+
</admin>
|
40 |
+
<default>
|
41 |
+
<proxy>
|
42 |
<feed>
|
43 |
<blockthatproxy_subject>A suspicious order has been completed</blockthatproxy_subject>
|
44 |
+
<blockthatproxy_redirectpageenable>1</blockthatproxy_redirectpageenable>
|
45 |
<blockthatproxy_message><![CDATA[Hi,
|
|
|
46 |
|
47 |
+
The order [ORDERID] was completed by a user behind a proxy server.
|
48 |
+
|
49 |
+
The users IP is [IP]. The distance between the address entered by the user, and the city the IP belongs to is [Distance] km. You can also look it up here: http://www.blockthatproxy.com/ip-lookup.aspx.
|
50 |
+
|
51 |
+
It is advised that you manually check the order before shipping it. If you have setup a redirect page, the user has been redirected to this page after payment.
|
52 |
|
53 |
Regards,
|
54 |
BlockThatProxy.com.]]></blockthatproxy_message>
|
55 |
</feed>
|
56 |
+
</proxy>
|
57 |
</default>
|
58 |
+
<adminhtml>
|
59 |
+
<menu>
|
60 |
+
<proxy module="proxy">
|
61 |
+
<title>BlockThatProxy</title>
|
62 |
+
<action>proxy/Orders/List</action>
|
63 |
+
<sort_order>90</sort_order>
|
64 |
+
<children>
|
65 |
+
<proxy_orders>
|
66 |
+
<title>Proxy Orders</title>
|
67 |
+
<action>proxy/Orders/List</action>
|
68 |
+
</proxy_orders>
|
69 |
+
<proxy>
|
70 |
+
<title>Proxy Settings</title>
|
71 |
+
<action>adminhtml/system_config/edit/section/proxy/</action>
|
72 |
+
</proxy>
|
73 |
+
</children>
|
74 |
+
</proxy>
|
75 |
+
</menu>
|
76 |
+
<acl>
|
77 |
+
<resources>
|
78 |
+
<admin>
|
79 |
+
<children>
|
80 |
+
<system>
|
81 |
+
<children>
|
82 |
+
<config>
|
83 |
+
<children>
|
84 |
+
<proxy>
|
85 |
+
<title>Proxy Settings</title>
|
86 |
+
</proxy>
|
87 |
+
</children>
|
88 |
+
</config>
|
89 |
+
</children>
|
90 |
+
</system>
|
91 |
+
</children>
|
92 |
+
</admin>
|
93 |
+
</resources>
|
94 |
+
</acl>
|
95 |
+
<layout>
|
96 |
+
<updates>
|
97 |
+
<proxy>
|
98 |
+
<file>proxy.xml</file>
|
99 |
+
</proxy>
|
100 |
+
</updates>
|
101 |
+
</layout>
|
102 |
+
<routers>
|
103 |
+
<proxy>
|
104 |
+
<use>standard</use>
|
105 |
+
<args>
|
106 |
+
<module>BlockThatProxy_Proxy</module>
|
107 |
+
<frontName>Proxy</frontName>
|
108 |
+
</args>
|
109 |
+
</proxy>
|
110 |
+
</routers>
|
111 |
+
</adminhtml>
|
112 |
+
<global>
|
113 |
+
<models>
|
114 |
+
<proxy>
|
115 |
+
<class>BlockThatProxy_Proxy_Model</class>
|
116 |
+
<resourceModel>proxy_mysql4</resourceModel>
|
117 |
+
</proxy>
|
118 |
+
<proxy_mysql4>
|
119 |
+
<class>BlockThatProxy_Proxy_Model_Mysql4</class>
|
120 |
+
<entities>
|
121 |
+
<Order>
|
122 |
+
<table>proxy_flag</table>
|
123 |
+
</Order>
|
124 |
+
<feed>
|
125 |
+
<table>Proxy</table>
|
126 |
+
</feed>
|
127 |
+
</entities>
|
128 |
+
</proxy_mysql4>
|
129 |
+
</models>
|
130 |
+
<resources>
|
131 |
+
<proxy_setup>
|
132 |
+
<setup>
|
133 |
+
<module>BlockThatProxy_Proxy</module>
|
134 |
+
</setup>
|
135 |
+
<connection>
|
136 |
+
<use>core_setup</use>
|
137 |
+
</connection>
|
138 |
+
</proxy_setup>
|
139 |
+
<proxy_write>
|
140 |
+
<connection>
|
141 |
+
<use>core_write</use>
|
142 |
+
</connection>
|
143 |
+
|
144 |
+
</proxy_write>
|
145 |
+
<proxy_read>
|
146 |
+
<connection>
|
147 |
+
<use>core_read</use>
|
148 |
+
</connection>
|
149 |
+
</proxy_read>
|
150 |
+
</resources>
|
151 |
+
<blocks>
|
152 |
+
<proxy>
|
153 |
+
<class>BlockThatProxy_Proxy_Block</class>
|
154 |
+
</proxy>
|
155 |
+
</blocks>
|
156 |
+
<helpers>
|
157 |
+
<proxy>
|
158 |
+
<class>BlockThatProxy_Proxy_Helper</class>
|
159 |
+
</proxy>
|
160 |
+
</helpers>
|
161 |
+
</global>
|
162 |
+
</config>
|
@@ -1,42 +1,68 @@
|
|
1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<config>
|
3 |
<sections>
|
4 |
-
|
5 |
-
|
6 |
-
<label>BlockThatProxy Settings</label>
|
7 |
<frontend_type>text</frontend_type>
|
8 |
-
|
|
|
|
|
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 |
-
<feed translate="label comment" module="
|
14 |
-
<comment><![CDATA[<DIV style="border:1px solid #CCCCCC; background:#CCCCCC; padding:5px; font-weight:bold">This requires a subscription from www.blockthatproxy.com. Create a free user on our website to get your license. Free to use, no personal details required at sign up.</DIV><div style="padding-top:20px;"></div>]]></comment>
|
15 |
<label>BlockThatProxy Options</label>
|
16 |
<frontend_type>text</frontend_type>
|
17 |
<sort_order>10</sort_order>
|
18 |
<show_in_default>1</show_in_default>
|
19 |
<show_in_website>1</show_in_website>
|
20 |
<show_in_store>1</show_in_store>
|
21 |
-
<fields>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
<blockthatproxy_fromemail translate="label">
|
23 |
-
<label>From
|
24 |
<frontend_type>text</frontend_type>
|
25 |
<sort_order>20</sort_order>
|
26 |
<show_in_default>1</show_in_default>
|
27 |
<show_in_website>1</show_in_website>
|
28 |
<show_in_store>1</show_in_store>
|
29 |
-
<comment><![CDATA[The email shown as sender of the email.]]></comment>
|
30 |
</blockthatproxy_fromemail>
|
31 |
-
|
32 |
<blockthatproxy_toemail translate="label">
|
33 |
-
<label>To
|
34 |
<frontend_type>text</frontend_type>
|
35 |
<sort_order>20</sort_order>
|
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 |
-
<comment><![CDATA[The receiver of the email.]]></comment>
|
40 |
</blockthatproxy_toemail>
|
41 |
<blockthatproxy_message translate="label">
|
42 |
<label>Message</label>
|
@@ -45,7 +71,7 @@
|
|
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 |
-
<comment><![CDATA[Content of the email. Can include the variables [ORDERID] and [
|
49 |
</blockthatproxy_message>
|
50 |
<blockthatproxy_subject translate="label">
|
51 |
<label>Subject</label>
|
@@ -55,9 +81,18 @@
|
|
55 |
<show_in_website>1</show_in_website>
|
56 |
<show_in_store>1</show_in_store>
|
57 |
<comment><![CDATA[The subject of the email that is sent.]]></comment>
|
58 |
-
</blockthatproxy_subject>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
<blockthatproxy_hashkey translate="label">
|
60 |
-
<label>BlockThatProxy Hash
|
61 |
<frontend_type>text</frontend_type>
|
62 |
<sort_order>20</sort_order>
|
63 |
<show_in_default>1</show_in_default>
|
@@ -68,6 +103,6 @@
|
|
68 |
</fields>
|
69 |
</feed>
|
70 |
</groups>
|
71 |
-
</
|
72 |
-
|
73 |
-
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento Fianet Extension
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
*
|
13 |
+
* @category Gr
|
14 |
+
* @package Gr_Fianet
|
15 |
+
* @author Nicolas Fabre <nicolas.fabre@groupereflect.net>
|
16 |
+
* @copyright Copyright (c) 2008 Nicolas Fabre
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
-->
|
20 |
<config>
|
21 |
<sections>
|
22 |
+
<proxy translate="label" module="proxy">
|
23 |
+
<label>BlockThatProxy Settings</label>
|
|
|
24 |
<frontend_type>text</frontend_type>
|
25 |
+
<tab>general</tab>
|
26 |
+
|
27 |
+
<sort_order>500</sort_order>
|
28 |
<show_in_default>1</show_in_default>
|
29 |
<show_in_website>1</show_in_website>
|
30 |
<show_in_store>1</show_in_store>
|
31 |
<groups>
|
32 |
+
<feed translate="label comment" module="proxy">
|
33 |
+
<comment><![CDATA[<DIV style="border:1px solid #CCCCCC; background:#CCCCCC; padding:5px; font-weight:bold">This requires a subscription from <a href="http://www.blockthatproxy.com">www.blockthatproxy.com</a>. Create a free user on our website to get your license. Free to use, no personal details required at sign up.</DIV><div style="padding-top:20px;"></div>]]></comment>
|
34 |
<label>BlockThatProxy Options</label>
|
35 |
<frontend_type>text</frontend_type>
|
36 |
<sort_order>10</sort_order>
|
37 |
<show_in_default>1</show_in_default>
|
38 |
<show_in_website>1</show_in_website>
|
39 |
<show_in_store>1</show_in_store>
|
40 |
+
<fields><blockthatproxy_redirectpageenable translate="label">
|
41 |
+
<label>Enable redirect</label>
|
42 |
+
<frontend_type>select</frontend_type>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
47 |
+
<comment><![CDATA[Please select to enable/disable redirect. If enabled, also set the page below.]]></comment>
|
48 |
+
</blockthatproxy_redirectpageenable>
|
49 |
<blockthatproxy_fromemail translate="label">
|
50 |
+
<label>From email</label>
|
51 |
<frontend_type>text</frontend_type>
|
52 |
<sort_order>20</sort_order>
|
53 |
<show_in_default>1</show_in_default>
|
54 |
<show_in_website>1</show_in_website>
|
55 |
<show_in_store>1</show_in_store>
|
56 |
+
<comment><![CDATA[The email shown as sender of the warning email.]]></comment>
|
57 |
</blockthatproxy_fromemail>
|
|
|
58 |
<blockthatproxy_toemail translate="label">
|
59 |
+
<label>To email</label>
|
60 |
<frontend_type>text</frontend_type>
|
61 |
<sort_order>20</sort_order>
|
62 |
<show_in_default>1</show_in_default>
|
63 |
<show_in_website>1</show_in_website>
|
64 |
<show_in_store>1</show_in_store>
|
65 |
+
<comment><![CDATA[The receiver of the warning email (you).]]></comment>
|
66 |
</blockthatproxy_toemail>
|
67 |
<blockthatproxy_message translate="label">
|
68 |
<label>Message</label>
|
71 |
<show_in_default>1</show_in_default>
|
72 |
<show_in_website>1</show_in_website>
|
73 |
<show_in_store>1</show_in_store>
|
74 |
+
<comment><![CDATA[Content of the email. Can include the variables [ORDERID], [IP] and [Distance].]]></comment>
|
75 |
</blockthatproxy_message>
|
76 |
<blockthatproxy_subject translate="label">
|
77 |
<label>Subject</label>
|
81 |
<show_in_website>1</show_in_website>
|
82 |
<show_in_store>1</show_in_store>
|
83 |
<comment><![CDATA[The subject of the email that is sent.]]></comment>
|
84 |
+
</blockthatproxy_subject>
|
85 |
+
<blockthatproxy_redirectpage translate="label">
|
86 |
+
<label>Redirect to this page</label>
|
87 |
+
<frontend_type>text</frontend_type>
|
88 |
+
<sort_order>20</sort_order>
|
89 |
+
<show_in_default>1</show_in_default>
|
90 |
+
<show_in_website>1</show_in_website>
|
91 |
+
<show_in_store>1</show_in_store>
|
92 |
+
<comment><![CDATA[If users are detected as proxy, they will be automatically redirected here after payment. For example http://www.domain.com/warning.html.]]></comment>
|
93 |
+
</blockthatproxy_redirectpage>
|
94 |
<blockthatproxy_hashkey translate="label">
|
95 |
+
<label>BlockThatProxy Hash key</label>
|
96 |
<frontend_type>text</frontend_type>
|
97 |
<sort_order>20</sort_order>
|
98 |
<show_in_default>1</show_in_default>
|
103 |
</fields>
|
104 |
</feed>
|
105 |
</groups>
|
106 |
+
</proxy>
|
107 |
+
</sections>
|
108 |
+
</config>
|
@@ -1 +1,26 @@
|
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
|
5 |
+
|
6 |
+
|
7 |
+
$installer->endSetup();
|
8 |
+
|
9 |
+
$installer->run("
|
10 |
+
CREATE TABLE IF NOT EXISTS `proxy_flag` (
|
11 |
+
`po_num` int(11) NOT NULL AUTO_INCREMENT,
|
12 |
+
`po_order_id` varchar(20) NOT NULL,
|
13 |
+
`po_flag` varchar(20) NOT NULL,
|
14 |
+
`distance` varchar(50) NOT NULL,
|
15 |
+
`email` varchar(50) NOT NULL,
|
16 |
+
`name` varchar(50) NOT NULL,
|
17 |
+
`city` varchar(50) NOT NULL,
|
18 |
+
`country` varchar(50) NOT NULL,
|
19 |
+
PRIMARY KEY (`po_num`)
|
20 |
+
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
|
21 |
+
");
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
$installer->endSetup();
|
26 |
+
?>
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
// $installer->run("DELETE from {$this->getTable('core_resource')} where code = 'proxy_setup'");
|
5 |
+
|
6 |
+
$installer->run("CREATE TABLE IF NOT EXISTS {$this->getTable('proxy_flag')} (
|
7 |
+
`po_num` int(11) NOT NULL AUTO_INCREMENT,
|
8 |
+
`po_order_id` varchar(20) NOT NULL,
|
9 |
+
`po_flag` varchar(20) NOT NULL,
|
10 |
+
`distance` varchar(50) NOT NULL,
|
11 |
+
`email` varchar(50) NOT NULL,
|
12 |
+
`name` varchar(50) NOT NULL,
|
13 |
+
`city` varchar(50) NOT NULL,
|
14 |
+
`country` varchar(50) NOT NULL,
|
15 |
+
PRIMARY KEY (`po_num`)
|
16 |
+
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
|
17 |
+
");
|
18 |
+
$installer->endSetup();
|
19 |
+
?>
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!-- ce fichier doit se trouver dans adminhtml/default/default sinon pas pris en compte.. -->
|
3 |
+
<layout version="0.1.0">
|
4 |
+
<proxy_orders_list>
|
5 |
+
<reference name="content">
|
6 |
+
<block type="proxy/Order_Grid" name="orderlist" template="proxy/Order/Grid.phtml" />
|
7 |
+
</reference>
|
8 |
+
</proxy_orders_list>
|
9 |
+
</layout>
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $list = $this->getList(); ?>
|
2 |
+
|
3 |
+
<div class="entry-edit">
|
4 |
+
|
5 |
+
<div class="content-header">
|
6 |
+
<table cellspacing="0" class="grid-header">
|
7 |
+
<tr>
|
8 |
+
<td><h3><?php echo $this->__('Products Stock Errors')?></h3></td>
|
9 |
+
</tr>
|
10 |
+
</table>
|
11 |
+
</div>
|
12 |
+
|
13 |
+
<div class="grid">
|
14 |
+
<table cellspacing="0" class="data" width="100%">
|
15 |
+
<thead>
|
16 |
+
<tr class="headings">
|
17 |
+
<th class="a-center"><?php echo $this->__('Product')?></th>
|
18 |
+
<th class="a-center"><?php echo $this->__('Ordered Qty')?></th>
|
19 |
+
<th class="a-center"><?php echo $this->__('Reserved Qty')?></th>
|
20 |
+
<th class="a-center"><?php echo $this->__('Stock')?></th>
|
21 |
+
<th class="a-center"><?php echo $this->__('Other')?></th>
|
22 |
+
<th class="a-center"><?php echo $this->__('Action')?></th>
|
23 |
+
</tr>
|
24 |
+
</thead>
|
25 |
+
<tbody>
|
26 |
+
<?php foreach ($list as $item): ?>
|
27 |
+
<tr>
|
28 |
+
<td class="a-center"><?php echo $item['product_name']; ?> </td>
|
29 |
+
<td class="a-center"><?php echo $item['ordered_qty']; ?> </td>
|
30 |
+
<td class="a-center"><?php echo $item['reserved_qty']; ?> </td>
|
31 |
+
<td class="a-center"><?php echo $item['stock']; ?> </td>
|
32 |
+
<td class="a-center"><?php echo $item['other']; ?> </td>
|
33 |
+
<td class="a-center"><a href="<?php echo $this->getUrl('Purchase/Misc/ComputeStock', array('product_id' => $item['product_id'])); ?>">Compute stocks</a> </td>
|
34 |
+
</tr>
|
35 |
+
<?php endforeach; ?>
|
36 |
+
<tbody>
|
37 |
+
</table>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<div align="right">If Error, displays "stored value / expected value"</div>
|
41 |
+
|
42 |
+
</div>
|
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script>
|
2 |
+
|
3 |
+
//***********************************************************************************************************************
|
4 |
+
//set delivered qty to max and submit form
|
5 |
+
function AllProductDelivered()
|
6 |
+
{
|
7 |
+
<?php
|
8 |
+
$collection = $this->getOrder()->getProducts();
|
9 |
+
foreach ($collection as $item)
|
10 |
+
{
|
11 |
+
if ($item->getpop_qty() > $item->getpop_supplied_qty())
|
12 |
+
{
|
13 |
+
$remaining_qty = ($item->getpop_qty() - $item->getpop_supplied_qty());
|
14 |
+
echo "document.getElementById('add_sm_qty_".$item->getpop_product_id()."').value = ".$remaining_qty.";";
|
15 |
+
}
|
16 |
+
}
|
17 |
+
?>
|
18 |
+
}
|
19 |
+
|
20 |
+
</script>
|
21 |
+
|
22 |
+
<div class="content-header">
|
23 |
+
<table cellspacing="0" class="grid-header">
|
24 |
+
<tr>
|
25 |
+
<td><h3><?php echo$this->__('Deliveries')?></h3></td>
|
26 |
+
<td align="right">
|
27 |
+
|
28 |
+
</td>
|
29 |
+
</tr>
|
30 |
+
</table>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
<div class="entry-edit">
|
34 |
+
<div class="grid">
|
35 |
+
<table cellspacing="0" class="data" width="100%">
|
36 |
+
<thead>
|
37 |
+
<tr class="headings">
|
38 |
+
<th class="a-center">Date</th>
|
39 |
+
<th><?php echo $this->__('Product'); ?></th>
|
40 |
+
<th class="a-center"><?php echo $this->__('Qty'); ?></th>
|
41 |
+
<th>Description</th>
|
42 |
+
</tr>
|
43 |
+
</thead>
|
44 |
+
<tbody>
|
45 |
+
<?php
|
46 |
+
//Affiche les mouvements de stock
|
47 |
+
$collection = $this->getOrder()->getStockMovements();
|
48 |
+
foreach ($collection as $item)
|
49 |
+
{
|
50 |
+
$product = mage::getModel('catalog/product')->load($item->getsm_product_id());
|
51 |
+
echo '<tr>';
|
52 |
+
echo '<td class="a-center">'.$item->getsm_date().'</td>';
|
53 |
+
echo '<td>'.$product->getname().'</td>';
|
54 |
+
echo '<td class="a-center">'.$item->getsm_qty().'</td>';
|
55 |
+
echo '<td>'.$item->getsm_description().'</td>';
|
56 |
+
echo '</tr>';
|
57 |
+
}
|
58 |
+
|
59 |
+
?>
|
60 |
+
</tbody>
|
61 |
+
</table>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<p> </p>
|
66 |
+
|
67 |
+
<div class="content-header">
|
68 |
+
<table cellspacing="0" class="grid-header">
|
69 |
+
<tr>
|
70 |
+
<td><h3><?php echo$this->__('Create New Delivery')?></h3></td>
|
71 |
+
<td align="right">
|
72 |
+
<button onclick="AllProductDelivered();" class="scalable" type="button"><span><?php echo $this->__('All products delivered')?></span></button>
|
73 |
+
</td>
|
74 |
+
</tr>
|
75 |
+
</table>
|
76 |
+
</div>
|
77 |
+
|
78 |
+
<div class="entry-edit">
|
79 |
+
<fieldset id="my-fieldset">
|
80 |
+
<table border="0">
|
81 |
+
<tr>
|
82 |
+
<td>Date</td>
|
83 |
+
<td width="30"> </td>
|
84 |
+
<td>
|
85 |
+
<input type="text" id="add_sm_date" name="add_sm_date" value="<?php echo date('Y-m-d'); ?>">
|
86 |
+
<img src="<?php echo $this->getSkinUrl('images/purchase/grid-cal.gif') ?>" class="v-middle" id="img_calendar_sm" />
|
87 |
+
<script type="text/javascript">
|
88 |
+
Calendar.setup({
|
89 |
+
inputField : 'add_sm_date',
|
90 |
+
ifFormat : '%Y-%m-%e',
|
91 |
+
button : 'img_calendar_sm',
|
92 |
+
align : 'Bl',
|
93 |
+
singleClick : true
|
94 |
+
});
|
95 |
+
</script>
|
96 |
+
</td>
|
97 |
+
</tr>
|
98 |
+
</table>
|
99 |
+
<p> </p>
|
100 |
+
<div class="grid">
|
101 |
+
<table border="0" cellspacing="0" class="data" width="100%" cellspacing="0">
|
102 |
+
<thead>
|
103 |
+
<tr class="headings">
|
104 |
+
<th class="a-center"><?php echo $this->__('Product'); ?></th>
|
105 |
+
<th class="a-center"><?php echo $this->__('Qty'); ?></th>
|
106 |
+
<th class="a-center"><?php echo $this->__('Ordered Qty'); ?></th>
|
107 |
+
<th class="a-center"><?php echo $this->__('Already Delivered Qty'); ?></th>
|
108 |
+
<th class="a-center"><?php echo $this->__('Remaining Qty'); ?></th>
|
109 |
+
</tr>
|
110 |
+
</thead>
|
111 |
+
<tbody>
|
112 |
+
<?php
|
113 |
+
$collection = $this->getOrder()->getProducts();
|
114 |
+
foreach ($collection as $item)
|
115 |
+
{
|
116 |
+
if ($item->getpop_qty() > $item->getpop_supplied_qty())
|
117 |
+
{
|
118 |
+
$remaining_qty = ($item->getpop_qty() - $item->getpop_supplied_qty());
|
119 |
+
echo '<tr>';
|
120 |
+
echo '<td>'.$item->getpop_product_name().'</td>';
|
121 |
+
//Si on doit bloquer les qte recues (cad qu'elles ne soient pas sup�rieure � la qte command�e
|
122 |
+
if (mage::getStoreConfig('purchase/purchase_order/check_delivery_qty') == 1)
|
123 |
+
{
|
124 |
+
echo '<td class="a-center">';
|
125 |
+
echo '<select id="add_sm_qty_'.$item->getpop_product_id().'" name="add_sm_qty_'.$item->getpop_product_id().'">';
|
126 |
+
for ($i=0;$i<=$remaining_qty;$i++)
|
127 |
+
echo '<option value="'.$i.'">'.$i.'</option>';
|
128 |
+
echo '</select>';
|
129 |
+
echo '</td>';
|
130 |
+
}
|
131 |
+
else
|
132 |
+
{
|
133 |
+
echo '<td class="a-center"><input type="text" id="add_sm_qty_'.$item->getpop_product_id().'" name="add_sm_qty_'.$item->getpop_product_id().'" value="0"></td>';
|
134 |
+
}
|
135 |
+
echo '<td class="a-center">'.$item->getpop_qty().'</td>';
|
136 |
+
echo '<td class="a-center">'.$item->getpop_supplied_qty().'</td>';
|
137 |
+
echo '<td class="a-center">'.$remaining_qty.'</td>';
|
138 |
+
echo '</tr>';
|
139 |
+
}
|
140 |
+
}
|
141 |
+
?>
|
142 |
+
</tbody>
|
143 |
+
</table>
|
144 |
+
</div>
|
145 |
+
</fieldset>
|
146 |
+
</div>
|
@@ -0,0 +1,293 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script>
|
2 |
+
|
3 |
+
var productLinksController = Class.create();
|
4 |
+
|
5 |
+
productLinksController.prototype = {
|
6 |
+
initialize : function(fieldId, products, grid) {
|
7 |
+
this.saveField = $(fieldId);
|
8 |
+
this.saveFieldId = fieldId;
|
9 |
+
this.products = $H(products);
|
10 |
+
this.grid = grid;
|
11 |
+
this.tabIndex = 1000;
|
12 |
+
this.grid.rowClickCallback = this.rowClick.bind(this);
|
13 |
+
this.grid.initRowCallback = this.rowInit.bind(this);
|
14 |
+
this.grid.checkboxCheckCallback = this.registerProduct.bind(this);
|
15 |
+
this.grid.rows.each(this.eachRow.bind(this));
|
16 |
+
this.saveField.value = this.serializeObject(this.products);
|
17 |
+
this.grid.reloadParams = {'products[]':this.products.keys()};
|
18 |
+
},
|
19 |
+
eachRow : function(row) {
|
20 |
+
this.rowInit(this.grid, row);
|
21 |
+
},
|
22 |
+
registerProduct : function(grid, element, checked) {
|
23 |
+
if(checked){
|
24 |
+
if(element.inputElements) {
|
25 |
+
this.products.set(element.value, {});
|
26 |
+
for(var i = 0; i < element.inputElements.length; i++) {
|
27 |
+
element.inputElements[i].disabled = false;
|
28 |
+
this.products.get(element.value)[element.inputElements[i].name] = element.inputElements[i].value;
|
29 |
+
}
|
30 |
+
}
|
31 |
+
}
|
32 |
+
else{
|
33 |
+
if(element.inputElements){
|
34 |
+
for(var i = 0; i < element.inputElements.length; i++) {
|
35 |
+
element.inputElements[i].disabled = true;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
this.products.unset(element.value);
|
40 |
+
}
|
41 |
+
this.saveField.value = this.serializeObject(this.products);
|
42 |
+
this.grid.reloadParams = {'products[]':this.products.keys()};
|
43 |
+
},
|
44 |
+
serializeObject : function(hash) {
|
45 |
+
var clone = hash.clone();
|
46 |
+
clone.each(function(pair) {
|
47 |
+
clone.set(pair.key, encode_base64(Object.toQueryString(pair.value)));
|
48 |
+
});
|
49 |
+
return clone.toQueryString();
|
50 |
+
},
|
51 |
+
rowClick : function(grid, event) {
|
52 |
+
var trElement = Event.findElement(event, 'tr');
|
53 |
+
var isInput = Event.element(event).tagName == 'INPUT';
|
54 |
+
if(trElement){
|
55 |
+
var checkbox = Element.select(trElement, 'input');
|
56 |
+
if(checkbox[0]){
|
57 |
+
var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
|
58 |
+
this.grid.setCheckboxChecked(checkbox[0], checked);
|
59 |
+
}
|
60 |
+
}
|
61 |
+
},
|
62 |
+
inputChange : function(event) {
|
63 |
+
var element = Event.element(event);
|
64 |
+
if(element && element.checkboxElement && element.checkboxElement.checked){
|
65 |
+
this.products.get(element.checkboxElement.value)[element.name] = element.value;
|
66 |
+
this.saveField.value = this.serializeObject(this.products);
|
67 |
+
}
|
68 |
+
},
|
69 |
+
rowInit : function(grid, row) {
|
70 |
+
var checkbox = $(row).select('.checkbox')[0];
|
71 |
+
var inputs = $(row).select('.input-text');
|
72 |
+
if(checkbox && inputs.length > 0) {
|
73 |
+
checkbox.inputElements = inputs;
|
74 |
+
for(var i = 0; i < inputs.length; i++) {
|
75 |
+
inputs[i].checkboxElement = checkbox;
|
76 |
+
if(this.products.get(checkbox.value) && this.products.get(checkbox.value)[inputs[i].name]) {
|
77 |
+
inputs[i].value = this.products.get(checkbox.value)[inputs[i].name];
|
78 |
+
}
|
79 |
+
inputs[i].disabled = !checkbox.checked;
|
80 |
+
inputs[i].tabIndex = this.tabIndex++;
|
81 |
+
Event.observe(inputs[i],'keyup', this.inputChange.bind(this));
|
82 |
+
Event.observe(inputs[i],'change', this.inputChange.bind(this));
|
83 |
+
}
|
84 |
+
}
|
85 |
+
}
|
86 |
+
};
|
87 |
+
|
88 |
+
//***********************************************************************************************************************
|
89 |
+
function SubmitOrderForm()
|
90 |
+
{
|
91 |
+
//Verifie que tous les produits aient un prix
|
92 |
+
var already_alerted;
|
93 |
+
already_alerted = false;
|
94 |
+
var t_input = document.getElementsByTagName('input');
|
95 |
+
for (var i = 0 ; i < t_input.length ; i ++)
|
96 |
+
{
|
97 |
+
if ((t_input[i].id.indexOf('pop_price_ht_') > -1) && (already_alerted == false))
|
98 |
+
{
|
99 |
+
if (t_input[i].value == 0)
|
100 |
+
{
|
101 |
+
if (!confirm('<?php echo $this->__('Some products buy price are not set'); ?>'))
|
102 |
+
return false;
|
103 |
+
else
|
104 |
+
already_alerted = true;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
//Si case sent coch�, il faut qu'il y ait une date de livraison
|
110 |
+
if (document.getElementById('po_sent').checked)
|
111 |
+
{
|
112 |
+
var date_delivery = '';
|
113 |
+
date_delivery = document.getElementById('po_supply_date').value;
|
114 |
+
if ((date_delivery == '') || (date_delivery == '0000-00-00'))
|
115 |
+
{
|
116 |
+
alert('<?php echo $this->__('Please fill delivery date field')?>');
|
117 |
+
return;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
document.getElementById('edit_form').submit();
|
122 |
+
}
|
123 |
+
|
124 |
+
|
125 |
+
</script>
|
126 |
+
|
127 |
+
<style>
|
128 |
+
|
129 |
+
.span-help span
|
130 |
+
{
|
131 |
+
position : absolute;
|
132 |
+
top : -2000em;
|
133 |
+
left : -2000em;
|
134 |
+
width : 1px;
|
135 |
+
height : 1px;
|
136 |
+
overflow : hidden;
|
137 |
+
background : #ffffe1; /* D�finition du fond, sinon on a le m�me que notre lien */
|
138 |
+
border : 1px solid #000000; /* D�finition des bordures */
|
139 |
+
text-decoration: none;
|
140 |
+
color: black;
|
141 |
+
text-align: left;
|
142 |
+
}
|
143 |
+
|
144 |
+
|
145 |
+
.span-help:hover span
|
146 |
+
{
|
147 |
+
top : auto;
|
148 |
+
left : auto;
|
149 |
+
width : 400px;
|
150 |
+
height : auto;
|
151 |
+
overflow : visible;
|
152 |
+
text-decoration: none;
|
153 |
+
}
|
154 |
+
|
155 |
+
</style>
|
156 |
+
|
157 |
+
<input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
|
158 |
+
<input type="hidden" name="po_num" value="<?php echo $this->getOrder()->getId(); ?>">
|
159 |
+
<div class="entry-edit">
|
160 |
+
|
161 |
+
<div class="entry-edit-head">
|
162 |
+
<h4 class="icon-head head-edit-form fieldset-legend">General</h4>
|
163 |
+
</div>
|
164 |
+
<fieldset id="my-fieldset">
|
165 |
+
<table cellspacing="0" class="form-list">
|
166 |
+
<tr>
|
167 |
+
<td class="label" width="25%">Id</td>
|
168 |
+
<td class="input-ele" width="25%"><input type="textbox" id="po_order_id" name="po_order_id" value="<?php echo $this->getOrder()->getpo_order_id(); ?>"></td>
|
169 |
+
<td rowspan="10"> </td>
|
170 |
+
<td class="label" width="25%"><?php echo $this->__('Currency'); ?></td>
|
171 |
+
<td class="input-ele" width="25%"><?php echo $this->getCurrencyAsCombo('po_currency', $this->getOrder()->getpo_currency()); ?></td>
|
172 |
+
</tr>
|
173 |
+
<tr>
|
174 |
+
<td class="label"><?php echo $this->__('Order Date'); ?></td>
|
175 |
+
<td class="input-ele">
|
176 |
+
<input size="7" type="text" id="po_date" name="po_date" value="<?php echo $this->getOrder()->getpo_date(); ?>">
|
177 |
+
<img src="<?php echo $this->getSkinUrl('images/purchase/grid-cal.gif') ?>" class="v-middle" id="img_calendar_date" />
|
178 |
+
<script type="text/javascript">
|
179 |
+
Calendar.setup({
|
180 |
+
inputField : 'po_date',
|
181 |
+
ifFormat : '%Y-%m-%e',
|
182 |
+
button : 'img_calendar_date',
|
183 |
+
align : 'Bl',
|
184 |
+
singleClick : true
|
185 |
+
});
|
186 |
+
</script>
|
187 |
+
</td>
|
188 |
+
<td class="label"><?php echo $this->__('Tax Rate'); ?></td>
|
189 |
+
<td class="input-ele"><input size="6" type="text" id="po_tax_rate" name="po_tax_rate" value="<?php echo $this->getOrder()->getpo_tax_rate(); ?>"> % (<i><?php echo $this->__('For shipping and zoll costs'); ?></i>)</td>
|
190 |
+
</tr>
|
191 |
+
<tr>
|
192 |
+
<td class="label"><?php echo $this->__('Delivery Date'); ?></td>
|
193 |
+
<td class="input-ele">
|
194 |
+
<input size="7" type="text" id="po_supply_date" name="po_supply_date" value="<?php echo $this->getOrder()->getpo_supply_date(); ?>">
|
195 |
+
<img src="<?php echo $this->getSkinUrl('images/purchase/grid-cal.gif') ?>" class="v-middle" id="img_calendar_supply_date" />
|
196 |
+
<script type="text/javascript">
|
197 |
+
Calendar.setup({
|
198 |
+
inputField : 'po_supply_date',
|
199 |
+
ifFormat : '%Y-%m-%e',
|
200 |
+
button : 'img_calendar_supply_date',
|
201 |
+
align : 'Bl',
|
202 |
+
singleClick : true
|
203 |
+
});
|
204 |
+
</script>
|
205 |
+
</td>
|
206 |
+
<td class="label"><?php echo $this->__('Currency Change Rate'); ?></td>
|
207 |
+
<td class="input-ele"><input size="3" type="text" id="po_currency_change_rate" name="po_currency_change_rate" value="<?php echo $this->getOrder()->getpo_currency_change_rate(); ?>"></td>
|
208 |
+
</tr>
|
209 |
+
<tr>
|
210 |
+
<td class="label" width="25%"><?php echo $this->__('Payment Type'); ?></td>
|
211 |
+
<td class="input-ele" width="25%"><?php echo $this->getPaymentModeAsCombo('po_payment_type', $this->getOrder()->getpo_payment_type()); ?></td>
|
212 |
+
<td class="label"><?php echo $this->__('Shipping Cost'); ?></td>
|
213 |
+
<td class="input-ele"><input size="6" type="text" id="po_shipping_cost" name="po_shipping_cost" value="<?php echo $this->getOrder()->getpo_shipping_cost(); ?>"> <i>(<?php echo $this->getOrder()->getpo_shipping_cost_base(); ?> eur)</i></td>
|
214 |
+
</tr>
|
215 |
+
<tr>
|
216 |
+
<td class="label"><?php echo $this->__('Supplier'); ?></td>
|
217 |
+
<td class="input-ele"><a href="<?php echo $this->getUrl('Purchase/Suppliers/Edit').'sup_id/'.$this->getSupplier()->getsup_id(); ?>"><?php echo $this->getSupplier()->getsup_name().'</a><br><a href="'.$this->getSupplier()->getsup_mail().'">'.$this->getSupplier()->getsup_mail().'</a><br>'.$this->getSupplier()->getsup_tel(); ?></td>
|
218 |
+
<td class="label"><?php echo $this->__('Zoll Cost'); ?></td>
|
219 |
+
<td class="input-ele"><input size="6" type="text" id="po_zoll_cost" name="po_zoll_cost" value="<?php echo $this->getOrder()->getpo_zoll_cost(); ?>"> <i>(<?php echo $this->getOrder()->getpo_zoll_cost_base(); ?> eur)</i></td>
|
220 |
+
</tr>
|
221 |
+
<tr>
|
222 |
+
<td class="label" width="25%"><?php echo $this->__('Carrier'); ?></td>
|
223 |
+
<td class="input-ele" width="25%"><?php echo $this->getCarriersAsCombo('po_carrier', $this->getOrder()->getpo_carrier()); ?></td>
|
224 |
+
<td class="label"><?php echo $this->__('Invoice Date'); ?></td>
|
225 |
+
<td class="input-ele">
|
226 |
+
<input size="7" type="text" id="po_invoice_date" name="po_invoice_date" value="<?php echo $this->getOrder()->getpo_invoice_date(); ?>">
|
227 |
+
<img src="<?php echo $this->getSkinUrl('images/purchase/grid-cal.gif') ?>" class="v-middle" id="img_calendar_invoice_date" />
|
228 |
+
<script type="text/javascript">
|
229 |
+
Calendar.setup({
|
230 |
+
inputField : 'po_invoice_date',
|
231 |
+
ifFormat : '%Y-%m-%e',
|
232 |
+
button : 'img_calendar_invoice_date',
|
233 |
+
align : 'Bl',
|
234 |
+
singleClick : true
|
235 |
+
});
|
236 |
+
</script>
|
237 |
+
</td>
|
238 |
+
</tr>
|
239 |
+
<tr>
|
240 |
+
<td class="label" width="25%" rowspan="3"><?php echo $this->__('Comments'); ?></td>
|
241 |
+
<td class="input-ele" rowspan="3"><textarea id="po_comments" name="po_comments" cols="50" rows="4"><?php echo $this->getOrder()->getpo_comments(); ?></textarea></td>
|
242 |
+
<td class="label" width="25%"><?php echo $this->__('Invoice Ref'); ?></td>
|
243 |
+
<td class="input-ele" width="25%"><input type="text" name="po_invoice_ref" id="po_invoice_ref" value="<?php echo $this->getOrder()->getpo_invoice_ref(); ?>"></td>
|
244 |
+
</tr>
|
245 |
+
<tr>
|
246 |
+
<td class="label" width="25%"><?php echo $this->__('Payment Date'); ?></td>
|
247 |
+
<td class="input-ele" width="25%">
|
248 |
+
<input size="7" type="text" id="po_payment_date" name="po_payment_date" value="<?php echo $this->getOrder()->getpo_payment_date(); ?>">
|
249 |
+
<img src="<?php echo $this->getSkinUrl('images/purchase/grid-cal.gif') ?>" class="v-middle" id="img_calendar_payment_date" />
|
250 |
+
<script type="text/javascript">
|
251 |
+
Calendar.setup({
|
252 |
+
inputField : 'po_payment_date',
|
253 |
+
ifFormat : '%Y-%m-%e',
|
254 |
+
button : 'img_calendar_payment_date',
|
255 |
+
align : 'Bl',
|
256 |
+
singleClick : true
|
257 |
+
});
|
258 |
+
</script>
|
259 |
+
</td>
|
260 |
+
</tr>
|
261 |
+
<tr>
|
262 |
+
<td class="label" width="25%"><?php echo $this->__('Supplier Order Ref'); ?></td>
|
263 |
+
<td class="input-ele" width="25%">
|
264 |
+
<input type="text" name="po_supplier_order_ref" id="po_supplier_order_ref" value="<?php echo $this->getOrder()->getpo_supplier_order_ref(); ?>">
|
265 |
+
</td>
|
266 |
+
</tr>
|
267 |
+
<tr>
|
268 |
+
<td>Status</td>
|
269 |
+
<td><?php echo $this->getStatusAsCombo('po_status', $this->getOrder()->getpo_status()); ?></td>
|
270 |
+
<td><input type="checkbox" value="1" id="po_paid" name="po_paid" <?php if ($this->getOrder()->getpo_paid() == 1) { echo "checked"; } ?>><?php echo $this->__('Paid'); ?></td>
|
271 |
+
</tr>
|
272 |
+
<tr>
|
273 |
+
<td><?php echo $this->__('Delivery Progress'); ?></td>
|
274 |
+
<td><?php echo $this->getOrder()->getpo_delivery_percent(); ?>%</td>
|
275 |
+
</tr>
|
276 |
+
</table>
|
277 |
+
</fieldset>
|
278 |
+
|
279 |
+
</div>
|
280 |
+
|
281 |
+
|
282 |
+
<div align="right">
|
283 |
+
<table border="0">
|
284 |
+
<tr>
|
285 |
+
<td><h3><?php echo $this->__('Total'); ?></h3></td>
|
286 |
+
<td width="100"><h3><?php echo $this->getOrder()->getCurrency()->formatTxt($this->getOrder()->getTotalHt()) ?></h3></td>
|
287 |
+
</tr>
|
288 |
+
<tr>
|
289 |
+
<td><h3><?php echo $this->__('Total (incl tax)'); ?></h3></td>
|
290 |
+
<td width="100"><h3><?php echo $this->getOrder()->getCurrency()->formatTxt($this->getOrder()->getTotalTtc()) ?></h3></td>
|
291 |
+
</tr>
|
292 |
+
</table>
|
293 |
+
</div>
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php echo $this->__('Select products to add and click on save button'); ?>
|
2 |
+
|
3 |
+
<?php echo $this->getGridParentHtml() ?>
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style>
|
2 |
+
.lien-popup span
|
3 |
+
{
|
4 |
+
position : absolute;
|
5 |
+
top : -2000em;
|
6 |
+
left : -2000em;
|
7 |
+
width : 1px;
|
8 |
+
height : 1px;
|
9 |
+
overflow : hidden;
|
10 |
+
background : #ffffe1; /* D�finition du fond, sinon on a le m�me que notre lien */
|
11 |
+
border : 1px solid #000000; /* D�finition des bordures */
|
12 |
+
text-decoration: none;
|
13 |
+
color: black;
|
14 |
+
text-align: left;
|
15 |
+
}
|
16 |
+
|
17 |
+
|
18 |
+
.lien-popup:hover span
|
19 |
+
{
|
20 |
+
top : auto;
|
21 |
+
left : auto;
|
22 |
+
width : 200px;
|
23 |
+
height : auto;
|
24 |
+
overflow : visible;
|
25 |
+
}
|
26 |
+
|
27 |
+
</style>
|
28 |
+
|
29 |
+
<input type="hidden" id="po_num" name="po_num" value="<?php echo $this->getOrder()->getId(); ?>">
|
30 |
+
<div class="entry-edit">
|
31 |
+
|
32 |
+
<div class="grid">
|
33 |
+
<table cellspacing="0" class="data" width="100%" cellspacing="0">
|
34 |
+
<thead>
|
35 |
+
<tr class="headings">
|
36 |
+
<th class="a-center">Infos</th>
|
37 |
+
<th class="a-center">Sku</th>
|
38 |
+
<th>Description</th>
|
39 |
+
<th class="a-center"><?php echo$this->__('Supplier Ref')?></th>
|
40 |
+
<th class="a-center"><?php echo$this->__('Qty')?></th>
|
41 |
+
<th class="a-center"><?php echo$this->__('Delivered Qty')?></th>
|
42 |
+
<th class="a-center"><?php echo$this->__('Price HT')?></th>
|
43 |
+
<th class="a-center"><?php echo$this->__('Last Price HT')?></th>
|
44 |
+
<th class="a-center"><?php echo$this->__('Tax Rate')?></th>
|
45 |
+
<th class="a-center"><?php echo$this->__('Total HT')?></th>
|
46 |
+
<th class="a-center"><?php echo$this->__('Delete')?></th>
|
47 |
+
</tr>
|
48 |
+
</thead>
|
49 |
+
<tbody>
|
50 |
+
<?php
|
51 |
+
//Affiche la liste des lignres commande
|
52 |
+
$collection = $this->getProducts();
|
53 |
+
if (sizeof($collection) == 0)
|
54 |
+
{
|
55 |
+
echo '<tr><td colspan="13" align="center">'.$this->__('No items').'</td></tr>';
|
56 |
+
}
|
57 |
+
foreach ($collection as $item)
|
58 |
+
{
|
59 |
+
echo '<tr>';
|
60 |
+
|
61 |
+
//D�finit les d�tails de beosin d'appro sur le produit
|
62 |
+
$product = mage::getModel('catalog/product')->load($item->getpop_product_id());
|
63 |
+
$SupplyNeedsItem = mage::getModel('Purchase/SupplyNeeds')->getSupplyNeedsForProduct($product);
|
64 |
+
$details = $this->__('Current stock').' : '.(int)$SupplyNeedsItem['stock']->getQty();
|
65 |
+
$details .= "\n".$this->__('Stock Mini').' : '.(int)$SupplyNeedsItem['stock']->getnotify_stock_qty();
|
66 |
+
$details .= "\n".$this->__('Ordered Qty').' : '.$SupplyNeedsItem['ordered_qty'];
|
67 |
+
$details .= "\n".$this->__('Needed Qty').' : '.$SupplyNeedsItem['needed_qty'];
|
68 |
+
$details .= "\n".$this->__('Already Ordered Qty').' : '.$SupplyNeedsItem['waiting_for_deliver_qty'];
|
69 |
+
$details .= "\n".$SupplyNeedsItem['details'];
|
70 |
+
|
71 |
+
echo '<td align="center">';
|
72 |
+
//rajoute le span pour le popup
|
73 |
+
echo '<a href="#" class="lien-popup">';
|
74 |
+
echo '<img src="'.$this->getSkinUrl('images/note_msg_icon.gif').'">';
|
75 |
+
echo '<span>'.nl2br($details).'</span>';
|
76 |
+
echo '</a>';
|
77 |
+
echo '</td>';
|
78 |
+
|
79 |
+
echo '<td><a href="'.$this->getUrl('Purchase/Products/Edit').'product_id/'.$item->getpop_product_id().'">'.$item->getsku().'</a></td>';
|
80 |
+
echo '<td><input size="40" type="text" id="pop_product_name_'.$item->getId().'" name="pop_product_name_'.$item->getId().'" value="'.$item->getpop_product_name().'"></td>';
|
81 |
+
echo '<td><input size="11" type="text" id="pop_supplier_ref_'.$item->getId().'" name="pop_supplier_ref_'.$item->getId().'" value="'.$item->getpop_supplier_ref().'"></td>';
|
82 |
+
echo '<td align="center"><input size="2" type="text" id="pop_qty_'.$item->getId().'" name="pop_qty_'.$item->getId().'" value="'.$item->getpop_qty().'"></td>';
|
83 |
+
echo '<td align="center">';
|
84 |
+
if ($item->getpop_supplied_qty() >= $item->getpop_qty())
|
85 |
+
echo $item->getpop_supplied_qty();
|
86 |
+
else
|
87 |
+
echo '<font color="red">'.$item->getpop_supplied_qty().'</font>';
|
88 |
+
echo '</td>';
|
89 |
+
echo '<td align="center"><input size="6" type="text" id="pop_price_ht_'.$item->getId().'" name="pop_price_ht_'.$item->getId().'" value="'.$item->getpop_price_ht().'"><br>'.$this->getOrder()->getCurrency()->formatTxt($item->getUnitPriceWithExtendedCosts_base()).'</td>';
|
90 |
+
echo '<td align="center">'.$this->GetLastPriceWithoutFees($item->getpop_product_id()).' </td>';
|
91 |
+
echo '<td align="center"><input size="6" type="text" id="pop_tax_rate_'.$item->getId().'" name="pop_tax_rate_'.$item->getId().'" value="'.$item->getpop_tax_rate().'"></td>';
|
92 |
+
echo '<td align="center">'.$this->getOrder()->getCurrency()->formatTxt($item->getRowTotal()).'</td>';
|
93 |
+
echo '<td align="center"><input type="checkbox" id="delete_'.$item->getId().'" name="delete_'.$item->getId().'" value="1"></td>';
|
94 |
+
|
95 |
+
echo '</tr>';
|
96 |
+
}
|
97 |
+
?>
|
98 |
+
</tbody>
|
99 |
+
</table>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
<div align="right">
|
104 |
+
<table border="0">
|
105 |
+
<tr>
|
106 |
+
<td><h3><?php echo $this->__('Total'); ?></h3></td>
|
107 |
+
<td width="100"><h3><?php echo $this->getOrder()->getCurrency()->formatTxt($this->getOrder()->getTotalHt()) ?></h3></td>
|
108 |
+
</tr>
|
109 |
+
<tr>
|
110 |
+
<td><h3><?php echo $this->__('Total (incl tax)'); ?></h3></td>
|
111 |
+
<td width="100"><h3><?php echo $this->getOrder()->getCurrency()->formatTxt($this->getOrder()->getTotalTtc()) ?></h3></td>
|
112 |
+
</tr>
|
113 |
+
</table>
|
114 |
+
</div>
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script>
|
2 |
+
function sendToSupplier()
|
3 |
+
{
|
4 |
+
document.getElementById('send_to_customer').value = '1';
|
5 |
+
editForm.submit();
|
6 |
+
}
|
7 |
+
</script>
|
8 |
+
|
9 |
+
<div class="entry-edit">
|
10 |
+
|
11 |
+
<div class="entry-edit-head">
|
12 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Send order to supplier'); ?></h4>
|
13 |
+
</div>
|
14 |
+
<fieldset id="my-fieldset">
|
15 |
+
<?php echo $this->__('Fill comments and click button to send order to supplier by email'); ?>
|
16 |
+
<br><?php echo $this->__('Supplier email address').' : '.$this->getOrder()->getSupplier()->getsup_mail(); ?>
|
17 |
+
<?php if ($this->getOrder()->getpo_supplier_notification_date() != ''): ?>
|
18 |
+
<br><?php echo $this->__('Supplier notified on').' : '.$this->formatDate($this->getOrder()->getpo_supplier_notification_date(), 'medium', true); ?>
|
19 |
+
<?php endif; ?>
|
20 |
+
<p> </p>
|
21 |
+
<center>
|
22 |
+
<textarea id="email_comment" name="email_comment" cols="100" rows="15"></textarea>
|
23 |
+
<p><input checked type="checkbox" value="1" id="ch_change_order_status_to_pending" name="ch_change_order_status_to_pending"> <?php echo $this->__('Set order status to pending for delivery after sending email'); ?></p>
|
24 |
+
<input type="hidden" id="send_to_customer" name="send_to_customer" value="">
|
25 |
+
<p> </p>
|
26 |
+
<button type="button" class="scalable " onclick="sendToSupplier();" style=""><span><?php echo $this->__('Send to supplier'); ?></span></button>
|
27 |
+
</center>
|
28 |
+
</fieldset>
|
29 |
+
</div>
|
30 |
+
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<div class="entry-edit">
|
2 |
+
<?php echo $this->getGridParentHtml() ?>
|
3 |
+
</div>
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style>
|
2 |
+
.lien-popup span
|
3 |
+
{
|
4 |
+
position : absolute;
|
5 |
+
top : -2000em;
|
6 |
+
left : -2000em;
|
7 |
+
width : 1px;
|
8 |
+
height : 1px;
|
9 |
+
overflow : hidden;
|
10 |
+
background : #ffffe1; /* D�finition du fond, sinon on a le m�me que notre lien */
|
11 |
+
border : 1px solid #000000; /* D�finition des bordures */
|
12 |
+
text-decoration: none;
|
13 |
+
color: black;
|
14 |
+
text-align: left;
|
15 |
+
}
|
16 |
+
|
17 |
+
|
18 |
+
.lien-popup:hover span
|
19 |
+
{
|
20 |
+
top : auto;
|
21 |
+
left : auto;
|
22 |
+
width : 200px;
|
23 |
+
height : auto;
|
24 |
+
overflow : visible;
|
25 |
+
}
|
26 |
+
|
27 |
+
</style>
|
28 |
+
|
29 |
+
<script>
|
30 |
+
|
31 |
+
//***************************************************************************************************************************
|
32 |
+
//Fonction pour trier la liste
|
33 |
+
function setSortBy(field)
|
34 |
+
{
|
35 |
+
document.getElementById('sort_by').value = field;
|
36 |
+
document.getElementById('form_search').submit();
|
37 |
+
}
|
38 |
+
|
39 |
+
//***************************************************************************************************************************
|
40 |
+
//fonction pour reseter les filtres
|
41 |
+
function resetFilters()
|
42 |
+
{
|
43 |
+
document.location.href = '<?php echo $this->getUrl('Purchase/SupplyNeeds/List'); ?>';
|
44 |
+
}
|
45 |
+
|
46 |
+
//****************************************************************************************************************************
|
47 |
+
//S�lectionne toutes les case a cocher de s�lection
|
48 |
+
function selectAll()
|
49 |
+
{
|
50 |
+
for (i=0; i < document.form_products.elements.length; i++)
|
51 |
+
{
|
52 |
+
if (document.form_products.elements[i].name.indexOf('ch_') != -1)
|
53 |
+
{
|
54 |
+
document.form_products.elements[i].checked = document.getElementById('all').checked;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
//****************************************************************************************************************************
|
60 |
+
//Ajoute les produits a la commande
|
61 |
+
function AddToOrder()
|
62 |
+
{
|
63 |
+
//Soumet le formulaire en ajax
|
64 |
+
var url = '';
|
65 |
+
url = '<?php echo $this->getUrl('Purchase/Orders/CreateFromSupplyNeeds'); ?>';
|
66 |
+
|
67 |
+
var request = new Ajax.Request(
|
68 |
+
url,
|
69 |
+
{
|
70 |
+
method: 'post',
|
71 |
+
onSuccess: function onSuccess(transport)
|
72 |
+
{
|
73 |
+
//Rafraichit le parent
|
74 |
+
window.opener.location.href = window.opener.location.href;
|
75 |
+
|
76 |
+
//ferme cette fenetre
|
77 |
+
self.close();
|
78 |
+
|
79 |
+
},
|
80 |
+
onFailure: function onFailure(transport)
|
81 |
+
{
|
82 |
+
//Rafraichit la page
|
83 |
+
alert('error');
|
84 |
+
},
|
85 |
+
parameters: Form.serialize(document.getElementById('form_products'))
|
86 |
+
}
|
87 |
+
);
|
88 |
+
}
|
89 |
+
|
90 |
+
</script>
|
91 |
+
|
92 |
+
<div class="entry-edit">
|
93 |
+
|
94 |
+
<div class="content-header">
|
95 |
+
<table cellspacing="0" class="grid-header">
|
96 |
+
<tr>
|
97 |
+
<td><h3><?php echo$this->__('Import Supply Needs')?></h3></td>
|
98 |
+
<td align="right">
|
99 |
+
<button onclick="document.getElementById('form_search').submit();" class="scalable save" type="button"><span><?php echo $this->__('Refresh')?></span></button>
|
100 |
+
<button onclick="resetFilters()" class="scalable save" type="button"><span><?php echo $this->__('Reset')?></span></button>
|
101 |
+
<button onclick="AddToOrder();" class="scalable save" type="button"><span><?php echo $this->__('Import')?></span></button>
|
102 |
+
</td>
|
103 |
+
</tr>
|
104 |
+
</table>
|
105 |
+
</div>
|
106 |
+
|
107 |
+
<fieldset>
|
108 |
+
|
109 |
+
<form id="form_search" name="form_search" method="GET">
|
110 |
+
<input type="hidden" id="sort_by" name="sort_by" value="<?php echo $this->sortBy(); ?>">
|
111 |
+
<table border="0" width="100%">
|
112 |
+
<tr>
|
113 |
+
<td><?php echo $this->__('Supplier')?> : <?php echo $this->getSupplierListAsCombo('supplier', $this->supplierFilter()); ?></td>
|
114 |
+
<td><?php echo $this->__('Manufacturer')?> : <?php echo $this->getManufacturerListAsCombo('manufacturer', $this->manufacturerFilter()); ?></td>
|
115 |
+
<td><?php echo $this->__('Status')?> : <?php echo $this->getStatusListAsCombo('status', $this->statusFilter()); ?></td>
|
116 |
+
</tr>
|
117 |
+
</table>
|
118 |
+
</form>
|
119 |
+
|
120 |
+
</fieldset>
|
121 |
+
|
122 |
+
<form id="form_products" name="form_products" method="POST" action="<?php echo $this->getUrl('Purchase/Orders/CreateFromSupplyNeeds') ?>">
|
123 |
+
<input type="hidden" id="po_num" name="po_num" value="<?php echo Mage::app()->getRequest()->getParam('po_num', false); ?>">
|
124 |
+
<input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
|
125 |
+
<div class="grid">
|
126 |
+
<table cellspacing="0" class="data" width="100%">
|
127 |
+
<thead>
|
128 |
+
<tr class="headings">
|
129 |
+
<th class="a-center"><input type="checkbox" name="all" id="all" onclick="selectAll();"></th>
|
130 |
+
<th class="a-center"><a href="javascript:setSortBy('manufacturer');"><?php echo $this->__('Manufacturer')?></a></th>
|
131 |
+
<th class="a-center"><a href="javascript:setSortBy('description');"><?php echo $this->__('Description')?></a></th>
|
132 |
+
<th class="a-center" width="100"><a href="javascript:setSortBy('status');"><?php echo $this->__('Status')?></a></th>
|
133 |
+
<th class="a-center"><?php echo $this->__('Details')?></th>
|
134 |
+
<th class="a-center"><a href="javascript:setSortBy('needed_qty');"><?php echo $this->__('Needed Qty')?></a></th>
|
135 |
+
<th class="a-center"><?php echo $this->__('Suppliers')?></th>
|
136 |
+
</tr>
|
137 |
+
</thead>
|
138 |
+
<tbody>
|
139 |
+
<?php
|
140 |
+
$collection = $this->getList();
|
141 |
+
foreach ($collection as $item)
|
142 |
+
{
|
143 |
+
$UnderlinedStart = '';
|
144 |
+
$UnderlinedStop = '';
|
145 |
+
if ($item->getsn_needed_qty() <= 0)
|
146 |
+
{
|
147 |
+
$UnderlinedStart = '<font color="#129218">';
|
148 |
+
$UnderlinedStop = '</i>';
|
149 |
+
}
|
150 |
+
|
151 |
+
echo '<tr>';
|
152 |
+
echo '<td align="center"><input type="checkbox" id="ch_'.$item->getsn_product_id().'" name="ch_'.$item->getsn_product_id().'" value="1"></td>';
|
153 |
+
echo '<td>'.$UnderlinedStart.$item->getsn_manufacturer_name().'</td>';
|
154 |
+
echo '<td><a href="'.$this->getUrl('Purchase/Products/Edit').'product_id/'.$item->getsn_product_id().'">'.$UnderlinedStart.$item->getsn_product_name().'<input type="hidden" id="name_'.$item->getsn_product_id().'" name="name_'.$item->getsn_product_id().'" value="'.$item->getsn_product_name().'"></a></td>';
|
155 |
+
echo '<td align="center">'.$UnderlinedStart.$this->__($item->getsn_status()).'</td>';
|
156 |
+
|
157 |
+
echo '<td align="center">';
|
158 |
+
//rajoute le span pour le popup
|
159 |
+
echo '<a href="#" class="lien-popup">';
|
160 |
+
echo '<img src="'.$this->getSkinUrl('images/note_msg_icon.gif').'">';
|
161 |
+
echo '<span>'.nl2br($item->getsn_details()).'</span>';
|
162 |
+
echo '</a>';
|
163 |
+
|
164 |
+
//rajoute un panneau si warning
|
165 |
+
if ($item->getsn_is_warning())
|
166 |
+
echo ' <img src="'.$this->getSkinUrl('images/purchase/warning.gif').'" alt="Warning" height="16">';
|
167 |
+
echo '</td>';
|
168 |
+
|
169 |
+
echo '<td align="center">'.$UnderlinedStart.$item->getsn_needed_qty().'<input type="hidden" id="qty_'.$item->getsn_product_id().'" name="qty_'.$item->getsn_product_id().'" value="'.$item->getsn_needed_qty().'"></td>';
|
170 |
+
echo '<td>'.$UnderlinedStart.$item->getsn_suppliers_name ().' </td>';
|
171 |
+
|
172 |
+
|
173 |
+
echo '</tr>';
|
174 |
+
}
|
175 |
+
?>
|
176 |
+
</tbody>
|
177 |
+
</table>
|
178 |
+
</div>
|
179 |
+
</form>
|
180 |
+
|
181 |
+
</div>
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="content-header">
|
2 |
+
<table cellspacing="0" class="grid-header">
|
3 |
+
<tr>
|
4 |
+
<td><h3><?php echo$this->__('Create New Order')?></h3></td>
|
5 |
+
<td align="right">
|
6 |
+
<button onclick="document.location.href='<?php echo $this->getBackUrl()?>'" class="scalable back" type="button"><span><?php echo $this->__('Back')?></span></button>
|
7 |
+
<button onclick="document.getElementById('edit_form').submit();" class="scalable save" type="button"><span><?php echo $this->__('Save')?></span></button>
|
8 |
+
</td>
|
9 |
+
</tr>
|
10 |
+
</table>
|
11 |
+
</div>
|
12 |
+
|
13 |
+
<form id="edit_form" name="edit_form" action="<?php echo $this->getUrl('*/*/create')?>">
|
14 |
+
<div class="entry-edit">
|
15 |
+
|
16 |
+
<fieldset id="my-fieldset">
|
17 |
+
<table cellspacing="0" class="form-list">
|
18 |
+
<tr>
|
19 |
+
<td class="label"><?php echo $this->__('Supplier'); ?></td>
|
20 |
+
<td class="input-ele"><?php echo $this->getSuppliersAsCombo(); ?></td>
|
21 |
+
</tr>
|
22 |
+
</table>
|
23 |
+
</fieldset>
|
24 |
+
|
25 |
+
</div>
|
26 |
+
</form>
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
3 |
+
$order = Mage::getModel('sales/order')->load($lastOrderId);
|
4 |
+
$incId=$order->getIncrementId();
|
5 |
+
$_shippingAddress = $order->getShippingAddress();
|
6 |
+
$addcity=$_shippingAddress->getCity();
|
7 |
+
$countryName=$_shippingAddress->getCountryModel()->getName();
|
8 |
+
|
9 |
+
$cname=$_shippingAddress->getName();
|
10 |
+
|
11 |
+
$cemail=$order->getBillingAddress()->getEmail();
|
12 |
+
|
13 |
+
|
14 |
+
$this->retrieveFeed($lastOrderId,$addcity,$countryName,$cname,$cemail,$incId);
|
15 |
+
?>
|
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
3 |
-
$order = Mage::getModel('sales/order')->load($lastOrderId);
|
4 |
-
$this->retrieveFeed($order->increment_id);
|
5 |
-
?>
|
|
|
|
|
|
|
|
|
|
@@ -4,7 +4,7 @@
|
|
4 |
<BlockThatProxy_Proxy>
|
5 |
<active>true</active>
|
6 |
<codePool>local</codePool>
|
7 |
-
<version>
|
8 |
</BlockThatProxy_Proxy>
|
9 |
</modules>
|
10 |
</config>
|
4 |
<BlockThatProxy_Proxy>
|
5 |
<active>true</active>
|
6 |
<codePool>local</codePool>
|
7 |
+
<version>2.0</version>
|
8 |
</BlockThatProxy_Proxy>
|
9 |
</modules>
|
10 |
</config>
|
@@ -1,22 +1,32 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>BlockThatProxy</name>
|
4 |
-
<version>
|
5 |
<stability>stable</stability>
|
6 |
-
<license>OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Integrates the anti-fraud system from BlockThatProxy.com.</summary>
|
10 |
-
<description>This extension integrates the anti-fraud system from BlockThatProxy
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
15 |
-
<notes>
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
<compatible/>
|
21 |
<dependencies/>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>BlockThatProxy</name>
|
4 |
+
<version>2.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>Integrates the anti-fraud system from BlockThatProxy.com.</summary>
|
10 |
+
<description>This extension integrates the anti-fraud system from BlockThatProxy, which makes it possible for you to stop e-commerce fraud on your Magento webshop.
|
11 |
|
12 |
+
To get started you only need a www.blockthatproxy.com subscription, which is available free for 3 months. After registration, get the licens (HASH) key from your members area and add it to the extension settings in Magento Admin (Systems - Configuration - BlockThatProxy Settings).
|
13 |
|
14 |
+
If any question or problems, please contact us using the form on our website.</description>
|
15 |
+
<notes>New release from BlockThatProxy with many new functionalities.
|
16 |
+
|
17 |
+
- If an order is detected as proxy, the system automatically sets the order status as "possible fraud", so you can manually review it before shipping.
|
18 |
+
|
19 |
+
- You can choose to redirect a user to a specific page if the user is detected as proxy during checkout (after payment!). In this way you can automatically ask the customer to contact you to confirm his details.
|
20 |
+
|
21 |
+
- The system looks up the users IP in our global IP to address database and provide you with the country and city the IP belongs to.
|
22 |
+
|
23 |
+
- It calculates the distance between the shipping address entered by the user, and the address matching the IP, so you can see if its a very high distance (possible fraud).
|
24 |
+
|
25 |
+
- Adds an page to your admin panel, where you easily can see all orders marked as possible fraud.</notes>
|
26 |
+
<authors><author><name>Martin</name><user>auto-converted</user><email>martin@wickings.dk</email></author></authors>
|
27 |
+
<date>2011-02-16</date>
|
28 |
+
<time>22:02:13</time>
|
29 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="proxy.xml" hash="749eb6b9f97531a78924e8932ad26d2e"/></dir><dir name="template"><dir name="proxy"><dir name="Misc"><file name="Errors.phtml" hash="436e57bf38548227cd36bd3385eb97ac"/></dir><dir name="Order"><dir name="Edit"><dir name="Tab"><file name="Deliveries.phtml" hash="c223d7961de6b0d756ad7f35bc84e89b"/><file name="Info.phtml" hash="5202a5f25892e3d412aae5a1a4721bad"/><file name="Products.phtml" hash="aa6e7035df6c205daba994535adc36fe"/><file name="ProductSelection.phtml" hash="93d1562b161fee72e63a19c82857126b"/><file name="SendToSupplier.phtml" hash="338a7a8da444eaf3b056789d9910790d"/></dir></dir><file name="Grid.phtml" hash="d6b6f706833ee7921241c8dd5216b225"/><file name="ImportFromSupplyNeeds.phtml" hash="9b89a56a4b8426e112f4238df9098b4b"/><file name="New.phtml" hash="afb4d550e1edaeec3d1772de4b014645"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="proxy.xml" hash="8559ef08e002869ee52dc61ecebb09a0"/></dir><dir name="template"><dir name="proxy"><file name="feed.phtml" hash="a80df077e1a4703e70e2b39f58ac02fd"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="BlockThatProxy"><dir name="Proxy"><dir name="Block"><dir name="Adminhtml"><file name="page.php" hash="e857c09781e4d5b2f4dcbbd02864cc7c"/></dir><dir name="Order"><dir name="Edit"><dir name="Tabs"><file name="Deliveries.php" hash="81b8fd2689d4a718af73bb636c0d22e4"/><file name="Info.php" hash="90ef41668a307f6868566cc90370d9e9"/><file name="Products.php" hash="5715be0c5cbbb5b99ced16360f5fd1e8"/><file name="ProductSelection.php" hash="54977e1bcf25c7c3de848d9370bb71d7"/><file name="SendToSupplier.php" hash="da4c662619fa7f5d45a5bf4cf6636306"/></dir><file name="Form.php" hash="b94f8e0d8d5baf6dd7def12b4fa76cf1"/><file name="Tabs.php" hash="d6e3d6157b82b13f426d1ca5ac0b3daa"/></dir><file name="Edit.php" hash="bfee68ee9ebf1dfa0a99f34ab4388250"/><file name="Grid.php" hash="fb118242ff851c0b8f8d766773690e5a"/><file name="New.php" hash="3659bb0e883f8384b6d14f333d1d18ee"/></dir><file name="Feed.php" hash="4ff0aba956fb8462e647e9a505522224"/><file name="Index.php" hash="0ec01dbf7a02f6baf8183e28a8522e92"/></dir><dir name="controllers"><file name="FeedController.php" hash="30e9a036f5f9e73c8dc033914120847c"/><file name="IndexController.php" hash="30f3bd336eb73f41b03b62bbd435c5d0"/><file name="OrdersController.php" hash="4b5293ba6002f0ca7923cae76c6e3ea0"/></dir><dir name="etc"><file name="config.xml" hash="91d7cdce94348e827e1e9a6f3a5fd940"/><file name="system.xml" hash="ce81ee9798d74dadc07efa5a1ba4b643"/></dir><dir name="Helper"><file name="Data.php" hash="d75e65e52a560dfb49b007c943cf7789"/></dir><dir name="Model"><dir name="Config"><file name="Redirectpage.php" hash="ee6a80ddd7cd83772bed383c4fbe4fa9"/></dir><dir name="Mysql4"><dir name="Feed"><file name="Collection.php" hash="d5f619ce7db798fbf597ad056531c11d"/></dir><dir name="Order"><file name="Collection.php" hash="49ed750fa03021b2bd09ca36b8cc8e04"/></dir><file name="Feed.php" hash="e466c024bf2314050064a80cbccc7b58"/><file name="Order.php" hash="ab5412725756f59ce9279083ca2a1e65"/></dir><dir name="MySql14"><dir name="Proxy"><file name="Collection.php" hash="a86451f979847ed72c0485b4628ba817"/></dir><file name="Proxy.php" hash="375ba8e8577a1551a263d4da1e49d7a8"/></dir><file name="Feed.php" hash="2cdc320e354b7169e68c30b642d3cdba"/><file name="Observer.php" hash="23bf3b44d31683ed98b5cc2eb071501c"/><file name="Order.php" hash="ac3534a7ea4e8e964f11cba7048989eb"/><file name="Proxy.php" hash="f219ced3c0b31e1a7f5b3a6afa89ef91"/><file name="Status.php" hash="64d3de8c5121947e2924343af9d7f289"/></dir><dir name="sql"><dir name="proxy_setup"><file name="mysql4-install-0.1.0.php" hash="495618f16a8e4a91bb5062c8ce2b5651"/><file name="mysql4-upgrade-0.1.0-0.2.0.php" hash="145cee245c5f1723901527e69bdf96cc"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="BlockThatProxy_Proxy.xml" hash="6a23fce1757d829bba13f9f1a3c8e71e"/></dir></target></contents>
|
30 |
<compatible/>
|
31 |
<dependencies/>
|
32 |
</package>
|