Merge branch 'master' of bitbucket.org:pensare/dbois

# Conflicts:
#	application/controllers/projects/EmployeeHoursController.php
#	application/views/pages/employeehours_view.php
#	public/js/lib/modules/projects/employeehoursModule.js
This commit is contained in:
2018-04-02 17:34:19 +02:00
15 changed files with 137 additions and 69 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;
}
}