Local configuration

This commit is contained in:
Deon George 2018-06-13 21:40:08 +10:00
parent a27787e0d4
commit 2e0eefe62f
27 changed files with 405 additions and 160 deletions

View File

@ -13,6 +13,8 @@ RewriteBase /
# Protect application and system files from being viewed # Protect application and system files from being viewed
RewriteRule ^(?:application|modules|includes/kohana)\b.* index.php/$0 [L] RewriteRule ^(?:application|modules|includes/kohana)\b.* index.php/$0 [L]
RewriteRule ^nbn$ /product/category/21 [R,L]
# Allow any files or directories that exist to be displayed directly # Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d

View File

@ -0,0 +1,23 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides Direct Page Access
*
* @package OSB
* @category Controllers/Direct
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Controller_Direct extends Controller_TemplateDefault {
protected $auth_required = FALSE;
public function action_index() {
return $this->action_adsl();
}
public function action_adsl() {
$this->template->content = '<iframe border="0" src="http://www.exetel.com.au/table_inc/broadband_plans.php?is_agent=t&agent_code=V005#standalone" width="900" height="1000"></iframe>';
}
}
?>

View File

@ -37,11 +37,13 @@ class Controller_Reseller_Welcome extends Controller_Welcome {
->span(6) ->span(6)
->body(View::factory('invoice/list')->set('o',ORM::factory('Invoice')->list_due($t))); ->body(View::factory('invoice/list')->set('o',ORM::factory('Invoice')->list_due($t)));
/*
Block::factory() Block::factory()
->title('Un-applied payments') ->title('Un-applied payments')
->title_icon('fa fa-money') ->title_icon('fa fa-money')
->span(6) ->span(6)
->body(View::factory('payment/list')->set('o',ORM::factory('Payment')->where_authorised()->list_unapplied())); ->body(View::factory('payment/list')->set('o',ORM::factory('Payment')->where_authorised()->list_unapplied()));
*/
} }
/** /**

View File

@ -11,7 +11,7 @@
*/ */
return array( return array(
'appname' => 'OS Billing', // Our application name, as shown in the title bar of pages 'appname' => 'Graytech Billing', // Our application name, as shown in the title bar of pages
'email_from' => array('noreply@graytech.net.au'=>'Graytech Hosting'), 'email_from' => array('noreply@graytech.net.au'=>'Graytech Hosting'),
'method_security' => TRUE, // Enables Method Security. Setting to false means any method can be run without authentication 'method_security' => TRUE, // Enables Method Security. Setting to false means any method can be run without authentication
'session_change_trigger'=>array( // Updates to tables to make when our session ID is changed 'session_change_trigger'=>array( // Updates to tables to make when our session ID is changed

View File

@ -28,10 +28,10 @@ return array
* Ports and sockets may be appended to the hostname. * Ports and sockets may be appended to the hostname.
*/ */
'hostname' => 'localhost', 'hostname' => 'localhost',
'username' => 'username', 'username' => 'gh-webbill',
'password' => 'password', 'password' => 'ws0593',
'persistent' => FALSE, 'persistent' => FALSE,
'database' => 'database', 'database' => 'webghosb',
), ),
'table_prefix' => 'ab_', 'table_prefix' => 'ab_',
'charset' => 'utf8', 'charset' => 'utf8',
@ -50,9 +50,9 @@ return array
* string password database password * string password database password
* boolean persistent use persistent connections? * boolean persistent use persistent connections?
*/ */
'dsn' => 'mysql:host=localhost;dbname=database', 'dsn' => 'mysql:host=localhost;dbname=webghosb',
'username' => 'username', 'username' => 'gh-webbill',
'password' => 'password', 'password' => 'ws0593',
'persistent' => FALSE, 'persistent' => FALSE,
), ),
/** /**
@ -67,9 +67,9 @@ return array
'default' => array( 'default' => array(
'type' => 'MySQLi', 'type' => 'MySQLi',
'connection' => array( 'connection' => array(
'hostname' => 'localhost', 'hostname' => 'database',
'username' => 'username', 'username' => 'web',
'password' => 'password', 'password' => 'uva%Cn8B',
'persistent' => FALSE, 'persistent' => FALSE,
'database' => 'database', 'database' => 'database',
'ssl' => NULL, 'ssl' => NULL,

View File

@ -12,13 +12,14 @@
return array return array
( (
'ajax'=>FALSE, // AJAX actions can only be run by ajax calls if set to FALSE
'checkout_notify'=>FALSE, // Test mode to test a particular checkout_notify item 'checkout_notify'=>FALSE, // Test mode to test a particular checkout_notify item
'disabled_noaccess_redirect'=>FALSE, // Disable redirect when noaccess 'disabled_noaccess_redirect'=>FALSE, // Disable redirect when noaccess
'email_admin_only'=> array( // Override emails and send them to an admin instead 'email_admin_only'=> array( // Override emails and send them to an admin instead
#'task_invoice_list_overdue'=>array('deon@leenooks.net'=>'Deon George'), #'task_invoice_list_overdue'=>array('deon@leenooks.net'=>'Deon George'),
), ),
'email_bcc_admin'=> array( // Blind copy all email to an admin, in the format 'email'=>'name', 'email_bcc_admin'=> array( // Blind copy all email to an admin, in the format 'email'=>'name',
// 'deon@leenooks.net'=>'Deon George', 'deon@graytech.net.au'=>'Deon George',
), ),
'invoice'=>0, // Number of invoices to generate in a pass 'invoice'=>0, // Number of invoices to generate in a pass
'show_errors'=>FALSE, // Show errors instead of logging in the DB. 'show_errors'=>FALSE, // Show errors instead of logging in the DB.

View File

@ -12,6 +12,8 @@
return array( return array(
'trusted_hosts' => array( 'trusted_hosts' => array(
'.*\.graytech\.net\.au',
'graytech\.net\.au',
), ),
); );
?> ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -0,0 +1,81 @@
<!-- @todo Move this content into the DB -->
<div id="container">
<div class="row">
<div id="welcome" class="col-md-12">
<h1>Graytech Hosting is an Australian based Internet Solutions provider.</h1>
</div>
</div> <!-- /row -->
<hr class="row-divider" />
<div class="row divider service-container">
<div class="col-md-3">
<h2><span class="slash">//</span> Our Services</h2>
</div>
<div class="col-md-3">
<div class="service-item">
<h3><i class="fa fa-tint"></i>Website Hosting</h3>
<p>Graytech Hosting can host your website on our enterprise servers for the fraction of a cost of many providers.</p>
<p>Your website will be hosted on Australian based servers, providing the best access experience for your audience.</p>
<p><a href="http://domains.graytech.hosting/web-hosting" class="">See Our Plans »</a></p>
</div> <!-- /service -->
</div>
<div class="col-md-3">
<div class="service-item">
<h3><i class="fa fa-map-marker"></i>Domain Names</h3>
<p>Register your .AU, .COM, .NET (or something else) domain with Graytech Hosting.</p>
<p>We'll take away the complications of getting you visible on the Internet with an available Internet Name that suits your requirements.</p>
<p><a href="http://domains.graytech.hosting/domain-names" class="">Register a Domain Name »</a></p>
</div> <!-- /service -->
</div>
<!--
<div class="col-md-3">
<div class="service-item">
<h3><i class="fa fa-cogs"></i>ADSL Internet</h3>
<p>Need to get online?</p>
<p>We have an ADSL plan that will enable you to access the Internet, without worrying about the complications of uploads, downloads and speed.</p>
<p><a href="<?php echo URL::site('product/category/20'); ?>" class="">See Our Plans »</a></p>
</div> x!-- /service --x
</div>
-->
</div> <!-- /row -->
<hr class="row-divider" />
<div class="row divider about-container">
<div class="col-md-3">
<h2><span class="slash">//</span> Our Story</h2>
</div>
<div class="col-md-4">
<div class="about-item">
<h3><i class="fa fa-bank"></i> About Us</h3>
<p>Graytech Hosting was established in 2003 providing Virtual Private Networks over the Internet to customers with distributed offices.</p>
<p>Today our portfolio includes many customers all over Australia, using our Hosting and Email Products.</p>
</div> <!-- /about -->
</div> <!-- /grid-4 -->
<div class="col-md-5">
<div class="about-item">
<h3><i class="fa fa-question"></i>Why Choose Us</h3>
<div class="choose-item">
<h3><i class="fa fa-star"></i> Competive Pricing</h3>
<p>We constantly revise our supplier list providing the most competitive pricing. While we make improvements in the background, you still continue to receive the same great service and with competitive pricing.</p>
</div> <!-- /choose-item -->
<div class="choose-item">
<h3><i class="fa fa-star"></i> Support Local Bendigo Customers</h3>
<p>We are based in Bendigo Victoria, so we support many local Bendigo Customers and Business get online.</p>
</div> <!-- /choose-item -->
<div class="choose-item">
<h3><i class="fa fa-star"></i> We partner with Graytech Computers</h3>
<p>We partner with <a href="http://www.graytech.com.au">Graytech Computers</a> to provide you with your End-to-End Computing and Internet requirements.</p>
</div> <!-- /choose-item -->
</div> <!-- /choose-item -->
</div> <!-- /grid-5 -->
</div> <!-- /row -->
</div> <!-- /container -->

View File

@ -1,127 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title><?php echo Site::Appname(); ?></title>
<link rel="shortcut icon" href="<?php echo $meta->shortcut_icon ? $meta->shortcut_icon : '/favicon.ico' ?>" type="image/vnd.microsoft.icon" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="<?php echo $meta->language; ?>" />
<meta name="keywords" content="<?php echo $meta->keywords; ?>" />
<meta name="description" content="<?php echo $meta->description; ?>" />
<meta name="copyright" content="<?php echo Config::copywrite(); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<?php
if (Kohana::$environment >= Kohana::TESTING OR Request::current()->secure()) {
echo HTML::style('media/theme/bootstrap/css/bootstrap.min.css');
echo HTML::style('media/theme/bootstrap/css/bootstrap-responsive.min.css');
echo HTML::style('media/vendor/font-awesome/css/font-awesome.min.css');
} else {
echo HTML::style(Site::Protocol('netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap.min.css'));
echo HTML::style(Site::Protocol('netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-responsive.min.css'));
echo HTML::style(Site::Protocol('netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css'));
}
echo HTML::style(Site::Protocol('fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,800italic,400,600,800'));
echo HTML::style('media/css/ui-lightness/jquery-ui-1.10.0.custom.min.css');
echo HTML::style('media/theme/baseadmin/css/base-admin-2.css');
echo HTML::style('media/theme/baseadmin/css/base-admin-2-responsive.css');
echo HTML::style('media/theme/baseadmin/css/custom.css');
echo Style::factory()->render_all();
?>
</head>
<body>
<?php if (! empty($shownavbar)) : ?>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><i class="icon-cog"></i> </a>
<a class="brand" href="<?php echo URL::site(); ?>"><?php echo Site::Appname(); ?><sup></sup></a>
<div class="nav-collapse collapse">
<ul class="nav pull-right">
<?php echo $navbar; ?>
</ul>
<?php if (class_exists('Controller_Search')) : ?>
<div class="navbar-search pull-right">
<div class="navbar-search-addon">
<i class="icon-search"></i>
<?php echo HTML::image('media/img/spinner.gif',array('class'=>'right','name'=>'searching')); ?>
<input type="text" name="search-query" class="search-query" placeholder="Search" data-provide="typeahead">
</div>
</div>
<?php endif ?>
</div><!--/.nav-collapse -->
</div> <!-- /container -->
</div> <!-- /navbar-inner -->
</div> <!-- /nvarbar -->
<div class="subnavbar">
<div class="subnavbar-inner">
<div class="container">
<a class="btn-subnavbar collapsed" data-toggle="collapse" data-target=".subnav-collapse">
<i class="icon-reorder"></i>
</a>
<div class="subnav-collapse collapse">
<ul class="mainnav">
<li class="">
<a href="<?php echo URL::link('user','welcome',TRUE); ?>"><i class="icon-home"></i><span>Home</span></a>
</li>
<?php if (class_exists('Auth') AND ($ao = Auth::instance()->get_user()) AND $ao->isAdmin()) : ?>
<li class="">
<a href="<?php echo URL::link('admin','welcome',TRUE); ?>"><i class="icon-tasks"></i><span>Admin</span></a>
</li>
<?php elseif ($ao AND $ao->isReseller()) : ?>
<li class="">
<a href="<?php echo URL::link('reseller','welcome',TRUE); ?>"><i class="icon-tasks"></i><span>Reseller</span></a>
</li>
<?php endif ?>
</ul>
</div> <!-- /.subnav-collapse -->
</div> <!-- /container -->
</div> <!-- /subnavbar-inner -->
</div> <!-- /subnavbar -->
<?php endif ?>
<div class="error_container">
<div class="error_details">
<div class="row">
<div class="span10 offset2">
<?php echo SystemMessage::factory()->render_all(); ?>
</div>
</div> <!-- /row -->
</div> <!-- /error_details -->
</div> <!-- /error_container -->
<div class="main">
<div class="container">
<div class="row">
<?php echo $content; ?>
</div> <!-- /row -->
</div> <!-- /container -->
</div> <!-- /main -->
<?php
if (Kohana::$environment >= Kohana::TESTING OR Request::current()->secure()) {
echo HTML::script('media/js/jquery/jquery-1.9.1.min.js');
echo HTML::script('media/theme/bootstrap/js/bootstrap.min.js');
echo HTML::script('media/js/lodash/lodash-1.2.1.min.js');
} else {
echo HTML::script(Site::Protocol('code.jquery.com/jquery-1.9.1.min.js'));
echo HTML::script(Site::Protocol('netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js'));
echo HTML::script(Site::Protocol('cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.min.js'));
}
echo HTML::script('media/theme/baseadmin/js/backtotop.js');
echo HTML::script('media/js/search.js');
echo HTML::script('media/js/custom.js');
echo Script::factory()->render_all();
?>
</body>
</html>

Binary file not shown.

1
forms/index.html Normal file
View File

@ -0,0 +1 @@
The direct debit form is <a href="OCR-DDR-Online-V3.1.pdf">here</a>.

View File

@ -16,6 +16,7 @@ class Controller_Admin_Adsl extends Controller_Adsl {
'list'=>TRUE, 'list'=>TRUE,
'stat'=>TRUE, 'stat'=>TRUE,
'traffic'=>TRUE, 'traffic'=>TRUE,
'product'=>TRUE,
); );
public function action_index() { public function action_index() {
@ -110,6 +111,121 @@ class Controller_Admin_Adsl extends Controller_Adsl {
); );
} }
public function action_product() {
$lo = ORM::factory('Language',['name'=>'English']);
$aso = ORM::factory('Service')->where_authorised($this->ao)->list_byplugin('ADSL');
$output = '';
// Process our active services
$products = array();
foreach ($aso as $o) {
// $output .= sprintf('Got Service [%s]<br>',$o->id);
if (! array_key_exists($o->product_id,$products)) {
$products[$o->product_id] = $o->product;
}
}
// $output .= sprintf('Products [%s]<br>',join('|',array_keys($products)));
// Find our products without services.
$po = ORM::factory('Product')->where('prod_plugin_file','=','ADSL')->and_where('id','NOT IN',array_keys($products))->where_active()->find_all();
foreach ($po as $o) {
if (! array_key_exists($o->id,$products)) {
$products[$o->id] = $o;
}
}
// $output .= sprintf('Now Products [%s]<br>',join('|',array_keys($products)));
// Get a list of our ADSL plans that support these products
$supplierplans = $plans = array();
foreach ($products as $id => $po) {
if (! array_key_exists($po->prod_plugin_data,$plans)) {
$plans[$po->prod_plugin_data] = ORM::factory('ADSL_Plan',$po->prod_plugin_data);
}
//if ($po->id == 87) $output .= Debug::vars($po);
//if ($po->id == 87) $output .= '<hr>';
//if ($po->id == 87) $output .= Debug::vars($plans[$po->prod_plugin_data]);
//if ($po->id == 87) $output .= '<hr>';
if (! array_key_exists($plans[$po->prod_plugin_data]->adsl_supplier_plan_id,$supplierplans)) {
$supplierplans[$plans[$po->prod_plugin_data]->adsl_supplier_plan_id] = $plans[$po->prod_plugin_data]->supplier_plan;
//if ($po->id == 87) $output .= Debug::vars($plans[$po->prod_plugin_data]->supplier_plan);
}
}
// Get a list of our supplier ADSL plans that are active
$aspo = ORM::factory('ADSL_Supplier_Plan')->where('id','NOT IN',array_keys($supplierplans))->where_active()->find_all();
foreach ($aspo as $o) {
if (! array_key_exists($o->id,$supplierplans)) {
$supplierplans[$o->id] = $o;
}
}
$output .= '<table class="table table-striped table-condensed table-hover" border=0>';
$output .= sprintf('<tr><th colspan="5">%s</th><th>%s</th><th>%s</th></tr>','NAME','COST','ACTIVE');
// List our Supplier Plans
foreach ($supplierplans as $spo) {
$output .= '<tr>';
$output .= sprintf('<td colspan="5">%s: %s</td>',$spo->id,$spo->name());
$output .= sprintf('<td>%s</td>',$spo->display('base_cost'));
$output .= sprintf('<td>%s</td>',$spo->display('active'));
$output .= '</tr>';
// List our plans that use this supplier plans.
foreach ($plans as $po) {
if ($po->adsl_supplier_plan_id != $spo->id) continue;
$output .= '<tr>';
$output .= '<td>&nbsp;</td>';
$output .= '<td>&nbsp;</td>';
$output .= sprintf('<td colspan="3">%s</td>',$po->id);
$output .= '<td>&nbsp;</td>';
$output .= '<td>&nbsp;</td>';
$output .= '</tr>';
// List our products that use these plan
foreach ($products as $pro) {
if ($pro->prod_plugin_data != $po->id) continue;
$output .= '<tr>';
$output .= '<td>&nbsp;</td>';
$output .= '<td>&nbsp;</td>';
$output .= '<td>&nbsp;</td>';
$output .= sprintf('<td colspan="2"><a href="/a/product/edit/%s">%s</a>: ',$pro->id,$pro->id);
try {
$output .= sprintf('%s</td>',$pro->name($lo));
} catch (Exception $e) {
$output .= sprintf('%s</td>','Unavailable');
}
$output .= sprintf('<td>%s</td>',$pro->price(0,1,'base',true));
$output .= sprintf('<td>%s</td>',$pro->display('active'));
$output .= '</tr>';
// List our services using these products
foreach ($aso as $so) {
if ($so->product_id != $pro->id) continue;
$output .= '<tr>';
$output .= '<td colspan="1">&nbsp;</td>';
$output .= '<td colspan="1">&nbsp;</td>';
$output .= '<td colspan="1">&nbsp;</td>';
$output .= '<td colspan="1">&nbsp;</td>';
$output .= sprintf('<td><a href="/u/service/view/%s">%s</a>: %s</td>',$so->id,$so->id,$so->name($lo));
$output .= sprintf('<td>%s</td>',$so->price());
$output .= sprintf('<td>%s</td>',$so->display('active'));
$output .= '</tr>';
}
}
}
}
$output .= '</table>';
$this->template->content = $output;
}
/** /**
* Usage statistics for the previous moth * Usage statistics for the previous moth
*/ */

