Bug 4833: Show acq information when selecting suggestion for order
authorKatrin Fischer <katrin.fischer.83@web.de>
Mon, 11 Mar 2019 07:47:43 +0000 (07:47 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 15 May 2019 16:46:47 +0000 (16:46 +0000)
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 <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

acqui/newordersuggestion.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt

index 6bc0a64..2606555 100755 (executable)
@@ -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,
index 084ae32..59ebf09 100644 (file)
@@ -1,4 +1,6 @@
 [% USE raw %]
+[% USE Branches %]
+[% USE Price %]
 [% USE Asset %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
             <th>Suggestion</th>
             <th>Suggested by</th>
             <th>Accepted by</th>
+            <th>Library</th>
+            <th>Fund</th>
+            <th>Price</th>
+            <th>Quantity</th>
+            <th>Total</th>
             <th>&nbsp;</th>
         </tr>
         </thead>
                 <td>
                     [% suggestions_loo.surnamemanagedby | html %][% IF ( suggestions_loo.firstnamemanagedby ) %],[% END %] [% suggestions_loo.firstnamemanagedby | html %]
                 </td>
+                <td>
+                    [% Branches.GetName(suggestions_loo.branchcode) | html %]
+                </td>
+                <td>
+                    [% suggestions_loo.budget_name | html %]
+                </td>
+                <td>
+                    [% suggestions_loo.price | $Price %]
+                </td>
+                <td>
+                    [% IF (suggestions_loo.quantity > 0) %]
+                        [% suggestions_loo.quantity | html %]
+                    [% END %]
+                </td>
+                <td>
+                    [% suggestions_loo.total | $Price %]
+                </td>
                 <td class="actions">
                     [% IF ( suggestions_loo.biblionumber ) %]
                         <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;suggestionid=[% suggestions_loo.suggestionid | uri %]&amp;biblio=[% suggestions_loo.biblionumber | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Order</a>