Major work to domain and hosting

Minor updates for ADSL services
Updates to Sort::MAsort()
Move core OSB items under application/
Moved ACCOUNT functions under application
Minor updates to task
This commit is contained in:
Deon George
2011-09-28 16:46:22 +10:00
parent 147d035e46
commit 130a87aa9a
199 changed files with 1536 additions and 10742 deletions

View File

@@ -170,7 +170,7 @@ class Model_Invoice extends ORMOSB {
foreach ($this->items_main() as $ito) {
$unique = TRUE;
$t = $ito->product->summary();
$t = $ito->product->name();
if (! isset($result[$t])) {
$result[$t]['quantity'] = 0;
$result[$t]['subtotal'] = 0;
@@ -373,29 +373,26 @@ class Model_Invoice extends ORMOSB {
/** LIST FUNCTIONS **/
private function _list_due() {
// @todo This rounding should be a system configuration
return $this->where('round(total_amt-ifnull(credit_amt,0),2)','>','=billed_amt')
->and_where('status','=',1)
->order_by('due_date,account_id,id');
}
/**
* Identify all the invoices that are due
*/
private function _list_due($time=NULL,$op='<=') {
public function list_overdue($time=NULL) {
if (is_null($time))
$time = time();
// @todo This rounding should be a system configuration
return $this
->where('round(total_amt-ifnull(credit_amt,0),2)','>','=billed_amt')
->and_where('due_date',$op,$time)
->and_where('status','=',1)
->order_by('due_date,account_id,id')
return $this->_list_due()
->and_where('due_date','<=',$time)
->find_all();
}
/**
* Return a list of invoices that are over their due date.
*/
public function list_overdue($time=NULL) {
return $this->_list_due($time,'<=');
}
/**
* Return a list of invoices that are over their due date with/without auto billing
*/
@@ -419,7 +416,15 @@ class Model_Invoice extends ORMOSB {
* Return a list of invoices that are due, excluding overdue.
*/
public function list_due($time=NULL) {
return $this->_list_due($time,'>');
if (is_null($time))
return $this->_list_due()
->and_where('due_date','>',time())
->find_all();
else
return $this->_list_due()
->and_where('due_date','<=',$time)
->and_where('due_date','>',time())
->find_all();
}
}
?>

View File

@@ -39,7 +39,7 @@ class Model_Invoice_Item extends ORMOSB {
if ($this->item_type != 0)
return;
return $this->service->details('invoice');
return $this->service->details('invoice_detail_items');
}
public function subtotal() {