diff --git a/application/controllers/reports/ReportsController.php b/application/controllers/reports/ReportsController.php index 1d9df08..96f245f 100644 --- a/application/controllers/reports/ReportsController.php +++ b/application/controllers/reports/ReportsController.php @@ -68,9 +68,9 @@ class ReportsController extends MY_Controller { $this->json( $invoiceReport ); } - public function createInvoicesSpreadsheet( $year = FALSE ) + public function createInvoicesSpreadsheet( $year = FALSE, $orderType, $orderDirection, $archive ) { - $invoices = new Invoices( $year ); + $invoices = new Invoices( $year, $orderType, $orderDirection, $archive ); $invoiceReport = $invoices->getInvoiceReport(); diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php index cd0f788..dfb289d 100644 --- a/application/core/MY_Controller.php +++ b/application/core/MY_Controller.php @@ -16,7 +16,7 @@ class MY_Controller extends CI_Controller { { parent::__construct(); - $this->version = '1.00.02'; + $this->version = '1.00.03'; $this->load->library( 'beheer/session/RetrieveUserSession' ); diff --git a/application/libraries/reports/invoice/MonthForecast.php b/application/libraries/reports/invoice/MonthForecast.php index 8ab326f..74a6274 100644 --- a/application/libraries/reports/invoice/MonthForecast.php +++ b/application/libraries/reports/invoice/MonthForecast.php @@ -56,7 +56,7 @@ class MonthForecast { private function setInitialsForecastMonths() { - for ( $i = 0; $i <= 12; $i ++ ) + for ( $i = 0; $i < 12; $i ++ ) { $this->forecastMonths[ $i ] = ['forecastamount' => 0]; } diff --git a/public/js/lib/modules/reports/invoicereport.js b/public/js/lib/modules/reports/invoicereport.js index cd0911c..a650242 100644 --- a/public/js/lib/modules/reports/invoicereport.js +++ b/public/js/lib/modules/reports/invoicereport.js @@ -229,7 +229,11 @@ dbo.invoicereportInit = function () { createSpreadsheet: function () { var vm = dbo.invoicereport; - var url = 'index.php/reports/reportsController/createInvoicesSpreadsheet/' + vm.selectedYear(); + + var orderDirection = vm.orderDirection ? 'ASC' : 'DESC'; + var archive = vm.archive() ? 'T' : 'F'; + + var url = 'index.php/reports/reportsController/createInvoicesSpreadsheet/' + vm.selectedYear() + '/' + vm.orderType + '/' + orderDirection + '/' + archive; window.open( url, '_blank' ); } }