From 9dd8f6c477b82fb438efaf0dc55c09b7e4992d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Thu, 12 Mar 2015 16:14:40 +0100 Subject: [PATCH] Bug 13813 - Remove C4::Dates from PDF templates in acquisitions To test: Apply patch In Acquisitions, go to a vendor's "Basket grouping" Find a basket and print order Change PDF templates using syspref OrderPdfFormat and test for - English 2-page - English 3-page - French 3-page - German 2-page Amended following comment #58 /MV --- acqui/pdfformat/layout2pages.pm | 3 ++- acqui/pdfformat/layout2pagesde.pm | 3 ++- acqui/pdfformat/layout3pages.pm | 3 ++- acqui/pdfformat/layout3pagesfr.pm | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/acqui/pdfformat/layout2pages.pm b/acqui/pdfformat/layout2pages.pm index 15b9838..ccb0d45 100644 --- a/acqui/pdfformat/layout2pages.pm +++ b/acqui/pdfformat/layout2pages.pm @@ -31,6 +31,7 @@ use utf8; use C4::Branch qw(GetBranchDetail); use Koha::Number::Price; +use Koha::DateUtils; BEGIN { use Exporter (); @@ -170,7 +171,7 @@ sub printhead { $text->text($basketgroup->{'id'}); # print the date - my $today = C4::Dates->today(); + my $today = output_pref({ dt=>dt_from_string, dateonly=>1 }); $text->translate(130/mm, ($height-5-48)/mm); $text->text($today); diff --git a/acqui/pdfformat/layout2pagesde.pm b/acqui/pdfformat/layout2pagesde.pm index 6ac57b0..5e647e4 100644 --- a/acqui/pdfformat/layout2pagesde.pm +++ b/acqui/pdfformat/layout2pagesde.pm @@ -31,6 +31,7 @@ use utf8; use C4::Branch qw(GetBranchDetail); use Koha::Number::Price; +use Koha::DateUtils; BEGIN { use Exporter (); @@ -170,7 +171,7 @@ sub printhead { $text->text($basketgroup->{'id'}); # print the date - my $today = C4::Dates->today(); + my $today = output_pref({ dt=>dt_from_string, dateonly=>1 }); $text->translate(130/mm, ($height-5-48)/mm); $text->text($today); diff --git a/acqui/pdfformat/layout3pages.pm b/acqui/pdfformat/layout3pages.pm index a38f4d3..15de944 100644 --- a/acqui/pdfformat/layout3pages.pm +++ b/acqui/pdfformat/layout3pages.pm @@ -32,6 +32,7 @@ use utf8; use C4::Branch qw(GetBranchDetail GetBranchName); use Koha::Number::Price; +use Koha::DateUtils; BEGIN { use Exporter (); @@ -334,7 +335,7 @@ sub printhead { $text->text($basketgroup->{'id'}); # print the date - my $today = C4::Dates->today(); + my $today = output_pref({ dt=>dt_from_string, dateonly=>1 }); $text->translate(130/mm, ($height-5-48)/mm); $text->text($today); diff --git a/acqui/pdfformat/layout3pagesfr.pm b/acqui/pdfformat/layout3pagesfr.pm index bf5adb3..f5b113a 100644 --- a/acqui/pdfformat/layout3pagesfr.pm +++ b/acqui/pdfformat/layout3pagesfr.pm @@ -31,6 +31,7 @@ use utf8; use C4::Branch qw(GetBranchDetail GetBranchName); use Koha::Number::Price; +use Koha::DateUtils; BEGIN { use Exporter (); @@ -334,7 +335,7 @@ sub printhead { $text->text($basketgroup->{'id'}); # print the date - my $today = C4::Dates->today(); + my $today = output_pref({ dt=>dt_from_string, dateonly=>1 }); $text->translate(130/mm, ($height-5-48)/mm); $text->text($today); -- 1.7.10.4