fix for #537 : in borrower screen, the "fine & debts" now shows only amount due if >0, "nothing due" if borrower has no debts.
This commit is contained in:
parent
0bc6382e5e
commit
bc14432d5f
|
|
@ -98,28 +98,20 @@
|
|||
|
||||
<TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
|
||||
<TR VALIGN=TOP>
|
||||
<td bgcolor="99cc33" background="<!-- TMPL_VAR name="themelang" -->/images/background-mem.gif" colspan=4><B>FINES & CHARGES</TD>
|
||||
<td bgcolor="99cc33" background="<!-- TMPL_VAR name="themelang" -->/images/background-mem.gif" colspan=2><B>FINES & CHARGES</TD>
|
||||
</TR>
|
||||
|
||||
<!-- TMPL_LOOP NAME=accountloop -->
|
||||
<!-- TMPL_IF NAME=amountoutstanding -->
|
||||
<tr VALIGN=TOP>
|
||||
<td><!-- TMPL_VAR NAME="date" --></td>
|
||||
<td>
|
||||
<!-- TMPL_IF NAME=biblionumber -->
|
||||
<a href="/cgi-bin/koha/moredetail.pl?itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->&bib=<!-- TMPL_VAR NAME="blionumber" -->&bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->"><!-- TMPL_VAR NAME="description" --> <!-- TMPL_VAR NAME="title" --></a>
|
||||
<!-- TMPL_ELSE -->
|
||||
|
||||
<!-- /TMPL_IF -->
|
||||
</td>
|
||||
<td><!-- TMPL_VAR NAME="amount" --></td>
|
||||
<td><!-- TMPL_VAR NAME="amountoutstanding" --></td>
|
||||
<TMPL_IF name="totaldue">
|
||||
<tr valign="top">
|
||||
<td>Total due</td>
|
||||
<td><!-- TMPL_VAR name="totaldue"--></td>
|
||||
</tr>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- /TMPL_LOOP -->
|
||||
|
||||
<TMPL_ELSE>
|
||||
<tr valign="top">
|
||||
<td colspan=2>No debts</td>
|
||||
</tr>
|
||||
</TMPL_IF>
|
||||
<tr VALIGN=TOP >
|
||||
<TD colspan=3 align=right>
|
||||
<TD colspan=2 align=right>
|
||||
<p>
|
||||
<br>
|
||||
<a class="button" href=/cgi-bin/koha/boraccount.pl?bornum=<!-- TMPL_VAR NAME="bornum" -->>View Account</a>
|
||||
|
|
|
|||
|
|
@ -123,41 +123,7 @@ $data->{'branchcode'} = &getbranchname($data->{'branchcode'});
|
|||
# Converts the categorycode to the description
|
||||
$data->{'categorycode'} = &getborrowercategory($data->{'categorycode'});
|
||||
|
||||
# FIXME
|
||||
# it looks like $numaccts is a temp variable and that the
|
||||
# for (my $i;$i<$numaccts;$i++)
|
||||
# can be turned into a foreach loop instead
|
||||
#
|
||||
my ($numaccts,$accts,$total)=getboracctrecord('',\%bor);
|
||||
#if ($numaccts > 10){
|
||||
# $numaccts=10;
|
||||
#}
|
||||
my @accountdata;
|
||||
for (my$i=0;$i<$numaccts;$i++){
|
||||
my $amount= $accts->[$i]{'amount'} + 0.00;
|
||||
my $amount2= $accts->[$i]{'amountoutstanding'} + 0.00;
|
||||
my %row = %$accts->[$i];
|
||||
if ($amount2 != 0){
|
||||
my $item=" ";
|
||||
$row{'date'} = format_date($accts->[$i]{'date'});
|
||||
|
||||
if ($accts->[$i]{'accounttype'} ne 'Res'){
|
||||
#get item data
|
||||
#$item=
|
||||
}
|
||||
|
||||
# FIXME
|
||||
# why set this variable if it's not going to be used?
|
||||
#
|
||||
my $env;
|
||||
if ($accts->[$i]{'accounttype'} ne 'Res'){
|
||||
my $iteminfo=C4::Circulation::Circ2::getiteminformation($env,$accts->[$i]->{'itemnumber'},'');
|
||||
# FIXME, seems to me $iteminfo gets not defined
|
||||
%row = (%row , %$iteminfo) if $iteminfo;
|
||||
}
|
||||
}
|
||||
push (@accountdata, \%row);
|
||||
}
|
||||
|
||||
my ($count,$issue)=borrissues($bornum);
|
||||
my $today=ParseDate('today');
|
||||
|
|
@ -210,7 +176,7 @@ foreach my $reserveline (@$reserves) {
|
|||
$template->param($data);
|
||||
$template->param(
|
||||
bornum => $bornum,
|
||||
accountloop => \@accountdata,
|
||||
totaldue =>$total,
|
||||
issueloop => \@issuedata,
|
||||
reserveloop => \@reservedata);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue