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