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

(-)a/acqui/neworderempty.pl (-2 / +10 lines)
Lines 360-365 my @gst_values = map { Link Here
360
    option => $_ + 0.0
360
    option => $_ + 0.0
361
}, split( '\|', C4::Context->preference("gist") );
361
}, split( '\|', C4::Context->preference("gist") );
362
362
363
my $quantity = $data->{'quantity'};
364
{
365
    defined($quantity) && last;
366
    my $rr_quantity_to_order = $input->param('rr_quantity_to_order');
367
    (defined($rr_quantity_to_order) && $rr_quantity_to_order) || last;
368
    $quantity = $rr_quantity_to_order;
369
}
370
363
$template->param(
371
$template->param(
364
    existing         => $biblionumber,
372
    existing         => $biblionumber,
365
    ordernumber           => $ordernumber,
373
    ordernumber           => $ordernumber,
Lines 404-411 $template->param( Link Here
404
    ean              => $data->{'ean'},
412
    ean              => $data->{'ean'},
405
    seriestitle      => $data->{'seriestitle'},
413
    seriestitle      => $data->{'seriestitle'},
406
    itemtypeloop     => \@itemtypes,
414
    itemtypeloop     => \@itemtypes,
407
    quantity         => $data->{'quantity'},
415
    quantity         => $quantity,
408
    quantityrec      => $data->{'quantity'},
416
    quantityrec      => $quantity,
409
    rrp              => $data->{'rrp'},
417
    rrp              => $data->{'rrp'},
410
    gst_values       => \@gst_values,
418
    gst_values       => \@gst_values,
411
    gstrate          => $data->{gstrate} ? $data->{gstrate}+0.0 : $bookseller->{gstrate} ? $bookseller->{gstrate}+0.0 : 0,
419
    gstrate          => $data->{gstrate} ? $data->{gstrate}+0.0 : $bookseller->{gstrate} ? $bookseller->{gstrate}+0.0 : 0,
(-)a/circ/reserveratios.pl (+30 lines)
Lines 30-35 use C4::Auth; Link Here
30
use C4::Dates qw/format_date format_date_in_iso/;
30
use C4::Dates qw/format_date format_date_in_iso/;
31
use C4::Debug;
31
use C4::Debug;
32
use C4::Biblio qw/GetMarcBiblio GetRecordValue GetFrameworkCode/;
32
use C4::Biblio qw/GetMarcBiblio GetRecordValue GetFrameworkCode/;
33
use C4::Acquisition qw/GetOrdersByBiblionumber/;
33
34
34
my $input = new CGI;
35
my $input = new CGI;
35
my $startdate = $input->param('from');
36
my $startdate = $input->param('from');
Lines 47-52 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
47
    }
48
    }
48
);
49
);
49
50
51
my $booksellerid = $input->param('booksellerid') // '';
52
my $basketno = $input->param('basketno') // '';
53
if ($booksellerid && $basketno) {
54
     $template->param( booksellerid => $booksellerid, basketno => $basketno );
55
}
56
50
my ( $year, $month, $day ) = Today();
57
my ( $year, $month, $day ) = Today();
51
my $todaysdate     = sprintf("%-04.4d-%-02.2d-%02.2d", $year, $month, $day);
58
my $todaysdate     = sprintf("%-04.4d-%-02.2d-%02.2d", $year, $month, $day);
52
# Find yesterday for the default shelf pull start and end dates
59
# Find yesterday for the default shelf pull start and end dates
Lines 159-164 while ( my $data = $sth->fetchrow_hashref ) { Link Here
159
    );
166
    );
