From 5d89149fa9e04839e8eaaf81390f31d500c56e54 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 11 Mar 2019 07:47:43 +0000 Subject: [PATCH] Bug 4833: Show acq information when selecting suggestion for order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When adding an order line to a basket using the 'from a suggestion' feature, the list of accepted suggestions doesn't show any information from the acquisition are of the suggestions. This patch adds new columns to the list for: - library - fund - price - quantity - total To test: - Create several suggestions with - Empty acq values - A specific library, any library - Set acq values (fund, price, quantity) - Accept your suggestions - Create a new basket/order - Add an order line from accepted suggestions - Verify the list displays nicely with the new columns - Verify filters etc. still work ok Signed-off-by: Séverine QUEUNE Signed-off-by: Séverine QUEUNE Signed-off-by: Chris Cormack --- acqui/newordersuggestion.pl | 9 ++++++++ .../prog/en/modules/acqui/newordersuggestion.tt | 24 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/acqui/newordersuggestion.pl b/acqui/newordersuggestion.pl index 6bc0a6462f..26065559e9 100755 --- a/acqui/newordersuggestion.pl +++ b/acqui/newordersuggestion.pl @@ -95,6 +95,7 @@ use C4::Auth; # get_template_and_user use C4::Output; use C4::Suggestions; use C4::Biblio; +use C4::Budgets; use Koha::Acquisition::Booksellers; @@ -136,6 +137,14 @@ my $suggestions_loop = SearchSuggestion( STATUS => 'ACCEPTED' } ); + +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/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt index 084ae32cc4..59ebf092ec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt @@ -1,4 +1,6 @@ [% USE raw %] +[% USE Branches %] +[% USE Price %] [% USE Asset %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] @@ -27,6 +29,11 @@ Suggestion Suggested by Accepted by + Library + Fund + Price + Quantity + Total   @@ -52,6 +59,23 @@ [% suggestions_loo.surnamemanagedby | html %][% IF ( suggestions_loo.firstnamemanagedby ) %],[% END %] [% suggestions_loo.firstnamemanagedby | html %] + + [% Branches.GetName(suggestions_loo.branchcode) | html %] + + + [% suggestions_loo.budget_name | html %] + + + [% suggestions_loo.price | $Price %] + + + [% IF (suggestions_loo.quantity > 0) %] + [% suggestions_loo.quantity | html %] + [% END %] + + + [% suggestions_loo.total | $Price %] + [% IF ( suggestions_loo.biblionumber ) %] Order -- 2.11.0