diff --git a/application/libraries/reports/invoice/Invoices.php b/application/libraries/reports/invoice/Invoices.php index bc5b56b..a60d8a2 100644 --- a/application/libraries/reports/invoice/Invoices.php +++ b/application/libraries/reports/invoice/Invoices.php @@ -108,7 +108,7 @@ class Invoices { private function setInvoiced() { - $this->invoiced = Invoice::getInvoiced( $this->year ); + $this->invoiced = Invoice::getInvoiced( $this->year, $this->orderType, $this->orderDirection ); } private function setInvoicedYears() diff --git a/application/libraries/reports/invoice/MonthForecast.php b/application/libraries/reports/invoice/MonthForecast.php index 74a6274..c2fb537 100644 --- a/application/libraries/reports/invoice/MonthForecast.php +++ b/application/libraries/reports/invoice/MonthForecast.php @@ -79,6 +79,7 @@ class MonthForecast { private function setProjectDetails() { $this->projectDetails = [ + 'projectnumber' => $this->project->projectnumber, 'projectname' => $this->projectname, 'customer' => $this->customer, 'needInvoice' => number_format( $this->invoiceForecast->getNeedInvoice(), 0, ',', '.' ), @@ -88,4 +89,4 @@ class MonthForecast { ]; } -} \ No newline at end of file +} diff --git a/application/libraries/reports/invoice/MonthPayments.php b/application/libraries/reports/invoice/MonthPayments.php index 01edb38..0508e8f 100644 --- a/application/libraries/reports/invoice/MonthPayments.php +++ b/application/libraries/reports/invoice/MonthPayments.php @@ -118,6 +118,7 @@ class MonthPayments { private function setProjectDetails() { $this->projectDetails[] = [ + 'projectnumber' => $this->project->projectnumber, 'projectname' => $this->projectname, 'customer' => $this->customer, 'monthPayments' => $this->monthPayments, diff --git a/application/models/eloquent/Invoice.php b/application/models/eloquent/Invoice.php index 9fdb7b0..d4c6b1c 100644 --- a/application/models/eloquent/Invoice.php +++ b/application/models/eloquent/Invoice.php @@ -63,13 +63,13 @@ class Invoice extends BaseModel { return $invoiceID; } - public static function getInvoiced( $year ) + public static function getInvoiced( $year, $orderType='invoicedate', $orderDirection='DESC' ) { $invoiced = Invoice::selectRaw('invoicenumber, PRJ.projectname, projectnumber, CUS.name, invoicedate, CUS.name, ROUND(invoiceamount, 0) AS 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') + ->orderBy($orderType, $orderDirection) ->get(); return $invoiced; diff --git a/application/views/reports/invoices/invoices_report.php b/application/views/reports/invoices/invoices_report.php index 7b1529d..2bb9645 100644 --- a/application/views/reports/invoices/invoices_report.php +++ b/application/views/reports/invoices/invoices_report.php @@ -3,6 +3,13 @@ + @@ -28,6 +35,9 @@ + diff --git a/application/views/reports/invoices/monthforecast_report.php b/application/views/reports/invoices/monthforecast_report.php index af2aba0..45bb680 100644 --- a/application/views/reports/invoices/monthforecast_report.php +++ b/application/views/reports/invoices/monthforecast_report.php @@ -1,6 +1,13 @@
+
+ + projectnummer + +
+
factuurnummer
+ +
+ @@ -26,7 +33,8 @@ - + + @@ -58,4 +66,4 @@ -
+
+ + projectnummer + +
+
project
\ No newline at end of file + diff --git a/application/views/reports/invoices/monthpayment_report.php b/application/views/reports/invoices/monthpayment_report.php index 6c94a7e..22719b0 100644 --- a/application/views/reports/invoices/monthpayment_report.php +++ b/application/views/reports/invoices/monthpayment_report.php @@ -1,6 +1,13 @@ + @@ -20,7 +27,8 @@ - + + @@ -44,4 +52,4 @@ -
+
+ + projectnummer + +
+
project
\ No newline at end of file + diff --git a/public/js/lib/modules/reports/invoicereport.js b/public/js/lib/modules/reports/invoicereport.js index 6891c7e..d26847a 100644 --- a/public/js/lib/modules/reports/invoicereport.js +++ b/public/js/lib/modules/reports/invoicereport.js @@ -235,6 +235,7 @@ dbo.invoicereportInit = function () { Monthpayment: function (data) { var vm = dbo.invoicereport var self = this + self.projectnumber = data.projectnumber self.projectname = data.projectname self.customer = data.customer self.totalProjectPayments = data.totalProjectPayments @@ -259,6 +260,7 @@ dbo.invoicereportInit = function () { this.invoiceamount = dbo.helpers.thousandSeparator(data.invoiceamount) this.vat = dbo.helpers.thousandSeparator(vat) this.inclVat = dbo.helpers.thousandSeparator(inclVat) + this.projectnumber = data.projectnumber this.project = data.projectnumber + ' ' + data.projectname this.invoicedate = data.invoicedate this.name = data.name