Bugzilla – Attachment 42556 Details for
Bug 14402
Add --fees option to cleanup_database.pl to purge all 0 balance fees and payments older than the given number of days
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14402 - QA Followup
Bug-14402---QA-Followup.patch (text/plain), 4.45 KB, created by
Kyle M Hall (khall)
on 2015-09-15 12:46:35 UTC
(
hide
)
Description:
Bug 14402 - QA Followup
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-09-15 12:46:35 UTC
Size:
4.45 KB
patch
obsolete
>From 46b759bdadfd9bfe74b10d31625e9974ea45da3a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 15 Sep 2015 08:28:45 -0400 >Subject: [PATCH] Bug 14402 - QA Followup > >--- > misc/cronjobs/cleanup_database.pl | 39 ++++++++++++++++-------------------- > t/db_dependent/Accounts.t | 13 ++++++----- > 2 files changed, 24 insertions(+), 28 deletions(-) > >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index 3ef4231..0fec402 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -81,28 +81,23 @@ USAGE > exit $_[0]; > } > >-my ( >- $help, >- $sessions, >- $sess_days, >- $verbose, >- $zebraqueue_days, >- $mail, >- $purge_merged, >- $pImport, >- $pLogs, >- $pSearchhistory, >- $pZ3950, >- $pListShareInvites, >- $pDebarments, >- $allDebarments, >- $pExpSelfReg, >- $pUnvSelfReg, >- $fees_days >- $help, $sessions, $sess_days, $verbose, $zebraqueue_days, >- $mail, $purge_merged, $pImport, $pLogs, $pSearchhistory, >- $pZ3950, $pListShareInvites, $pDebarments, $allDebarments, >-); >+my $help; >+my $sessions; >+my $sess_days; >+my $verbose; >+my $zebraqueue_days; >+my $mail; >+my $purge_merged; >+my $pImport; >+my $pLogs; >+my $pSearchhistory; >+my $pZ3950; >+my $pListShareInvites; >+my $pDebarments; >+my $allDebarments; >+my $pExpSelfReg; >+my $pUnvSelfReg; >+my $fees_days; > > GetOptions( > 'h|help' => \$help, >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index 531500b..763796f 100644 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -59,7 +59,6 @@ $dbh->do(q|DELETE FROM issues|); > $dbh->do(q|DELETE FROM borrowers|); > > my $branchcode = 'CPL'; >-my $borrower_number; > > my $context = new Test::MockModule('C4::Context'); > $context->mock( 'userenv', sub { >@@ -77,7 +76,7 @@ $context->mock( 'userenv', sub { > # 1 => yesterday > # etc. > >-$sth = $dbh->prepare( >+my $sth = $dbh->prepare( > "INSERT INTO accountlines ( > borrowernumber, > amountoutstanding, >@@ -95,15 +94,17 @@ my @test_data = ( > { amount => 0 , days_ago => $days , description =>'purge_zero_balance_fees should not delete 0 balance fees with date on threshold day' , delete => 0 } , > { amount => 0 , days_ago => $days + 1 , description =>'purge_zero_balance_fees should delete 0 balance fees with date after threshold day' , delete => 1 } , > { amount => undef , days_ago => $days + 1 , description =>'purge_zero_balance_fees should delete NULL balance fees with date after threshold day' , delete => 1 } , >- { amount => 5 , days_ago => $days - 1 , description =>'purge_zero_balance_fees should not delete fees with postive amout owed before threshold day' , delete => 0 } , >- { amount => 5 , days_ago => $days , description =>'purge_zero_balance_fees should not delete fees with postive amout owed on threshold day' , delete => 0 } , >- { amount => 5 , days_ago => $days + 1 , description =>'purge_zero_balance_fees should not delete fees with postive amout owed after threshold day' , delete => 0 } , >+ { amount => 5 , days_ago => $days - 1 , description =>'purge_zero_balance_fees should not delete fees with positive amout owed before threshold day' , delete => 0 } , >+ { amount => 5 , days_ago => $days , description =>'purge_zero_balance_fees should not delete fees with positive amout owed on threshold day' , delete => 0 } , >+ { amount => 5 , days_ago => $days + 1 , description =>'purge_zero_balance_fees should not delete fees with positive amout owed after threshold day' , delete => 0 } , > { amount => -5 , days_ago => $days - 1 , description =>'purge_zero_balance_fees should not delete fees with negative amout owed before threshold day' , delete => 0 } , > { amount => -5 , days_ago => $days , description =>'purge_zero_balance_fees should not delete fees with negative amout owed on threshold day' , delete => 0 } , > { amount => -5 , days_ago => $days + 1 , description =>'purge_zero_balance_fees should not delete fees with negative amout owed after threshold day' , delete => 0 } > ); > >-for my $data ( @test_data ) { >+my $borrower = Koha::Borrower->new( { firstname => 'Test', surname => 'Patron', categorycode => 'PT', branchcode => 'MPL' } )->store(); >+ >+for my $data ( @test_data ) { > $sth->execute($borrower->borrowernumber, $data->{amount}, $data->{days_ago}, $data->{description}); > } > >-- >1.7.2.5
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 14402
:
41043
|
41086
|
41087
|
41088
|
42242
|
42243
|
42244
|
42245
|
42246
|
42477
|
42478
|
42479
|
42480
|
42556
|
42557
|
42815
|
42816
|
42817
|
42818
|
42819
|
42820
|
42993
|
42994
|
42995
|
42996
|
42997
|
44664