mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-02 02:18:20 +00:00
Code for #937
This commit is contained in:
21
public/js/ff/index.js
vendored
21
public/js/ff/index.js
vendored
@@ -43,13 +43,25 @@ function drawChart() {
|
||||
getBillsBox();
|
||||
getAvailableBox();
|
||||
getNetWorthBox();
|
||||
getPiggyBanks();
|
||||
|
||||
//getBoxAmounts();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function getPiggyBanks() {
|
||||
$.getJSON(piggyInfoUri).done(function (data) {
|
||||
if (data.html.length > 0) {
|
||||
$('#piggy_bank_overview').html(data.html);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getNetWorthBox() {
|
||||
// box-net-worth
|
||||
$.getJSON('json/box/net-worth').done(function(data) {
|
||||
$.getJSON('json/box/net-worth').done(function (data) {
|
||||
$('#box-net-worth').html(data.net_worth);
|
||||
});
|
||||
}
|
||||
@@ -60,7 +72,7 @@ function getNetWorthBox() {
|
||||
function getAvailableBox() {
|
||||
// box-left-to-spend
|
||||
// box-left-per-day
|
||||
$.getJSON('json/box/available').done(function(data) {
|
||||
$.getJSON('json/box/available').done(function (data) {
|
||||
$('#box-left-to-spend').html(data.left);
|
||||
$('#box-left-per-day').html(data.perDay);
|
||||
});
|
||||
@@ -72,7 +84,7 @@ function getAvailableBox() {
|
||||
function getBillsBox() {
|
||||
// box-bills-unpaid
|
||||
// box-bills-paid
|
||||
$.getJSON('json/box/bills').done(function(data) {
|
||||
$.getJSON('json/box/bills').done(function (data) {
|
||||
$('#box-bills-paid').html(data.paid);
|
||||
$('#box-bills-unpaid').html(data.unpaid);
|
||||
});
|
||||
@@ -85,7 +97,7 @@ function getBalanceBox() {
|
||||
// box-balance-total
|
||||
// box-balance-out
|
||||
// box-balance-in
|
||||
$.getJSON('json/box/balance').done(function(data) {
|
||||
$.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);
|
||||
@@ -93,7 +105,6 @@ function getBalanceBox() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getBoxAmounts() {
|
||||
"use strict";
|
||||
var boxes = ['in', 'out', 'bills-unpaid', 'bills-paid'];
|
||||
|
Reference in New Issue
Block a user