Example #1
0
    }
    /**
     * returns true if account has no active subscribers and no relevant lines for next billrun
     * @return true if account is deactivated (causes no xml to be produced for this account)
     */
    public function is_deactivated()
    {
        $deactivated = true;
        foreach ($this->data['subs'] as $subscriber) {
            $its_empty = $this->empty_subscriber($subscriber);
            if (!$its_empty) {
                $deactivated = false;
                break;
            }
        }
        return $deactivated;
    }
    /**
     * checks for a given account if its "empty" : its status is closed and it has no relevant lines for next billrun
     * @param type $subscriber : sid
     * @return true if its "emtpy"
     */
    public function empty_subscriber($subscriber)
    {
        $status = $subscriber['subscriber_status'];
        return $status == "closed" && !isset($subscriber['breakdown']);
    }
}
Billrun_Billrun::loadRates();
Billrun_Billrun::loadPlans();