Fixes for live environment and updates to admin/service/update
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
* @todo Replace View::factory files to use $this->viewpath()
|
||||
*/
|
||||
class Controller_Admin_Service extends Controller_TemplateDefault {
|
||||
protected $control = array('Services'=>'services');
|
||||
@@ -51,14 +50,14 @@ ORDER BY c.id,s.recur_schedule,c.name,a.company,a.last_name,a.first_name
|
||||
|
||||
if (($si != $last_account) AND $last_account) {
|
||||
if ($sc > 1)
|
||||
$output .= View::factory('service/list/bycheckout_subtotal')
|
||||
$output .= View::factory('service/admin/list/bycheckout_subtotal')
|
||||
->set('subtotal',Currency::display($st))
|
||||
->set('i',$i++%2);
|
||||
$sc = $st = 0;
|
||||
}
|
||||
|
||||
if (($service['cid'] != $last_checkout) OR (! is_null($last_checkout) AND ! $last_checkout)) {
|
||||
$output .= View::factory('service/list/bycheckout_header')
|
||||
$output .= View::factory('service/admin/list/bycheckout_header')
|
||||
->set('checkout_name',$service['checkout_plugin_name'])
|
||||
->set('last_checkout',$last_checkout);
|
||||
}
|
||||
@@ -69,14 +68,14 @@ ORDER BY c.id,s.recur_schedule,c.name,a.company,a.last_name,a.first_name
|
||||
$st += round($so->price+$so->tax(),2);
|
||||
$sc++;
|
||||
|
||||
$output .= View::factory('service/list/bycheckout_body')
|
||||
$output .= View::factory('service/admin/list/bycheckout_body')
|
||||
->set('service',$so)
|
||||
->set('i',$i++%2);
|
||||
}
|
||||
|
||||
// Last subtotal
|
||||
if ($sc > 1)
|
||||
$output .= View::factory('service/list/bycheckout_subtotal')
|
||||
$output .= View::factory('service/admin/list/bycheckout_subtotal')
|
||||
->set('subtotal',$st)
|
||||
->set('i',$i++%2);
|
||||
|
||||
@@ -124,13 +123,13 @@ ORDER BY C.last_name,B.account_id,A.service_number
|
||||
if ($i)
|
||||
$output .= '<tr><td colspan="10"> </td></tr>';
|
||||
|
||||
$output .= View::factory('service/list/adslservices_header')
|
||||
$output .= View::factory('service/admin/list/adslservices_header')
|
||||
->set('service',$so);
|
||||
|
||||
$last_account = $so->account_id;
|
||||
}
|
||||
|
||||
$output .= View::factory('service/list/adslservices_body')
|
||||
$output .= View::factory('service/admin/list/adslservices_body')
|
||||
->set('service',$so)
|
||||
->set('i',$i++%2);
|
||||
}
|
||||
@@ -218,13 +217,13 @@ ORDER BY C.last_name,B.account_id,A.service_number
|
||||
if ($i)
|
||||
$output .= '<tr><td colspan="10"> </td></tr>';
|
||||
|
||||
$output .= View::factory('service/list/adslservices_header')
|
||||
$output .= View::factory('service/admin/list/adslservices_header')
|
||||
->set('service',$so);
|
||||
|
||||
$last_account = $so->account_id;
|
||||
}
|
||||
|
||||
$output .= View::factory('service/list/adslservices_body')
|
||||
$output .= View::factory('service/admin/list/adslservices_body')
|
||||
->set('service',$so)
|
||||
->set('i',$i++%2);
|
||||
}
|
||||
@@ -294,7 +293,7 @@ GROUP BY DATE_FORMAT(DATE,"%%Y-%%m"),SID
|
||||
$i = $j = 0;
|
||||
$total = 0;
|
||||
$summary = '';
|
||||
$output = View::factory('service/list/adslbilling_head');
|
||||
$output = View::factory('service/admin/list/adslbilling_head');
|
||||
$output .= '<table class="box-left">';
|
||||
foreach ($aso->services(TRUE) as $so) {
|
||||
// Reset our uploaded data
|
||||
@@ -307,7 +306,7 @@ GROUP BY DATE_FORMAT(DATE,"%%Y-%%m"),SID
|
||||
|
||||
// Record the the exception if the cost is not expected
|
||||
if (round($so->service_adsl->adsl_plan->adsl_supplier_plan->base_cost+$so->service_adsl->adsl_plan->adsl_supplier_plan->tax(),2) != $uploaded['amount']) {
|
||||
$summary .= View::factory('service/list/adslbilling_summary')
|
||||
$summary .= View::factory('service/admin/list/adslbilling_summary')
|
||||
->set('service',$so)
|
||||
->set('amount',$uploaded['amount'])
|
||||
->set('i',$j++%2);
|
||||
@@ -325,7 +324,7 @@ GROUP BY DATE_FORMAT(DATE,"%%Y-%%m"),SID
|
||||
}
|
||||
$total += $uploaded['amount'];
|
||||
|
||||
$output .= View::factory('service/list/adslbilling_body')
|
||||
$output .= View::factory('service/admin/list/adslbilling_body')
|
||||
->set('service',$so)
|
||||
->set('checked',$uploaded['checked'])
|
||||
->set('amount',$uploaded['amount'])
|
||||
@@ -333,7 +332,7 @@ GROUP BY DATE_FORMAT(DATE,"%%Y-%%m"),SID
|
||||
->set('i',$i++%2);
|
||||
}
|
||||
|
||||
$output .= View::factory('service/list/adslbilling_foot')
|
||||
$output .= View::factory('service/admin/list/adslbilling_foot')
|
||||
->set('total',$total);
|
||||
|
||||
$output .= '</table>';
|
||||
@@ -341,7 +340,7 @@ GROUP BY DATE_FORMAT(DATE,"%%Y-%%m"),SID
|
||||
// Summary Report of remaining CSV items.
|
||||
if (! empty($csv))
|
||||
foreach ($csv as $service => $item) {
|
||||
$summary .= View::factory('service/list/adslbilling_summary_exception')
|
||||
$summary .= View::factory('service/admin/list/adslbilling_summary_exception')
|
||||
->set('service',$service)
|
||||
->set('item',$item)
|
||||
->set('i',$j++%2);
|
||||
@@ -433,8 +432,31 @@ GROUP BY DATE_FORMAT(DATE,"%%Y-%%m"),SID
|
||||
'title'=>sprintf('%s %s:%s',_('Update Service'),$so->id(),$so->name()),
|
||||
'body'=>View::factory($so->viewpath())
|
||||
->set('so',$so)
|
||||
->set('mediapath',Route::get('default/media'))
|
||||
->set('plugin_form',$so->admin_update()),
|
||||
));
|
||||
|
||||
// @todo Investigate a better way of preparing for jscalendar
|
||||
Script::add(array(
|
||||
'type'=>'file',
|
||||
'data'=>'js/dhtml.calendar.js',
|
||||
));
|
||||
Script::add(array(
|
||||
'type'=>'file',
|
||||
'data'=>'js/dhtml.calendar-setup.js',
|
||||
));
|
||||
Script::add(array(
|
||||
'type'=>'file',
|
||||
'data'=>'js/dhtml.calendar-en.js',
|
||||
));
|
||||
Script::add(array(
|
||||
'type'=>'file',
|
||||
'data'=>'js/dhtml.date_selector.js',
|
||||
));
|
||||
Style::add(array(
|
||||
'type'=>'file',
|
||||
'data'=>'css/dhtml.calendar.css',
|
||||
));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user