Bugzilla – Attachment 11089 Details for
Bug 8037
Add holds and funds to items already received in parcel.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8037 - Add holds and funds to items already received in parcel.pl
Bug-8037---Add-holds-and-funds-to-items-already-re.patch (text/plain), 10.59 KB, created by
Kyle M Hall (khall)
on 2012-07-23 20:31:47 UTC
(
hide
)
Description:
Bug 8037 - Add holds and funds to items already received in parcel.pl
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2012-07-23 20:31:47 UTC
Size:
10.59 KB
patch
obsolete
>From c5edb57cf1efa63a958de1dae1119c590e7a3163 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 28 Mar 2012 13:33:36 -0400 >Subject: [PATCH] Bug 8037 - Add holds and funds to items already received in parcel.pl > >Adds a column to indicate holds on recieved items, as well as adding >a new column for fund and showing the subtotals per fund above >the total subtotal. >--- > C4/Budgets.pm | 25 ++++ > acqui/parcel.pl | 5 +- > .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 122 ++++++++++++-------- > 3 files changed, 104 insertions(+), 48 deletions(-) > >diff --git a/C4/Budgets.pm b/C4/Budgets.pm >index e9732ac..d9dc8ae 100644 >--- a/C4/Budgets.pm >+++ b/C4/Budgets.pm >@@ -34,6 +34,7 @@ BEGIN { > @EXPORT = qw( > > &GetBudget >+ &GetBudgetByOrderNumber > &GetBudgets > &GetBudgetHierarchy > &AddBudget >@@ -616,6 +617,30 @@ sub GetBudget { > return $result; > } > >+=head2 GetBudgetByOrderNumber >+ >+ &GetBudgetByOrderNumber($ordernumber); >+ >+get a specific budget by order number >+ >+=cut >+ >+# ------------------------------------------------------------------- >+sub GetBudgetByOrderNumber { >+ my ( $ordernumber ) = @_; >+ my $dbh = C4::Context->dbh; >+ my $query = " >+ SELECT aqbudgets.* >+ FROM aqbudgets, aqorders >+ WHERE ordernumber=? >+ AND aqorders.budget_id = aqbudgets.budget_id >+ "; >+ my $sth = $dbh->prepare($query); >+ $sth->execute( $ordernumber ); >+ my $result = $sth->fetchrow_hashref; >+ return $result; >+} >+ > =head2 GetChildBudgetsSpent > > &GetChildBudgetsSpent($budget-id); >diff --git a/acqui/parcel.pl b/acqui/parcel.pl >index bf14ff0..f73c35e 100755 >--- a/acqui/parcel.pl >+++ b/acqui/parcel.pl >@@ -68,6 +68,7 @@ use CGI; > use C4::Output; > use C4::Dates qw/format_date format_date_in_iso/; > use C4::Suggestions; >+use C4::Reserves qw/GetReservesFromBiblionumber/; > use JSON; > > my $input=new CGI; >@@ -176,6 +177,9 @@ for (my $i = 0 ; $i < $countlines ; $i++) { > $line{gst} = $gst; > $line{total} = sprintf($cfstr, $total); > $line{booksellerid} = $booksellerid; >+ my ($count) = &GetReservesFromBiblionumber($line{biblionumber}); >+ $line{holds} = $count; >+ $line{budget} = GetBudgetByOrderNumber( $line{ordernumber} ); > push @loop_received, \%line; > $totalprice += $parcelitems[$i]->{'unitprice'}; > $line{unitprice} = sprintf($cfstr, $parcelitems[$i]->{'unitprice'}); >@@ -184,7 +188,6 @@ for (my $i = 0 ; $i < $countlines ; $i++) { > $line{suggestionid} = $suggestion->{suggestionid}; > $line{surnamesuggestedby} = $suggestion->{surnamesuggestedby}; > $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby}; >- > #double FIXME - totalfreight is redefined later. > > # FIXME - each order in a parcel holds the freight for the whole parcel. This means if you receive a parcel with items from multiple budgets, you'll see the freight charge in each budget.. >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >index 7b0f7ca..062c894 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -1,3 +1,4 @@ >+[% USE currency = format('%.2f') -%] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › [% IF ( date ) %] > Receipt summary for [% name %] [% IF ( invoice ) %]invoice [% invoice %][% END %] on [% formatteddatereceived %][% ELSE %]Receive orders from [% name %][% END %]</title> >@@ -338,73 +339,100 @@ > <thead> > <tr> > <th>Basket</th> >- <th>Order line</th> >+ <th>Order Line</th> >+ <th>Holds</th> > <th>Summary</th> >- <th>View record</th> >+ <th>View record</th> > <th>Quantity</th> >+ <th>Fund</th> > <th>Est cost</th> > <th>Actual cost</th> >- <th>TOTAL</th> >+ <th>Total</th> > </tr> >- </thead> >- <tfoot> >+ </thead> >+ <tbody class="filterclass"> >+ [% SET funds = {} %] >+ [% SET estimated_total = 0 %] >+ [% FOREACH loop_receive IN loop_received %] >+ [% SET estimated_total = estimated_total + ( loop_receive.ecost * loop_receive.quantityreceived ) %] >+ [% SET funds.${ loop_receive.budget.budget_name }.estimated = funds.${ loop_receive.budget.budget_name }.estimated + loop_receive.ecost %] >+ [% SET funds.${ loop_receive.budget.budget_name }.actual = funds.${ loop_receive.budget.budget_name }.actual + loop_receive.total %] >+ >+ [% UNLESS ( loop.odd ) %] >+ <tr class="highlight"> >+ [% ELSE %] >+ <tr> >+ [% END %] >+ >+ <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_receive.basketno %]">[% loop_receive.basketno %]</a></td> >+ <td><a href="neworderempty.pl?ordernumber=[% loop_receive.ordernumber %]&booksellerid=[% booksellerid %]">[% loop_receive.ordernumber %]</a></td> >+ <td>[% IF loop_receive.holds %] <span class="error"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% loop_receive.biblionumber %]"><img src="/intranet-tmpl/prog/img/deny.gif" /></a></span>[% END %]</td> >+ <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_receive.biblionumber %]">[% loop_receive.title |html %]</a> >+ [% IF ( loop_receive.author ) %] / [% loop_receive.author %][% END %] >+ [% IF ( loop_receive.isbn ) %] - [% loop_receive.isbn %][% END %] >+ [% IF ( loop_receive.publishercode ) %]<br />Publisher :[% loop_receive.publishercode %][% END %] >+ [% IF ( loop_receive.suggestionid ) %] >+ <br/> >+ Suggested by: [% loop_receive.surnamesuggestedby %][% IF ( loop_receive.firstnamesuggestedby ) %], [% loop_receive.firstnamesuggestedby %] [% END %] >+ (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_receive.suggestionid %]&op=show">suggestion #[% loop_receive.suggestionid %]</a>) >+ [% END %] >+ </td> >+ <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_receive.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_receive.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td> >+ <td>[% loop_receive.quantityreceived %]</td> >+ <td>[% loop_receive.budget.budget_name %]</td> >+ <td>[% loop_receive.ecost %]</td> >+ <td>[% loop_receive.unitprice %]</td> >+ <td>[% loop_receive.total %]</td> >+ >+ </tr> >+ [% END %] >+ </tbody> >+ >+<tfoot> >+ [% FOREACH key IN funds.keys.sort %] >+ <tr> >+ <td colspan="6" class="total"> </td> >+ <td><i>Subtotal for</i> [% key %]</td> >+ <td>[% currency( funds.$key.estimated ) %]</td> >+ <td>[% currency( funds.$key.actual ) %]</td> >+ <td> </td> >+ </tr> >+ [% END %] >+ > <tr> >- <td colspan="4" class="total">SUBTOTAL</td> >+ <td colspan="5" class="total">SUBTOTAL</td> > <td colspan="2"> </td> >- <td>[% totalprice %]</td> >+ <td>[% currency( estimated_total ) %]</td> > <td>[% tototal %]</td> >+ <td> </td> > </tr> > > [% IF ( totalfreight ) %] > <tr> >- <td colspan="6"> >- </td> >- <td>Shipping</td> >- <td>[% totalfreight %]</td> >- </tr> >- [% END %] >+ <td colspan="7"> </td> >+ <td>Shipping</td> >+ <td>[% totalfreight %]</td> >+ </tr> >+ [% END %] > [% IF ( gst ) %] > <tr> >- <td colspan="6"> >- <p class="message"> >- <b>HELP</b><br /> >- The total at the bottom of the page should be within a few cents of the total for the invoice. >- </p> >- </td> >- <td><b>Tax rate</b></td> >- <td>[% gst %]</td> >- </tr> >+ <td colspan="7"> >+ <p class="message"> >+ <b>HELP</b><br/> >+ The total at the bottom of the page should be within a few cents of the total for the invoice. >+ </p> >+ </td> >+ <td><b>Tax rate</b></td> >+ <td>[% gst %]</td> >+ </tr> > [% END %] > <tr> >- <td colspan="4" class="total">TOTAL</td> >+ <td colspan="5" class="total">TOTAL</td> > <td>[% totalquantity %]</td> >- <td colspan="2"> </td> >+ <td colspan="3"> </td> > <td>[% grandtot %]</td> > </tr> > </tfoot> >- <tbody class="filterclass"> >- [% FOREACH loop_receive IN loop_received %] >- <tr> >- <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_receive.basketno %]">[% loop_receive.basketno %]</a></td> >- <td><a href="neworderempty.pl?ordernumber=[% loop_receive.ordernumber %]&booksellerid=[% booksellerid %]">[% loop_receive.ordernumber %]</a></td> >- <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_receive.biblionumber %]">[% loop_receive.title |html %]</a> >- [% IF ( loop_receive.author ) %] / [% loop_receive.author %][% END %] >- [% IF ( loop_receive.isbn ) %] - [% loop_receive.isbn %][% END %] >- [% IF ( loop_receive.publishercode ) %]<br />Publisher :[% loop_receive.publishercode %][% END %] >- [% IF ( loop_receive.suggestionid ) %] >- <br/> >- Suggested by: [% loop_receive.surnamesuggestedby %][% IF ( loop_receive.firstnamesuggestedby ) %], [% loop_receive.firstnamesuggestedby %] [% END %] >- (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_receive.suggestionid %]&op=show">suggestion #[% loop_receive.suggestionid %]</a>) >- [% END %] >- </td> >- <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_receive.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_receive.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td> >- <td>[% loop_receive.quantityreceived %]</td> >- <td>[% loop_receive.ecost %]</td> >- <td>[% loop_receive.unitprice %]</td> >- <td>[% loop_receive.total %]</td> >- </tr> >- [% END %] >- </tbody> > </table> > </form> > [% ELSE %]There are no received orders.[% END %] >-- >1.7.2.5
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 8037
:
9383
|
9384
|
11089
|
13152
|
13153
|
14892
|
16336
|
16635
|
16651
|
16660
|
16749
|
18021
|
18022
|
18023
|
18693
|
19672
|
19789
|
19790
|
19791
|
22244
|
22390
|
22636
|
22637
|
22638
|
22639
|
22647