Bugzilla – Attachment 89618 Details for
Bug 4833
Show acquisition information when ordering from a suggestion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 4833: (QA follow-up) Add budgetname to SearchSuggestion
Bug-4833-QA-follow-up-Add-budgetname-to-SearchSugg.patch (text/plain), 3.52 KB, created by
Katrin Fischer
on 2019-05-11 21:02:16 UTC
(
hide
)
Description:
Bug 4833: (QA follow-up) Add budgetname to SearchSuggestion
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-05-11 21:02:16 UTC
Size:
3.52 KB
patch
obsolete
>From 4d5dd3824bda7d4699cd6f1621897fb9b433c365 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Sat, 11 May 2019 21:01:51 +0000 >Subject: [PATCH] Bug 4833: (QA follow-up) Add budgetname to SearchSuggestion > >This patch adds the budgetname to the return of SearchSuggestion >to improve performance. > >To test: >- Same test plan as for the first patch >- Verify fund names show in the table >- Run t/db_dependent/Suggestions.t >--- > C4/Suggestions.pm | 4 +++- > acqui/newordersuggestion.pl | 7 ------- > t/db_dependent/Suggestions.t | 10 ++++++++-- > 3 files changed, 11 insertions(+), 10 deletions(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index 39faddde3f..71b9000574 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -109,7 +109,8 @@ sub SearchSuggestion { > B2.branchname AS branchnamesuggestedby, > U2.email AS emailmanagedby, > U2.branchcode AS branchcodemanagedby, >- U2.borrowernumber AS borrnummanagedby >+ U2.borrowernumber AS borrnummanagedby, >+ BU.budget_name AS budget_name > FROM suggestions > LEFT JOIN borrowers AS U1 ON suggestedby=U1.borrowernumber > LEFT JOIN branches AS B1 ON B1.branchcode=U1.branchcode >@@ -117,6 +118,7 @@ sub SearchSuggestion { > LEFT JOIN borrowers AS U2 ON managedby=U2.borrowernumber > LEFT JOIN branches AS B2 ON B2.branchcode=U2.branchcode > LEFT JOIN categories AS C2 ON C2.categorycode=U2.categorycode >+ LEFT JOIN aqbudgets AS BU ON budgetid=BU.budget_id > WHERE 1=1 > } > ); >diff --git a/acqui/newordersuggestion.pl b/acqui/newordersuggestion.pl >index 26065559e9..54934967ab 100755 >--- a/acqui/newordersuggestion.pl >+++ b/acqui/newordersuggestion.pl >@@ -138,13 +138,6 @@ my $suggestions_loop = SearchSuggestion( > } > ); > >-foreach my $suggestion (@$suggestions_loop) { >- if ($suggestion->{budgetid}){ >- my $bud = GetBudget( $suggestion->{budgetid} ); >- $suggestion->{budget_name} = $bud->{budget_name} if $bud; >- } >-} >- > my $vendor = Koha::Acquisition::Booksellers->find( $booksellerid ); > $template->param( > suggestions_loop => $suggestions_loop, >diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t >index ab08771352..46d4582006 100644 >--- a/t/db_dependent/Suggestions.t >+++ b/t/db_dependent/Suggestions.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > > use DateTime::Duration; >-use Test::More tests => 107; >+use Test::More tests => 109; > use Test::Warn; > > use t::lib::Mocks; >@@ -26,7 +26,7 @@ use t::lib::TestBuilder; > > use C4::Context; > use C4::Letters; >-use C4::Budgets qw( AddBudgetPeriod AddBudget ); >+use C4::Budgets qw( AddBudgetPeriod AddBudget GetBudget ); > use Koha::Database; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Libraries; >@@ -369,6 +369,12 @@ $search_suggestion = SearchSuggestion({ > }); > is( @$search_suggestion, 3, 'SearchSuggestion (budgetid = "__ANY__") returns the correct number of suggestions' ); > >+$search_suggestion = SearchSuggestion({ budgetid => $budget_id }); >+is( @$search_suggestion[0]->{budget_name}, GetBudget($budget_id)->{budget_name}, 'SearchSuggestion returns the correct budget name'); >+$search_suggestion = SearchSuggestion({ budgetid => "__NONE__" }); >+is( @$search_suggestion[0]->{budget_name}, undef, 'SearchSuggestion returns the correct budget name'); >+ >+ > my $del_suggestion = { > title => 'my deleted title', > STATUS => 'CHECKED', >-- >2.11.0
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 4833
:
86493
|
88272
|
89095
| 89618