diversen nav opmerkingen
This commit is contained in:
@@ -23,4 +23,20 @@ class Invoices_model extends MY_Model {
|
||||
|
||||
return $invoiced;
|
||||
}
|
||||
|
||||
public function getOutstandingPerProject( $projectID )
|
||||
{
|
||||
$this->sql = "
|
||||
SELECT (own_revenue + other_revenue) - SUM(INV.invoiceamount) AS outstanding
|
||||
FROM invoices INV
|
||||
JOIN projects PRJ
|
||||
ON PRJ.id = INV.project_id
|
||||
JOIN offers OFF
|
||||
ON PRJ.id = OFF.project_id
|
||||
WHERE PRJ.id = {$projectID} ";
|
||||
|
||||
$invoiced = $this->get_query_row( 'outstanding' );
|
||||
|
||||
return $invoiced;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user