dashboard

This commit is contained in:
2020-01-17 13:19:00 +01:00
parent 20fc96a8fd
commit fa58fa5b71
3 changed files with 15 additions and 12 deletions
@@ -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))
})
},