@@ -, +, @@ - Basket group closed date and delivery place (in basketgroup column) - Additional order fields (one column for each additional field) --- C4/Acquisition.pm | 2 ++ acqui/histsearch.pl | 21 ++++++++++++++++++ .../prog/en/modules/acqui/histsearch.tt | 23 ++++++++++++++++++-- 3 files changed, 44 insertions(+), 2 deletions(-) --- a/C4/Acquisition.pm +++ a/C4/Acquisition.pm @@ -2197,6 +2197,8 @@ sub GetHistory { aqbasket.basketname, aqbasket.basketgroupid, aqbasketgroups.name as groupname, + aqbasketgroups.closeddate as groupcloseddate, + IF(aqbasketgroups.freedeliveryplace != '', aqbasketgroups.freedeliveryplace, aqbasketgroups.deliveryplace) as groupdeliveryplace, aqbooksellers.name, aqbasket.creationdate, aqorders.datereceived, --- a/acqui/histsearch.pl +++ a/acqui/histsearch.pl @@ -59,6 +59,7 @@ use C4::Dates; use C4::Debug; use C4::Branch; use C4::Koha; +use Koha::AdditionalField; my $input = new CGI; my $title = $input->param( 'title'); @@ -118,6 +119,26 @@ if ($do_search) { budget => $budget, orderstatus => $orderstatus, ); + my $additional_fields = Koha::AdditionalField->all({ + tablename => 'aqorders', + }); + foreach my $af (@$additional_fields) { + if (!$af->{authorised_value_category} && $af->{marcfield}) { + # Try to retrieve authorised values category from MARC framework + my ($field, $subfield) = split /\$/, $af->{marcfield}; + my $category = C4::Koha::GetAuthValCodeFromField($field, $subfield); + if ($category) { + $af->{authorised_value_category} = $category; + } + } + } + my $af_values = Koha::AdditionalField->fetch_all_values({ + tablename => 'aqorders', + }); + $template->param( + 'additional_fields' => $additional_fields, + 'additional_fields_values' => $af_values, + ); } my $from_date = $from_placed_on ? $from_placed_on->output('syspref') : undef; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt @@ -1,4 +1,5 @@ [% USE KohaDates %] +[% USE AuthorisedValues %] [% INCLUDE 'doc-head-open.inc' %] Koha › Acquisitions › [% IF ( order_loop ) %]Orders search › Search results[% ELSE %]Order search[% END %] @@ -134,6 +135,9 @@ Pending order Unit cost Fund + [% FOREACH field IN additional_fields %] + [% field.name %] + [% END %] @@ -156,8 +160,12 @@ [% IF ( order.basketgroupid ) %] [% order.groupname %] ([% order.basketgroupid %]) - [% ELSE %] -   + [% IF order.groupcloseddate %] +
Closed on [% order.groupcloseddate |$KohaDates %]. + [% END %] + [% IF order.groupdeliveryplace %] +
Delivery place: [% order.groupdeliveryplace %] + [% END %] [% END %] [% IF ( order.invoicenumber ) %] @@ -181,6 +189,17 @@ [% order.quantity %] [% order.ecost %] [% order.budget_name %] + [% FOREACH field IN additional_fields %] + [% value = '' %] + [% IF additional_fields_values.exists(order.ordernumber) %] + [% values = additional_fields_values.item(order.ordernumber) %] + [% value = values.item(field.name) %] + [% IF field.authorised_value_category %] + [% value = AuthorisedValues.GetByCode(field.authorised_value_category, value) %] + [% END %] + [% END %] + [% value %] + [% END %] [% END %] --