Invoiced report
This commit is contained in:
@@ -23,6 +23,8 @@ class Invoices {
|
||||
private $orderType;
|
||||
private $orderDirection;
|
||||
private $archive;
|
||||
private $invoicedYears;
|
||||
private $invoiced;
|
||||
|
||||
public function __construct( $year, $orderType, $orderDirection, $archive )
|
||||
{
|
||||
@@ -48,6 +50,10 @@ class Invoices {
|
||||
//only projects with payments also archived projects
|
||||
$this->setMonthPayments();
|
||||
|
||||
$this->setInvoicedyears();
|
||||
|
||||
$this->setInvoiced();
|
||||
|
||||
$this->setInvoiceReport();
|
||||
}
|
||||
|
||||
@@ -95,18 +101,33 @@ class Invoices {
|
||||
public function setMonthPayments()
|
||||
{
|
||||
$monthPayment = new MonthPayments(
|
||||
$this->year, $this->orderType, $this->orderDirection );
|
||||
$this->year, $this->orderType, $this->orderDirection );
|
||||
|
||||
$this->monthPayments = $monthPayment->getProjectDetails();
|
||||
}
|
||||
|
||||
private function setInvoiced()
|
||||
{
|
||||
$this->invoiced = Invoice::getInvoiced( $this->year );
|
||||
}
|
||||
|
||||
private function setInvoicedYears()
|
||||
{
|
||||
$this->invoicedYears = Invoice::selectRaw( 'DATE_FORMAT(invoicedate, "%Y") AS years' )
|
||||
->distinct()
|
||||
->orderBy( 'invoicedate' )
|
||||
->lists( 'years' );
|
||||
}
|
||||
|
||||
private function setInvoiceReport()
|
||||
{
|
||||
$this->invoiceReport = [
|
||||
'invoiceOverview' => $this->invoiceOverviews,
|
||||
'forecasts' => $this->invoiceForecasts,
|
||||
'monthForecasts' => $this->monthForecasts,
|
||||
'monthPayments' => $this->monthPayments
|
||||
'monthPayments' => $this->monthPayments,
|
||||
'invoicedYears' => $this->invoicedYears,
|
||||
'invoiced' => $this->invoiced
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user