Diverse aanpassing nav mail Peter
This commit is contained in:
@@ -154,6 +154,7 @@ dbo.projectsInit = function () {
|
||||
self.id = data.id;
|
||||
self.projectnumber = data.projectnumber;
|
||||
self.projectleader = data.projectleader ? data.projectleader.fullname : '#NB';
|
||||
self.projectname = data.projectname;
|
||||
self.customer = data.customer ? data.customer.name : '#NB';
|
||||
self.startdate = data.startdate;
|
||||
self.enddate = data.enddate;
|
||||
|
||||
@@ -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' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ dbo.monthlyemployeehoursInit = function () {
|
||||
totalNextFinancialYear : ko.observable(),
|
||||
totalInvoicedYear : ko.observableArray( [] ),
|
||||
validYear : ko.observable( true ),
|
||||
archive : ko.observable(),
|
||||
|
||||
init: function () {
|
||||
var vm = dbo.monthlyEmployeeHoursModel;
|
||||
@@ -72,7 +73,9 @@ dbo.monthlyemployeehoursInit = function () {
|
||||
vm.uniqueEmployees.push( new vm.UniqueEmployee( p ) )
|
||||
} );
|
||||
} );
|
||||
dbo.reportsDataService.getRecapProjects( function ( data ) {
|
||||
|
||||
var archive = vm.archive() ? 'T' : 'F';
|
||||
dbo.reportsDataService.getRecapProjects( archive, function ( data ) {
|
||||
vm.recap.removeAll();
|
||||
vm.uniqueYears.removeAll();
|
||||
$.each( data, function ( i, p ) {
|
||||
@@ -90,7 +93,7 @@ dbo.monthlyemployeehoursInit = function () {
|
||||
vm.totalSaldo( dbo.helpers.thousandSeparator( vm.totalSaldo() ) );
|
||||
vm.totalWorkInProgress( dbo.helpers.thousandSeparator( vm.totalWorkInProgress() ) );
|
||||
vm.totalEmployeeRevenues( dbo.helpers.thousandSeparator( vm.totalEmployeeRevenues() ) );
|
||||
vm.totalAvailableRevenues( dbo.helpers.thousandSeparator( vm.totalAvailableRevenues() ));
|
||||
vm.totalAvailableRevenues( dbo.helpers.thousandSeparator( vm.totalAvailableRevenues() ) );
|
||||
vm.totalOwp( dbo.helpers.thousandSeparator( vm.totalOwp() ) );
|
||||
vm.totalEmployeeHours( dbo.helpers.thousandSeparator( vm.totalEmployeeHours() ) );
|
||||
_.each( vm.totalPerEmployee(), function ( p ) {
|
||||
@@ -121,6 +124,13 @@ dbo.monthlyemployeehoursInit = function () {
|
||||
} );
|
||||
},
|
||||
|
||||
toggleArchive: function () {
|
||||
var vm = dbo.monthlyEmployeeHoursModel;
|
||||
|
||||
vm.archive( !vm.archive() );
|
||||
vm.initModule();
|
||||
},
|
||||
|
||||
checkYear: function () {
|
||||
var vm = dbo.monthlyEmployeeHoursModel;
|
||||
if ( timeout ) {
|
||||
|
||||
Reference in New Issue
Block a user