Bugzilla – Attachment 7011 Details for
Bug 5358
keep track of cancelled orders
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Rebased patch
0001-Bug-5358-Show-cancelled-orders-in-basket-page.patch (text/plain), 5.76 KB, created by
Julian Maurice
on 2012-01-02 10:04:43 UTC
(
hide
)
Description:
Rebased patch
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2012-01-02 10:04:43 UTC
Size:
5.76 KB
patch
obsolete
>From deb2ba08d9db1375c4d15760f00ee4ed5ad2ec71 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Sat, 5 Nov 2011 15:05:48 +0530 >Subject: [PATCH] Bug 5358: Show cancelled orders in basket page > >--- > C4/Acquisition.pm | 37 ++++++++++++++++ > acqui/basket.pl | 6 +++ > .../intranet-tmpl/prog/en/modules/acqui/basket.tt | 44 ++++++++++++++++++++ > 3 files changed, 87 insertions(+), 0 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 7127f24..2814977 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -54,6 +54,7 @@ BEGIN { > &GetOrderNumber &GetLateOrders &GetOrderFromItemnumber > &SearchOrder &GetHistory &GetRecentAcqui > &ModReceiveOrder &ModOrderBiblioitemNumber >+ &GetCancelledOrders > > &NewOrderItem &ModOrderItem > >@@ -1041,6 +1042,42 @@ sub ModOrderBiblioitemNumber { > $sth->execute( $biblioitemnumber, $ordernumber, $biblionumber ); > } > >+=head3 GetCancelledOrders >+ >+ my @orders = GetCancelledOrders($basketno, $orderby); >+ >+Returns cancelled orders for a basket >+ >+=cut >+ >+sub GetCancelledOrders { >+ my ( $basketno, $orderby ) = @_; >+ >+ return () unless $basketno; >+ >+ my $dbh = C4::Context->dbh; >+ my $query = " >+ SELECT biblio.*, biblioitems.*, aqorders.*, aqbudgets.* >+ FROM aqorders >+ LEFT JOIN aqbudgets ON aqbudgets.budget_id = aqorders.budget_id >+ LEFT JOIN biblio ON biblio.biblionumber = aqorders.biblionumber >+ LEFT JOIN biblioitems ON biblioitems.biblionumber = biblio.biblionumber >+ WHERE basketno = ? >+ AND (datecancellationprinted IS NOT NULL >+ AND datecancellationprinted <> '0000-00-00') >+ "; >+ >+ $orderby = "aqorders.datecancellationprinted desc, aqorders.timestamp desc" >+ unless $orderby; >+ $query .= " ORDER BY $orderby"; >+ my $sth = $dbh->prepare($query); >+ $sth->execute($basketno); >+ my $results = $sth->fetchall_arrayref( {} ); >+ >+ return @$results; >+} >+ >+ > #------------------------------------------------------------# > > =head3 ModReceiveOrder >diff --git a/acqui/basket.pl b/acqui/basket.pl >index b836280..c528156 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -343,6 +343,11 @@ my $total_est_gste; > last; > } > >+ my @cancelledorders = GetCancelledOrders($basketno); >+ foreach (@cancelledorders) { >+ $_->{'line_total'} = sprintf("%.2f", $_->{'ecost'} * $_->{'quantity'}); >+ } >+ > $template->param( > basketno => $basketno, > basketname => $basket->{'basketname'}, >@@ -359,6 +364,7 @@ my $total_est_gste; > name => $bookseller->{'name'}, > entrydate => C4::Dates->new($results[0]->{'entrydate'},'iso')->output, > books_loop => \@books_loop, >+ cancelledorders_loop => \@cancelledorders, > gist_rate => sprintf( "%.2f", $gist * 100 ) . '%', > total_rrp_gste => sprintf( "%.2f", $total_rrp_gste ), > total_est_gste => sprintf( "%.2f", $total_est_gste ), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >index 7bf1843..aaea6c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -12,6 +12,7 @@ > 10: { sorter: false } > } > }); >+ $("#cancelledorderst").tablesorter(); > }); > function confirm_close() { > var is_confirmed = confirm(_('Are you sure you want to close this basket?')); >@@ -332,6 +333,49 @@ > [% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small> > [% END %] > </div> >+ [% IF (cancelledorders_loop) %] >+ <div id="cancelledorders"> >+ <h2>Cancelled orders</h2> >+ <table id="cancelledorderst"> >+ <thead> >+ <tr> >+ <th>Order</th> >+ <th>RRP</th> >+ <th>Est.</th> >+ <th>Qty.</th> >+ <th>Total</th> >+ <th>Fund</th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH order IN cancelledorders_loop %] >+ <tr style="color:grey"> >+ <td> >+ <p> >+ [% IF ( order.order_received ) %] (rcvd)[% END %] >+ [% IF (order.title) %] >+ [% order.title |html %] by [% order.author %]<br /> >+ [% ELSE %] >+ <em>Deleted bibliographic record, can't find title</em><br /> >+ [% END %] >+ [% IF ( order.notes ) %] [% order.notes %][% END %] >+ [% IF ( order.isbn ) %] - [% order.isbn %][% END %] >+ [% IF ( order.issn ) %] - [% order.issn %][% END %] >+ [% IF ( order.publishercode ) %], [% order.publishercode %][% END %] >+ [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %] >+ </p> >+ </td> >+ <td><p>[% order.rrp %]</p></td> >+ <td><p>[% order.ecost %]</p></td> >+ <td><p>[% order.quantity %]</p></td> >+ <td><p>[% order.line_total %]</p></td> >+ <td><p>[% order.budget_name %]</p></td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ </div> >+ [% END %] > <br /> > [% UNLESS ( closedate ) %] > [% INCLUDE 'acquisitions-add-to-basket.inc' %] >-- >1.7.7.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5358
:
6222
|
6632
|
7011
|
7065