diversen dashboard

This commit is contained in:
2020-01-17 12:04:29 +01:00
parent 69766f7a63
commit 20fc96a8fd
6 changed files with 196 additions and 63 deletions
@@ -35,7 +35,8 @@ class Invoices_model extends MY_Model {
JOIN invoices INV
ON INV.id = PAY.invoice_id
WHERE INV.project_id = {$projectID}
) AS payed
) AS payed,
PRJ.archive
FROM invoices INV
JOIN projects PRJ
ON PRJ.id = INV.project_id
@@ -55,7 +56,7 @@ class Invoices_model extends MY_Model {
return $invoiceDetails;
}
public function getTotalsOutstandingPerProject()
public function getTotalsOutstandingPerProject($archive = TRUE)
{
$this->sql = "
SELECT
@@ -102,9 +103,12 @@ class Invoices_model extends MY_Model {
FROM
projectcosts
GROUP BY
project_id) Q4 ON Q4.project_id = PRJ.id
GROUP BY
PRJ.id ";
project_id) Q4 ON Q4.project_id = PRJ.id ";
if( $archive == FALSE ) $this->sql .= "WHERE PRJ.archive = 'F' ";
$this->sql .= "
GROUP BY
PRJ.id ";
$outstandings = $this->get_query_result();