More minor fixes
This commit is contained in:
@@ -16,6 +16,7 @@ class Model_Product_Plugin_Host extends Model_Product_Plugin {
|
||||
}
|
||||
|
||||
// Our required abstract methods
|
||||
public function admin_update() {}
|
||||
public function feature_summary() {}
|
||||
|
||||
// @todo This is not used, but should be.
|
||||
|
@@ -605,16 +605,74 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$loutput = '';
|
||||
$doutput = $loutput = '';
|
||||
|
||||
$loutput .= View::factory($this->viewpath())
|
||||
->set('so',$so);
|
||||
|
||||
// Validate the transactions
|
||||
$bt = NULL;
|
||||
$save = (isset($_REQUEST['go']) && $_REQUEST['go']=1) ? 1 : 0;
|
||||
$xsid=197;
|
||||
foreach ($so->transactions()->where('item_type','=',0)->find_all() as $iio) {
|
||||
if ($iio->service_id == $xsid AND $iio->invoice_id < 3070) continue;
|
||||
if ($iio->quantity < 0 OR $iio->price_base < 0)
|
||||
continue;
|
||||
if (in_array($iio->id,array(960)))
|
||||
continue;
|
||||
|
||||
if ($iio->invoice_id > 4000 OR $iio->product->prod_plugin_file=="ADSL")
|
||||
$a = FALSE;
|
||||
else
|
||||
$a = TRUE;
|
||||
|
||||
if (is_null($bt))
|
||||
$bt = $iio->date_start;
|
||||
|
||||
// $doutput .= sprintf('%s: BT is: %s [%s]<br/>',$iio->id,Config::date($bt),$bt);
|
||||
|
||||
$pdata = Period::details($iio->recurring_schedule,$a ? NULL : $iio->product->price_recurr_weekday,$bt,TRUE);
|
||||
|
||||
switch ($iio->recurring_schedule) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 4:
|
||||
case 5:
|
||||
if ($iio->date_start != $pdata['start_time']) {
|
||||
$doutput .= sprintf('%s: Set start_time: %s [%s]<br/>',$iio->id,Config::date($pdata['start_time']),$pdata['start_time']);
|
||||
$iio->date_start=$pdata['start_time'];
|
||||
}
|
||||
|
||||
if ($iio->date_stop != $pdata['end_time']) {
|
||||
$doutput .= sprintf('%s: Set end_time: %s [%s] <br/>',$iio->id,Config::date($pdata['end_time']),$pdata['end_time']);
|
||||
$iio->date_stop=$pdata['end_time'];
|
||||
}
|
||||
$bt = $pdata['end_time']+86400;
|
||||
|
||||
//$doutput .= sprintf('%s: BT now: %s (%s) [%s]<br/>',$iio->id,Config::date($bt),Config::date($pdata['end_time']),$bt);
|
||||
break;
|
||||
|
||||
default:
|
||||
$doutput .= sprintf('%s: %s Not handled',$iio->id,$iio->recurring_schedule);
|
||||
}
|
||||
//$doutput .= '<br/>';
|
||||
if ($save) {
|
||||
$iio->save();
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['go']))
|
||||
$this->request->redirect('admin/service/view/'.$so->id);
|
||||
Block::add(array(
|
||||
'title'=>sprintf('Transaction History for %s: %s',$so->id(),$so->name()),
|
||||
'body'=>$loutput,
|
||||
));
|
||||
|
||||
Block::add(array(
|
||||
'title'=>sprintf('Transaction Debug for %s: %s',$so->id(),$so->name()),
|
||||
'body'=>$doutput,
|
||||
));
|
||||
|
||||
$output .= View::factory('service/user/view')
|
||||
->set('so',$so);
|
||||
|
||||
|
@@ -131,7 +131,7 @@ class Model_Service extends ORMOSB {
|
||||
}
|
||||
|
||||
public function transactions() {
|
||||
return $this->invoice_item->order_by('date_start,date_stop')->find_all();
|
||||
return $this->invoice_item->order_by('date_start,date_stop');
|
||||
}
|
||||
|
||||
// @todo To implement
|
||||
|
@@ -1,41 +1,36 @@
|
||||
<!-- @todo NEEDS TO BE TRANSLATED -->
|
||||
<table class="box-left" width="100%">
|
||||
<tr>
|
||||
<td class="head" colspan="2">Transactions for this service</td>
|
||||
<table class="list-box-left">
|
||||
<tr class="list-head">
|
||||
<th>ID</th>
|
||||
<th>Invoice</th>
|
||||
<th>Product</th>
|
||||
<th>IT</th>
|
||||
<th>RS</th>
|
||||
<th>Start</th>
|
||||
<th>Stop</th>
|
||||
<th>Desc</th>
|
||||
<th>Quantity</th>
|
||||
<th>Charge</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>Invoice</td>
|
||||
<td>Product</td>
|
||||
<td>IT</td>
|
||||
<td>RS</td>
|
||||
<td>Start</td>
|
||||
<td>Stop</td>
|
||||
<td>Desc</td>
|
||||
<td>Charge</td>
|
||||
<td>Quantity</td>
|
||||
</tr>
|
||||
<?php $lp=NULL;$i=0; foreach ($so->transactions() as $iio) { ?>
|
||||
<?php $lp=NULL; foreach ($so->transactions()->find_all() as $iio) { ?>
|
||||
<?php if (! is_null($iio->product_id) AND $lp != $iio->product_id) {
|
||||
$lp = $iio->product_id; ?>
|
||||
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
|
||||
<td class="head" colspan="10"><?php echo sprintf('%s: %s',$iio->product_id,$iio->product->name()); ?></td>
|
||||
<tr class="list-sub-head">
|
||||
<th class="id"><?php echo $iio->product_id; ?></th>
|
||||
<th colspan="9"><?php echo $iio->product->name(); ?></th>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
|
||||
<td class="icon" width="20px"><?php echo $iio->id; ?></td>
|
||||
<td class="data"><?php echo HTML::anchor('/user/invoice/view/'.$iio->invoice_id,$iio->invoice_id); ?></td>
|
||||
<td class="data"><?php echo $iio->display('product_id'); ?></td>
|
||||
<td class="data"><?php echo $iio->display('item_type'); ?></td>
|
||||
<td class="data"><?php echo $iio->display('recurring_schedule'); ?></td>
|
||||
<td class="data"><?php echo $iio->display('date_start'); ?></td>
|
||||
<td class="data"><?php echo $iio->display('date_stop'); ?></td>
|
||||
<td class="data"><?php echo $iio->display('product_name'); ?></td>
|
||||
<td class="data"><?php echo $iio->display('price_base'); ?></td>
|
||||
<td class="data"><?php echo $iio->display('quantity'); ?></td>
|
||||
<tr class="list-data">
|
||||
<td class="id"><?php echo $iio->id; ?></td>
|
||||
<td><?php echo HTML::anchor('/user/invoice/view/'.$iio->invoice_id,$iio->invoice_id); ?></td>
|
||||
<td><?php echo $iio->display('product_id'); ?></td>
|
||||
<td><?php echo $iio->display('item_type'); ?></td>
|
||||
<td><?php echo $iio->display('recurring_schedule'); ?></td>
|
||||
<td><?php echo $iio->display('date_start'); ?></td>
|
||||
<td><?php echo $iio->display('date_stop'); ?></td>
|
||||
<td><?php echo $iio->display('product_name'); ?></td>
|
||||
<td><?php echo $iio->display('quantity'); ?></td>
|
||||
<td class="right"><?php echo $iio->display('price_base'); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
|
@@ -14,6 +14,8 @@ class Model_Product_Plugin_SSL extends Model_Product_Plugin {
|
||||
protected $_table_name = 'ssl';
|
||||
|
||||
// Our required abstract methods
|
||||
public function admin_update() {}
|
||||
|
||||
public function feature_summary() {
|
||||
// @todo This view should render based on the the results of this::allowance();
|
||||
return View::factory('product/plugin/ssl/feature_summary')
|
||||
|
Reference in New Issue
Block a user