Diverse aanpassing nav mail Peter
This commit is contained in:
@@ -35,6 +35,9 @@ dbo.invoicereportInit = function () {
|
||||
forecastOtherYears : ko.observable(),
|
||||
forecastRemaining : ko.observable(),
|
||||
totalProjectPayments : ko.observable(),
|
||||
orderType : 'projectnumber',
|
||||
orderDirection : false,
|
||||
archive : ko.observable( false ),
|
||||
|
||||
init: function () {
|
||||
var vm = dbo.invoicereport;
|
||||
@@ -52,7 +55,10 @@ dbo.invoicereportInit = function () {
|
||||
|
||||
vm.resetTotals();
|
||||
|
||||
dbo.invoiceDataService.getInvoiceOverview( vm.selectedYear(), function ( data ) {
|
||||
var orderDirection = vm.orderDirection ? 'ASC' : 'DESC';
|
||||
var archive = vm.archive() ? 'T' : 'F';
|
||||
|
||||
dbo.invoiceDataService.getInvoiceOverview( vm.selectedYear(), vm.orderType, orderDirection, archive, function ( data ) {
|
||||
vm.invoiceOverview( data.invoiceOverview );
|
||||
vm.setInvoiceOverviewTotals( data.invoiceOverview );
|
||||
|
||||
@@ -70,7 +76,7 @@ dbo.invoicereportInit = function () {
|
||||
vm.monthPayments.removeAll();
|
||||
_.each( data.monthPayments, function ( p ) {
|
||||
vm.monthPayments.push( new vm.Monthpayment( p ) );
|
||||
vm.totalProjectPayments( Number( vm.totalProjectPayments() ) + Number(p.totalProjectPayments.replace('.', '')) );
|
||||
vm.totalProjectPayments( Number( vm.totalProjectPayments() ) + Number( p.totalProjectPayments.replace( '.', '' ) ) );
|
||||
console.log( vm.totalProjectPayments() );
|
||||
} );
|
||||
vm.totalProjectPayments( dbo.helpers.thousandSeparator( vm.totalProjectPayments() ) );
|
||||
@@ -81,6 +87,22 @@ dbo.invoicereportInit = function () {
|
||||
} );
|
||||
},
|
||||
|
||||
toggleArchive: function () {
|
||||
var vm = dbo.invoicereport;
|
||||
vm.archive( !vm.archive() );
|
||||
|
||||
vm.initModule();
|
||||
},
|
||||
|
||||
sortList: function ( orderType ) {
|
||||
var vm = dbo.invoicereport;
|
||||
|
||||
vm.orderType = orderType;
|
||||
vm.orderDirection = !vm.orderDirection;
|
||||
|
||||
vm.initModule();
|
||||
},
|
||||
|
||||
resetTotals: function () {
|
||||
var vm = dbo.invoicereport;
|
||||
|
||||
@@ -165,6 +187,7 @@ dbo.invoicereportInit = function () {
|
||||
Monthforecast: function ( data ) {
|
||||
var vm = dbo.invoicereport;
|
||||
var self = this;
|
||||
self.projectnumber = data.projectnumber;
|
||||
self.projectname = data.projectname;
|
||||
self.customer = data.customer;
|
||||
self.needInvoice = data.needInvoice;
|
||||
@@ -175,7 +198,7 @@ dbo.invoicereportInit = function () {
|
||||
_.each( data.forecastMonths, function ( p, i ) {
|
||||
self.forecastMonths.push( new vm.ForecastMonth( p ) );
|
||||
_.each( vm.monthTotals(), function ( q ) {
|
||||
if ( q.monthID == i ) q.forecastamount( Number( q.forecastamount() ) + Number(p.forecastamount) );
|
||||
if ( q.monthID == i ) q.forecastamount( Number( q.forecastamount() ) + Number( p.forecastamount ) );
|
||||
} );
|
||||
} );
|
||||
},
|
||||
@@ -195,7 +218,7 @@ dbo.invoicereportInit = function () {
|
||||
_.each( data.monthPayments, function ( p, i ) {
|
||||
self.paymentMonths.push( new vm.PaymentMonth( p ) );
|
||||
_.each( vm.monthPaymentTotals(), function ( q ) {
|
||||
if ( q.monthID == i ) q.paymentamount( Number( q.paymentamount() ) + Number(p.paymentamount) );
|
||||
if ( q.monthID == i ) q.paymentamount( Number( q.paymentamount() ) + Number( p.paymentamount ) );
|
||||
} );
|
||||
} );
|
||||
},
|
||||
@@ -204,10 +227,10 @@ dbo.invoicereportInit = function () {
|
||||
this.paymentamount = dbo.helpers.thousandSeparator( data.paymentamount );
|
||||
},
|
||||
|
||||
createSpreadsheet:function(){
|
||||
createSpreadsheet: function () {
|
||||
var vm = dbo.invoicereport;
|
||||
var url = 'index.php/reports/reportsController/createInvoicesSpreadsheet/' + vm.selectedYear();
|
||||
window.open(url, '_blank');
|
||||
window.open( url, '_blank' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user