View | Details | Raw Unified | Return to bug 10124
Collapse All | Expand All

(-)a/acqui/parcel.pl (-35 / +2 lines)
Lines 212-218 for my $item ( @parcelitems ) { Link Here
212
push @book_foot_loop, map { $_ } values %foot;
212
push @book_foot_loop, map { $_ } values %foot;
213
213
214
my @loop_orders = ();
214
my @loop_orders = ();
215
if(!defined $invoice->{closedate}) {
215
unless( defined $invoice->{closedate} ) {
216
    my $pendingorders;
216
    my $pendingorders;
217
    if($input->param('op') eq "search"){
217
    if($input->param('op') eq "search"){
218
        my $search   = $input->param('summaryfilter') || '';
218
        my $search   = $input->param('summaryfilter') || '';
Lines 297-336 if(!defined $invoice->{closedate}) { Link Here
297
        my $budget = GetBudget( $line{budget_id} );
297
        my $budget = GetBudget( $line{budget_id} );
298
        $line{budget_name} = $budget->{'budget_name'};
298
        $line{budget_name} = $budget->{'budget_name'};
299
299
300
        push @loop_orders, \%line if ($i >= $startfrom and $i < $startfrom + $resultsperpage);
300
        push @loop_orders, \%line;
301
    }
302
303
    my $count = $countpendings;
304
305
    if ($count>$resultsperpage){
306
        my $displaynext=0;
307
        my $displayprev=$startfrom;
308
        if(($count - ($startfrom+$resultsperpage)) > 0 ) {
309
            $displaynext = 1;
310
        }
311
312
        my @numbers = ();
313
        for (my $i=1; $i<$count/$resultsperpage+1; $i++) {
314
                my $highlight=0;
315
                ($startfrom/$resultsperpage==($i-1)) && ($highlight=1);
316
                push @numbers, { number => $i,
317
                    highlight => $highlight ,
318
                    startfrom => ($i-1)*$resultsperpage};
319
        }
320
321
        my $from = $startfrom*$resultsperpage+1;
322
        my $to;
323
        if($count < (($startfrom+1)*$resultsperpage)){
324
            $to = $count;
325
        } else {
326
            $to = (($startfrom+1)*$resultsperpage);
327
        }
328
        $template->param(numbers=>\@numbers,
329
                         displaynext=>$displaynext,
330
                         displayprev=>$displayprev,
331
                         nextstartfrom=>(($startfrom+$resultsperpage<$count)?$startfrom+$resultsperpage:$count),
332
                         prevstartfrom=>(($startfrom-$resultsperpage>0)?$startfrom-$resultsperpage:0)
333
                        );
334
    }
301
    }
335
302
336
    $template->param(
303
    $template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt (-36 / +46 lines)
Lines 4-9 Link Here
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
7
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
7
[% INCLUDE 'datatables-strings.inc' %]
8
[% INCLUDE 'datatables-strings.inc' %]
8
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
9
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
9
[% INCLUDE 'greybox.inc' %]
10
[% INCLUDE 'greybox.inc' %]
Lines 14-23 Link Here
14
    dt_overwrite_html_sorting_localeCompare();
15
    dt_overwrite_html_sorting_localeCompare();
15
16
16
    $(document).ready(function(){
17
    $(document).ready(function(){
18
17
        var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, {
19
        var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, {
18
            "bStateSave": true,
20
            "bStateSave": true,
19
            "iCookieDuration": 60*60*24*1000, // 1000 days
21
            "iCookieDuration": 60*60*24*1000, // 1000 days
20
            "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
22
            "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
21
            "aoColumnDefs": [
23
            "aoColumnDefs": [
22
                { "aTargets": [ 3, 8, 9 ], "bSortable": false, "bSearchable": false },
24
                { "aTargets": [ 3, 8, 9 ], "bSortable": false, "bSearchable": false },
23
            ],
25
            ],
Lines 33-44 Link Here
33
                null,
35
                null,
34
                null,
36
                null,
35
            ],
37
            ],
38
            'bAutoWidth': false,
36
            "sPaginationType": "four_button"
39
            "sPaginationType": "four_button"
37
        } ) );
40
        } )
41
        ).columnFilter({
42
            sPlaceHolder: "head:after",
43
            aoColumns: [
44
                { type: "text" },
45
                { type: "text" },
46
                { type: "text" },
47
                null,
48
                { type: "text" },
49
                { type: "text" },
50
                { type: "text" },
51
                { type: "text" },
52
                null,
53
                null
54
            ]
55
        });
56
38
        var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, {
57
        var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, {
39
            "bStateSave": true,
58
            "bStateSave": true,
40
            "iCookieDuration": 60*60*24*1000, // 1000 days
59
            "iCookieDuration": 60*60*24*1000, // 1000 days
41
            "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
60
            "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
42
            "aoColumnDefs": [
61
            "aoColumnDefs": [
43
                { "aTargets": [ 3, -1 ], "bSortable": false, "bSearchable": false },
62
                { "aTargets": [ 3, -1 ], "bSortable": false, "bSearchable": false },
44
            ],
63
            ],
Lines 55-66 Link Here
55
            ],
74
            ],
56
            "sPaginationType": "four_button"
75
            "sPaginationType": "four_button"
57
        } ) );
