Diverse wijzigingen nav word document
This commit is contained in:
@@ -28,6 +28,17 @@ class Payment extends BaseModel {
|
||||
return $projectPayment->payment;
|
||||
}
|
||||
|
||||
public static function getProjectsWithPayments($year)
|
||||
{
|
||||
$projects = self::selectRaw('INV.project_id')
|
||||
->distinct()
|
||||
->join('invoices AS INV', 'INV.id', '=', 'payments.invoice_id')
|
||||
->whereRaw('DATE_FORMAT(INV.invoicedate, "%Y") = "'. $year.'"')
|
||||
->lists('project_id');
|
||||
|
||||
return $projects->toArray();
|
||||
}
|
||||
|
||||
public static function savePayment( $paymentID, $payment )
|
||||
{
|
||||
$payment = (array) $payment;
|
||||
@@ -50,4 +61,4 @@ class Payment extends BaseModel {
|
||||
Payment::whereId( $paymentID )->delete();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user