Browse Source

Adding possibility to order the basket by :

* publishercode
OR
* budget then publishercode
3.0.x
tipaul 20 years ago
parent
commit
89dea6f3ec
  1. 6
      C4/Acquisition.pm
  2. 3
      acqui/basket.pl
  3. 4
      koha-tmpl/intranet-tmpl/default/en/acqui/basket.tmpl

6
C4/Acquisition.pm

@ -102,7 +102,7 @@ number of elements in C<@orders>.
=cut
#'
sub getbasketcontent {
my ($basketno,$supplier)=@_;
my ($basketno,$supplier,$orderby)=@_;
my $dbh = C4::Context->dbh;
my $query="Select *,biblio.title from aqorders,biblio,biblioitems
left join aqorderbreakdown on aqorderbreakdown.ordernumber=aqorders.ordernumber
@ -114,7 +114,9 @@ sub getbasketcontent {
if ($supplier ne ''){
$query.=" and aqorders.booksellerid='$supplier'";
}
$query.=" order by biblioitems.publishercode";
$orderby="biblioitems.publishercode" unless $orderby;
$query.=" order by $orderby";
my $sth=$dbh->prepare($query);
$sth->execute;
my @results;

3
acqui/basket.pl

@ -37,6 +37,7 @@ use C4::Date;
my $query =new CGI;
my $basketno = $query ->param('basket');
my $booksellerid = $query->param('supplierid');
my $order = $query->param('order');
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "acqui/basket.tmpl",
query => $query,
@ -57,7 +58,7 @@ my ($count2,@booksellers)=bookseller($booksellerid);
# if new basket, pre-fill infos
$basket->{creationdate} = "" unless ($basket->{creationdate});
$basket->{authorisedby} = $loggedinuser unless ($basket->{authorisedby});
($count,@results)=getbasketcontent($basketno);
($count,@results)=getbasketcontent($basketno,'',$order);
my $line_total; # total of each line
my $sub_total; # total of line totals

4
koha-tmpl/intranet-tmpl/default/en/acqui/basket.tmpl

@ -23,7 +23,7 @@
<table>
<tr valign="top" bgcolor="#ffdf61">
<th class="acquisition">Order</th>
<th class="acquisition">Publisher</th>
<th class="acquisition">Publisher<a href="basket.pl?basket=<!-- TMPL_VAR name="basketno" -->&order=biblioitems.publishercode">[order]</a></th>
<th class="acquisition">Isbn</th>
<th class="acquisition">Title</th>
<th class="acquisition">Author</th>
@ -31,7 +31,7 @@
<th class="acquisition">est</th>
<th class="acquisition">Qty</th>
<th class="acquisition">Total</th>
<th class="acquisition">Book fund</th>
<th class="acquisition">Fund <a href="basket.pl?basket=<!-- TMPL_VAR name="basketno" -->&order=aqorderbreakdown.bookfundid,biblioitems.publishercode">[order]</a></th>
</tr>
<!-- TMPL_LOOP NAME="books_loop" -->
<tr valign="top" bgcolor="<!-- TMPL_VAR NAME="color" -->">

Loading…
Cancel
Save