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