From e16b244b43c3ce06ad998f49fd49084af1e1b5dc Mon Sep 17 00:00:00 2001 From: Will Budic Date: Sun, 10 May 2020 11:23:03 +1000 Subject: [PATCH] Bug 24 fixed. --- Current Development Check List.md | 2 +- htdocs/cgi-bin/main.cgi | 19 ++++++++++--------- htdocs/cgi-bin/stats.cgi | 3 +-- htdocs/cgi-bin/wsrc/main.css | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Current Development Check List.md b/Current Development Check List.md index 201dc36..b89be26 100644 --- a/Current Development Check List.md +++ b/Current Development Check List.md @@ -94,7 +94,7 @@ This version is not compatible in data structure to prior versions. Data migrati ### v. 1.9 Encountered/Fixed -* Bug 24 - Logs row sum calculation not working/wrong, with negative and positive values. +* ✔ Bug 24 - Logs row sum calculation not working/wrong, with negative and positive values. * ✔ Bug 23 - Delete not working in view mode. * ✔ Bug 22 - Delete selection of entries not working after a while, db fix in config page required. * ✔ Bug 21 - Income sum for year in stats is displayed wrong. diff --git a/htdocs/cgi-bin/main.cgi b/htdocs/cgi-bin/main.cgi index 440fe58..36be759 100755 --- a/htdocs/cgi-bin/main.cgi +++ b/htdocs/cgi-bin/main.cgi @@ -362,7 +362,7 @@ qq(
my $id = 0; my $log_start = index $sqlVWL, "<="; my $re_a_tag = qr/.*<\/a>/si; - my $isInViewMode = rindex ($sqlVWL, 'PID<=') > 0 || rindex ($sqlVWL, 'ID_CAT=') > 0 || $prm_aa; + my $isInViewMode = rindex ($sqlVWL, 'PID<=') > 0 || rindex ($sqlVWL, 'ID_CAT=') > 0 || $prm_aa || rindex ($sqlVWL, 'REGEXP')>0; print $cgi->pre("###[Session PARAMS->isV:$isInViewMode|vc=$prm_vc|xc=$prm_xc|aa: $prm_aa|xc_lst=$prm_xc_lst|\@xc_lst=@xc_lst|keepExcludes=".&Settings::keepExcludes."] -> ".$sqlVWL) if $DEBUG; @@ -426,7 +426,7 @@ sub buildLog { my $sticky = $row[$i++]; #Sticky to top my $pid = $row[$i++]; #PID actual log ID in View. - if ( $af == 1 ) { #AFLAG Income + if ( $af == 1 ) { #AFLAG Income, assets are neutral. $sum += $am; } elsif ( $af == 2 ) { @@ -677,18 +677,19 @@ sub buildLog { if ( $tfId == 1 ) { $tfId = 0; } else { $tfId = 1; } - my ($tot,$tas); - $tot = $sum - $exp; - $sum = &cam($sum); + my ($tot,$tin); + $tot = $sum + $ass - abs($exp); + $tin = &cam($sum); $exp = &cam($exp); - $tas = &cam($ass); + $ass = &cam($ass); $tot = &cam($tot); + $tot = "$tot" if($tot<0); $log_output .= qq( - # Totals: Assets[$tas] Gross[$tot <-- $sum ($exp)] + # Totals: Assets [ $ass ] Inc [ $tin ] Exp [ $exp ] → Gross [$tot ] ); ### @@ -962,8 +963,8 @@ print qq( Config
Show All
$sm_reset_all -LOGOUT
-$vmode
+LOGOUT

+$vmode
$frm
$srh
diff --git a/htdocs/cgi-bin/stats.cgi b/htdocs/cgi-bin/stats.cgi index be764ec..690e32f 100755 --- a/htdocs/cgi-bin/stats.cgi +++ b/htdocs/cgi-bin/stats.cgi @@ -135,9 +135,8 @@ $tbl .=qq(LifeLog App. Version:).&Settings::release. print qq(); diff --git a/htdocs/cgi-bin/wsrc/main.css b/htdocs/cgi-bin/wsrc/main.css index 7990e83..dbe3276 100644 --- a/htdocs/cgi-bin/wsrc/main.css +++ b/htdocs/cgi-bin/wsrc/main.css @@ -275,5 +275,5 @@ a:hover { font-size: large; font-style: normal; font-weight: bold; - color:crimson; + color:crimson; } \ No newline at end of file -- 2.34.1