Bug 4833: Show acq information when selecting suggestion for order

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>
This commit is contained in:
Katrin Fischer 2019-03-11 07:47:43 +00:00 committed by Nick Clemens
parent 71018d4cca
commit 3d3944cba3
2 changed files with 33 additions and 0 deletions

View File

@ -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,

View File

@ -1,4 +1,6 @@
[% USE raw %]
[% USE Branches %]
[% USE Price %]
[% USE Asset %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
@ -27,6 +29,11 @@
<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>
@ -52,6 +59,23 @@
<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>