Bugzilla – Attachment 17623 Details for
Bug 10013
Ability to link directly from an item in the Staff client to budget information.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10013 - Ability to link directly from an item in the Staff client to budget information.
0001-Bug-10013-Ability-to-link-directly-from-an-item-in-t.patch (text/plain), 5.17 KB, created by
Amit Gupta
on 2013-04-23 16:18:51 UTC
(
hide
)
Description:
Bug 10013 - Ability to link directly from an item in the Staff client to budget information.
Filename:
MIME Type:
Creator:
Amit Gupta
Created:
2013-04-23 16:18:51 UTC
Size:
5.17 KB
patch
obsolete
>From 9dd9be65d88a636c1f5c05fd3839d2f9b6246510 Mon Sep 17 00:00:00 2001 >From: Amit Gupta <amit.gupta@osslabs.biz> >Date: Tue, 23 Apr 2013 21:39:46 +0530 >Subject: [PATCH] Bug 10013 - Ability to link directly from an item in the > Staff client to budget information. > >To Test: >1) Create budget and fund under budget administration. >2) Create Vendor in acquisitons module. >3) Create basket under vendor. >4) Create order and choose budget while creating order. >5) Receive shipment. >6) Check in catalog details, in holding tab budget information column is displayed >, on click it should display the budget information >--- > C4/Acquisition.pm | 19 +++++++++++++++++++ > catalogue/detail.pl | 9 ++++++++- > .../prog/en/modules/catalogue/detail.tt | 7 +++++-- > 3 files changed, 32 insertions(+), 3 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index b78a51e..7a4c5e0 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -71,6 +71,7 @@ BEGIN { > &ModInvoice > &CloseInvoice > &ReopenInvoice >+ &GetBudgetInfoFromItemnumber > > &GetItemnumbersFromOrder > >@@ -102,6 +103,24 @@ sub GetOrderFromItemnumber { > > } > >+sub GetBudgetInfoFromItemnumber { >+ my ($itemnumber) = @_; >+ my $dbh = C4::Context->dbh; >+ my $query = qq| >+ >+ SELECT aqorders_items.ordernumber, aqbudgets.budget_period_id, aqorders.budget_id, aqbudgets.budget_name, items.barcode >+ FROM aqorders_items LEFT JOIN items ON items.itemnumber = aqorders_items.itemnumber >+ LEFT JOIN aqorders ON aqorders.ordernumber = aqorders_items.ordernumber >+ LEFT JOIN aqbudgets ON aqbudgets.budget_id = aqorders.budget_id >+ WHERE items.itemnumber = ? | ; >+ >+ my $sth = $dbh->prepare($query); >+ $sth->execute($itemnumber); >+ return $sth->fetchrow_hashref; >+ >+} >+ >+ > # Returns the itemnumber(s) associated with the ordernumber given in parameter > sub GetItemnumbersFromOrder { > my ($ordernumber) = @_; >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index a5b32c6..3e14c40 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -39,6 +39,7 @@ use C4::Tags qw(get_tags); > use C4::VirtualShelves; > use C4::XSLT; > use C4::Images; >+use C4::Acquisition qw(GetBudgetInfoFromItemnumber); > use Koha::DateUtils; > use C4::HTML5Media; > >@@ -214,7 +215,7 @@ foreach my $item (@items) { > $item->{'ccode'} = $collections->{$ccode} if ( defined( $ccode ) && defined($collections) && exists( $collections->{$ccode} ) ); > my $copynumber = $item->{'copynumber'}; > $item->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumber) && defined($copynumbers) && exists( $copynumbers->{$copynumber} ) ); >- foreach (qw(ccode enumchron copynumber itemnotes uri)) { >+ foreach (qw(ccode enumchron copynumber itemnotes uri booksellerid)) { > $itemfields{$_} = 1 if ( $item->{$_} ); > } > >@@ -222,6 +223,11 @@ foreach my $item (@items) { > my ($reservedate,$reservedfor,$expectedAt) = GetReservesFromItemnumber($item->{itemnumber}); > my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0); > >+ # checking for budget information >+ my $budget = GetBudgetInfoFromItemnumber($item->{itemnumber}); >+ $item->{budget_period_id} = $budget->{'budget_period_id'}; >+ $item->{budget_name} = $budget->{'budget_name'}; >+ > if (C4::Context->preference('HidePatronName')){ > $item->{'hidepatronname'} = 1; > } >@@ -305,6 +311,7 @@ $template->param( > itemdata_copynumber => $itemfields{copynumber}, > volinfo => $itemfields{enumchron}, > itemdata_itemnotes => $itemfields{itemnotes}, >+ itemdata_booksellerid => $itemfields{booksellerid}, > z3950_search_params => C4::Search::z3950_search_args($dat), > hostrecords => $hostrecords, > analytics_flag => $analytics_flag, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 8f40e31..5bed472 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -370,6 +370,7 @@ function verify_images() { > [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %] > [% IF ( hostrecords ) %]<th>Host records</th>[% END %] > [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %] >+ [% IF ( itemdata_booksellerid ) %]<th>Budget information</th>[% END %] > </tr> > </thead> > <tbody> >@@ -520,8 +521,10 @@ function verify_images() { > [% END %] > [% IF ( analyze ) %] > <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber %]&hostitemnumber=[% item.itemnumber %]">Create analytics</a></td> >- [% END %] >- >+ [% END %] >+ [% IF ( itemdata_booksellerid ) %] >+ <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% item.budget_period_id %]" >[% item.budget_name %]</a></td> >+ [% END %] > </tr> > [% END %] > </tbody> >-- >1.7.9.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 10013
:
17598
|
17610
|
17623
|
17645
|
18598
|
18600
|
20061
|
20063
|
20064
|
22061