Local fixes to invoice display and retrieve traffic data

This commit is contained in:
Deon George
2011-08-02 16:48:41 +10:00
parent 41eec89afa
commit 5953e28f22
9 changed files with 1039 additions and 15 deletions

View File

@@ -195,10 +195,13 @@ class Model_Service_ADSL extends Model_Service {
return $this->traffic_month(strtotime('yesterday'),$string);
}
public function traffic_lastmonth_exceed($all=FALSE) {
public function traffic_lastmonth_exceed($all=FALSE,$date=NULL) {
$return = array();
foreach ($this->traffic_month(strtotime('last month'),FALSE) as $k => $v) {
if (is_null($date))
$date = strtotime('last month');
foreach ($this->traffic_month($date,FALSE) as $k => $v) {
// We shouldnt need to eval for nulls, since the traffic calc does that
if ($all OR ($v > $this->adsl_plan->$k)) {
$return[$k]['allowance'] = $this->adsl_plan->$k;
@@ -351,7 +354,7 @@ class Model_Service_ADSL extends Model_Service {
case 'invoice':
return array(
_('Service Address')=>$this->display('service_address'),
_('Contact Until')=>$this->contract_date_end(),
_('Contract Until')=>$this->contract_date_end(),
);
break;
default: