diversen nav opmerkingen

This commit is contained in:
2018-03-21 17:23:58 +01:00
parent 3241cc0c67
commit e89dc41e18
23 changed files with 404 additions and 154 deletions
@@ -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;
}
}