]> lifelog.hopto.org Git - LifeLog.git/commitdiff
reverted back, bug fix 22. Category selected is irrelevant, should not be searched...
authorWill Budic <redacted>
Fri, 8 May 2020 21:03:10 +0000 (07:03 +1000)
committerWill Budic <redacted>
Fri, 8 May 2020 21:03:10 +0000 (07:03 +1000)
htdocs/cgi-bin/stats.cgi

index 91d512a47b955be1623d153e520697f23eb6291d..be764ecd49a9ab0d623c4a429249d534cc6062b8 100755 (executable)
@@ -77,23 +77,10 @@ my $notes_rc = selectSQL('select count(LID) from NOTES where DOC is not null;');
 my $id;
 
 #INCOME
-$stm1 = 'select ID from CAT where NAME like "Income"';
-$id = selectSQL($stm1);
-if($id){
-    $stm1 = "SELECT sum(AMOUNT) from LOG where date>=date('now','start of year') AND (ID_CAT =$id or AFLAG=1);";
-}
-else{
-    $stm1 = 'SELECT sum(AMOUNT) from LOG where date>=date("now","start of year") AND AFLAG = 1;';
-}
+$stm1 = 'SELECT sum(AMOUNT) from LOG where date>=date("now","start of year") AND AFLAG = 1;';
 #EXPENSE
-$stm2 = 'select ID from CAT where NAME like "Expense"';
-$id = selectSQL($stm2);
-if($id){
-    $stm2 = "SELECT sum(AMOUNT) from LOG where date>=date('now','start of year') AND (ID_CAT =$id or AFLAG=2);";
-}
-else{
-    $stm2 = 'SELECT sum(AMOUNT) from LOG where date>=date("now","start of year") AND AFLAG = 2;';
-}
+$stm2 = 'SELECT sum(AMOUNT) from LOG where date>=date("now","start of year") AND AFLAG = 2;';
+
 
 my $income = selectSQL($stm1);
 my $expense= selectSQL($stm2);