Misc fixes for ADSL excess traffic and strtotime() functions for last month
This commit is contained in:
@@ -135,8 +135,15 @@ class Model_Product_Plugin_Adsl extends Model_Product_Plugin {
|
||||
if (! isset($data[$k]))
|
||||
$data[$k] = 0;
|
||||
|
||||
if ($over)
|
||||
$data[$k] = $invert ? $this->{$k} : $data[$k]-$this->{$k};
|
||||
if ($over) {
|
||||
// @todo This is an ugly hack - if our data has been passed it, it is assumed it has been reduced by $this->metric
|
||||
$z = $this->metric ? round($this->{$k}/$this->metric,2) : $this->{$k};
|
||||
|
||||
$data[$k] = $invert ? $z : $data[$k]-$z;
|
||||
|
||||
// We need to return this back to base units as later, we'll return it back to metric
|
||||
$data[$k] = $this->metric ? $data[$k]*$this->metric : $data[$k];
|
||||
}
|
||||
|
||||
// Do we charge for extra, or merge it to another field
|
||||
if (! is_null($this->{$v})) {
|
||||
|
Reference in New Issue
Block a user