my $sth = $dbh->prepare("INSERT INTO transport_cost (frombranch, tobranch, cost, disable_transfer) VALUES (?, ?, ?, ?)");
- $dbh->do("TRUNCATE TABLE transport_cost");
+ $dbh->do("DELETE FROM transport_cost");
foreach (@$records) {
my $cost = $_->{cost};
my $from = $_->{frombranch};
$cost ||= 0;
}
elsif ( !defined ($cost) || ($cost !~ m/(0|[1-9][0-9]*)(\.[0-9]*)?/o) ) {
- warn "Invalid $from -> $to cost $cost - must be a number >= 0, disablig";
+ warn "Invalid $from -> $to cost $cost - must be a number >= 0, disabling";
$cost = 0;
$_->{disable_transfer} = 1;
}
$sth->execute(@bind_params);
my $items = [];
while ( my $row = $sth->fetchrow_hashref ){
- my $record = GetMarcBiblio($row->{biblionumber});
+ my $record = GetMarcBiblio({ biblionumber => $row->{biblionumber} });
if ($record){
$row->{subtitle} = [ map { $_->{subfield} } @{ GetRecordValue( 'subtitle', $record, '' ) } ];
$row->{parts} = GetRecordValue('parts',$record,'')->[0]->{subfield};
my $firstname = $patron->firstname;
my $phone = $patron->phone;
- my $bib = GetBiblioData($biblionumber);
- my $title = $bib->{title};
+ my $biblio = Koha::Biblios->find( $biblionumber );
+ my $title = $biblio->title;
$sth_load->execute($biblionumber, $itemnumber, $barcode, $surname, $firstname, $phone, $borrowernumber,
$cardnumber, $reservedate, $title, $itemcallnumber,