if ( my $mf = $relations->{$frameworkcode}->{$kohafield} ) {
return @$mf;
}
- warn qq{No marc tags for framework "$frameworkcode" field $kohafield};
return (0, undef);
}
my $item_id = @_ ? shift : $itemnumber; # Send the barcode if you want that logged in the description
my $dbh = C4::Context->dbh;
# check for charge made for lost book
- my $sth = $dbh->prepare("SELECT * FROM accountlines WHERE (itemnumber = ?) AND (accounttype='L' OR accounttype='Rep') ORDER BY date DESC");
+ my $sth = $dbh->prepare("SELECT * FROM accountlines WHERE itemnumber = ? AND accounttype IN ('L', 'Rep', 'W') ORDER BY date DESC, accountno DESC");
$sth->execute($itemnumber);
my $data = $sth->fetchrow_hashref;
$data or return; # bail if there is nothing to do
+ $data->{accounttype} eq 'W' and return; # Written off
# writeoff this amount
my $offset;
my @resultitems;
my $yaml = C4::Context->preference('OpacHiddenItems');
- $yaml = "$yaml\n"; # YAML is anal on ending \n. Surplus does not hurt
+ $yaml = "$yaml\n\n"; # YAML is anal on ending \n. Surplus does not hurt
my $hidingrules;
eval {
$hidingrules = YAML::Load($yaml);
}
else {
my @id = $input->param('id');
+
+ if ( not defined @id ) {
+ # empty server list -> report and exit
+ $template->param( emptyserverlist => 1 );
+ output_html_with_http_headers $input, $cookie, $template->output;
+ exit;
+ }
+
my @oConnection;
my @oResult;
+ my @errconn;
my $s = 0;
my $query;
my $nterms;
$query .= " \@attr 1=21 \"$subject\" ";
$nterms++;
}
- if ($lccn) {
+ if ($lccn) {
$query .= " \@attr 1=9 $lccn ";
$nterms++;
}
$sth->execute($servid);
while ( $server = $sth->fetchrow_hashref ) {
warn "serverinfo ".join(':',%$server) if $DEBUG;
- my $noconnection = 0;
my $option1 = new ZOOM::Options();
$option1->option( 'async' => 1 );
$option1->option( 'elementSetName', 'F' );
my ( $error, $errmsg, $addinfo, $diagset ) =
$oConnection[$k]->error_x();
if ($error) {
- warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n"
- if $DEBUG;
-
+ if ($error =~ m/^(10000|10007)$/ ) {
+ push(@errconn, {'server' => $serverhost[$k]});
+ }
+ $DEBUG and warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n";
}
else {
my $numresults = $oResult[$k]->size();
)
= ImportBreeding( $marcdata, 2, $serverhost[$k], $encoding[$k], $random, 'z3950' );
my %row_data;
- if ( $i % 2 ) {
- $toggle = 1;
- }
- else {
- $toggle = 0;
- }
- $row_data{toggle} = $toggle;
$row_data{server} = $servername[$k];
$row_data{isbn} = $oldbiblio->{isbn};
$row_data{lccn} = $oldbiblio->{lccn};
$row_data{breedingid} = $breedingid;
$row_data{biblionumber} = $biblionumber;
push( @breeding_loop, \%row_data );
-
+
} else {
- push(@breeding_loop,{'toggle'=>($i % 2)?1:0,'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'breedingid'=>-1,'biblionumber'=>-1});
+ push(@breeding_loop,{'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'breedingid'=>-1,'biblionumber'=>-1});
} # $rec
} # upto 5 results
} #$numresults
breeding_loop => \@breeding_loop,
server => $servername[$k],
numberpending => $numberpending,
+ errconn => \@errconn
);
output_html_with_http_headers $input, $cookie, $template->output if $numberpending == 0;
- # print $template->output if $firstresult !=1;
+ # print $template->output if $firstresult !=1;
$firstresult++;
}
displayresults();
</p>
[% END %]
- <fieldset class="action"><input type="submit" class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel close" href="#">Cancel</a></fieldset>
+ <fieldset class="action"><input type="submit" class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a></fieldset>
</div>
</form>
[% END %]</tbody>
</table>
[% ELSE %]
+ [% IF ( emptyserverlist ) %]
+ You didn't select any Z39.50 target.
+ [% ELSE %]
+ [% FOREACH errcon IN errconn %]
+ Connection failed to [% errcon.server %]
+ [% END %]
+ [% END %]
<p>Nothing found. <a href="javascript: history.back()">Try another search</a>.</p>
[% END %]
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
+<script type=text/javascript>
+
+function confirmWriteoffAll() {
+ return confirm(_("Are you sure you want to writeoff all fines?"));
+}
+
+</script>
+
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Pay Fines for [% borrower.firstname %] [% borrower.surname %]</div>
<div id="doc3" class="yui-t2">
</table>
<fieldset class="action">
<input type="submit" name="paycollect" value="Pay Amount" class="submit" />
-<input type="submit" name="woall" value="Writeoff All" class="submit" />
-<input type="submit" name="payselected" value="Pay Selected" class="submit" />
+<input type="submit" name="woall" value="Writeoff All" class="submit" onclick="return confirmWriteoffAll()" />
+<input type="submit" name="payselected" value="Pay Selected" class="submit"/>
<a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a>
</fieldset>
</form>
<form name="payindivfine" onsubmit="return validatePayment(this);" method="post" action="/cgi-bin/koha/members/paycollect.pl">
<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
<input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual %]" />
+ <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" />
<input type="hidden" name="description" id="description" value="[% description %]" />
<input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" />
<input type="hidden" name="notify_id" id="notify_id" value="[% notify_id %]" />
<form name="woindivfine" action="/cgi-bin/koha/members/pay.pl" method="post" >
<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
<input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual %]" />
+ <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" />
<input type="hidden" name="description" id="description" value="[% description %]" />
<input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" />
<input type="hidden" name="notify_id" id="notify_id" value="[% notify_id %]" />
my $amount = $input->param('amount');
my $amountoutstanding = $input->param('amountoutstanding');
$accountno = $input->param('accountno');
+ my $itemnumber = $input->param('itemnumber');
my $description = $input->param('description');
my $title = $input->param('title');
my $notify_id = $input->param('notify_id');
amount => $amount,
amountoutstanding => $amountoutstanding,
title => $title,
+ itemnumber => $itemnumber,
description => $description,
notify_id => $notify_id,
notify_level => $notify_level,