Code to allow the associated borrowers to work
[koha.git] / serials / lateissues.pl
1 #!/usr/bin/perl
2
3 use strict;
4 use CGI;
5 use C4::Auth;
6 use C4::Bull;
7 use C4::Acquisition;
8 use C4::Output;
9 use C4::Interface::CGI::Output;
10 use C4::Context;
11 use HTML::Template;
12
13 my $query = new CGI;
14 # my $title = $query->param('title');
15 # my $ISSN = $query->param('ISSN');
16 # my @subscriptions = getsubscriptions($title,$ISSN);
17
18 my $supplierid = $query->param('supplierid');
19 my %supplierlist = getSupplierListWithLateIssues;
20 my @select_supplier;
21 push @select_supplier,"";
22 foreach my $supplierid (keys %supplierlist){
23         push @select_supplier, $supplierid
24 }
25 my $CGIsupplier=CGI::scrolling_list( -name     => 'supplierid',
26                         -values   => \@select_supplier,
27                         -default  => $supplierid,
28                         -labels   => \%supplierlist,
29                         -size     => 1,
30                         -multiple => 0 );
31
32 my @lateissues;
33 @lateissues = GetLateIssues($supplierid) if $supplierid;
34 my @supplierinfo;
35 my $nothing;
36 ($nothing,@supplierinfo)=bookseller($supplierid) if $supplierid;
37
38 my ($template, $loggedinuser, $cookie)
39 = get_template_and_user({template_name => "serials/lateissues.tmpl",
40                                 query => $query,
41                                 type => "intranet",
42                                 authnotrequired => 0,
43                                 flagsrequired => {catalogue => 1},
44                                 debug => 1,
45                                 });
46
47 $template->param(
48         CGIsupplier => $CGIsupplier,
49         lateissues => \@lateissues,
50         phone => $supplierinfo[0]->{phone},
51         booksellerfax => $supplierinfo[0]->{booksellerfax},
52         bookselleremail => $supplierinfo[0]->{bookselleremail},
53         );
54 output_html_with_http_headers $query, $cookie, $template->output;