4 [% USE TablesSettings %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% IF ( order_loop ) %]Orders search › Search results[% ELSE %]Order search[% END %] › Acquisitions › Koha</title>
9 [% INCLUDE 'doc-head-close.inc' %]
12 <body id="acq_histsearch" class="acq">
13 [% WRAPPER 'header.inc' %]
14 [% INCLUDE 'acquisitions-search.inc' %]
17 [% WRAPPER 'sub-header.inc' %]
18 [% WRAPPER breadcrumbs %]
19 [% WRAPPER breadcrumb_item %]
20 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
22 [% IF ( order_loop ) %]
23 [% WRAPPER breadcrumb_item %]
24 <a href="/cgi-bin/koha/acqui/histsearch.pl">Orders search</a>
26 [% WRAPPER breadcrumb_item bc_active= 1 %]
27 <span>Search results</span>
30 [% WRAPPER breadcrumb_item bc_active= 1 %]
31 <span>Order search</span>
34 [% END #/ WRAPPER breadcrumbs %]
35 [% END #/ WRAPPER sub-header.inc %]
37 <div class="main container-fluid">
39 <div class="col-sm-10 col-sm-push-2">
44 [% IF !order_loop && search_done %]
45 <div class="dialog message">
46 Your search returned no results.
50 [% UNLESS ( order_loop ) %]
51 [% PROCESS filter_form context => "main" %]
55 [% IF ( order_loop ) %]
56 <div id="acqui_histsearch" class="page-section">
57 <h2>Search results</h2>
58 <table id="histsearcht">
61 <th>Order line (parent)</th>
64 <th>Basket creator</th>
66 <th>Managing library</th>
67 <th>Invoice number</th>
68 <th class="anti-the">Summary</th>
72 <th>Quantity received</th>
73 <th>Quantity ordered</th>
76 <th>Internal note</th>
81 [% FOREACH order IN order_loop %]
84 [% order.ordernumber | html %]
85 [% IF order.ordernumber != order.parent_ordernumber %]([% order.parent_ordernumber | html %])[% END %]
88 [% SWITCH order.orderstatus %]
89 [% CASE 'new' %]<span>New</span>
90 [% CASE 'ordered' %]<span>Ordered</span>
91 [% CASE 'partial' %]<span>Partially received</span>
92 [% CASE 'complete' %]<span>Received</span>
93 [% CASE 'cancelled' %]<span>Cancelled</span>
95 [% IF order.is_standing %](standing order)[% END %]
97 <td><a href="basket.pl?basketno=[% order.basketno | uri %]">[% order.basketname | html %] ([% order.basketno | html %])</a></td>
98 <td>[% order.authorisedbyname | html %]</td>
100 [% IF ( order.basketgroupid ) %]
101 <a href="basketgroup.pl?op=add&booksellerid=[% order.id | uri %]&basketgroupid=[% order.basketgroupid | uri %]">[% order.groupname | html %] ([% order.basketgroupid | html %])</a>
106 <td>[% Branches.GetName(order.managing_library) | html %]</td>
107 <td>[% IF ( order.invoicenumber ) %]
108 <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% order.invoiceid | uri %]">[% order.invoicenumber | html %]</a>
114 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">[% order.title | html %]</a>
115 <br />[% order.author | html %] <br /> [% order.isbn | html %]
117 <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id | uri %]">[% order.name | html %]</a></td>
118 <td data-order="[% order.creationdate | html %]">[% order.creationdate | $KohaDates %]</td>
119 <td data-order="[% order.datereceived | html %]">
120 [% order.datereceived | $KohaDates %]
122 <td>[% order.quantityreceived | html %]</td>
123 <td>[% order.quantity | html %]</td>
124 <td>[% order.ecost | html %]</td>
125 <td>[% order.budget_name | html %]</td>
126 <td>[% order.order_internalnote | html %]</td>
127 <td>[% order.order_vendornote | html %]</td>
136 </div> <!-- /.col-sm-10.col-sm-push-2 -->
138 <div class="col-sm-2 col-sm-pull-10">
140 [% IF ( order_loop ) %]
141 [% PROCESS filter_form context => "sidebar" %]
143 [% INCLUDE 'acquisitions-menu.inc' %]
145 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
148 [% MACRO jsinclude BLOCK %]
149 [% Asset.js("js/acquisitions-menu.js") | $raw %]
150 [% INCLUDE 'calendar.inc' %]
151 [% INCLUDE 'datatables.inc' %]
152 [% INCLUDE 'columns_settings.inc' %]
154 var MSG_REMOVE_PATRON = _("Remove");
155 $(document).ready(function() {
156 var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'histsearch', 'histsearcht', 'json' ) | $raw %];
157 KohaTable("histsearcht", {
158 "sPaginationType": "full"
161 function AddPatron( patron_name, value, container, input_name ) {
162 div = "<div id='borrower_" + value + "'>" + patron_name + " ( <a href='#' class='removePatron'><i class='fa fa-trash-can' aria-hidden='true'></i> " + MSG_REMOVE_PATRON + " </a> ) <input type='hidden' name='" + input_name + "' value='" + value + "' /></div>";
163 $(container).append( div );
165 $(container).parent().show( 800 );
167 function RemovePatron( cardnumber, container ) {
168 $( '#borrower_' + cardnumber ).remove();
170 if ( ! $(container).html() ) {
171 $(container).parent("fieldset").hide( 800 );
174 patron_autocomplete($("#find_patron"), {
175 'on-select-callback': function( event, ui ) {
176 var field = ui.item.borrowernumber;
177 AddPatron( ui.item.firstname + " " + ( ui.item.middle_name || "" ) + " " + ui.item.surname, field, $("#basket_creators"), 'created_by' );
178 $("#find_patron").val('').focus();
182 $("body").on("click",".removePatron",function(e){
184 var divid = $(this).parent().attr("id");
185 var cardnumber = divid.replace("borrower_","");
186 RemovePatron(cardnumber, $("#basket_creators"));
193 [% BLOCK filter_form %]
194 <form action="/cgi-bin/koha/acqui/histsearch.pl" method="post">
195 [% IF ( context == "sidebar" ) %]
196 <fieldset class="brief">
197 <h4>Search orders</h4>
199 <fieldset class="rows">
200 <legend>Search orders</legend>
202 [% INCLUDE 'filter-orders.inc' %]
203 <input type="hidden" name="do_search" value="1" />
205 <fieldset class="action">
206 <input type="submit" class="btn btn-primary" value="Search" />
211 [% INCLUDE 'intranet-bottom.inc' %]