Diversen dashboard

This commit is contained in:
2020-01-31 15:56:51 +01:00
parent 63ac729032
commit 10d991f4c7
6 changed files with 104 additions and 26 deletions
@@ -29,6 +29,9 @@ dbo.dashboardInit = function () {
billingOverview : ko.observableArray([]),
showInvoiceOverview: ko.observable(false),
openInvoices : ko.observable(null),
invoiced : ko.observable(null),
minimumRevenues : ko.observable(null),
totalChance : ko.observable(null),
init: function () {
var self = dbo.dashboardModel
@@ -41,8 +44,11 @@ dbo.dashboardInit = function () {
self.owpTotal(dbo.helpers.thousandSeparator(data.totalOwp))
self.revenuesNextyear(dbo.helpers.thousandSeparator(data.revenuesNextyear))
self.totalRevenues(dbo.helpers.thousandSeparator(data.totalRevenues))
self.minimumRevenues(dbo.helpers.thousandSeparator(data.currentFinancialYear + data.revenuesThisYear))
self.invoiced(dbo.helpers.thousandSeparator(data.invoiced))
self.openInvoices(dbo.helpers.thousandSeparator(outstandings.openInvoices))
self.toInvoice(dbo.helpers.thousandSeparator(outstandings.toInvoice))
self.totalChance(dbo.helpers.thousandSeparator(data.totalChance))
self.revenueCurrentYear(dbo.helpers.thousandSeparator(revCurYear))
self.revenuesThisYear(dbo.helpers.thousandSeparator(data.revenuesThisYear))
+20 -8
View File
@@ -42,6 +42,9 @@ dbo.invoicereportInit = function () {
archive : ko.observable(false),
recievedInvoices : ko.observableArray([]),
invoiced : ko.observableArray([]),
totalInvoiced : ko.observable(),
totalVat : ko.observable(),
totalInclVat : ko.observable(),
init: function () {
var vm = dbo.invoicereport
@@ -87,13 +90,18 @@ dbo.invoicereportInit = function () {
p.paymentamount(dbo.helpers.thousandSeparator(p.paymentamount()))
})
vm.years(data.invoicedYears);
vm.years(data.invoicedYears)
vm.invoiced.removeAll()
_.each(data.invoiced, function(p){
vm.invoiced.push( new vm.Invoice(p));
});
vm.totalInvoiced(0)
vm.totalVat(0)
vm.totalInclVat(0)
_.each(data.invoiced, function (p) {
vm.invoiced.push(new vm.Invoice(p))
})
vm.totalInvoiced(dbo.helpers.thousandSeparator(vm.totalInvoiced()))
vm.totalVat(dbo.helpers.thousandSeparator(vm.totalVat()))
vm.totalInclVat(dbo.helpers.thousandSeparator(vm.totalInclVat()))
})
},
@@ -244,9 +252,10 @@ dbo.invoicereportInit = function () {
this.paymentamount = dbo.helpers.thousandSeparator(Math.round(data.paymentamount))
},
Invoice : function(data){
var vat = Math.round((data.invoiceamount * 21) / 100);
var inclVat = vat + Number(data.invoiceamount);
Invoice: function (data) {
var vm = dbo.invoicereport
var vat = Math.round((data.invoiceamount * 21) / 100)
var inclVat = vat + Number(data.invoiceamount)
this.invoiceamount = dbo.helpers.thousandSeparator(data.invoiceamount)
this.vat = dbo.helpers.thousandSeparator(vat)
this.inclVat = dbo.helpers.thousandSeparator(inclVat)
@@ -254,6 +263,9 @@ dbo.invoicereportInit = function () {
this.invoicedate = data.invoicedate
this.name = data.name
this.invoicenumber = ko.observable(data.invoicenumber)
vm.totalInvoiced(Number(vm.totalInvoiced()) + Number(data.invoiceamount))
vm.totalVat(Number(vm.totalVat()) + Number(vat))
vm.totalInclVat(Number(vm.totalInclVat()) + Number(inclVat))
},
createSpreadsheet: function () {