dashboard
This commit is contained in:
@@ -44,16 +44,19 @@ dbo.dashboardInit = function () {
|
||||
self.openInvoices(dbo.helpers.thousandSeparator(outstandings.openInvoices))
|
||||
self.toInvoice(dbo.helpers.thousandSeparator(outstandings.toInvoice))
|
||||
|
||||
self.revenues(dbo.helpers.thousandSeparator(outstandings.revenues))
|
||||
self.revenueCurrentYear(dbo.helpers.thousandSeparator(revCurYear))
|
||||
self.revenuesThisYear(dbo.helpers.thousandSeparator(data.revenuesThisYear))
|
||||
})
|
||||
dbo.reservationsDataservice.getReservations(function(data){
|
||||
var openCosts = 0
|
||||
$.each(data, function(i,p){
|
||||
openCosts += Number(p.other_revenue) - Number(p.payed);
|
||||
dbo.reservationsDataservice.getReservations(function (data) {
|
||||
var openCosts = 0
|
||||
$.each(data, function (i, p) {
|
||||
openCosts += Number(p.other_revenue) - Number(p.payed)
|
||||
})
|
||||
self.openCosts(dbo.helpers.thousandSeparator(openCosts))
|
||||
|
||||
var revenues = outstandings.openInvoices + outstandings.toInvoice - openCosts
|
||||
revenues = Math.round(revenues / 1.21)
|
||||
self.revenues(dbo.helpers.thousandSeparator(revenues))
|
||||
})
|
||||
self.openCosts(dbo.helpers.thousandSeparator(openCosts))
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user