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

(-)a/acqui/pdfformat/layout3pages.pm (-16 / +17 lines)
Lines 28-33 use List::MoreUtils qw/uniq/; Link Here
28
use strict;
28
use strict;
29
use warnings;
29
use warnings;
30
use utf8;
30
use utf8;
31
use Text::Bidi qw(log2vis);
31
use Koha::Number::Price;
32
use Koha::Number::Price;
32
use Koha::DateUtils;
33
use Koha::DateUtils;
Lines 54-60 use PDF::Table; Link Here
54
sub printorders {
55
sub printorders {
55
    my ($pdf, $basketgroup, $baskets, $orders) = @_;
56
    my ($pdf, $basketgroup, $baskets, $orders) = @_;
56
57
57
    my $cur_format = C4::Context->preference("CurrencyFormat");
58
    my $cur_format = C4::Context->preference("CurrencyFormat");
58
    $pdf->mediabox($height/mm, $width/mm);
59
    $pdf->mediabox($height/mm, $width/mm);
Lines 69-75 sub printorders { Link Here
69
        $box->rectxy(($width - 10)/mm, ($height - 5)/mm, 10/mm, ($height - 25)/mm);
70
        $box->rectxy(($width - 10)/mm, ($height - 5)/mm, 10/mm, ($height - 25)/mm);
70
        $box->stroke;
71
        $box->stroke;
71
#         $box->restore();
72
#         $box->restore();
72
73
73
        # create a text
74
        # create a text
74
        my $text = $page->text;
75
        my $text = $page->text;
75
        # add basketgroup number
76
        # add basketgroup number
Lines 114-121 sub printorders { Link Here
114
                    ( $line->{publishercode} ? ' published by '. $line->{publishercode} : '') .
115
                    ( $line->{publishercode} ? ' published by '. $line->{publishercode} : '') .
115
                    ( $line->{copyrightdate} ? ' '. $line->{copyrightdate} : '');
116
                    ( $line->{copyrightdate} ? ' '. $line->{copyrightdate} : '');
116
            }
117
            }
118
            $titleinfo = log2vis($titleinfo);
117
            push( @$arrbasket,
119
            push( @$arrbasket,
118
                $titleinfo. ($line->{order_vendornote} ? "\n----------------\nNote for vendor : " . $line->{order_vendornote} : '' ),
120
            $titleinfo. ($line->{order_vendornote} ? "\n----------------\nNote for vendor : " . $line->{order_vendornote} : '' ),
119
                $line->{quantity},
121
                $line->{quantity},
120
                Koha::Number::Price->new( $line->{rrp_tax_excluded} )->format,
122
                Koha::Number::Price->new( $line->{rrp_tax_excluded} )->format,
121
                Koha::Number::Price->new( $line->{rrp_tax_included} )->format,
123
                Koha::Number::Price->new( $line->{rrp_tax_included} )->format,
Lines 138-144 sub printorders { Link Here
138
                                        padding => 5,
140
                                        padding => 5,
139
                                        padding_right => 5,
141
                                        padding_right => 5,
140
                                        background_color_odd  => "lightgray",
142
                                        background_color_odd  => "lightgray",
141
                                        font       => $pdf->corefont("Times", -encoding => "utf8"),
143
                                        font       => $pdf->ttfont('/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf', -encoding => "utf8"),
142
                                        font_size => 3/mm,
144
                                        font_size => 3/mm,
143
                                        header_props   =>    {
145
                                        header_props   =>    {
144
                                            font       => $pdf->corefont("Times", -encoding => "utf8"),
146
                                            font       => $pdf->corefont("Times", -encoding => "utf8"),
Lines 182-198 sub printorders { Link Here
182
sub printbaskets {
184
sub printbaskets {
183
    my ($pdf, $basketgroup, $hbaskets, $bookseller, $GSTrate, $orders) = @_;
185
    my ($pdf, $basketgroup, $hbaskets, $bookseller, $GSTrate, $orders) = @_;
184
186
185
    # get library name
187
    # get library name
186
    my $libraryname = C4::Context->preference("LibraryName");
188
    my $libraryname = C4::Context->preference("LibraryName");
187
189
188
    my $cur_format = C4::Context->preference("CurrencyFormat");
190
    my $cur_format = C4::Context->preference("CurrencyFormat");
189
    $pdf->mediabox($width/mm, $height/mm);
191
    $pdf->mediabox($width/mm, $height/mm);
190
    my $page = $pdf->openpage(2);
192
    my $page = $pdf->openpage(2);
191
    # create a text
193
    # create a text
192
    my $text = $page->text;
194
    my $text = $page->text;
193
195
194
    # add basketgroup number
196
    # add basketgroup number
195
    $text->font( $pdf->corefont("Times", -encoding => "utf8"), 6/mm );
197
    $text->font( $pdf->corefont("Times", -encoding => "utf8"), 6/mm );
196
    $text->translate(($width-40)/mm,  ($height-53)/mm);
198
    $text->translate(($width-40)/mm,  ($height-53)/mm);
Lines 318-327 sub printhead { Link Here
318
    # open 1st page (with the header)
320
    # open 1st page (with the header)
319
    my $page = $pdf->openpage(1);
321
    my $page = $pdf->openpage(1);
320
322
321
    # create a text
323
    # create a text
322
    my $text = $page->text;
324
    my $text = $page->text;
323
325
324
    # print the libraryname in the header
326
    # print the libraryname in the header
325
    $text->font( $pdf->corefont("Times", -encoding => "utf8"), 6/mm );
327
    $text->font( $pdf->corefont("Times", -encoding => "utf8"), 6/mm );
326
    $text->translate(30/mm,  ($height-28.5)/mm);
328
    $text->translate(30/mm,  ($height-28.5)/mm);
Lines 331-344 sub printhead { Link Here
331
    $text->font( $pdf->corefont("Times", -encoding => "utf8"), 8/mm );
333
    $text->font( $pdf->corefont("Times", -encoding => "utf8"), 8/mm );
332
    $text->translate(100/mm,  ($height-5-48)/mm);
334
    $text->translate(100/mm,  ($height-5-48)/mm);
333
    $text->text($basketgroup->{'id'});
335
    $text->text($basketgroup->{'id'});
334
336
335
    # print the date
337
    # print the date
336
    my $today = output_pref({ dt => dt_from_string, dateonly => 1 });
338
    my $today = output_pref({ dt => dt_from_string, dateonly => 1 });
337
    $text->translate(130/mm,  ($height-5-48)/mm);
339
    $text->translate(130/mm,  ($height-5-48)/mm);
338
    $text->text($today);
340
    $text->text($today);
339
341
340
    $text->font( $pdf->corefont("Times", -encoding => "utf8"), 4/mm );
342
    $text->font( $pdf->corefont("Times", -encoding => "utf8"), 4/mm );
341
343
342
    # print billing infos
344
    # print billing infos
343
    $text->translate(100/mm,  ($height-86)/mm);
345
    $text->translate(100/mm,  ($height-86)/mm);
344
    $text->text($libraryname);
346
    $text->text($libraryname);
Lines 358-368 sub printhead { Link Here
358
    $text->text(join(' ', $billing_library->branchzip, $billing_library->branchcity, $billing_library->branchcountry));
360
    $text->text(join(' ', $billing_library->branchzip, $billing_library->branchcity, $billing_library->branchcountry));
359
    $text->translate(100/mm,  ($height-147.5)/mm);
361
    $text->translate(100/mm,  ($height-147.5)/mm);
360
    $text->text($billing_library->branchemail);
362
    $text->text($billing_library->branchemail);
361
363
362
    # print subject
364
    # print subject
363
    $text->translate(100/mm,  ($height-145.5)/mm);
365
    $text->translate(100/mm,  ($height-145.5)/mm);
364
    $text->text($subject);
366
    $text->text($subject);
365
367
366
    # print bookseller infos
368
    # print bookseller infos
367
    $text->translate(100/mm,  ($height-180)/mm);
369
    $text->translate(100/mm,  ($height-180)/mm);
368
    $text->text($bookseller->{name});
370
    $text->text($bookseller->{name});
Lines 376-382 sub printhead { Link Here
376
    $text->text($bookseller->{address3});
378
    $text->text($bookseller->{address3});
377
    $text->translate(100/mm, ($height-205)/mm);
379
    $text->translate(100/mm, ($height-205)/mm);
378
    $text->text($bookseller->{accountnumber});
380
    $text->text($bookseller->{accountnumber});
379
381
380
    # print delivery infos
382
    # print delivery infos
381
    $text->font( $pdf->corefont("Times-Bold", -encoding => "utf8"), 4/mm );
383
    $text->font( $pdf->corefont("Times-Bold", -encoding => "utf8"), 4/mm );
382
    $text->translate(50/mm,  ($height-237)/mm);
384
    $text->translate(50/mm,  ($height-237)/mm);
383
-

Return to bug 12832