Bugzilla – Attachment 60007 Details for
Bug 17708
Renewal log seems empty
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Added a logaction function in Addrenewal in order to send renew logs
Added-a-logaction-function-in-Addrenewal-in-order-.patch (text/plain), 2.58 KB, created by
Baptiste Wojtkowski (bwoj)
on 2017-02-08 09:06:21 UTC
(
hide
)
Description:
Added a logaction function in Addrenewal in order to send renew logs
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2017-02-08 09:06:21 UTC
Size:
2.58 KB
patch
obsolete
>From ae67afcc5eaae641911c5168c025382afeb23e3a Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Wed, 8 Feb 2017 08:54:42 +0000 >Subject: [PATCH] Added a logaction function in Addrenewal in order to send > renew logs > >test plan >1 - Chose a Borrower and have him renewing an item >2 - Check the renew logs : they should be empty >3 - Apply patch >4 - Have the Borrower renewing a new item >5 - Check the renew logs : there should be your renew > >I called the function logaction, which is in charge of modifying the >logs, within the function which adds a new renewal at the list. > >https://bugs.koha-community.org/show_bug.cgi?id=17708 >--- > C4/Circulation.pm | 4 +++- > t/db_dependent/Circulation.t | 9 +++++++-- > 2 files changed, 10 insertions(+), 3 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 0230429..ed7925a 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2908,7 +2908,7 @@ sub AddRenewal { > DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' }); > } > >- # Log the renewal >+ # Add the renewal to stats > UpdateStats( > { > branch => C4::Context->userenv ? C4::Context->userenv->{branch} : $branch, >@@ -2921,6 +2921,8 @@ sub AddRenewal { > } > ); > >+ #Log the renewal >+ logaction("CIRCULATION", "RENEW", $itemnumber, ""); > return $datedue; > } > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index e3d4c8d..8e3137c 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -17,10 +17,10 @@ > > use Modern::Perl; > >-use Test::More tests => 91; >+use Test::More tests => 92; > > BEGIN { >- require_ok('C4::Circulation'); >+ use_ok('C4::Log') > } > > use DateTime; >@@ -473,7 +473,12 @@ C4::Context->dbh->do("DELETE FROM accountlines"); > due => Koha::DateUtils::output_pref($five_weeks_ago) > } > ); >+ my $date = output_pref( { dt => dt_from_string(), datenonly => 1, dateformat => 'iso' } ); >+ my $old_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEW"]) } ); > AddRenewal( $renewing_borrower->{borrowernumber}, $itemnumber7, $branch ); >+ my $new_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEW"]) } ); >+ is ($new_log_size -1, $old_log_size, 'renew log successfuly added'); >+ > $fine = $schema->resultset('Accountline')->single( { borrowernumber => $renewing_borrower->{borrowernumber}, itemnumber => $itemnumber7 } ); > is( $fine->accounttype, 'F', 'Fine on renewed item is closed out properly' ); > $fine->delete(); >-- >2.7.4
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 17708
:
57861
|
60007
|
60383
|
60454
|
60455
|
60458
|
60459
|
60460
|
60541
|
60641
|
61353
|
61368
|
61369
|
61417
|
61418
|
61419
|
61420