76
        } ) );
58
/*
59
    $("#pendingt").tablesorter({
60
		headers: { 2: { sorter: 'articles' },3: { sorter: false },8:{sorter:false}}
61
    });
62
*/
63
64
    });
77
    });
65
78
66
     // Case-insensitive version of jquery's contains function
79
     // Case-insensitive version of jquery's contains function
Lines 165-176 Link Here
165
<p><strong>Invoice number:</strong> [% invoice %] <strong>Received by:</strong> [% loggedinusername %] <strong>On:</strong> [% formatteddatereceived %]</p>
178
<p><strong>Invoice number:</strong> [% invoice %] <strong>Received by:</strong> [% loggedinusername %] <strong>On:</strong> [% formatteddatereceived %]</p>
166
</div>
179
</div>
167
[% UNLESS (invoiceclosedate) %]
180
[% UNLESS (invoiceclosedate) %]
168
<div id="acqui_receive_search">
181
  <div id="acqui_receive_search">
169
    <h3>Pending orders</h3>
182
    <h3>Pending orders</h3>
170
183
171
 [% IF ( loop_orders ) %]<table id="pendingt">
184
    [% IF ( loop_orders ) %]
172
    <thead>
185
      <table id="pendingt">
173
        <tr>
186
        <thead>
187
          <tr>
188
            <th>Basket search</th>
189
            <th>Order line search</th>
190
            <th>Summary search</th>
191
            <th>&nbsp;</th>
192
            <th>Quantity search</th>
193
            <th>Unit cost search</th>
194
            <th>Order cost search</th>
195
            <th>Fund search</th>
196
            <th>&nbsp;</th>
197
            <th>&nbsp;</th>
198
          </tr>
199
          <tr>
174
            <th>Basket</th>
200
            <th>Basket</th>
175
            <th>Order line</th>
201
            <th>Order line</th>
176
            <th>Summary</th>
202
            <th>Summary</th>
Lines 181-189 Link Here
181
            <th>Fund</th>
207
            <th>Fund</th>
182
            <th>&nbsp;</th>
208
            <th>&nbsp;</th>
183
            <th>&nbsp;</th>
209
            <th>&nbsp;</th>
184
        </tr>
210
          </tr>
185
    </thead>
211
        </thead>
186
    <tbody class="filterclass">
212
        <tbody class="filterclass">
187
        [% FOREACH loop_order IN loop_orders %]
213
        [% FOREACH loop_order IN loop_orders %]
188
            <tr>
214
            <tr>
189
                <td class="basketfilterclass">[% loop_order.basketname %] (<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_order.basketno %]">[% loop_order.basketno %]</a>)</td>
215
                <td class="basketfilterclass">[% loop_order.basketname %] (<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_order.basketno %]">[% loop_order.basketno %]</a>)</td>
Lines 238-263 Link Here
238
                        [% END %]
264
                        [% END %]
239
                    </td>
265
                    </td>
240
                </tr>
266
                </tr>
241
            [% END %]
242
        </tbody>
243
         </table>[% ELSE %]There are no pending orders.[% END %]
244
       <div id="resultnumber">
245
        <!-- Row of numbers corresponding to search result pages -->
246
        [% IF ( displayprev ) %]
247
            <a href="parcel.pl?invoiceid=[% invoiceid %]&amp;startfrom=[% prevstartfrom %][% IF ( resultsperpage ) %]&amp;resultsperpage=[% resultsperpage %][% END %]#resultnumber">&lt;&lt; Previous</a>
248
        [% END %]
249
        [% FOREACH number IN numbers %]
250
            [% IF ( number.highlight ) %]
251
            <span class="current">[% number.number %]</span>
252
            [% ELSE %]
253
            <a href="parcel.pl?invoiceid=[% invoiceid %]&amp;startfrom=[% number.startfrom %][% IF ( resultsperpage ) %]&amp;resultsperpage=[% resultsperpage %][% END %]#resultnumber">[% number.number %]</a>
254
            [% END %]
255
        [% END %]
267
        [% END %]
256
        [% IF ( displaynext ) %]
268
        </tbody>
257
            <a href="parcel.pl?invoiceid=[% invoiceid %]&amp;startfrom=[% nextstartfrom %][% IF ( resultsperpage ) %]&amp;resultsperpage=[% resultsperpage %][% END %]#resultnumber">Next &gt;&gt;</a>
269
      </table>
258
        [% END %]
270
    [% ELSE %]There are no pending orders.[% END %]
259
        </div>
271
  </div>
260
    </div>
261
[% ELSE %]
272
[% ELSE %]
262
    <p>
273
    <p>
263
        Invoice is closed, so you can't receive orders anymore.
274
        Invoice is closed, so you can't receive orders anymore.
264
- 

Return to bug 10124