Bug 5688

Summary: OPAC My Summary tab fines column doesn't display accruing fines
Product: Koha Reporter: Jane Wagner <jwagner>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P5 - low CC: gmcharlt, katrin.fischer, kyle.m.hall
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: screen shot of My Summary tab

Description Jane Wagner 2011-02-03 13:45:15 UTC
Created attachment 3059 [details]
screen shot of My Summary tab

Problem description copied from: http://lists.katipo.co.nz/public/koha/2008-March/013387.html

"Long version: I'm using the script <KOHA>/bin/cronjobs/fines2.pl to
calculate fines on a nightly basis.  It works pretty well, but I
noticed that it has this line:

  UpdateFine($data->[$i]->{'itemnumber'},
  $data->[$i]->{'borrowernumber'},$amount,$type,$due);

This calls the UpdateFine subroutine in C4/Overdues.pm, which runs this
command:

    my $sth2 = $dbh->prepare(
      "INSERT INTO accountlines
      (borrowernumber,itemnumber,date,amount,
      description,accounttype,amountoutstanding,accountno) VALUES
      (?,?,now(),?,?,'FU',?,?)"
    );

Note how "FU" is hardcoded as the "accounttype" in this section.  But
when a patron is viewing his/her summary screen in the OPAC (i.e. 
http://www.example.net/cgi-bin/koha/opac-user.pl) and has an overdue
item, the line under "Fines" always says "No".

Why?  Because opac-user.pl has this bit of code:

    my $charges = 0;
    foreach my $ac (@$accts) {
        if ( $ac->{'itemnumber'} == $issue->{'itemnumber'} ) {
            $charges += $ac->{'amountoutstanding'}
              if $ac->{'accounttype'} eq 'F';
            $charges += $ac->{'amountoutstanding'}
              if $ac->{'accounttype'} eq 'L';
        }
    }
    $issue->{'charges'} = $charges;

So, $charges is only going to be passed to the template if the
accounttype is "F" or "L".  But since C4/Overdues.pm is always setting
it to "FU", that will never happen, and the Summary screen will always
tell the patron they have no fines."



I tested this morning on current master/head, and this problem still seems to exist.  The fines.pl script is setting accounttype to FU, and opac-user.pl is still not displaying FU types of fines.  What are the implications (if any) of adding FU to opac-user.pl?

See screenshot -- the fines display correctly under the separate My Fines tab, but not in the Fines column of the My Summary tab.
Comment 1 Katrin Fischer 2011-02-07 10:49:06 UTC
I have tested this on current master and current 3.2.x branch. The column fine on the opac summary page shows always 'No'. The 'Fines' tab on the same page and the 'My fines' tab show the fines and amounts correctly.
Comment 2 Katrin Fischer 2013-02-17 20:41:47 UTC

*** This bug has been marked as a duplicate of bug 8079 ***