Bug 30055: Use /acquisitions/baskets/managers for basket's manager
[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>Receive shipment from vendor [% name | html %] &rsaquo; Acquisitions &rsaquo; Koha</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 number</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>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 data-order="[% searchresult.datereceived | html %]">
101                 [% searchresult.datereceived | $KohaDates %]
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="flatpickr" />
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>
207                 <label for="datefrom">From:</label>
208                 <input type="text" size="9" id="datefrom" name="datefrom" value="[% datefrom | html %]" class="flatpickr" />
209                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
210             </li>
211             <li>
212                 <label for="dateto">To:</label>
213                 <input type="text" size="9" id="dateto" name="dateto" value="[% dateto | html %]" class="flatpickr" />
214                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
215             </li>
216             <li><label for="orderby">Sort by :</label><select name="orderby" id="orderby">
217                 <option value="invoicenumber">Invoice number</option>
218                 <option value="shipmentdate">Shipment date</option>
219                 <option value="shipmentdate desc">Shipment date reverse</option>
220                 <option value="invoicenumber desc">Invoice number reverse</option>
221                 </select><br />
222                 <label for="resultsperpage">Results per page :</label><select name="resultsperpage" id="resultsperpage">
223                 <option value="20">20</option>
224                 <option value="30">30</option>
225                 <option value="50">50</option>
226                 <option value="100">100</option>
227                 </select></li>
228         </ol>
229     <fieldset class="action"><input type="submit" class="button" value="Filter" /> <a href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid | uri %]">Clear</a></fieldset>
230         </fieldset>
231 </form>
232 </aside>
233 </div>  <!-- /.col-sm-2.col-sm-pull-10 -->
234 [% END %]
235 </div> <!-- /.row -->
236
237 [% MACRO jsinclude BLOCK %]
238     [% Asset.js("js/acquisitions-menu.js") | $raw %]
239     [% INCLUDE 'calendar.inc' %]
240     [% INCLUDE 'datatables.inc' %]
241     <script>
242         $(document).ready(function() {
243             var parcelst = $("#parcelst").dataTable($.extend(true, {}, dataTablesDefaults, {
244                 'bPaginate': false
245             }));
246
247             //keep a copy of all budgets before removing the inactives
248             var budgetId = $("#shipmentcost_budgetid");
249             var disabledBudgetsCopy = budgetId.html();
250             $('.b_inactive').remove();
251
252             $('#showallfunds').click(function() {
253                 if ($(this).is(":checked")) {
254                     budgetId.html(disabledBudgetsCopy); //Puts back all the funds
255                 }
256                 else {
257                     $('.b_inactive').remove();
258                 }
259             });
260         });
261     </script>
262 [% END %]
263
264 [% INCLUDE 'intranet-bottom.inc' %]