From 11d413a0750e65d07d016b15417f2de7b053e910 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Wed, 30 Sep 2015 15:57:19 +0200 Subject: [PATCH] Bug 14928: Remove C4::Dates from files acqui/pdfformat/layout*.pm This patch removes C4::Dates from: - acqui/pdfformat/layout2pages.pm - acqui/pdfformat/layout2pagesde.pm - acqui/pdfformat/layout3pages.pm - acqui/pdfformat/layout3pagesfr.pm To test: - Apply patch - Go to Home > Acquisitions > [Vendor] > Basket groups - Print a basket (order) - Verify that the current date is formatted respects syspref 'dateformat' - Do the same with syspref 'OrderPdfFormat' set to the four different choices Signed-off-by: Hector Castro Works as advertised. Date printed in PDF Ok Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- 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 9cfe79d68f..a06d1b8892 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 bb887e06b6..5df84d3df9 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 b1534b392a..9b9c47ffe1 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 d04bb93ec3..a3d509f281 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); -- 2.39.5