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