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