From 4b5d0c7635cd14dd78fc6ab1ac5d494bd99b41d4 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 10 Dec 2012 17:28:12 -0800 Subject: Filter bogus transactions --- public/js/report.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/report.coffee b/public/js/report.coffee index 225f4392..004f655f 100644 --- a/public/js/report.coffee +++ b/public/js/report.coffee @@ -20,7 +20,9 @@ filterDates = -> from = moment($('#from').val(), "MM/DD/YYYY") to = moment($('#to').val(), "MM/DD/YYYY") d = moment(e.date) + amount = parseFloat(e.exchange) * parseFloat(e.received) + return false unless !isNaN(parseFloat(amount)) && isFinite(amount) return (!from? || d.diff(from) >= 0) && (!to? || d.diff(to) <= 0) ) @@ -45,8 +47,6 @@ display = (transactions) -> received = parseFloat(this.received) amount = received * exchange - return true unless !isNaN(parseFloat(amount)) && isFinite(amount) - $('tbody').append(""" #{this.date} -- cgit v1.2.3