View File

@ -275,17 +275,17 @@ class Model_Service_Plugin_Adsl extends Model_Service_Plugin {
'table'=>'style="border: 1px solid #bebcb7; padding: 5px 5px; background: none repeat scroll 0% 0% #f8f7f5; font-size: 70%;"', 'table'=>'style="border: 1px solid #bebcb7; padding: 5px 5px; background: none repeat scroll 0% 0% #f8f7f5; font-size: 70%;"',
)); break; )); break;
case 'OFFPEAK_ALLOWANCE': $value = isset($data['allow']['base_down_offpeak']) ? $data['allow']['base_down_offpeak'].' MB' : '-'; break; case 'OFFPEAK_ALLOWANCE': $value = isset($data['allow']['base_down_offpeak']) ? $data['allow']['base_down_offpeak'] : '-'; break;
case 'OFFPEAK_USAGE': $value = isset($data['used']['base_down_offpeak']) ? $data['used']['base_down_offpeak'].' MB' : '-'; break; case 'OFFPEAK_USAGE': $value = isset($data['used']['base_down_offpeak']) ? $data['used']['base_down_offpeak'] : '-'; break;
case 'PEAK_ALLOWANCE': $value = isset($data['allow']['base_down_peak']) ? $data['allow']['base_down_peak'].' MB' : '-'; break; case 'PEAK_ALLOWANCE': $value = isset($data['allow']['base_down_peak']) ? $data['allow']['base_down_peak'] : '-'; break;
case 'PEAK_USAGE': $value = isset($data['used']['base_down_peak']) ? $data['used']['base_down_peak'].' MB' : '-'; break; case 'PEAK_USAGE': $value = isset($data['used']['base_down_peak']) ? $data['used']['base_down_peak'] : '-'; break;
case 'OFFPEAK_AVERAGE': $value = isset($data['used']['base_down_offpeak']) ? round($data['used']['base_down_offpeak']/$data['day'],2).' MB' : '-'; break; case 'OFFPEAK_AVERAGE': $value = isset($data['used']['base_down_offpeak']) ? round($data['used']['base_down_offpeak']/$data['day'],2) : '-'; break;
case 'OFFPEAK_AVERAGE_REMAIN': $value = ((isset($data['used']['base_down_offpeak']) AND ($data['allow']['base_down_offpeak'] > $data['used']['base_down_offpeak']) AND $daysleft) ? round(($data['allow']['base_down_offpeak']-$data['used']['base_down_offpeak'])/$daysleft,2).' MB' : '-'); break; case 'OFFPEAK_AVERAGE_REMAIN': $value = ((isset($data['used']['base_down_offpeak']) AND ($data['allow']['base_down_offpeak'] > $data['used']['base_down_offpeak']) AND $daysleft) ? round(($data['allow']['base_down_offpeak']-$data['used']['base_down_offpeak'])/$daysleft,2) : '-'); break;
case 'PEAK_AVERAGE': $value = isset($data['used']['base_down_peak']) ? round($data['used']['base_down_peak']/$data['day'],2).' MB' : '-'; break; case 'PEAK_AVERAGE': $value = isset($data['used']['base_down_peak']) ? round($data['used']['base_down_peak']/$data['day'],2) : '-'; break;
case 'PEAK_AVERAGE_REMAIN': $value = ((isset($data['used']['base_down_peak']) AND ($data['allow']['base_down_peak'] > $data['used']['base_down_peak']) AND $daysleft) ? round(($data['allow']['base_down_peak']-$data['used']['base_down_peak'])/$daysleft,2).' MB' : '-'); break; case 'PEAK_AVERAGE_REMAIN': $value = ((isset($data['used']['base_down_peak']) AND ($data['allow']['base_down_peak'] > $data['used']['base_down_peak']) AND $daysleft) ? round(($data['allow']['base_down_peak']-$data['used']['base_down_peak'])/$daysleft,2) : '-'); break;
case 'SERVICE_NUMBER': $value = $this->service_number; break; case 'SERVICE_NUMBER': $value = $this->service_number; break;
case 'USAGE_DATE': $value = Site::Date($data['last']); break; case 'USAGE_DATE': $value = Site::Date($data['last']); break;