160
}
167
}
161
168
169
{
170
    for my $rd ( @reservedata ) {
171
        $rd->{biblionumber} || next;
172
        my $pcnt = CountPendingOrdersByBiblionumber( $rd->{biblionumber} );
173
        $pcnt || next;
174
        $rd->{pendingorders} = $pcnt;
175
    }
176
}
177
162
$template->param(
178
$template->param(
163
    ratio_atleast1  => $ratio_atleast1,
179
    ratio_atleast1  => $ratio_atleast1,
164
    todaysdate      => format_date($todaysdate),
180
    todaysdate      => format_date($todaysdate),
Lines 169-171 $template->param( Link Here
169
);
185
);
170
186
171
output_html_with_http_headers $input, $cookie, $template->output;
187
output_html_with_http_headers $input, $cookie, $template->output;
188
189
sub CountPendingOrdersByBiblionumber {
190
    my $biblionumber = shift;
191
    my @orders = GetOrdersByBiblionumber( $biblionumber );
192
    scalar(@orders) || return(0);
193
    my $cnt=0;  for my $order ( @orders ) {
194
        defined($order->{datecancellationprinted}) && $order->{datecancellationprinted} && next;
195
        my $onum = $order->{quantity} // 0;
196
        my $rnum = $order->{quantityreceived} // 0;
197
        $rnum >= $onum && next;
198
        $cnt+=$onum; $cnt-=$rnum;
199
    }
200
    $cnt;
201
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-add-to-basket.inc (+1 lines)
Lines 17-22 Link Here
17
        <li><a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">From a new (empty) record</a></li>
17
        <li><a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">From a new (empty) record</a></li>
18
        <li><a href="/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">From an external source</a></li>
18
        <li><a href="/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">From an external source</a></li>
19
        <li><a href="/cgi-bin/koha/acqui/addorderiso2709.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]"> From a staged file</a></li>
19
        <li><a href="/cgi-bin/koha/acqui/addorderiso2709.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]"> From a staged file</a></li>
20
        [% IF ( CAN_user_circulate ) %]<li><a href="/cgi-bin/koha/circ/reserveratios.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">From titles with highest hold ratios</a></li>[% END %]
20
      </ul>
21
      </ul>
21
    [% ELSE %]
22
    [% ELSE %]
22
        <div class="dialog alert">
23
        <div class="dialog alert">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt (-2 / +6 lines)
Lines 85-91 Link Here
85
            <td><p>[% reserveloo.location %]</p></td>
85
            <td><p>[% reserveloo.location %]</p></td>
86
            <td><p>[% reserveloo.itype %]</p></td>
86
            <td><p>[% reserveloo.itype %]</p></td>
87
            <td><p>[% reserveloo.listcall %]</p></td>
87
            <td><p>[% reserveloo.listcall %]</p></td>
88
            <td>[% IF ( reserveloo.thisratio_atleast1 ) %]<p><b>[% reserveloo.ratiocalc %] to order</b></p>[% END %]</td>
88
            <td>[% IF ( reserveloo.thisratio_atleast1 ) %]<p>[% IF ( CAN_user_acquisition && basketno && booksellerid ) %]<!-- [% reserveloo.ratiocalc %] --><a href="/cgi-bin/koha/acqui/neworderempty.pl?biblionumber=[% reserveloo.biblionumber %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]&amp;rr_quantity_to_order=[% reserveloo.ratiocalc %]">[% END %]<b>[% reserveloo.ratiocalc %] to order</b>[% IF ( CAN_user_acquisition && basketno && booksellerid ) %]</a>[% END %]
89
            [% IF ( reserveloo.pendingorders ) %]<br><b>[% reserveloo.pendingorders %] pending</b>[% END %]</p>[% END %]</td>
89
        </tr>
90
        </tr>
90
      [% END %]
91
      [% END %]
91
      </tbody>
92
      </tbody>
Lines 117-122 Link Here
117
118
118
<fieldset class="action"><input type="submit" value="Go" class="submit"/></fieldset>
119
<fieldset class="action"><input type="submit" value="Go" class="submit"/></fieldset>
119
</fieldset>
120
</fieldset>
121
[% IF ( CAN_user_acquisition && basketno && booksellerid ) %]
122
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
123
<input type="hidden" name="basketno" value="[% basketno %]" />
124
[% END %]
120
</form>
125
</form>
121
126
122
</div>
127
</div>
123
- 

Return to bug 11665