Bugzilla – Attachment 42477 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]
Add function purge_zero_balance_fees to C4/Accounts.pm
Add-function-purgezerobalancefees-to-C4Accountspm.patch (text/plain), 1.61 KB, created by
Barton Chittenden
on 2015-09-10 22:54:21 UTC
(
hide
)
Description:
Add function purge_zero_balance_fees to C4/Accounts.pm
Filename:
MIME Type:
Creator:
Barton Chittenden
Created:
2015-09-10 22:54:21 UTC
Size:
1.61 KB
patch
obsolete
>From 4c2a9c7ea911811dc477754e8b953c48f0927dc0 Mon Sep 17 00:00:00 2001 >From: Barton Chittenden <barton@bywatersolutions.com> >Date: Sat, 18 Jul 2015 11:41:38 -0700 >Subject: [PATCH] Add function purge_zero_balance_fees to C4/Accounts.pm > >http://bugs.koha-community.org/show_bug.cgi?id=14402 > >Signed-off-by: Nancy Keener <nkeener@washoecounty.us> >--- > C4/Accounts.pm | 32 +++++++++++++++++++++++++++++--- > 1 file changed, 29 insertions(+), 3 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index 9ca87e3..4b67dce 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -46,9 +46,10 @@ BEGIN { > &getrefunds > &chargelostitem > &ReversePayment >- &makepartialpayment >- &recordpayment_selectaccts >- &WriteOffFee >+ &makepartialpayment >+ &recordpayment_selectaccts >+ &WriteOffFee >+ &purge_zero_balance_fees > ); > } > >@@ -824,6 +825,31 @@ sub WriteOffFee { > > } > >+=head2 purge_zero_balance_fees >+ >+ purge_zero_balance_fees( $days ); >+ >+Delete accountlines entries where amountoutstanding is 0 which are more than a given number of days old. >+ >+B<$days> -- Zero balance fees older than B<$days> days old will be deleted. >+ >+=cut >+ >+sub purge_zero_balance_fees { >+ my $days = shift; >+ my $count = 0; >+ >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare( >+ q{ >+ DELETE FROM accountlines >+ WHERE date < date_sub(curdate(), INTERVAL ? DAY) >+ AND amountoutstanding = 0; >+ } >+ ); >+ $sth->execute($days) or die $dbh->errstr; >+} >+ > END { } # module clean-up code here (global destructor) > > 1; >-- >1.7.10.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 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