Lines 61-67
The biblionumber of this order.
Link Here
|
61 |
=cut |
61 |
=cut |
62 |
|
62 |
|
63 |
use strict; |
63 |
use strict; |
64 |
#use warnings; FIXME - Bug 2505 |
64 |
use warnings; |
|
|
65 |
|
65 |
use CGI; |
66 |
use CGI; |
66 |
use C4::Context; |
67 |
use C4::Context; |
67 |
use C4::Koha; # GetKohaAuthorisedValues GetItemTypes |
68 |
use C4::Koha; # GetKohaAuthorisedValues GetItemTypes |
Lines 81-88
use C4::Suggestions;
Link Here
|
81 |
my $input = new CGI; |
82 |
my $input = new CGI; |
82 |
|
83 |
|
83 |
my $dbh = C4::Context->dbh; |
84 |
my $dbh = C4::Context->dbh; |
84 |
my $booksellerid = $input->param('booksellerid'); |
85 |
my $booksellerid = $input->param('booksellerid'); |
85 |
my $ordernumber = $input->param('ordernumber'); |
86 |
my $ordernumber = $input->param('ordernumber'); |
86 |
my $search = $input->param('receive'); |
87 |
my $search = $input->param('receive'); |
87 |
my $invoice = $input->param('invoice'); |
88 |
my $invoice = $input->param('invoice'); |
88 |
my $freight = $input->param('freight'); |
89 |
my $freight = $input->param('freight'); |
Lines 96-108
my $input_gst = ($input->param('gst') eq '' ? undef : $input->param('gst'));
Link Here
|
96 |
my $gst= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0; |
97 |
my $gst= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0; |
97 |
my $results = SearchOrder($ordernumber,$search); |
98 |
my $results = SearchOrder($ordernumber,$search); |
98 |
|
99 |
|
99 |
|
|
|
100 |
my $count = scalar @$results; |
101 |
my $order = GetOrder($ordernumber); |
102 |
|
103 |
|
104 |
my $date = @$results[0]->{'entrydate'}; |
105 |
|
106 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
100 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
107 |
{ |
101 |
{ |
108 |
template_name => "acqui/orderreceive.tmpl", |
102 |
template_name => "acqui/orderreceive.tmpl", |
Lines 114-121
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
114 |
} |
108 |
} |
115 |
); |
109 |
); |
116 |
|
110 |
|
|
|
111 |
my $count = scalar @$results; |
117 |
# prepare the form for receiving |
112 |
# prepare the form for receiving |
118 |
if ( $count == 1 ) { |
113 |
if ( $count == 1 ) { |
|
|
114 |
my $order = $results->[0]; |
119 |
if (C4::Context->preference('AcqCreateItem') eq 'receiving') { |
115 |
if (C4::Context->preference('AcqCreateItem') eq 'receiving') { |
120 |
# Check if ACQ framework exists |
116 |
# Check if ACQ framework exists |
121 |
my $marc = GetMarcStructure(1, 'ACQ'); |
117 |
my $marc = GetMarcStructure(1, 'ACQ'); |
Lines 128-169
if ( $count == 1 ) {
Link Here
|
128 |
); |
124 |
); |
129 |
} |
125 |
} |
130 |
|
126 |
|
131 |
if ( @$results[0]->{'quantityreceived'} == 0 ) { |
127 |
if ( $order->{'unitprice'} == 0 ) { |
132 |
@$results[0]->{'quantityreceived'} = ''; |
128 |
$order->{'unitprice'} = ''; |
133 |
} |
|
|
134 |
if ( @$results[0]->{'unitprice'} == 0 ) { |
135 |
@$results[0]->{'unitprice'} = ''; |
136 |
} |
129 |
} |
137 |
|
130 |
|
138 |
my $suggestion = GetSuggestionInfoFromBiblionumber(@$results[0]->{'biblionumber'}); |
131 |
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{'biblionumber'}); |
139 |
|
132 |
|
140 |
my $authorisedby = @$results[0]->{'authorisedby'}; |
133 |
my $authorisedby = $order->{'authorisedby'}; |
141 |
my $member = GetMember( borrowernumber => $authorisedby ); |
134 |
my $member = GetMember( borrowernumber => $authorisedby ); |
142 |
|
135 |
|
143 |
my $budget = GetBudget( @$results[0]->{'budget_id'} ); |
136 |
my $budget = GetBudget( $order->{'budget_id'} ); |
144 |
|
137 |
|
145 |
$template->param( |
138 |
$template->param( |
146 |
count => 1, |
139 |
count => 1, |
147 |
biblionumber => @$results[0]->{'biblionumber'}, |
140 |
biblionumber => $order->{'biblionumber'}, |
148 |
ordernumber => @$results[0]->{'ordernumber'}, |
141 |
ordernumber => $order->{'ordernumber'}, |
149 |
biblioitemnumber => @$results[0]->{'biblioitemnumber'}, |
142 |
biblioitemnumber => $order->{'biblioitemnumber'}, |
150 |
booksellerid => @$results[0]->{'booksellerid'}, |
143 |
booksellerid => $order->{'booksellerid'}, |
151 |
freight => $freight, |
144 |
freight => $freight, |
152 |
gst => $gst, |
145 |
gst => $gst, |
153 |
name => $bookseller->{'name'}, |
146 |
name => $bookseller->{'name'}, |
154 |
date => format_date($date), |
147 |
date => format_date($order->{entrydate}), |
155 |
title => @$results[0]->{'title'}, |
148 |
title => $order->{'title'}, |
156 |
author => @$results[0]->{'author'}, |
149 |
author => $order->{'author'}, |
157 |
copyrightdate => @$results[0]->{'copyrightdate'}, |
150 |
copyrightdate => $order->{'copyrightdate'}, |
158 |
isbn => @$results[0]->{'isbn'}, |
151 |
isbn => $order->{'isbn'}, |
159 |
seriestitle => @$results[0]->{'seriestitle'}, |
152 |
seriestitle => $order->{'seriestitle'}, |
160 |
bookfund => $budget->{budget_name}, |
153 |
bookfund => $budget->{budget_name}, |
161 |
quantity => @$results[0]->{'quantity'}, |
154 |
quantity => $order->{'quantity'}, |
162 |
quantityreceivedplus1 => @$results[0]->{'quantityreceived'} + 1, |
155 |
quantityreceivedplus1 => $order->{'quantityreceived'} + 1, |
163 |
quantityreceived => @$results[0]->{'quantityreceived'}, |
156 |
quantityreceived => $order->{'quantityreceived'}, |
164 |
rrp => @$results[0]->{'rrp'}, |
157 |
rrp => $order->{'rrp'}, |
165 |
ecost => @$results[0]->{'ecost'}, |
158 |
ecost => $order->{'ecost'}, |
166 |
unitprice => @$results[0]->{'unitprice'}, |
159 |
unitprice => $order->{'unitprice'}, |
167 |
memberfirstname => $member->{firstname} || "", |
160 |
memberfirstname => $member->{firstname} || "", |
168 |
membersurname => $member->{surname} || "", |
161 |
membersurname => $member->{surname} || "", |
169 |
invoice => $invoice, |
162 |
invoice => $invoice, |
Lines 196-202
else {
Link Here
|
196 |
); |
189 |
); |
197 |
} |
190 |
} |
198 |
my $op = $input->param('op'); |
191 |
my $op = $input->param('op'); |
199 |
if ($op eq 'edit'){ |
192 |
if ($op and $op eq 'edit'){ |
200 |
$template->param(edit => 1); |
193 |
$template->param(edit => 1); |
201 |
} |
194 |
} |
202 |
output_html_with_http_headers $input, $cookie, $template->output; |
195 |
output_html_with_http_headers $input, $cookie, $template->output; |
203 |
- |
|
|