]> lifelog.hopto.org Git - LifeLog.git/commitdiff
Bug 24 fixed.
authorWill Budic <redacted>
Sun, 10 May 2020 01:23:03 +0000 (11:23 +1000)
committerWill Budic <redacted>
Sun, 10 May 2020 01:23:03 +0000 (11:23 +1000)
Current Development Check List.md
htdocs/cgi-bin/main.cgi
htdocs/cgi-bin/stats.cgi
htdocs/cgi-bin/wsrc/main.css

index 201dc3681c6b4571cbd032503762afbc0c031af7..b89be26350590c57d3d003f99c8953bef28c654c 100644 (file)
@@ -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.
+* &#10004; Bug 24 - Logs row sum calculation not working/wrong, with negative and positive values.
 * &#10004; Bug 23 - Delete not working in view mode.
 * &#10004; Bug 22 - Delete selection of entries not working after a while, db fix in config page required.
 * &#10004; Bug 21 - Income sum for year in stats is displayed wrong.
index 440fe586865949f80826d672f1a9fe2e3b4a5180..36be7594e18f9e53393746b7155414c1d8987681 100755 (executable)
@@ -362,7 +362,7 @@ qq(<form id="frm_log" action="data.cgi" onSubmit="return formDelValidation();">
     my $id        = 0;
     my $log_start = index $sqlVWL, "<=";
     my $re_a_tag  = qr/<a\s+.*?>.*<\/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 = "<font color='red'>$tot</font>" if($tot<0);
 
     $log_output .= qq(
     <tr class="r$tfId">
                <td></td>
                <td></td>
-               <td id="summary" colspan="4" style="text-align:right"># <i>Totals</i>: Assets[$tas] Gross[<b><i>$tot</i></b> &lt;-- $sum (<font color="red">$exp</font>)]</td>
+               <td id="summary" colspan="4" style="text-align:right"># <i>Totals</i>: Assets [ $ass ] Inc [ $tin ] Exp [ <font color="red">$exp</font> ] <b>&#8594; Gross [<i>$tot</i> ] </b></td>
        </tr>);
 
     ###
@@ -962,8 +963,8 @@ print qq(
 <a class="a_" href="config.cgi">Config</a><hr>
 <a class="a_" id="lnk_show_all" onclick="return showAll();">Show All <span  class="ui-icon ui-icon-heart"></a><hr>
 $sm_reset_all
-<a class="a_" href="login_ctr.cgi?logout=bye">LOGOUT</a><br>
-<span style="font-size: x-small;">$vmode</span><br>
+<a class="a_" href="login_ctr.cgi?logout=bye">LOGOUT</a><br><hr>
+<span style="font-size: x-small; font-weight: bold;">$vmode</span><br>
 </div>
          <div id="div_log">$frm</div>
          <div id="div_srh">$srh</div>
index be764ecd49a9ab0d623c4a429249d534cc6062b8..690e32fb083b1bd9bdde8788be75543c8be546cc 100755 (executable)
@@ -135,9 +135,8 @@ $tbl .=qq(<tr class="r1"><td>LifeLog App. Version:</td><td>).&Settings::release.
 
 
 print qq(<div id="menu" title="To close this menu click on its heart, and wait." style="border: 1px solid black;padding: 5px;margin-top: 25px;">
-<a class="a_" href="config.cgi">Config</a><hr>
 <a class="a_" href="main.cgi">Log</a><hr>
-<br>
+<a class="a_" href="config.cgi">Config</a><hr>
 <a class="a_" href="login_ctr.cgi?logout=bye">LOGOUT</a>
 </div>);
 
index 7990e831df40a4b6d946d06492b89274159697de..dbe3276e66bc1647767575007d2fbc7f27f826f2 100644 (file)
@@ -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