employeehours report

This commit is contained in:
2018-02-21 21:27:23 +01:00
parent 4fbcc6a52a
commit 327f81ea97
3290 changed files with 17984 additions and 747234 deletions
@@ -0,0 +1,26 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 21/02/2018
* Time: 10:34
*/
class Invoices_model extends MY_Model {
protected $tablename = 'invoices';
public function getInvoicedPerYearPerProject( $projectID )
{
$this->sql = "
SELECT ROUND(COALESCE(SUM(invoiceamount), 0),0) AS invoiced, YEAR(invoicedate) AS invoiceyear
FROM invoices
WHERE project_id = {$projectID}
GROUP BY YEAR(invoicedate)
ORDER BY YEAR(invoicedate) ";
$invoiced = $this->get_query_result();
return $invoiced;
}
}