|
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 |
} |