Sortering factuuroverzicht rapportages
This commit is contained in:
@@ -63,13 +63,13 @@ class Invoice extends BaseModel {
|
||||
return $invoiceID;
|
||||
}
|
||||
|
||||
public static function getInvoiced( $year )
|
||||
public static function getInvoiced( $year, $orderType='invoicedate', $orderDirection='DESC' )
|
||||
{
|
||||
$invoiced = Invoice::selectRaw('invoicenumber, PRJ.projectname, projectnumber, CUS.name, invoicedate, CUS.name, ROUND(invoiceamount, 0) AS 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')
|
||||
->orderBy($orderType, $orderDirection)
|
||||
->get();
|
||||
|
||||
return $invoiced;
|
||||
|
||||
Reference in New Issue
Block a user