Invoiced report

This commit is contained in:
2020-01-10 17:42:25 +01:00
parent b4d69d272c
commit 5594865554
11 changed files with 384 additions and 190 deletions
@@ -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
];
}
}