Lines 31-36
use C4::Debug;
Link Here
|
31 |
use C4::Biblio qw/GetMarcBiblio GetRecordValue GetFrameworkCode/; |
31 |
use C4::Biblio qw/GetMarcBiblio GetRecordValue GetFrameworkCode/; |
32 |
use C4::Acquisition qw/GetOrdersByBiblionumber/; |
32 |
use C4::Acquisition qw/GetOrdersByBiblionumber/; |
33 |
use Koha::DateUtils; |
33 |
use Koha::DateUtils; |
|
|
34 |
use Koha::Acquisition::Baskets; |
34 |
|
35 |
|
35 |
my $input = new CGI; |
36 |
my $input = new CGI; |
36 |
my $startdate = $input->param('from'); |
37 |
my $startdate = $input->param('from'); |
Lines 55-60
if ($booksellerid && $basketno) {
Link Here
|
55 |
$template->param( booksellerid => $booksellerid, basketno => $basketno ); |
56 |
$template->param( booksellerid => $booksellerid, basketno => $basketno ); |
56 |
} |
57 |
} |
57 |
|
58 |
|
|
|
59 |
my $effective_create_items; |
60 |
if ( $basketno ){ |
61 |
my $basket = Koha::Acquisition::Baskets->find( $basketno ); |
62 |
if ($basket){ |
63 |
$effective_create_items = $basket->effective_create_items; |
64 |
} else { |
65 |
$effective_create_items = C4::Context->preference('AcqCreateItem'); |
66 |
} |
67 |
} |
68 |
|
58 |
$startdate = eval { dt_from_string( $startdate ) } if $startdate; |
69 |
$startdate = eval { dt_from_string( $startdate ) } if $startdate; |
59 |
$enddate = eval { dt_from_string( $enddate ) } if $enddate; |
70 |
$enddate = eval { dt_from_string( $enddate ) } if $enddate; |
60 |
|
71 |
|
Lines 84-95
$sqldatewhere .= " AND reservedate <= ?";
Link Here
|
84 |
push @query_params, output_pref({ dt => $enddate, dateformat => 'iso' }); |
95 |
push @query_params, output_pref({ dt => $enddate, dateformat => 'iso' }); |
85 |
|
96 |
|
86 |
my $include_aqorders_qty = |
97 |
my $include_aqorders_qty = |
87 |
C4::Context->preference('AcqCreateItem') eq 'receiving' |
98 |
$effective_create_items eq 'receiving' |
88 |
? '+ COALESCE(aqorders.quantity, 0) - COALESCE(aqorders.quantityreceived, 0)' |
99 |
? '+ COALESCE(aqorders.quantity, 0) - COALESCE(aqorders.quantityreceived, 0)' |
89 |
: q{}; |
100 |
: q{}; |
90 |
|
101 |
|
91 |
my $include_aqorders_qty_join = |
102 |
my $include_aqorders_qty_join = |
92 |
C4::Context->preference('AcqCreateItem') eq 'receiving' |
103 |
$effective_create_items eq 'receiving' |
93 |
? 'LEFT JOIN aqorders ON reserves.biblionumber=aqorders.biblionumber' |
104 |
? 'LEFT JOIN aqorders ON reserves.biblionumber=aqorders.biblionumber' |
94 |
: q{}; |
105 |
: q{}; |
95 |
|
106 |
|