mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 04:04:34 -04:00
CreateStatementRequest.php
This commit is contained in:
parent
35bcb1d779
commit
bcd29b93e1
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests\Statements;
|
namespace App\Http\Requests\Statements;
|
||||||
|
|
||||||
|
use App\Models\Invoice;
|
||||||
|
use App\Models\Payment;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
class CreateStatementRequest extends FormRequest
|
class CreateStatementRequest extends FormRequest
|
||||||
@ -28,4 +30,42 @@ class CreateStatementRequest extends FormRequest
|
|||||||
'end_date' => ['required'],
|
'end_date' => ['required'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The collection of invoices for the statement.
|
||||||
|
*
|
||||||
|
* @return Invoice[]|\Illuminate\Database\Eloquent\Collection
|
||||||
|
*/
|
||||||
|
public function getInvoices()
|
||||||
|
{
|
||||||
|
// $this->request->start_date & $this->request->end_date are available.
|
||||||
|
|
||||||
|
return Invoice::all();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The collection of payments for the statement.
|
||||||
|
*
|
||||||
|
* @return Payment[]|\Illuminate\Database\Eloquent\Collection
|
||||||
|
*/
|
||||||
|
public function getPayments()
|
||||||
|
{
|
||||||
|
// $this->request->start_date & $this->request->end_date are available.
|
||||||
|
|
||||||
|
return Payment::all();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The array of aging data.
|
||||||
|
*/
|
||||||
|
public function getAging(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'0-30' => 1000,
|
||||||
|
'30-60' => 2000,
|
||||||
|
'60-90' => 3000,
|
||||||
|
'90-120' => 4000,
|
||||||
|
'120+' => 5000,
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user