employeehours report
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user