View File

@ -49,14 +49,14 @@ class Service_Traffic_Adsl_Exetelvisp extends Service_Traffic_Adsl {
$valuesarray = explode(',',$details); $valuesarray = explode(',',$details);
// Extel VISP stores data in MB's*100. // Extel VISP stores data in MB's.
$attrs = array(); $attrs = array();
$attrs['service'] = $valuesarray[0]; $attrs['service'] = $valuesarray[0];
$attrs['date'] = $valuesarray[1]; $attrs['date'] = $valuesarray[1];
$attrs['up_peak'] = $valuesarray[2]/100; $attrs['up_peak'] = $valuesarray[2];
$attrs['down_peak'] = $valuesarray[3]/100; $attrs['down_peak'] = $valuesarray[3];
$attrs['up_offpeak'] = $valuesarray[4]/100; $attrs['up_offpeak'] = $valuesarray[4];
$attrs['down_offpeak'] = $valuesarray[5]/100; $attrs['down_offpeak'] = $valuesarray[5];
array_push($result,$attrs); array_push($result,$attrs);
} }

View File

@ -13,7 +13,7 @@ abstract class Checkout_Plugin_Paypal extends Checkout_Plugin {
protected $url_prod = 'www.paypal.com'; protected $url_prod = 'www.paypal.com';
protected $url_test = 'www.sandbox.paypal.com'; protected $url_test = 'www.sandbox.paypal.com';
private $ipn_test = '173.0.82.126'; private $ipn_test = '173.0.82.126';
protected $email_prod = ''; // @todo This should be in the DB protected $email_prod = 'deon@graytech.net.au'; // @todo This should be in the DB
protected $email_test = ''; // @todo This should be in the DB protected $email_test = ''; // @todo This should be in the DB
protected $test_mode = FALSE; protected $test_mode = FALSE;

View File

@ -11,6 +11,31 @@
*/ */
class Controller_Admin_Checkout extends Controller_Checkout { class Controller_Admin_Checkout extends Controller_Checkout {
protected $secure_actions = array( protected $secure_actions = array(
'manual'=>FALSE,
); );
public function action_manual() {
$this->auto_render = FALSE;
$cno = ORM::factory('Checkout_Notify',$this->request->param('id'));
if (! $cno->loaded())
throw HTTP_Exception::factory(404,'Not found?');
// Process our Notify
try {
$this->response->body($cno->process());
} catch (Exception $e) {
Kohana_Exception::log($e);
echo Debug::vars($e);
die();
}
$this->response->headers('Content-Type','text/plain');
$this->response->headers('Content-Length',(string)$this->response->content_length());
$this->response->headers('Last-Modified',time());
}
} }
?> ?>

View File

@ -172,6 +172,8 @@ class Invoice {
break; break;
case 'html': case 'html':
// @todo What happened to rounding, look at service 410. Why is cost correct and invoice generation not? Maybe fixed - need to validate.
//echo Debug::vars(['m'=>__METHOD__,'i'=>$this->_io->dump()]);
switch ($section) { switch ($section) {
case 'body': case 'body':
if (! $this->_io->active) if (! $this->_io->active)

View File

@ -296,7 +296,8 @@ class Model_Invoice extends ORM implements Cartable {
} else { } else {
$key = preg_replace("/^$prefix/",'',$key); $key = preg_replace("/^$prefix/",'',$key);
return isset($this->reminders[$key]) ? ($format ? Config::date($this->reminders[$key]) : $this->reminders[$key]) : NULL; // Fix for inv 5061
return (isset($this->reminders[$key]) AND ! is_array($this->reminders[$key])) ? ($format ? Site::Date($this->reminders[$key]) : $this->reminders[$key]) : NULL;
} }
} }

View File

@ -58,6 +58,7 @@ class Model_Invoice_Item extends ORM {
7=>'Extra Product/Service Charge', // * Service Billing in advance, Must have corresponding SERVICE_ID 7=>'Extra Product/Service Charge', // * Service Billing in advance, Must have corresponding SERVICE_ID
8=>'Product Addition', // * Additional Product Customisation, Must have corresponding SERVICE_ID 8=>'Product Addition', // * Additional Product Customisation, Must have corresponding SERVICE_ID
120=>'Credit/Debit Transfer', // * SERVICE_ID is NULL, MODULE_ID is NULL, MODULE_REF is NULL : INVOICE_ID is NOT NULL 120=>'Credit/Debit Transfer', // * SERVICE_ID is NULL, MODULE_ID is NULL, MODULE_REF is NULL : INVOICE_ID is NOT NULL
123=>'Shipping',
124=>'Late Payment Fee', // * SERVICE_ID is NULL, MODULE_ID = CHECKOUT MODULE, 124=>'Late Payment Fee', // * SERVICE_ID is NULL, MODULE_ID = CHECKOUT MODULE,
125=>'Payment Fee', // * SERVICE_ID is NULL, MODULE_ID = CHECKOUT MODULE, MODULE_REF = CHECKOUT NAME 125=>'Payment Fee', // * SERVICE_ID is NULL, MODULE_ID = CHECKOUT MODULE, MODULE_REF = CHECKOUT NAME
126=>'Other', // * MODEL_ID should be a module 126=>'Other', // * MODEL_ID should be a module
@ -125,20 +126,33 @@ class Model_Invoice_Item extends ORM {
private function isValid() { private function isValid() {
switch ($this->item_type) { switch ($this->item_type) {
case 0: case 0:
// When a charge is charging normal service fees, this fails.
if (is_object($this->module_id))
$this->module_id = $this->module_id->id;
try{
// @todo Validate if module_id = charge and module_ref corresponds with the line item // @todo Validate if module_id = charge and module_ref corresponds with the line item
if (! $this->service_id OR ! $this->product_id OR ($this->module_id AND $this->module_id != 30 AND ! is_null($this>module_ref)) OR $this->product_name OR is_null($this->recurring_schedule)) if (! $this->service_id OR ! $this->product_id OR ($this->module_id AND $this->module_id != 30 AND ! is_null($this->module_ref)) OR $this->product_name OR is_null($this->recurring_schedule))
return FALSE; return FALSE;
} catch (Exception $e) {
echo Debug::vars($this->dump());
}
break; break;
case 1: case 1:
return TRUE;
if (! $this->product_id OR $this->module_id OR $this->module_ref OR $this->product_name OR ! is_null($this->recurring_schedule)) if (! $this->product_id OR $this->module_id OR $this->module_ref OR $this->product_name OR ! is_null($this->recurring_schedule))
return FALSE; return FALSE;
break; break;
// These items come from the charge module, so we should have a charge module_id and ref // These items come from the charge module, so we should have a charge module_id and ref
case 2: case 2:
if (! $this->service_id OR ! $this->product_id OR ($this->module_id AND $this->module_id != 30 AND ! is_null($this>module_ref)) OR $this->product_name OR ! is_null($this->recurring_schedule)) try{
if (! $this->service_id OR ! $this->product_id OR ($this->module_id->id AND $this->module_id->id != 32 AND ! is_null($this->module_ref)) OR $this->product_name OR ! is_null($this->recurring_schedule))
return FALSE; return FALSE;
} catch (Exception $e) {
echo Debug::vars($this->dump());
die();
}
break; break;
case 3: case 5:
case 4: case 4:
case 7: case 7:
if (! $this->service_id OR ! $this->product_id OR ! $this->module_id OR ! $this->module_ref OR $this->product_name OR ! is_null($this->recurring_schedule)) if (! $this->service_id OR ! $this->product_id OR ! $this->module_id OR ! $this->module_ref OR $this->product_name OR ! is_null($this->recurring_schedule))
@ -194,6 +208,8 @@ class Model_Invoice_Item extends ORM {
switch ($this->item_type) { switch ($this->item_type) {
case 0: case 0:
return sprintf('%s: %s',StaticList_ItemType::get($this->item_type),$this->period()); return sprintf('%s: %s',StaticList_ItemType::get($this->item_type),$this->period());
case 1:
return StaticList_ItemType::get($this->item_type);
case 2: case 2:
return sprintf('%s: %s',StaticList_ItemType::get($this->item_type),$this->_module() ? $this->_module()->display('date_charge') : $this->period()); return sprintf('%s: %s',StaticList_ItemType::get($this->item_type),$this->_module() ? $this->_module()->display('date_charge') : $this->period());
case 3: case 3:
@ -203,6 +219,8 @@ class Model_Invoice_Item extends ORM {
case 5: case 5:
case 7: case 7:
return $this->_module()->namesub($variable); return $this->_module()->namesub($variable);
case 123:
return StaticList_ItemType::get($this->item_type);
default: default:
return sprintf('Unknown [%s-%s]',$this->item_type,$this->id); return sprintf('Unknown [%s-%s]',$this->item_type,$this->id);
} }

View File

@ -0,0 +1,29 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Fix up the missing Tax in invoices.
*
* @package Invoice
* @category Tasks
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Task_Devel_Invoice_Fixtax extends Minion_Task {
protected function _execute(array $params) {
$c = array();
foreach (ORM::factory('Invoice')->find_all() as $io)
if ($io->due() < 0)
foreach ($io->subitems() as $iio)
if ($iio->tax->find_all()->count() === 0) {
$iio->subitem_add($io->account->country,FALSE);
$iio->save();
array_push($c,$iio);
}
return sprintf('%s items updated (%s)',count($c),join('|',$c));
}
}
?>

View File

@ -0,0 +1,65 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
*
*
* @package Invoice
* @category Tasks
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Task_Devel_Invoice_List extends Minion_Task {
protected function _execute(array $params) {
$c = 0;
foreach (ORM::factory('Invoice')->where('id','>',4331)->and_where('id','<',5320)->order_by('id','ASC')->find_all() as $io) {
if ($io->due() == 0)
continue;
/*
elseif ($io->due() < 0) {
foreach ($io->subitems() as $iio) {
switch ($iio->price_base) {
case 40.909:
$iio->price_base=40.92;
break;
case 98.045:
case 98.05:
$iio->price_base=98.055;
break;
case 103.045:
$iio->price_base=103.055;
break;
case 204.545:
$iio->price_base=204.56;
break;
case 209.545:
$iio->price_base=209.56;
break;
default:
print_r($iio->dump());
}
$iio->save();
}
printf("%4s %6.2f\n",$io->id,$io->due());
if ($c++>2)
break;
} elseif ($io->due() < 1) {
printf("%4s %6.2f\n",$io->id,$io->due());
}
*/
printf("%4s %6.2f\n",$io->id,$io->due());
}
}
}
?>

View File

@ -100,6 +100,7 @@ class Controller_Admin_Payment extends Controller_Payment {
if ($this->request->post()) { if ($this->request->post()) {
$po->values($this->request->post()); $po->values($this->request->post());
$po->total_amt = (float)$po->total_amt;
// Update our invoice payment items // Update our invoice payment items
if (is_array($this->request->post('payment_item')) AND count($this->request->post('payment_item'))) if (is_array($this->request->post('payment_item')) AND count($this->request->post('payment_item')))
foreach ($this->request->post('payment_item') as $k=>$v) { foreach ($this->request->post('payment_item') as $k=>$v) {

View File

@ -107,10 +107,11 @@ class Model_SSL_CA extends ORM {
$result = NULL; $result = NULL;
// If we are a root cert, we are valid // If we are a root cert, we are valid
if (is_null($this->parent_ssl_ca_id) AND $this->isRoot()) if ((($this->parent_ssl_ca_id == $this->id) OR is_null($this->parent_ssl_ca_id)) AND $this->isRoot())
return StaticList_YesNo::get(TRUE,$format); return StaticList_YesNo::get(TRUE,$format);
//echo Debug::vars([__METHOD__,'psci'=>$this->parent_ssl_ca_id,'myid'=>$this->id,'root'=>$this->isRoot()]);
return StaticList_YesNo::get($this->aki_keyid() == $this->parent->ski(),$format); return StaticList_YesNo::get(($this->aki_keyid() == $this->parent->ski() AND $this->parent_ssl_ca_id != $this->id),$format);
} }
// If we change the SSL certificate, we need to reload our SSL object // If we change the SSL certificate, we need to reload our SSL object

View File

@ -116,9 +116,11 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
// Get the first parent CA certificate // Get the first parent CA certificate
$po = $this->ca; $po = $this->ca;
while ($po AND $po->loaded()) { //echo Debug::vars([__METHOD__,'this'=>$this,'po'=>$po,'vp'=>$po->validParent()]);die();
$c = 0;
while ($po AND $po->loaded() AND $c++ < 5) {
array_push($result,$po); array_push($result,$po);
$po = ($po->validParent()) ? $po->parent : NULL; $po = ($po->validParent() AND $po->id != $po->parent_ssl_ca_id) ? $po->parent : NULL;
} }
return $result; return $result;