Changed checkout_plugin_id to checkout_id and ADSL speed to SUPPLIER speed

This commit is contained in:
Deon George 2013-06-17 22:47:44 +10:00
parent 98a36554ae
commit 1caeed6606
11 changed files with 18 additions and 18 deletions

View File

@ -72,7 +72,7 @@ class Controller_Reseller_Service_Adsl extends Controller_Service {
'id'=>'ID',
'name()'=>'Service',
'plugin()->ipaddress()'=>'IP Address',
'product->plugin()->speed'=>'Speed',
'product->plugin()->adsl_supplier_plan->speed'=>'Speed',
'product->plugin()->allowance()'=>'Allowance',
'plugin()->traffic_thismonth()'=>'This Month',
'plugin()->traffic_lastmonth()'=>'Last Month',

View File

@ -35,7 +35,7 @@
<tr class="plan-features">
<th>Speed</th>
<?php $c=0; foreach ($o->products() as $po) : ?>
<td><?php echo $po->plugin()->display('speed'); ?></td>
<td><?php echo $po->plugin()->adsl_supplier_plan->display('speed'); ?></td>
<?php endforeach ?>
</tr>

View File

@ -34,7 +34,7 @@
<div class="plan-features">
<ul>
<li><span class="note">$</span><strong><?php echo Currency::display($po->price(0,1,'price_setup',TRUE)); ?></strong> setup</li>
<li><strong><?php echo $po->plugin()->display('speed'); ?></strong> Speed</li>
<li><strong><?php echo $po->plugin()->adsl_supplier_plan->display('speed'); ?></strong> Speed</li>
<li><strong><?php echo $po->plugin()->base_down_peak/1000; ?></strong>GB Peak Downloads</li>
<?php if ($po->plugin()->base_down_offpeak) : ?>
<li><strong><?php echo $po->plugin()->base_down_offpeak/1000; ?></strong>GB OffPeak Downloads</li>

View File

@ -4,7 +4,7 @@
<div class="dl-horizontal">
<dt>Speed</dt>
<dd><?php echo $po->display('speed'); ?></dd>
<dd><?php echo $po->adsl_supplier_plan->display('speed'); ?></dd>
<dt>Peak Downloads Included</dt>
<dd><?php echo $po->base_down_peak/1000; ?> GB, excess <?php echo $po->display('extra_down_peak'); ?>/GB.

View File

@ -154,7 +154,7 @@ abstract class Checkout_Plugin_Paypal extends Checkout_Plugin {
$po->fees_amt = $cno->data['mc_fee'];
$po->total_amt = $cno->data['mc_gross'];
$po->date_payment = strtotime($cno->data['payment_date']);
$po->checkout_plugin_id = $this->co->id;
$po->checkout_id = $this->co->id;
$po->notes = $cno->data['txn_id'];
$po->save();

View File

@ -11,7 +11,7 @@
*/
class Model_Checkout extends ORM_OSB {
protected $_has_many = array(
'account'=>array('through'=>'account_billing','foreign_key'=>'checkout_plugin_id'),
'account'=>array('through'=>'account_billing','foreign_key'=>'checkout_id'),
'payment'=>array(),
);

View File

@ -78,9 +78,9 @@ class Payment_Bulk_Ezypay {
// @todo Hack - since the reports dont show how the payment was made.
// @todo Put this in a config file, in the mean time.
if ($array[7] == 1.05)
$payments[$array[3]]->checkout_plugin_id = 2;
$payments[$array[3]]->checkout_id = 2;
else
$payments[$array[3]]->checkout_plugin_id = 4;
$payments[$array[3]]->checkout_id = 4;
}
$result = '';

View File

@ -12,7 +12,7 @@
</tr>
<tr>
<td>Method</td>
<td><?php echo Form::select('checkout_plugin_id',ORM::factory('Checkout')->list_select(),$po->checkout_plugin_id,array('label'=>'Payment Method','required')); ?></td>
<td><?php echo Form::select('checkout_id',ORM::factory('Checkout')->list_select(),$po->checkout_id,array('label'=>'Payment Method','required')); ?></td>
</tr>
<tr>
<td>Amount</td>

View File

@ -597,10 +597,10 @@ class Controller_Admin_Service extends Controller_Service {
foreach ($svs as $a=>$so) {
// Number of services
if (! isset($stats[$so->product->plugin()->speed]['c']))
$stats[$so->product->plugin()->speed]['c'] = 0;
if (! isset($stats[$so->product->plugin()->adsl_supplier_plan->speed]['c']))
$stats[$so->product->plugin()->adsl_supplier_plan->speed]['c'] = 0;
$stats[$so->product->plugin()->speed]['c']++;
$stats[$so->product->plugin()->adsl_supplier_plan->speed]['c']++;
$ts++;
// Amount of traffic
@ -612,10 +612,10 @@ class Controller_Admin_Service extends Controller_Service {
$a = $i;
}
if (! isset($stats[$so->product->plugin()->speed]['d'][$a]))
$stats[$so->product->plugin()->speed]['d'][$a] = 0;
if (! isset($stats[$so->product->plugin()->adsl_supplier_plan->speed]['d'][$a]))
$stats[$so->product->plugin()->adsl_supplier_plan->speed]['d'][$a] = 0;
$stats[$so->product->plugin()->speed]['d'][$a]++;
$stats[$so->product->plugin()->adsl_supplier_plan->speed]['d'][$a]++;
}
if (count($stats)) {

View File

@ -52,7 +52,7 @@ class Controller_Reseller_Service extends Controller_Service {
foreach (ORM::factory('Account')->where_active()->where('id','IN',$this->ao->RTM->customers($this->ao->RTM))->find_all() as $ao)
if ($ao->has_any('group',array($go)))
foreach ($ao->service->list_active() as $so)
if (! $so->service_billing->checkout_plugin_id)
if (! $so->service_billing->checkout_id)
array_push($svs,$so);
if ($svs)
@ -82,7 +82,7 @@ class Controller_Reseller_Service extends Controller_Service {
foreach ($co->account->where('account.id','IN',$this->ao->RTM->customers($this->ao->RTM))->find_all() as $ao)
foreach ($ao->service->list_active() as $so)
if ($so->service_billing->checkout_plugin_id == $co->id)
if ($so->service_billing->checkout_id == $co->id)
array_push($svs,$so);
if ($svs)

View File

@ -14,7 +14,7 @@ class Model_Service_Billing extends ORM_OSB {
// Relationships
protected $_has_one = array(
'checkout'=>array('far_key'=>'checkout_plugin_id','foreign_key'=>'id'),
'checkout'=>array('far_key'=>'checkout_id','foreign_key'=>'id'),
);
}
?>