Bug 27982: Replace obsolete title-string sorting: Acquisitions templates part 1
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / parcels.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Acquisitions &rsaquo; Receive shipment from vendor [% name | html %]</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 </head>
9
10 <body id="acq_parcels" class="acq">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'acquisitions-search.inc' %]
13
14 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
15     <ol>
16         <li>
17             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
18         </li>
19         <li>
20             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
21         </li>
22         <li>
23             <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% name | html %]</a>
24         </li>
25         <li>
26             <a href="#" aria-current="page">
27                 Receive shipment from vendor [% name | html %]
28             </a>
29         </li>
30     </ol>
31 </nav>
32
33 <div class="main container-fluid">
34     <div class="row">
35         [% IF ( count ) %]
36             <div class="col-sm-10 col-sm-push-2">
37         [% ELSE %]
38             <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
39         [% END %]
40             <main>
41
42 [% IF ( error_failed_to_create_invoice ) %]
43     <div id="error" class="dialog alert">
44         <p>An error has occurred. Invoice cannot be created.</p>
45     </div>
46 [% END %]
47 <h1>Receive shipment from vendor <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% name | html %]</a></h1>
48
49     [% IF duplicate_invoices %]
50     <div id="parcels_duplicate_invoice" class="dialog alert">
51         <p>This invoice number has already been used. Would you like to receive on an existing invoice?</p>
52         <table>
53             <thead><tr><th>Invoice no.</th><th>Shipment date</th><th></th></tr></thead>
54             <tbody>
55                 [% FOREACH invoice IN duplicate_invoices %]
56                     <tr>
57                         <td>[% invoice.invoicenumber | html %]</td>
58                         <td>[% invoice.shipmentdate | $KohaDates %]</td>
59                         <td><a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoice.invoiceid | uri %]">Receive</a></td>
60                     </tr>
61                 [% END %]
62             </tbody>
63         </table>
64         <form method="get" action="parcels.pl">
65             <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
66             <input type="hidden" name="op" value="confirm" />
67             <input type="hidden" name="invoice" value="[% invoicenumber | html %]" />
68             <input type="hidden" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" />
69             <input type="hidden" name="shipmentcost" value="[% shipmentcost | html %]" />
70             <input type="hidden" name="shipmentcost_budgetid" value="[% shipmentcost_budgetid | html %]" />
71             <input type="submit" class="button" value="Create new invoice anyway" />
72         </form>
73     </div>
74     [% END %]
75
76
77 [% IF ( count ) %]
78 <p> [% count | html %] shipments</p>
79 <div id="resultlist">
80 <!-- Search Results Table -->
81
82 <table class="small" id="parcelst">
83     <thead>
84         <tr>
85             <th>Line</th>
86             <th class="title-string">Date received</th>
87             <th>Invoice number</th>
88             <th>Item count</th>
89             <th>Biblio count</th>
90             <th>Items expected</th>
91         </tr>
92     </thead>
93     <tbody>
94     <!-- Actual Search Results -->
95     [% FOREACH searchresult IN searchresults %]
96         <tr>
97             <td>
98                 [% searchresult.number | html %]
99             </td>
100             <td>
101                 <span title="[% searchresult.datereceived | html %]">[% searchresult.datereceived | $KohaDates %]</span>
102             </td>
103             <td>
104                 [% IF ( searchresult.code ) %]
105                     <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% searchresult.invoiceid | uri %]">[% searchresult.code | html %]</a>
106                 [% ELSE %]
107                     <abbr title="not available">n/a</abbr>
108                 [% END %]
109             </td>
110             <td>
111                 [% searchresult.reccount | html %]
112             </td>
113             <td>
114                 [% searchresult.bibcount | html %]
115             </td>
116             <td>
117                 [% searchresult.itemcount | html %]
118             </td>
119         </tr>
120     [% END %]
121     </tbody>
122 </table>
123
124 <div id="resultnumber">
125 <!-- Row of numbers corresponding to search result pages -->
126 [% IF ( displayprev ) %]
127     <a href="parcels.pl?booksellerid=[% booksellerid | uri %]&amp;startfrom=[% prevstartfrom | uri %][% IF ( datefrom ) %]&amp;datefrom=[% datefrom | uri %][% END %][% IF ( dateto ) %]&amp;dateto=[% dateto | uri %][% END %][% IF ( code ) %]&amp;filter=[% code | uri %][% END %][% IF ( orderby ) %]&amp;orderby=[% orderby | uri %][% END %][% IF ( resultsperpage ) %]&amp;resultsperpage=[% resultsperpage | uri %][% END %]&amp;type=intra">&lt;&lt; Previous</a>
128 [% END %]
129 [% FOREACH number IN numbers %]
130     [% IF ( number.highlight ) %]
131     <span class="current">[% number.number | html %]</span>
132     [% ELSE %]
133     <a href="parcels.pl?booksellerid=[% booksellerid | uri %]&amp;startfrom=[% number.startfrom | uri %][% IF ( number.datefrom ) %]&amp;datefrom=[% number.datefrom | uri %][% END %][% IF ( number.dateto ) %]&amp;dateto=[% number.dateto | uri %][% END %][% IF ( number.code ) %]&amp;filter=[% number.code | uri %][% END %][% IF ( number.orderby ) %]&amp;orderby=[% number.orderby | uri %][% END %][% IF ( number.resultsperpage ) %]&amp;resultsperpage=[% number.resultsperpage | uri %][% END %]&amp;type=intra">[% number.number | html %]</a>
134     [% END %]
135 [% END %]
136 [% IF ( displaynext ) %]
137     <a href="parcels.pl?booksellerid=[% booksellerid | uri %]&amp;startfrom=[% nextstartfrom | uri %][% IF ( datefrom ) %]&amp;datefrom=[% datefrom | uri %][% END %][% IF ( dateto ) %]&amp;dateto=[% dateto | uri %][% END %][% IF ( code ) %]&amp;filter=[% code | uri %][% END %][% IF ( orderby ) %]&amp;orderby=[% orderby | uri %][% END %][% IF ( resultsperpage ) %]&amp;resultsperpage=[% resultsperpage | uri %][% END %]&amp;type=intra">Next &gt;&gt;</a>
138 [% END %]
139 </div>
140 </div>
141 [% END %]
142
143     <div id="parcels_new_parcel">
144         <form method="get" action="parcels.pl" class="validated">
145     <fieldset class="rows">
146     <legend>Receive a new shipment</legend>
147        <ol> <li>
148             <label for="invoice" class="required">Vendor invoice:</label>
149             <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
150             <input type="hidden" name="op" value="new" />
151             <input type="text" size="20" id="invoice" name="invoice" class="focus required" required="required" />
152         </li>
153                 [% IF ( gst ) %]
154         <li>
155             <label for="gst">GST:</label>
156             <input type="text" size="20" id="gst" name="gst" />
157         </li>
158                 [% END %]
159       <!--  // Removing freight input until shipping can be proplerly handled .
160           <li>
161             <label for="freight">Shipping:</label>
162             <input type="text" size="20" id="freight" name="freight" />
163         </li> -->
164          <li>
165             <label for="shipmentdate">Shipment date: </label>
166             <input type="text" id="shipmentdate" name="shipmentdate" maxlength="10" size="10" value="[% shipmentdate_today | $KohaDates %]" class="datepicker" />
167             <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
168         </li>
169         <li>
170             <label for="shipmentcost">Shipping cost: </label>
171             <input type="text" id="shipmentcost" name="shipmentcost" size="10" />
172         </li>
173         <li>
174             <label for="shipmentcost_budgetid">Shipping fund: </label>
175             <select id="shipmentcost_budgetid" name="shipmentcost_budgetid">
176                 <option value="">No fund</option>
177                 [% FOREACH budget IN budgets %]
178                     [% IF ( budget.b_active ) %]
179                         <option value="[% budget.b_id | html %]">[% budget.b_txt | html %]</option>
180                     [% ELSE %]
181                         <option value="[% budget.b_id | html %]" class="b_inactive">[% budget.b_txt | html %] (inactive)</option>
182                     [% END %]
183                 [% END %]
184             </select>
185             <label for="showallfunds" style="float:none;width:auto;">&nbsp;Show inactive:</label>
186             <input type="checkbox" id="showallfunds" />
187
188         </li>
189                 </ol>
190     </fieldset>
191             <fieldset class="action"><input type="submit" class="button" value="Next" /> <a class="cancel" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">Cancel</a></fieldset>
192         </form>
193     </div>
194 </main>
195 </div> <!-- /.col-sm-10.col-sm-push-2 -->
196
197 [% IF ( count ) %]
198 <div class="col-sm-2 col-sm-pull-10">
199     <aside>
200     <form method="get" action="parcels.pl">
201     <fieldset class="brief">
202         <h4>Filter</h4>
203         <ol>
204             <li> <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" /></li>
205             <li><label for="filter">Invoice number:</label><input type="text" size="20" name="filter" value="[% filter | html %]" id="filter" /></li>
206             <li><label for="datefrom">From:</label><input type="text" size="9" id="datefrom" name="datefrom" value="[% datefrom | html %]" class="datepicker" /><br />
207                 <label for="dateto">To:</label><input type="text" size="9" id="dateto" name="dateto" value="[% dateto | html %]" class="datepicker" /></li>
208             <li><label for="orderby">Sort by :</label><select name="orderby" id="orderby">
209                 <option value="invoicenumber">Invoice number</option>
210                 <option value="shipmentdate">Shipment date</option>
211                 <option value="shipmentdate desc">Shipment date reverse</option>
212                 <option value="invoicenumber desc">Invoice number reverse</option>
213                 </select><br />
214                 <label for="resultsperpage">Results per page :</label><select name="resultsperpage" id="resultsperpage">
215                 <option value="20">20</option>
216                 <option value="30">30</option>
217                 <option value="50">50</option>
218                 <option value="100">100</option>
219                 </select></li>
220         </ol>
221     <fieldset class="action"><input type="submit" class="button" value="Filter" /> <a href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid | uri %]">Clear</a></fieldset>
222         </fieldset>
223 </form>
224 </aside>
225 </div>  <!-- /.col-sm-2.col-sm-pull-10 -->
226 [% END %]
227 </div> <!-- /.row -->
228
229 [% MACRO jsinclude BLOCK %]
230     [% Asset.js("js/acquisitions-menu.js") | $raw %]
231     [% INCLUDE 'calendar.inc' %]
232     [% INCLUDE 'datatables.inc' %]
233     <script>
234         $(document).ready(function() {
235             var parcelst = $("#parcelst").dataTable($.extend(true, {}, dataTablesDefaults, {
236                 "aoColumnDefs": [
237                   { "sType": "title-string", "aTargets" : [ "title-string" ] }
238                 ],
239                 'bPaginate': false,
240             }));
241
242             //keep a copy of all budgets before removing the inactives
243             var budgetId = $("#shipmentcost_budgetid");
244             var disabledBudgetsCopy = budgetId.html();
245             $('.b_inactive').remove();
246
247             $('#showallfunds').click(function() {
248                 if ($(this).is(":checked")) {
249                     budgetId.html(disabledBudgetsCopy); //Puts back all the funds
250                 }
251                 else {
252                     $('.b_inactive').remove();
253                 }
254             });
255         });
256     </script>
257 [% END %]
258
259 [% INCLUDE 'intranet-bottom.inc' %]