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

(-)a/acqui/neworderempty.pl (-2 / +10 lines)
Lines 358-363 my @gst_values = map { Link Here
358
    option => $_
358
    option => $_
359
}, split( '\|', C4::Context->preference("gist") );
359
}, split( '\|', C4::Context->preference("gist") );
360
360
361
my $quantity = $data->{'quantity'};
362
{
363
    defined($quantity) && last;
364
    my $rr_quantity_to_order = $input->param('rr_quantity_to_order');
365
    (defined($rr_quantity_to_order) && $rr_quantity_to_order) || last;
366
    $quantity = $rr_quantity_to_order;
367
}
368
361
$template->param(
369
$template->param(
362
    existing         => $biblionumber,
370
    existing         => $biblionumber,
363
    ordernumber           => $ordernumber,
371
    ordernumber           => $ordernumber,
Lines 400-407 $template->param( Link Here
400
    ean              => $data->{'ean'},
408
    ean              => $data->{'ean'},
401
    seriestitle      => $data->{'seriestitle'},
409
    seriestitle      => $data->{'seriestitle'},
402
    itemtypeloop     => \@itemtypes,
410
    itemtypeloop     => \@itemtypes,
403
    quantity         => $data->{'quantity'},
411
    quantity         => $quantity,
404
    quantityrec      => $data->{'quantity'},
412
    quantityrec      => $quantity,
405
    rrp              => $data->{'rrp'},
413
    rrp              => $data->{'rrp'},
406
    gst_values       => \@gst_values,
414
    gst_values       => \@gst_values,
407
    gstrate          => $data->{gstrate} ? $data->{gstrate}+0.0 : $bookseller->{gstrate} ? $bookseller->{gstrate}+0.0 : 0,
415
    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 160-165 while ( my $data = $sth->fetchrow_hashref ) { Link Here
160
    );
167
    );
161
}
168
}
162
169
170
{
171
    for my $rd ( @reservedata ) {
172
        $rd->{biblionumber} || next;
173
        my $pcnt = CountPendingOrdersByBiblionumber( $rd->{biblionumber} );
174
        $pcnt || next;
175
        $rd->{pendingorders} = $pcnt;
176
    }
177
}
178
163
$template->param(
179
$template->param(
164
    ratio_atleast1  => $ratio_atleast1,
180
    ratio_atleast1  => $ratio_atleast1,
165
    todaysdate      => format_date($todaysdate),
181
    todaysdate      => format_date($todaysdate),
Lines 170-172 $template->param( Link Here
170
);
186
);
171
187
172
output_html_with_http_headers $input, $cookie, $template->output;
188
output_html_with_http_headers $input, $cookie, $template->output;
189
190
sub CountPendingOrdersByBiblionumber {
191
    my $biblionumber = shift;
192
    my @orders = GetOrdersByBiblionumber( $biblionumber );
193
    scalar(@orders) || return(0);
194
    my $cnt=0;  for my $order ( @orders ) {
195
        defined($order->{datecancellationprinted}) && $order->{datecancellationprinted} && next;
196
        my $onum = $order->{quantity} // 0;
197
        my $rnum = $order->{quantityreceived} // 0;
198
        $rnum >= $onum && next;
199
        $cnt+=$onum; $cnt-=$rnum;
200
    }
201
    $cnt;
202
}
(-)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 w/ 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 76-82 Link Here
76
            <td><p>[% reserveloo.location %]</p></td>
76
            <td><p>[% reserveloo.location %]</p></td>
77
            <td><p>[% reserveloo.itype %]</p></td>
77
            <td><p>[% reserveloo.itype %]</p></td>
78
            <td><p>[% reserveloo.listcall %]</p></td>
78
            <td><p>[% reserveloo.listcall %]</p></td>
79
            <td>[% IF ( reserveloo.thisratio_atleast1 ) %]<p><b>[% reserveloo.ratiocalc %] to order</b></p>[% END %]</td>
79
            <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 %]
80
            [% IF ( reserveloo.pendingorders ) %]<br><b>[% reserveloo.pendingorders %] pending</b>[% END %]</p>[% END %]</td>
80
        </tr>
81
        </tr>
81
      [% END %]
82
      [% END %]
82
      </tbody>
83
      </tbody>
Lines 108-113 Link Here
108
109
109
<fieldset class="action"><input type="submit" value="Go" class="submit"/></fieldset>
110
<fieldset class="action"><input type="submit" value="Go" class="submit"/></fieldset>
110
</fieldset>
111
</fieldset>
112
[% IF ( CAN_user_acquisition && basketno && booksellerid ) %]
113
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
114
<input type="hidden" name="basketno" value="[% basketno %]" />
115
[% END %]
111
</form>
116
</form>
112
117
113
</div>
118
</div>
114
- 

Return to bug 11665