Skip to content

Commit

Permalink
Fix constants
Browse files Browse the repository at this point in the history
  • Loading branch information
davidschlachter committed Nov 12, 2024
1 parent d2d421a commit 10ba17f
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/frontend/src/BigPicture.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,11 @@ export default function BigPicture() {

// 'Income' means net income, after taxes; we also exclude taxes from
// 'Expenses', and interest from income (if positive).
if (interest_twelve_months > 0) {
const income_twelve_months = parseFloat(response.income_twelve_months) + taxes_twelve_months - interest_twelve_months
const expenses_twelve_months = parseFloat(response.expenses_twelve_months) - taxes_twelve_months
} else {
const income_twelve_months = parseFloat(response.income_twelve_months) + taxes_twelve_months
const expenses_twelve_months = parseFloat(response.expenses_twelve_months) - taxes_twelve_months - interest_twelve_months
}
if (interest_three_months > 0) {
const income_three_months = parseFloat(response.income_three_months) + taxes_three_months - interest_three_months
const expenses_three_months = parseFloat(response.expenses_three_months) - taxes_three_months
} else {
const income_three_months = parseFloat(response.income_three_months) + taxes_three_months
const expenses_three_months = parseFloat(response.expenses_three_months) - taxes_three_months - interest_three_months
}
const income_twelve_months = interest_twelve_months > 0 ? parseFloat(response.income_twelve_months) + taxes_twelve_months + interest_twelve_months : parseFloat(response.income_twelve_months) + taxes_twelve_months
const expenses_twelve_months = interest_twelve_months > 0 ? parseFloat(response.expenses_twelve_months) - taxes_twelve_months : parseFloat(response.expenses_twelve_months) - taxes_twelve_months - interest_twelve_months

const income_three_months = interest_three_months > 0 ? parseFloat(response.income_three_months) + taxes_three_months + interest_three_months : parseFloat(response.income_three_months) + taxes_three_months
const expenses_three_months = interest_three_months > 0 ? parseFloat(response.expenses_three_months) - taxes_three_months : parseFloat(response.expenses_three_months) - taxes_three_months - interest_three_months

const current_year = new Date().getFullYear()

Expand Down

0 comments on commit 10ba17f

Please sign in to comment.