Bugzilla – Attachment 116011 Details for
Bug 27574
Don't use NOW() in Koha::Accounts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27574: Update \NOW() to dt_from_string for Accounts
Bug-27574-Update-NOW-to-dtfromstring-for-Accounts.patch (text/plain), 3.35 KB, created by
Martin Renvoize (ashimema)
on 2021-01-29 08:49:55 UTC
(
hide
)
Description:
Bug 27574: Update \NOW() to dt_from_string for Accounts
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-01-29 08:49:55 UTC
Size:
3.35 KB
patch
obsolete
>From 83bf0922cfb9e6224b15a1b5f810fbed341e4dc2 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 29 Jan 2021 08:47:37 +0000 >Subject: [PATCH] Bug 27574: Update \NOW() to dt_from_string for Accounts > >This patch replaces all instances of setting the date/timestamp fields >for accounts related tables from the SQL literal \'NOW()' to >Koha::DateUtils dt_from_string so we get properly localised dates. >--- > Koha/Account.pm | 4 ++-- > Koha/Account/Line.pm | 8 ++++---- > 2 files changed, 6 insertions(+), 6 deletions(-) > >diff --git a/Koha/Account.pm b/Koha/Account.pm >index b4838bcdf2..4a79adf9e7 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -413,7 +413,7 @@ sub add_credit { > $line = Koha::Account::Line->new( > { > borrowernumber => $self->{patron_id}, >- date => \'NOW()', >+ date => dt_from_string, > amount => $amount, > description => $description, > credit_type_code => $credit_type, >@@ -560,7 +560,7 @@ sub add_debit { > $line = Koha::Account::Line->new( > { > borrowernumber => $self->{patron_id}, >- date => \'NOW()', >+ date => dt_from_string, > amount => $amount, > description => $description, > debit_type_code => $debit_type, >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index 2cc81993ef..3d37317d13 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -341,7 +341,7 @@ sub cancel { > # A 'cancellation' is a 'credit' > $cancellation = Koha::Account::Line->new( > { >- date => \'NOW()', >+ date => dt_from_string, > amount => 0 - $self->amount, > credit_type_code => 'CANCELLATION', > status => 'ADDED', >@@ -465,7 +465,7 @@ sub reduce { > # A 'reduction' is a 'credit' > $reduction = Koha::Account::Line->new( > { >- date => \'NOW()', >+ date => dt_from_string, > amount => 0 - $params->{amount}, > credit_type_code => $params->{reduction_type}, > status => 'ADDED', >@@ -687,7 +687,7 @@ sub payout { > # A 'payout' is a 'debit' > $payout = Koha::Account::Line->new( > { >- date => \'NOW()', >+ date => dt_from_string, > amount => $amount, > debit_type_code => 'PAYOUT', > payment_type => $params->{payout_type}, >@@ -801,7 +801,7 @@ sub adjust { > # Update the account line > $self->set( > { >- date => \'NOW()', >+ date => dt_from_string, > amount => $amount, > amountoutstanding => $new_outstanding, > } >-- >2.20.1
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 27574
:
116011
|
116029