Invoiced report

This commit is contained in:
2020-01-10 17:42:25 +01:00
parent b4d69d272c
commit 5594865554
11 changed files with 384 additions and 190 deletions
+13 -1
View File
@@ -62,4 +62,16 @@ class Invoice extends BaseModel {
return $invoiceID;
}
}
public static function getInvoiced( $year )
{
$invoiced = Invoice::selectRaw('invoicenumber, PRJ.projectname, projectnumber, CUS.name, invoicedate, CUS.name, invoiceamount')
->join('projects AS PRJ', 'PRJ.id', '=', 'invoices.project_id')
->join('customers AS CUS', 'CUS.id', '=', 'PRJ.customer_id')
->whereRaw("DATE_FORMAT(invoicedate, '%Y') = {$year}")
->orderBy('invoicedate')
->get();
return $invoiced;
}
}