Bugzilla – Attachment 108325 Details for
Bug 19036
Number payment receipts / payment slips
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19036: (QA follow-up) Use Koha::DateUtils
Bug-19036-QA-follow-up-Use-KohaDateUtils.patch (text/plain), 2.13 KB, created by
Katrin Fischer
on 2020-08-15 12:44:38 UTC
(
hide
)
Description:
Bug 19036: (QA follow-up) Use Koha::DateUtils
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-08-15 12:44:38 UTC
Size:
2.13 KB
patch
obsolete
>From e1a6a5edf71255f505ba03475074a28700d98741 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 25 Jun 2020 10:16:45 +0100 >Subject: [PATCH] Bug 19036: (QA follow-up) Use Koha::DateUtils > >This patch replaced raw DateTime->now calls with dt_from_string from >Koha::DateUtils > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > Koha/Account/Line.pm | 5 +++-- > t/db_dependent/Koha/Account.t | 2 +- > 2 files changed, 4 insertions(+), 3 deletions(-) > >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index d4fbd6bd71..98d7ef3c15 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -27,6 +27,7 @@ use Koha::Account::CreditType; > use Koha::Account::DebitType; > use Koha::Account::Offsets; > use Koha::Database; >+use Koha::DateUtils; > use Koha::Exceptions::Account; > use Koha::Items; > >@@ -905,7 +906,7 @@ sub store { > $max //= 0; > $self->credit_number($max + 1); > } elsif ($AutoCreditNumber eq 'annual') { >- my $now = DateTime->now; >+ my $now = dt_from_string; > my $prefix = sprintf('%d-', $now->year); > my $max = $rs->search({ > -and => [ >@@ -920,7 +921,7 @@ sub store { > my $userenv = C4::Context->userenv; > if ($userenv) { > my $branch = $userenv->{branch}; >- my $now = DateTime->now; >+ my $now = dt_from_string; > my $prefix = sprintf('%s%d%02d', $branch, $now->year, $now->month); > my $pattern = $prefix; > $pattern =~ s/([\?%_])/\\$1/g; >diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t >index c6341c0cb2..4a8ef7c2cf 100755 >--- a/t/db_dependent/Koha/Account.t >+++ b/t/db_dependent/Koha/Account.t >@@ -1065,7 +1065,7 @@ subtest 'Koha::Account::pay() generates credit number' => sub { > my $context = Test::MockModule->new('C4::Context'); > $context->mock( 'userenv', { branch => $library->id } ); > >- my $now = DateTime->now; >+ my $now = dt_from_string; > my $year = $now->year; > my $month = $now->month; > my ($accountlines_id, $accountline); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19036
:
99301
|
99302
|
99303
|
99676
|
101549
|
101550
|
101896
|
101897
|
106278
|
106279
|
106280
|
106281
|
106767
|
107872
|
107875
|
107877
|
108323
|
108324
| 108325 |
108326
|
108327
|
108328
|
108329
|
108525
|
108587
|
108733