mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-06 01:45:22 +00:00
Updated website boxes.
This commit is contained in:
54
public/js/ff/index.js
vendored
54
public/js/ff/index.js
vendored
@@ -28,10 +28,62 @@ function drawChart() {
|
||||
columnChart(accountExpenseUri, 'expense-accounts-chart');
|
||||
columnChart(accountRevenueUri, 'revenue-accounts-chart');
|
||||
|
||||
// get balance box:
|
||||
getBalanceBox();
|
||||
getBillsBox();
|
||||
getAvailableBox();
|
||||
getNetWorthBox();
|
||||
|
||||
getBoxAmounts();
|
||||
//getBoxAmounts();
|
||||
}
|
||||
|
||||
function getNetWorthBox() {
|
||||
// box-net-worth
|
||||
$.getJSON('json/box/net-worth').done(function(data) {
|
||||
$('#box-net-worth').html(data.net_worth);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function getAvailableBox() {
|
||||
// box-left-to-spend
|
||||
// box-left-per-day
|
||||
$.getJSON('json/box/available').done(function(data) {
|
||||
$('#box-left-to-spend').html(data.left);
|
||||
$('#box-left-per-day').html(data.perDay);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function getBillsBox() {
|
||||
// box-bills-unpaid
|
||||
// box-bills-paid
|
||||
$.getJSON('json/box/bills').done(function(data) {
|
||||
$('#box-bills-paid').html(data.paid);
|
||||
$('#box-bills-unpaid').html(data.unpaid);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function getBalanceBox() {
|
||||
// box-balance-total
|
||||
// box-balance-out
|
||||
// box-balance-in
|
||||
$.getJSON('json/box/balance').done(function(data) {
|
||||
$('#box-balance-total').html(data.combined);
|
||||
$('#box-balance-in').html(data.income);
|
||||
$('#box-balance-out').html(data.expense);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getBoxAmounts() {
|
||||
"use strict";
|
||||
var boxes = ['in', 'out', 'bills-unpaid', 'bills-paid'];
|
||||
|
||||
Reference in New Issue
Block a user