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>
use C4::Output;
use C4::Suggestions;
use C4::Biblio;
+use C4::Budgets;
use Koha::Acquisition::Booksellers;
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,
[% 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> </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 %]&basketno=[% basketno | uri %]&suggestionid=[% suggestions_loo.suggestionid | uri %]&biblio=[% suggestions_loo.biblionumber | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Order</a>