Version Notes
1. New secure communication protocal,
.
Download this release
Release Info
Developer | Warrin |
Extension | Ced_LayBuy |
Version | 2.1.8 |
Comparing to | |
See all releases |
Code changes from version 2.1.7 to 2.1.8
- app/code/local/Ced/LayBuy/Block/Adminhtml/Orders/Grid.php +2 -3
- app/code/local/Ced/LayBuy/Block/Adminhtml/Report/Details.php +34 -4
- app/code/local/Ced/LayBuy/Block/Adminhtml/Report/Edit.php +5 -1
- app/code/local/Ced/LayBuy/Block/Adminhtml/Report/Edit/Form.php +22 -7
- app/code/local/Ced/LayBuy/Block/Adminhtml/Report/Grid.php +1 -1
- app/code/local/Ced/LayBuy/Helper/Data.php +35 -0
- app/code/local/Ced/LayBuy/Model/Report.php +22 -2
- app/code/local/Ced/LayBuy/controllers/Adminhtml/ReportController.php +12 -5
- package.xml +4 -4
app/code/local/Ced/LayBuy/Block/Adminhtml/Orders/Grid.php
CHANGED
@@ -34,13 +34,12 @@ class Ced_LayBuy_Block_Adminhtml_Orders_Grid extends Mage_Adminhtml_Block_Widget
|
|
34 |
|
35 |
public function __construct()
|
36 |
{
|
37 |
-
|
38 |
$this->setId('sales_laybuy_order_grid');
|
39 |
-
$this->setUseAjax(true);
|
40 |
$this->setDefaultSort('created_at');
|
41 |
$this->setDefaultDir('ASC');
|
42 |
$this->setSaveParametersInSession(true);
|
43 |
-
|
44 |
}
|
45 |
|
46 |
/**
|
34 |
|
35 |
public function __construct()
|
36 |
{
|
37 |
+
parent::__construct();
|
38 |
$this->setId('sales_laybuy_order_grid');
|
|
|
39 |
$this->setDefaultSort('created_at');
|
40 |
$this->setDefaultDir('ASC');
|
41 |
$this->setSaveParametersInSession(true);
|
42 |
+
$this->setUseAjax(true);
|
43 |
}
|
44 |
|
45 |
/**
|
app/code/local/Ced/LayBuy/Block/Adminhtml/Report/Details.php
CHANGED
@@ -58,15 +58,45 @@ class Ced_LayBuy_Block_Adminhtml_Report_Details extends Mage_Adminhtml_Block_Wid
|
|
58 |
'class' => 'delete',
|
59 |
));
|
60 |
}
|
61 |
-
if(in_array($model->getStatus(),array(-2
|
62 |
-
$this->_addButton('
|
63 |
-
|
64 |
-
'label' => Mage::helper('laybuy')->__('
|
65 |
|
66 |
'onclick' => "setLocation('{$this->getUrl('*/*/edit',array('_secure' => true,'id'=>$this->getRequest()->getParam('id')))}')",
|
67 |
|
68 |
'class' => 'add',
|
69 |
));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
}
|
71 |
}
|
72 |
|
58 |
'class' => 'delete',
|
59 |
));
|
60 |
}
|
61 |
+
if(in_array($model->getStatus(),array(-2))) {
|
62 |
+
$this->_addButton('resend', array(
|
63 |
+
|
64 |
+
'label' => Mage::helper('laybuy')->__('Resend Email to Buyer'),
|
65 |
|
66 |
'onclick' => "setLocation('{$this->getUrl('*/*/edit',array('_secure' => true,'id'=>$this->getRequest()->getParam('id')))}')",
|
67 |
|
68 |
'class' => 'add',
|
69 |
));
|
70 |
+
$this->_addButton('edit', array(
|
71 |
+
|
72 |
+
'label' => Mage::helper('laybuy')->__('Revise Instalment Plan'),
|
73 |
+
|
74 |
+
'onclick' => "setLocation('{$this->getUrl('*/*/edit',array('_secure' => true,'id'=>$this->getRequest()->getParam('id'),'reviseagain'=>1))}')",
|
75 |
+
|
76 |
+
'class' => 'add',
|
77 |
+
));
|
78 |
+
}
|
79 |
+
if(in_array($model->getStatus(),array(0))) {
|
80 |
+
if(strlen($model->getReviseConfirmMessage())>0) {
|
81 |
+
$this->_addButton('edit', array(
|
82 |
+
|
83 |
+
'label' => Mage::helper('laybuy')->__('Revise Instalment Plan'),
|
84 |
+
|
85 |
+
'onclick' => "confirmSetLocation('{$model->getReviseConfirmMessage()}', '{$this->getUrl('*/*/edit',array('_secure' => true,'id'=>$this->getRequest()->getParam('id')))}')",
|
86 |
+
|
87 |
+
'class' => 'add',
|
88 |
+
));
|
89 |
+
} else {
|
90 |
+
$this->_addButton('edit', array(
|
91 |
+
|
92 |
+
'label' => Mage::helper('laybuy')->__('Revise Instalment Plan'),
|
93 |
+
|
94 |
+
'onclick' => "setLocation('{$this->getUrl('*/*/edit',array('_secure' => true,'id'=>$this->getRequest()->getParam('id')))}')",
|
95 |
+
|
96 |
+
'class' => 'add',
|
97 |
+
));
|
98 |
+
}
|
99 |
+
|
100 |
}
|
101 |
}
|
102 |
|
app/code/local/Ced/LayBuy/Block/Adminhtml/Report/Edit.php
CHANGED
@@ -63,7 +63,11 @@ class Ced_LayBuy_Block_Adminhtml_Report_Edit extends Mage_Adminhtml_Block_Widget
|
|
63 |
->addFieldToFilter('type',array('eq'=>'new'))->getLastItem()->load();
|
64 |
if($revised && $revised->getId()){
|
65 |
$model = $revised;
|
66 |
-
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
}
|
69 |
$this->_addButton('save', array(
|
63 |
->addFieldToFilter('type',array('eq'=>'new'))->getLastItem()->load();
|
64 |
if($revised && $revised->getId()){
|
65 |
$model = $revised;
|
66 |
+
if(Mage::app()->getRequest()->getParam('reviseagain')) {
|
67 |
+
|
68 |
+
} else {
|
69 |
+
$buttonLabel = Mage::helper('laybuy')->__('Resend Email to Buyer');
|
70 |
+
}
|
71 |
}
|
72 |
}
|
73 |
$this->_addButton('save', array(
|
app/code/local/Ced/LayBuy/Block/Adminhtml/Report/Edit/Form.php
CHANGED
@@ -44,6 +44,7 @@ class Ced_LayBuy_Block_Adminhtml_Report_Edit_Form extends Mage_Adminhtml_Block_W
|
|
44 |
$model = Mage::registry('current_laybuy_transaction_edit');
|
45 |
$newAmount = $model->getData('amount') - ($model->getData('downpayment_amount') + (((int)$model->getTransaction() - 2) * $model->getData('payment_amounts')));
|
46 |
$isRevised = 0;
|
|
|
47 |
if($model->getStatus() == -2) {
|
48 |
$revised = Mage::getModel('laybuy/revise')->getCollection()
|
49 |
->addFieldToFilter('transaction_id',array('eq'=>$model->getId()))
|
@@ -52,9 +53,14 @@ class Ced_LayBuy_Block_Adminhtml_Report_Edit_Form extends Mage_Adminhtml_Block_W
|
|
52 |
$model = $revised;
|
53 |
$newAmount = $model->getData('amount');
|
54 |
$isRevised = $model->getId();
|
|
|
|
|
|
|
|
|
55 |
}
|
56 |
}
|
57 |
|
|
|
58 |
/* print_r($model->getData());die; */
|
59 |
/* @var $model Mage_Paypal_Model_Report_Settlement_Row */
|
60 |
$settlement = Mage::getSingleton('laybuy/report');
|
@@ -119,15 +125,17 @@ class Ced_LayBuy_Block_Adminhtml_Report_Edit_Form extends Mage_Adminhtml_Block_W
|
|
119 |
'value' => 1,
|
120 |
'type' => 'radio',
|
121 |
'onclick'=> 'methodChange(1)',
|
122 |
-
|
123 |
-
!$
|
|
|
124 |
'after_element_html' => '<label for="lay-buy" class="inline">Lay-Buy</label>',
|
125 |
),
|
126 |
'buy-now' => array(
|
127 |
'label' => $settlement->getFieldLabel(''),
|
128 |
'value' => 0,
|
129 |
'type' => 'radio',
|
130 |
-
($
|
|
|
131 |
'onclick'=> 'methodChange(0)',
|
132 |
'after_element_html' => '<label for="buy-now" class="inline">Buy-Now</label>',
|
133 |
),
|
@@ -288,8 +296,14 @@ class Ced_LayBuy_Block_Adminhtml_Report_Edit_Form extends Mage_Adminhtml_Block_W
|
|
288 |
}
|
289 |
if(isset($info['dy']) && isset($info['onchange']) && $function = $info['onchange']){
|
290 |
|
291 |
-
if ($
|
292 |
-
$funtionData = '
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
} else {
|
294 |
$funtionData = 'document.getElementById("lay-buy").checked = true;
|
295 |
document.getElementById("loading-mask").show();
|
@@ -303,8 +317,9 @@ class Ced_LayBuy_Block_Adminhtml_Report_Edit_Form extends Mage_Adminhtml_Block_W
|
|
303 |
'<script type="text/javascript">
|
304 |
function '.$function.'{
|
305 |
'.$funtionData.'
|
306 |
-
}
|
307 |
-
setTimeout("
|
|
|
308 |
function loadXMLDoc(url)
|
309 |
{
|
310 |
var xmlhttp;
|
44 |
$model = Mage::registry('current_laybuy_transaction_edit');
|
45 |
$newAmount = $model->getData('amount') - ($model->getData('downpayment_amount') + (((int)$model->getTransaction() - 2) * $model->getData('payment_amounts')));
|
46 |
$isRevised = 0;
|
47 |
+
$reviseagain = 0;
|
48 |
if($model->getStatus() == -2) {
|
49 |
$revised = Mage::getModel('laybuy/revise')->getCollection()
|
50 |
->addFieldToFilter('transaction_id',array('eq'=>$model->getId()))
|
53 |
$model = $revised;
|
54 |
$newAmount = $model->getData('amount');
|
55 |
$isRevised = $model->getId();
|
56 |
+
$reviseagain = $isRevised;
|
57 |
+
if(Mage::app()->getRequest()->getParam('reviseagain')){
|
58 |
+
$isRevised = 0;
|
59 |
+
}
|
60 |
}
|
61 |
}
|
62 |
|
63 |
+
|
64 |
/* print_r($model->getData());die; */
|
65 |
/* @var $model Mage_Paypal_Model_Report_Settlement_Row */
|
66 |
$settlement = Mage::getSingleton('laybuy/report');
|
125 |
'value' => 1,
|
126 |
'type' => 'radio',
|
127 |
'onclick'=> 'methodChange(1)',
|
128 |
+
|
129 |
+
!$reviseagain || ($reviseagain && $model->getPaymentType())?'checked':'' => !$reviseagain || ($reviseagain && $model->getPaymentType())?'checked':'',
|
130 |
+
//!$isRevised || ($isRevised && $model->getPaymentType())?'checked':'' => !$isRevised || ($isRevised && $model->getPaymentType())?'checked':'',
|
131 |
'after_element_html' => '<label for="lay-buy" class="inline">Lay-Buy</label>',
|
132 |
),
|
133 |
'buy-now' => array(
|
134 |
'label' => $settlement->getFieldLabel(''),
|
135 |
'value' => 0,
|
136 |
'type' => 'radio',
|
137 |
+
($reviseagain && !$model->getPaymentType())?'checked':'' => ($reviseagain && !$model->getPaymentType())?'checked':'',
|
138 |
+
//($isRevised && !$model->getPaymentType())?'checked':'' => ($isRevised && !$model->getPaymentType())?'checked':'',
|
139 |
'onclick'=> 'methodChange(0)',
|
140 |
'after_element_html' => '<label for="buy-now" class="inline">Buy-Now</label>',
|
141 |
),
|
296 |
}
|
297 |
if(isset($info['dy']) && isset($info['onchange']) && $function = $info['onchange']){
|
298 |
|
299 |
+
if ($reviseagain && !$model->getPaymentType()) {
|
300 |
+
$funtionData = '
|
301 |
+
document.getElementById("loading-mask").show();
|
302 |
+
var f = document.getElementById("preview-tbl");
|
303 |
+
f.src = "'.$calcUrl.'?currency="+document.laybuy_revise_plan.currency.value+"&amt="+document.laybuy_revise_plan.amount.value+"&init="+document.laybuy_revise_plan.dp_amount.value+"&mnth="+document.laybuy_revise_plan.months.value+"&rnd="+Math.random()+"&html=1";
|
304 |
+
|
305 |
+
data = "'.$calcUrl.'?currency="+document.laybuy_revise_plan.currency.value+"&amt="+document.laybuy_revise_plan.amount.value+"&init="+document.laybuy_revise_plan.dp_amount.value+"&mnth="+document.laybuy_revise_plan.months.value+"&rnd="+Math.random();
|
306 |
+
loadXMLDoc(data);';
|
307 |
} else {
|
308 |
$funtionData = 'document.getElementById("lay-buy").checked = true;
|
309 |
document.getElementById("loading-mask").show();
|
317 |
'<script type="text/javascript">
|
318 |
function '.$function.'{
|
319 |
'.$funtionData.'
|
320 |
+
}
|
321 |
+
setTimeout("document.getElementById(\"buy-now\").checked = true;methodChange(0);",200);
|
322 |
+
setTimeout("'.$function.';",300);
|
323 |
function loadXMLDoc(url)
|
324 |
{
|
325 |
var xmlhttp;
|
app/code/local/Ced/LayBuy/Block/Adminhtml/Report/Grid.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php
|
2 |
* Lay-Buys
|
3 |
*
|
4 |
* NOTICE OF LICENSE
|
5 |
*
|
6 |
* This source file is subject to the Open Software License (OSL 3.0)
|
7 |
* that is bundled with this package in the file LICENSE.txt.
|
8 |
* It is also available through the world-wide-web at this URL:
|
9 |
* http://opensource.org/licenses/osl-3.0.php
|
10 |
* If you did not receive a copy of the license and are unable to
|
11 |
* obtain it through the world-wide-web, please send an email
|
12 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
13 |
*
|
14 |
* DISCLAIMER
|
15 |
*
|
16 |
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
17 |
* versions in the future. If you wish to customize Magento for your
|
18 |
* needs please refer to http://www.magentocommerce.com for more information.
|
19 |
*
|
20 |
* @category Ced
|
21 |
* @package Ced_LayBuy
|
22 |
* @author Asheesh Singh<asheeshsingh@cedcoss.com>
|
23 |
* @copyright Copyright LAY-BUYS (2011). (http://lay-buys.com/)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
* Block for LayBuy report grid
|
27 |
*/
|
28 |
{
|
29 |
$storeId = (int) $this->getRequest()->getParam('store', 0);
|
30 |
return Mage::app()->getStore($storeId);
|
31 |
}
|
32 |
public function getRowUrl($row)
|
33 |
{
|
34 |
return $this->getUrl('*/*/details', array('_secure' => true,'id' => $row->getId()));
|
35 |
}
|
|
|
36 |
* Lay-Buys
|
37 |
*
|
38 |
* NOTICE OF LICENSE
|
39 |
*
|
40 |
* This source file is subject to the Open Software License (OSL 3.0)
|
41 |
* that is bundled with this package in the file LICENSE.txt.
|
42 |
* It is also available through the world-wide-web at this URL:
|
43 |
* http://opensource.org/licenses/osl-3.0.php
|
44 |
* If you did not receive a copy of the license and are unable to
|
45 |
* obtain it through the world-wide-web, please send an email
|
46 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
47 |
*
|
48 |
* DISCLAIMER
|
49 |
*
|
50 |
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
51 |
* versions in the future. If you wish to customize Magento for your
|
52 |
* needs please refer to http://www.magentocommerce.com for more information.
|
53 |
*
|
54 |
* @category Ced
|
55 |
* @package Ced_LayBuy
|
56 |
* @author Asheesh Singh<asheeshsingh@cedcoss.com>
|
57 |
* @copyright Copyright LAY-BUYS (2011). (http://lay-buys.com/)
|
58 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
59 |
*/
|
60 |
* Block for LayBuy report grid
|
61 |
*/
|
62 |
{
|
63 |
$storeId = (int) $this->getRequest()->getParam('store', 0);
|
64 |
return Mage::app()->getStore($storeId);
|
65 |
}
|
66 |
public function getRowUrl($row)
|
67 |
{
|
68 |
return $this->getUrl('*/*/details', array('_secure' => true,'id' => $row->getId(),'fbr'=>$row->isFetchRequire()));
|
69 |
}
|
|
|
1 |
* Lay-Buys
|
2 |
*
|
3 |
* NOTICE OF LICENSE
|
4 |
*
|
5 |
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
* that is bundled with this package in the file LICENSE.txt.
|
7 |
* It is also available through the world-wide-web at this URL:
|
8 |
* http://opensource.org/licenses/osl-3.0.php
|
9 |
* If you did not receive a copy of the license and are unable to
|
10 |
* obtain it through the world-wide-web, please send an email
|
11 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
12 |
*
|
13 |
* DISCLAIMER
|
14 |
*
|
15 |
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
16 |
* versions in the future. If you wish to customize Magento for your
|
17 |
* needs please refer to http://www.magentocommerce.com for more information.
|
18 |
*
|
19 |
* @category Ced
|
20 |
* @package Ced_LayBuy
|
21 |
* @author Asheesh Singh<asheeshsingh@cedcoss.com>
|
22 |
* @copyright Copyright LAY-BUYS (2011). (http://lay-buys.com/)
|
23 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
24 |
*/
|
25 |
* Block for LayBuy report grid
|
26 |
*/
|
27 |
{
|
28 |
$storeId = (int) $this->getRequest()->getParam('store', 0);
|
29 |
return Mage::app()->getStore($storeId);
|
30 |
}
|
31 |
public function getRowUrl($row)
|
32 |
{
|
33 |
return $this->getUrl('*/*/details', array('_secure' => true,'id' => $row->getId()));
|
34 |
}
|
35 |
+
<?php
|
36 |
* Lay-Buys
|
37 |
*
|
38 |
* NOTICE OF LICENSE
|
39 |
*
|
40 |
* This source file is subject to the Open Software License (OSL 3.0)
|
41 |
* that is bundled with this package in the file LICENSE.txt.
|
42 |
* It is also available through the world-wide-web at this URL:
|
43 |
* http://opensource.org/licenses/osl-3.0.php
|
44 |
* If you did not receive a copy of the license and are unable to
|
45 |
* obtain it through the world-wide-web, please send an email
|
46 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
47 |
*
|
48 |
* DISCLAIMER
|
49 |
*
|
50 |
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
51 |
* versions in the future. If you wish to customize Magento for your
|
52 |
* needs please refer to http://www.magentocommerce.com for more information.
|
53 |
*
|
54 |
* @category Ced
|
55 |
* @package Ced_LayBuy
|
56 |
* @author Asheesh Singh<asheeshsingh@cedcoss.com>
|
57 |
* @copyright Copyright LAY-BUYS (2011). (http://lay-buys.com/)
|
58 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
59 |
*/
|
60 |
* Block for LayBuy report grid
|
61 |
*/
|
62 |
{
|
63 |
$storeId = (int) $this->getRequest()->getParam('store', 0);
|
64 |
return Mage::app()->getStore($storeId);
|
65 |
}
|
66 |
public function getRowUrl($row)
|
67 |
{
|
68 |
return $this->getUrl('*/*/details', array('_secure' => true,'id' => $row->getId(),'fbr'=>$row->isFetchRequire()));
|
69 |
}
|
app/code/local/Ced/LayBuy/Helper/Data.php
CHANGED
@@ -32,6 +32,7 @@
|
|
32 |
|
33 |
class Ced_LayBuy_Helper_Data extends Mage_Core_Helper_Abstract{
|
34 |
|
|
|
35 |
public function getStatuses(){
|
36 |
return array(
|
37 |
'0' => $this->__("Pending"),
|
@@ -119,6 +120,9 @@ class Ced_LayBuy_Helper_Data extends Mage_Core_Helper_Abstract{
|
|
119 |
}
|
120 |
|
121 |
public function getMatchingData(){
|
|
|
|
|
|
|
122 |
$result = array();
|
123 |
$orderIds = '';
|
124 |
$profileIds = '';
|
@@ -295,4 +299,35 @@ class Ced_LayBuy_Helper_Data extends Mage_Core_Helper_Abstract{
|
|
295 |
$collection->addFieldToFilter('method',$code);
|
296 |
return $collection->getAllIds();
|
297 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
}
|
32 |
|
33 |
class Ced_LayBuy_Helper_Data extends Mage_Core_Helper_Abstract{
|
34 |
|
35 |
+
protected $_matchingData = null;
|
36 |
public function getStatuses(){
|
37 |
return array(
|
38 |
'0' => $this->__("Pending"),
|
120 |
}
|
121 |
|
122 |
public function getMatchingData(){
|
123 |
+
if($this->_matchingData != null) {
|
124 |
+
return $this->_matchingData;
|
125 |
+
}
|
126 |
$result = array();
|
127 |
$orderIds = '';
|
128 |
$profileIds = '';
|
299 |
$collection->addFieldToFilter('method',$code);
|
300 |
return $collection->getAllIds();
|
301 |
}
|
302 |
+
|
303 |
+
public function fetchBeforeRevise($profileId = 0) {
|
304 |
+
if($profileId) {
|
305 |
+
$this->_matchingData = array('orderIds'=>'','profileIds'=>$profileId);
|
306 |
+
try {
|
307 |
+
$reports = Mage::getModel('laybuy/report');
|
308 |
+
/* @var $reports Mage_laybuy_Model_Report_Instalment */
|
309 |
+
$credentials = $reports->getApiCredentials();
|
310 |
+
if (empty($credentials)) {
|
311 |
+
return false;
|
312 |
+
}
|
313 |
+
foreach ($credentials as $config) {
|
314 |
+
try {
|
315 |
+
$fetched = $reports->fetchAndSave($config);
|
316 |
+
if($fetched){
|
317 |
+
return true;
|
318 |
+
}else{
|
319 |
+
return false;
|
320 |
+
}
|
321 |
+
} catch (Exception $e) {
|
322 |
+
return false;
|
323 |
+
}
|
324 |
+
}
|
325 |
+
} catch (Mage_Core_Exception $e) {
|
326 |
+
return false;
|
327 |
+
} catch (Exception $e) {
|
328 |
+
return false;
|
329 |
+
}
|
330 |
+
}
|
331 |
+
return false;
|
332 |
+
}
|
333 |
}
|
app/code/local/Ced/LayBuy/Model/Report.php
CHANGED
@@ -53,6 +53,19 @@ class Ced_LayBuy_Model_Report extends Mage_Core_Model_Abstract
|
|
53 |
{
|
54 |
$this->_init('laybuy/report');
|
55 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
/**
|
58 |
* Goes to specified host/path and fetches reports from there.
|
@@ -67,8 +80,9 @@ class Ced_LayBuy_Model_Report extends Mage_Core_Model_Abstract
|
|
67 |
$helper = Mage::helper('laybuy');
|
68 |
|
69 |
$listing = $helper->fetchFromLaybuy($config);
|
70 |
-
|
71 |
foreach($listing as $orderId=>$reports){
|
|
|
72 |
$status = $reports->status;
|
73 |
$report = $reports->report;
|
74 |
/* print_r($status);
|
@@ -96,6 +110,7 @@ class Ced_LayBuy_Model_Report extends Mage_Core_Model_Abstract
|
|
96 |
$transaction->paymentDate = date('Y-m-d h:i:s', strtotime(str_replace('/','-',$transaction->paymentDate)));
|
97 |
$date = Mage::helper('core')->formatDate($transaction->paymentDate, Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);
|
98 |
$nextPaymentDate = $transaction->paymentDate;
|
|
|
99 |
if($transaction->type == 'd'){
|
100 |
$newStr .= '<tbody><tr class="even" ><td style="text-align: center;"> DP: </td><td style="text-align: center;"> '.Mage::app()->getLocale()
|
101 |
->currency($model->getData('currency'))
|
@@ -105,6 +120,9 @@ class Ced_LayBuy_Model_Report extends Mage_Core_Model_Abstract
|
|
105 |
'<td style="text-align: center;"> '.$transaction->paymentStatus.' </td></tr>';
|
106 |
continue;
|
107 |
}elseif($transaction->type == 'p'){
|
|
|
|
|
|
|
108 |
$pending_flag = true;
|
109 |
$newStr .= '<tr ';
|
110 |
if($month%2==0)
|
@@ -126,9 +144,11 @@ class Ced_LayBuy_Model_Report extends Mage_Core_Model_Abstract
|
|
126 |
|
127 |
}
|
128 |
|
|
|
129 |
}
|
|
|
130 |
//if($pending_flag)
|
131 |
-
|
132 |
// else
|
133 |
// $startIndex = $month+2;
|
134 |
if($month<$months){
|
53 |
{
|
54 |
$this->_init('laybuy/report');
|
55 |
}
|
56 |
+
|
57 |
+
public function isFetchRequire() {
|
58 |
+
if($this->getId() && $this->getStatus() == 0) {
|
59 |
+
$nextPaymentDate = $this->getFirstPaymentDue();
|
60 |
+
if($this->getTransaction() > 2) {
|
61 |
+
$nextPaymentDate = date("Y-m-d h:i:s", strtotime($this->getFirstPaymentDue() . " +".($this->getTransaction() - 2)." month"));
|
62 |
+
}
|
63 |
+
if(time() >= strtotime($nextPaymentDate)) {
|
64 |
+
return true;
|
65 |
+
}
|
66 |
+
}
|
67 |
+
return false;
|
68 |
+
}
|
69 |
|
70 |
/**
|
71 |
* Goes to specified host/path and fetches reports from there.
|
80 |
$helper = Mage::helper('laybuy');
|
81 |
|
82 |
$listing = $helper->fetchFromLaybuy($config);
|
83 |
+
/* print_r($listing);die; */
|
84 |
foreach($listing as $orderId=>$reports){
|
85 |
+
$startIndex = 2;
|
86 |
$status = $reports->status;
|
87 |
$report = $reports->report;
|
88 |
/* print_r($status);
|
110 |
$transaction->paymentDate = date('Y-m-d h:i:s', strtotime(str_replace('/','-',$transaction->paymentDate)));
|
111 |
$date = Mage::helper('core')->formatDate($transaction->paymentDate, Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);
|
112 |
$nextPaymentDate = $transaction->paymentDate;
|
113 |
+
|
114 |
if($transaction->type == 'd'){
|
115 |
$newStr .= '<tbody><tr class="even" ><td style="text-align: center;"> DP: </td><td style="text-align: center;"> '.Mage::app()->getLocale()
|
116 |
->currency($model->getData('currency'))
|
120 |
'<td style="text-align: center;"> '.$transaction->paymentStatus.' </td></tr>';
|
121 |
continue;
|
122 |
}elseif($transaction->type == 'p'){
|
123 |
+
if(strlen($transaction->txnID)>0) {
|
124 |
+
$startIndex++;
|
125 |
+
}
|
126 |
$pending_flag = true;
|
127 |
$newStr .= '<tr ';
|
128 |
if($month%2==0)
|
144 |
|
145 |
}
|
146 |
|
147 |
+
|
148 |
}
|
149 |
+
|
150 |
//if($pending_flag)
|
151 |
+
//$startIndex = $month+1;
|
152 |
// else
|
153 |
// $startIndex = $month+2;
|
154 |
if($month<$months){
|
app/code/local/Ced/LayBuy/controllers/Adminhtml/ReportController.php
CHANGED
@@ -62,16 +62,23 @@ class Ced_LayBuy_Adminhtml_ReportController extends Mage_Adminhtml_Controller_Ac
|
|
62 |
public function detailsAction()
|
63 |
{
|
64 |
$rowId = $this->getRequest()->getParam('id');
|
|
|
65 |
$row = Mage::getModel('laybuy/report')->load($rowId);
|
66 |
if (!$row->getId()) {
|
67 |
$this->_redirect('*/*/',array('_secure' => true));
|
68 |
return;
|
69 |
}
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
}
|
76 |
|
77 |
/**
|
62 |
public function detailsAction()
|
63 |
{
|
64 |
$rowId = $this->getRequest()->getParam('id');
|
65 |
+
$fbr = $this->getRequest()->getParam('fbr',0);
|
66 |
$row = Mage::getModel('laybuy/report')->load($rowId);
|
67 |
if (!$row->getId()) {
|
68 |
$this->_redirect('*/*/',array('_secure' => true));
|
69 |
return;
|
70 |
}
|
71 |
+
$row->setReviseConfirmMessage('');
|
72 |
+
if($fbr && Mage::helper('laybuy')->fetchBeforeRevise($row->getData('paypal_profile_id'))) {
|
73 |
+
$row = Mage::getModel('laybuy/report')->load($row->getId());
|
74 |
+
} elseif($fbr) {
|
75 |
+
$row->setReviseConfirmMessage(Mage::helper('laybuy')->__("Are you sure to Revise Instalment Plan because instalment reports are not up-to-date."));
|
76 |
+
}
|
77 |
+
Mage::register('current_laybuy_transaction', $row);
|
78 |
+
$this->_initAction()
|
79 |
+
->_title($this->__('View Transaction'))
|
80 |
+
->_addContent($this->getLayout()->createBlock('laybuy/adminhtml_report_details', 'laybuyInstalmentDetails'))
|
81 |
+
->renderLayout();
|
82 |
}
|
83 |
|
84 |
/**
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ced_LayBuy</name>
|
4 |
-
<version>2.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
@@ -21,9 +21,9 @@ This effectively increases sales and radically improves cash flow where all the
|
|
21 |
<notes>1. New secure communication protocal,
|
22 |
.</notes>
|
23 |
<authors><author><name>Warrin</name><user>Warrin</user><email>warrin@lay-buys.com</email></author><author><name>Asheesh Singh</name><user>asheeshsingh</user><email>asheeshsingh@cedcoss.com</email></author></authors>
|
24 |
-
<date>
|
25 |
-
<time>
|
26 |
-
<contents><target name="magelocal"><dir name="Ced"><dir name="LayBuy"><dir name="Block"><dir name="Adminhtml"><file name="Docalc.php" hash="c12af05bee0d480ac49835b46ca8011e"/><dir name="Orders"><file name="Grid.php" hash="
|
27 |
<compatible/>
|
28 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
29 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ced_LayBuy</name>
|
4 |
+
<version>2.1.8</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
21 |
<notes>1. New secure communication protocal,
|
22 |
.</notes>
|
23 |
<authors><author><name>Warrin</name><user>Warrin</user><email>warrin@lay-buys.com</email></author><author><name>Asheesh Singh</name><user>asheeshsingh</user><email>asheeshsingh@cedcoss.com</email></author></authors>
|
24 |
+
<date>2015-01-09</date>
|
25 |
+
<time>13:34:42</time>
|
26 |
+
<contents><target name="magelocal"><dir name="Ced"><dir name="LayBuy"><dir name="Block"><dir name="Adminhtml"><file name="Docalc.php" hash="c12af05bee0d480ac49835b46ca8011e"/><dir name="Orders"><file name="Grid.php" hash="54a924cd69f95cf9496f91702a4edeec"/><file name="Grid.php.bkp" hash="b37908e3e7f57787c4b3d441be869ba9"/></dir><file name="Orders.php" hash="aa89abe43868eedab8cb195b5dcbe77f"/><dir name="Report"><dir name="Details"><file name="Form.php" hash="e0ce57d85efc14656d4294021e5f5257"/></dir><file name="Details.php" hash="16317e0652d7e33e1207d0a1b29ed185"/><dir name="Edit"><file name="Form.php" hash="7ed154807dc7abbf2113ecb9d9dd6226"/></dir><file name="Edit.php" hash="5dc6f961714c5d38a228f6b943c3127d"/><file name="Grid.php" hash="a94a86483b880c9908572e3fc8f5d30d"/><dir name="Renderer"><file name="Email.php" hash="8e6c0938d80f629cd285303018945ea1"/><file name="Order.php" hash="51a2ba685b652f69df633ccfa4b5900a"/><file name="Record.php" hash="95eb9f836a50f3f80d254a7cdd8e1d6e"/></dir></dir><file name="Report.php" hash="ff77fef080779db3a699cdb8a4703c49"/></dir><dir name="Customer"><dir name="Account"><file name="Details.php" hash="5bb9caf5b0a6e9584046f6af9ee4ae5f"/><file name="Grid.php" hash="3b170ed3f70422b3a64263535d3543e3"/></dir></dir><dir name="Form"><file name="Laybuy.php" hash="cbf8b96d0fa26d4b772bafd021e3fc83"/></dir><dir name="Info"><file name="Laybuy.php" hash="bced26100dc8bbadc334b54349734637"/></dir><dir name="Revise"><file name="Redirect.php" hash="6f63613d0fe5540a296804c14263a614"/></dir><dir name="Standard"><file name="Docalc.php" hash="42b2b63a23577c888cccc5f6c20b8867"/><file name="Redirect.php" hash="bdf403ef8c7c290ce0af83cdd172dcb7"/></dir></dir><dir name="Helper"><file name="Config.php" hash="360b6125612be9de5cd0e3b69f4422c2"/><file name="Data.php" hash="7e5ba01ef723858f4752d03cf2242103"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Report"><file name="Collection.php" hash="a3e133f1128200662330a5e21a94c809"/></dir><file name="Report.php" hash="25568238c401ab5e5768596fb76f7ef8"/><dir name="Revise"><file name="Collection.php" hash="2a502f75e4634e4f231f93226ef49b8a"/></dir><file name="Revise.php" hash="cd1a424882417e0ec94561a8cca378e8"/><file name="Setup.php" hash="261838defadf805c7ee29768f6ea8cec"/></dir><file name="Observer.php" hash="e085e396516583f6685648f75d967a66"/><file name="Report.php" hash="2570fe3fefbd6e25e0c055b16488cc66"/><file name="Revise.php" hash="b9bbea4b6760b464ec8ff66c872def7a"/><file name="Standard.php" hash="b991b733940156d1b24b6a0c813d68e0"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Cron.php" hash="955ae77c29ecbc063d8f779898d08472"/><file name="Cron.php.bkp" hash="24c8fcf93531c9877d03f2eebde2e2dd"/></dir><dir name="Source"><file name="Allowspecificcategory.php" hash="0463f2be60a2695e4f76411c979b6bc8"/><file name="Allowspecificgroup.php" hash="a27c9bf1231a59a8f38668b525c420ba"/><file name="Categories.php" hash="92c61dba3c23e7838cddbaaee8f21d05"/><file name="FetchingSchedule.php" hash="7ad862c46ec8f54299cc92ae87b61322"/><file name="FetchingSchedule.php.bkp" hash="4f3e5aec5a17991d1625d6f17c0f7d32"/><file name="Groups.php" hash="87a205676d93d59a26d1d7bb69266991"/></dir></dir></dir></dir><file name="README.txt" hash="7930d4ac1e8f9957bb2052983eab4340"/><dir name="controllers"><dir name="Adminhtml"><file name="OrdersController.php" hash="b439600c08514fb9ada1ae0e75272e21"/><file name="ReportController.php" hash="b22ab26daaeca1c067427288230d1656"/></dir><file name="ReportController.php" hash="e2c5e9ce734b2c3320eb503e05baecae"/><file name="ReviseController.php" hash="39cf4f4031522b1cf0f623f51c186715"/><file name="StandardController.php" hash="0c4233798441091d6749766c0a894789"/></dir><dir name="etc"><file name="adminhtml.xml" hash="6bc550c65f0f65b11d6dbb38aafcb63d"/><file name="config.xml" hash="b4989e2e7bc0e017b0202523cdc13097"/><file name="system.xml" hash="166bd65cd4f03b10cd879c5471c5ca6a"/></dir><dir name="sql"><dir name="laybuy_setup"><file name="mysql4-install-0.1.0.php" hash="68e359cd24b6051d0c2a91daad899d71"/><file name="mysql4-upgrade-0.1.0-0.2.0.php" hash="bec5e37090cb5a6da6c8ba3652a8bd32"/><file name="mysql4-upgrade-0.2.0-0.3.0.php" hash="97aa7a2a8c91e46c896a6d04d9554aeb"/><file name="mysql4-upgrade-0.3.0-0.4.0.php" hash="9b147158166b94d52e0cfff369ce965c"/><file name="mysql4-upgrade-0.4.0-0.5.0.php" hash="7626925b0cac03d0918eb6b1d51e6d19"/><file name="mysql4-upgrade-0.5.0-0.6.0.php" hash="bc96daed76ca1f04b1eb422508bc3a4b"/><file name="mysql4-upgrade-0.6.0-0.7.0.php" hash="6aa013f47e3b78e4d78e2cba9b471cd4"/><file name="mysql4-upgrade-0.7.0-0.8.0.php" hash="c2ea0f16c8f1e0dc7412a6a0fda1c622"/><file name="mysql4-upgrade-0.8.0-0.9.0.php" hash="d98ba6bef5f4f46ca741d5db014686f1"/><file name="mysql4-upgrade-0.9.0-1.0.0.php" hash="a20364c9f3a1b2a6a7e33a2e2f03bd60"/></dir></dir><file name="README.txt" hash="7930d4ac1e8f9957bb2052983eab4340"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="laybuy.xml" hash="963cc90317ac79c032f2530eca1813ba"/></dir><dir name="template"><dir name="laybuy"><dir name="checkout"><dir name="onepage"><dir name="review"><file name="button.phtml" hash="a1e678a76d674b223e944bdd4de0625a"/></dir></dir></dir><dir name="customer"><dir name="account"><file name="details.phtml" hash="965a58454b4b3cdcc115d78e595f7c33"/><file name="grid.phtml" hash="2dc802991a69b459f263f4e78c657549"/></dir></dir><dir name="form"><file name="extra.phtml" hash="535609083ce3e06706ec30766b354d8a"/><file name="extra.phtml.bkp" hash="e089ba0a3bd4ff1c0bc631c88ba32dd2"/><file name="laybuy.phtml" hash="551ef401641d7d62c8d821279b13d72e"/><file name="laybuy.phtml.bkp" hash="a1c8dc8ff7ebd565d0100785ad089f64"/></dir><dir name="info"><file name="default.phtml" hash="b0bdfa731e4410c99a79c3b5b0a86cff"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="laybuy.xml" hash="b60d76e466dac9154654041350d5e829"/></dir><dir name="template"><dir name="laybuy"><dir name="info"><file name="default.phtml" hash="a9dfb322a83df7bc53bb2a64c6f192e3"/><dir name="pdf"><file name="laybuy.phtml" hash="e96cab97e4bd4ca32a022e90d5449eae"/></dir></dir><file name="notification.phtml" hash="efb99f36ea192d6bc8c60d53dec8a6e1"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ced_LayBuy.xml" hash="394d4e115e1955ba12681f6a81cb118d"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Ced_LayBuy.csv" hash="f79a1a6ca61c5e7a7463c380eb00896d"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="laybuy"><file name="tooltip.css" hash="ece078bf3d8bb27db4a616fdad505671"/></dir></dir><dir name="images"><dir name="laybuy"><file name="closeBtn.png" hash="b0be9d9ef1053c79b0ebdcef83b53f44"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="laybuy"><file name="jquery.atooltip.js" hash="5ad78b7e8ac539053ff56a2ea25e4d4c"/><file name="jquery.min.js" hash="41ab3fafa358a66f764b91d072f16615"/></dir></dir></target></contents>
|
27 |
<compatible/>
|
28 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
29 |
</package>
|