Bug 16737 - Error when deleting EDIFACT message
[koha.git] / acqui / uncertainprice.pl
index 83bdea6..a90c75f 100755 (executable)
@@ -8,18 +8,18 @@
 #
 # This file is part of Koha.
 #
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
 #
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 
 =head1 NAME
@@ -46,15 +46,16 @@ The bookseller who we want to display the orders of.
 use strict;
 use warnings;
 
-use C4::Input;
 use C4::Auth;
 use C4::Output;
-use CGI;
+use CGI qw ( -utf8 );
 
-use C4::Bookseller qw/GetBookSellerFromId/;
+use C4::Bookseller::Contact;
 use C4::Acquisition qw/SearchOrders GetOrder ModOrder/;
 use C4::Biblio qw/GetBiblioData/;
 
+use Koha::Acquisition::Bookseller;
+
 my $input=new CGI;
 
 my ($template, $loggedinuser, $cookie)
@@ -70,7 +71,7 @@ my $booksellerid = $input->param('booksellerid');
 my $basketno     = $input->param('basketno');
 my $op = $input->param('op');
 my $owner = $input->param('owner') || 0 ; # flag to see only "my" orders, or everyone orders
-my $bookseller = &GetBookSellerFromId($booksellerid);
+my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
 
 #show all orders that have uncertain price for the bookseller
 my $pendingorders = SearchOrders({
@@ -124,16 +125,11 @@ $template->param( uncertainpriceorders => \@orders,
                                    booksellerphone =>$bookseller->{'phone'},
                                    booksellerfax => $bookseller->{'fax'},
                                    booksellerurl => $bookseller->{'url'},
-                                   booksellercontact => $bookseller->{'contact'},
-                                   booksellercontpos => $bookseller->{'contpos'},
-                                   booksellercontphone => $bookseller->{'contphone'},
-                                   booksellercontaltphone => $bookseller->{'contaltphone'},
-                                   booksellercontfax => $bookseller->{'contfax'},
-                                   booksellercontemail => $bookseller->{'contemail'},
-                                   booksellercontnotes => $bookseller->{'contnotes'},
                                    booksellernotes => $bookseller->{'notes'},
                                    basketcount   => $bookseller->{'basketcount'},
                                    subscriptioncount   => $bookseller->{'subscriptioncount'},
+                                   active => $bookseller->{active},
                                    owner => $owner,
                                    scriptname => "/cgi-bin/koha/acqui/uncertainprice.pl");
+$template->{'VARS'}->{'contacts'} = $bookseller->{'contacts'};
 output_html_with_http_headers $input, $cookie, $template->output;