Work on invoice printing - to clean up
This commit is contained in:
@@ -53,43 +53,6 @@ class Model_Service extends ORMOSB {
|
||||
return $this->product->product_translate->find()->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find invoices associated with this service
|
||||
*/
|
||||
public function invoices() {
|
||||
$return = array();
|
||||
|
||||
foreach ($this->invoice->distinct('id')->find_all() as $invoice) {
|
||||
$return[$invoice->id]['due'] = $invoice->due();
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find invoices currently outstanding associated with this service
|
||||
*/
|
||||
public function invoices_due() {
|
||||
$return = array();
|
||||
|
||||
foreach ($this->invoices() as $id => $invoice)
|
||||
if ($invoice['due'])
|
||||
array_push($return,$invoice);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the total of invoices due for this service
|
||||
*/
|
||||
public function invoices_due_total() {
|
||||
$total = 0;
|
||||
foreach ($this->invoices_due() as $invoice)
|
||||
$total += $invoice['due'];
|
||||
|
||||
return $total;
|
||||
}
|
||||
|
||||
// @todo To implement
|
||||
/**
|
||||
* Calculate the tax for this item
|
||||
|
Reference in New Issue
Block a user