Lines 184-192
sub printbasketgrouppdf{
Link Here
|
184 |
my ($basketgroupid) = @_; |
184 |
my ($basketgroupid) = @_; |
185 |
|
185 |
|
186 |
my $pdfformat = C4::Context->preference("OrderPdfFormat"); |
186 |
my $pdfformat = C4::Context->preference("OrderPdfFormat"); |
187 |
eval "use $pdfformat"; |
187 |
if ($pdfformat eq 'pdfformat::layout3pages' || $pdfformat eq 'pdfformat::layout2pages'){ |
188 |
# FIXME consider what would happen if $pdfformat does not |
188 |
eval { |
189 |
# contain the name of a valid Perl module. |
189 |
require $pdfformat; |
|
|
190 |
import $pdfformat; |
191 |
}; |
192 |
if ($@){ |
193 |
} |
194 |
} |
195 |
else { |
196 |
print $input->header; |
197 |
print $input->start_html; # FIXME Should do a nicer page |
198 |
print "<h1>Invalid PDF Format set</h1>"; |
199 |
print "Please go to the systempreferences and set a valid pdfformat"; |
200 |
exit; |
201 |
} |
190 |
|
202 |
|
191 |
my $basketgroup = GetBasketgroup($basketgroupid); |
203 |
my $basketgroup = GetBasketgroup($basketgroupid); |
192 |
my $bookseller = GetBookSellerFromId($basketgroup->{'booksellerid'}); |
204 |
my $bookseller = GetBookSellerFromId($basketgroup->{'booksellerid'}); |
Lines 202-209
sub printbasketgrouppdf{
Link Here
|
202 |
#isbn, itemtype, author, title, publishercode, quantity, listprice ecost discount gstrate |
214 |
#isbn, itemtype, author, title, publishercode, quantity, listprice ecost discount gstrate |
203 |
my @ba_order; |
215 |
my @ba_order; |
204 |
if ( $ord->{biblionumber} && $ord->{quantity}> 0 ) { |
216 |
if ( $ord->{biblionumber} && $ord->{quantity}> 0 ) { |
205 |
eval "use C4::Biblio"; |
217 |
eval { |
206 |
eval "use C4::Koha"; |
218 |
require C4::Biblio; |
|
|
219 |
import C4::Biblio; |
220 |
}; |
221 |
if ($@){ |
222 |
croak $@; |
223 |
} |
224 |
eval { |
225 |
require C4::Koha; |
226 |
import C4::Koha; |
227 |
}; |
228 |
if ($@){ |
229 |
croak $@; |
230 |
} |
207 |
my $bib = GetBiblioData($ord->{biblionumber}); |
231 |
my $bib = GetBiblioData($ord->{biblionumber}); |
208 |
my $itemtypes = GetItemTypes(); |
232 |
my $itemtypes = GetItemTypes(); |
209 |
if($ord->{isbn}){ |
233 |
if($ord->{isbn}){ |
Lines 246-251
sub printbasketgrouppdf{
Link Here
|
246 |
); |
270 |
); |
247 |
my $pdf = printpdf($basketgroup, $bookseller, $baskets, \%orders, $bookseller->{gstrate} // C4::Context->preference("gist")) || die "pdf generation failed"; |
271 |
my $pdf = printpdf($basketgroup, $bookseller, $baskets, \%orders, $bookseller->{gstrate} // C4::Context->preference("gist")) || die "pdf generation failed"; |
248 |
print $pdf; |
272 |
print $pdf; |
|
|
273 |
|
249 |
} |
274 |
} |
250 |
|
275 |
|
251 |
my $op = $input->param('op'); |
276 |
my $op = $input->param('op'); |
252 |
- |
|
|