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