Bugzilla – Attachment 18200 Details for
Bug 7560
SIP Self Checkout Ignoring Fines Thresholds for Not Being able to Check Out Books
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7560 - SIP Self Checkout Ignoring Fines Thresholds for Not Being able to Check Out Books - QA Followup 2
Bug-7560---SIP-Self-Checkout-Ignoring-Fines-Thresh.patch (text/plain), 8.88 KB, created by
Kyle M Hall (khall)
on 2013-05-17 13:15:14 UTC
(
hide
)
Description:
Bug 7560 - SIP Self Checkout Ignoring Fines Thresholds for Not Being able to Check Out Books - QA Followup 2
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-05-17 13:15:14 UTC
Size:
8.88 KB
patch
obsolete
>From aa1351da109fa3a11c05ef8262152fa8639a5987 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 11 Mar 2013 13:52:23 -0400 >Subject: [PATCH] Bug 7560 - SIP Self Checkout Ignoring Fines Thresholds for Not Being able to Check Out Books - QA Followup 2 > >--- > C4/Accounts.pm | 143 ++++++++++++++++--------------- > C4/ILSDI/Services.pm | 2 +- > circ/stats.pl | 2 +- > reports/stats.print.pl | 4 +- > reports/stats.screen.pl | 8 +- > t/db_dependent/lib/KohaTest/Accounts.pm | 6 +- > 6 files changed, 86 insertions(+), 79 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index c4b5046..34d7380 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -31,27 +31,28 @@ use Data::Dumper qw(Dumper); > use vars qw($VERSION @ISA @EXPORT); > > BEGIN { >- # set the version for version checking >+ >+ # set the version for version checking > $VERSION = 3.07.00.049; >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT = qw( >- &recordpayment >- &makepayment >- &manualinvoice >- &getnextacctno >- &reconcileaccount >- &getcharges >- &ModNote >- &getcredits >- &getrefunds >- &chargelostitem >- &ReversePayment >- &makepartialpayment >- &recordpayment_selectaccts >- &WriteOffFee >- &GetTotalFines >- ); >+ require Exporter; >+ @ISA = qw(Exporter); >+ @EXPORT = qw( >+ &recordpayment >+ &makepayment >+ &manualinvoice >+ &getnextacctno >+ &reconcileaccount >+ &GetCharges >+ &ModNote >+ &GetCredits >+ &GetRefunds >+ &chargelostitem >+ &ReversePayment >+ &makepartialpayment >+ &recordpayment_selectaccts >+ &WriteOffFee >+ &GetTotalFines >+ ); > } > > =head1 NAME >@@ -666,21 +667,24 @@ sub refund { > return ($amountleft); > } > >-sub getcharges { >- my ( $borrowerno, $timestamp, $accountno ) = @_; >- my $dbh = C4::Context->dbh; >- my $timestamp2 = $timestamp - 1; >- my $query = ""; >- my $sth = $dbh->prepare( >- "SELECT * FROM accountlines WHERE borrowernumber=? AND accountno = ?" >- ); >- $sth->execute( $borrowerno, $accountno ); >- >- my @results; >- while ( my $data = $sth->fetchrow_hashref ) { >- push @results,$data; >- } >- return (@results); >+sub GetCharges { >+ my ( $borrowerno, $timestamp, $accountno ) = @_; >+ >+ my $dbh = C4::Context->dbh; >+ >+ my $timestamp2 = $timestamp - 1; >+ >+ my $sth = $dbh->prepare(" >+ SELECT * >+ FROM accountlines >+ WHERE borrowernumber = ? >+ AND accountno = ? >+ "); >+ $sth->execute( $borrowerno, $accountno ); >+ >+ my $results = $sth->fetchall_arrayref({}); >+ >+ return @$results; > } > > sub ModNote { >@@ -690,45 +694,48 @@ sub ModNote { > $sth->execute( $note, $accountlines_id ); > } > >-sub getcredits { >- my ( $date, $date2 ) = @_; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare( >- "SELECT * FROM accountlines,borrowers >- WHERE amount < 0 AND accounttype <> 'Pay' AND accountlines.borrowernumber = borrowers.borrowernumber >- AND timestamp >=TIMESTAMP(?) AND timestamp < TIMESTAMP(?)" >- ); >- >- $sth->execute( $date, $date2 ); >- my @results; >- while ( my $data = $sth->fetchrow_hashref ) { >- $data->{'date'} = $data->{'timestamp'}; >- push @results,$data; >- } >- return (@results); >+sub GetCredits { >+ my ( $date, $date2 ) = @_; >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare(" >+ SELECT * >+ FROM accountlines, >+ borrowers >+ WHERE amount < 0 >+ AND accounttype <> 'Pay' >+ AND accountlines.borrowernumber = borrowers.borrowernumber >+ AND TIMESTAMP >= TIMESTAMP(?) >+ AND TIMESTAMP < TIMESTAMP(?) >+ "); >+ >+ $sth->execute( $date, $date2 ); >+ >+ my $results = $sth->fetchall_arrayref({}); >+ >+ return @$results; > } > > >-sub getrefunds { >- my ( $date, $date2 ) = @_; >- my $dbh = C4::Context->dbh; >- >- my $sth = $dbh->prepare( >- "SELECT *,timestamp AS datetime >- FROM accountlines,borrowers >- WHERE (accounttype = 'REF' >- AND accountlines.borrowernumber = borrowers.borrowernumber >- AND date >=? AND date <?)" >- ); >+sub GetRefunds { >+ my ( $date, $date2 ) = @_; >+ >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare(" >+ SELECT *, >+ TIMESTAMP AS datetime >+ FROM accountlines, >+ borrowers >+ WHERE accounttype = 'REF' >+ AND accountlines.borrowernumber = borrowers.borrowernumber >+ AND date >= ? >+ AND date < ? >+ "); > > $sth->execute( $date, $date2 ); > >- my @results; >- while ( my $data = $sth->fetchrow_hashref ) { >- push @results,$data; >- >- } >- return (@results); >+ my $results = $sth->fetchall_arrayref({}); >+ >+ return @$results; > } > > sub ReversePayment { >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 68cbdb3..c58eadf 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -392,7 +392,7 @@ sub GetPatronInfo { > # Fines management > if ( $cgi->param('show_fines') eq "1" ) { > my @charges; >- for ( my $i = 1 ; my @charge = getcharges( $borrowernumber, undef, $i ) ; $i++ ) { >+ for ( my $i = 1 ; my @charge = GetCharges( $borrowernumber, undef, $i ) ; $i++ ) { > push( @charges, @charge ); > } > $borrower->{'fines'}->{'fine'} = \@charges; >diff --git a/circ/stats.pl b/circ/stats.pl >index 558a985..889c1f4 100755 >--- a/circ/stats.pl >+++ b/circ/stats.pl >@@ -96,7 +96,7 @@ while ( $i < $count ) { > my @temp = split(/ /, $payments[$i]{'datetime'}); > my $date = $temp[0]; > my @charges = >- getcharges( $payments[$i]{'borrowernumber'}, $payments[$i]{'timestamp'} ); >+ GetCharges( $payments[$i]{'borrowernumber'}, $payments[$i]{'timestamp'} ); > my $count = @charges; > my $temptotalf = 0; > my $temptotalr = 0; >diff --git a/reports/stats.print.pl b/reports/stats.print.pl >index 066aafa..aced5f9 100755 >--- a/reports/stats.print.pl >+++ b/reports/stats.print.pl >@@ -86,7 +86,7 @@ while ($i<$count ){ > my @charges; > > if ($payments[$i]{'type'} ne 'writeoff'){ # lets ignore writeoff payments!. >- @charges=getcharges($payments[$i]{'borrowernumber'}, $payments[$i]{'timestamp'}, $payments[$i]{'proccode'}); >+ @charges=GetCharges($payments[$i]{'borrowernumber'}, $payments[$i]{'timestamp'}, $payments[$i]{'proccode'}); > $totalcharges++; > $count=@charges; > >@@ -124,7 +124,7 @@ while ($i<$count ){ > } > > #get credits and append to the bottom of payments >-my @credits=getcredits($date,$date2); >+my @credits=GetCredits($date,$date2); > > my $count=@credits; > my $i=0; >diff --git a/reports/stats.screen.pl b/reports/stats.screen.pl >index 16b8f8a..0978ac8 100755 >--- a/reports/stats.screen.pl >+++ b/reports/stats.screen.pl >@@ -77,7 +77,7 @@ foreach my $payment (@payments) { > my @charges; > if ( $payment->{'type'} ne 'writeoff' ) { > >- @charges = getcharges( >+ @charges = GetCharges( > $payment->{'borrowernumber'}, > $payment->{'timestamp'}, > $payment->{'proccode'} >@@ -124,7 +124,7 @@ foreach my $payment (@payments) { > } > > #get credits and append to the bottom of payments >-my @credits = getcredits( $date, $date2 ); >+my @credits = GetCredits( $date, $date2 ); > > my $count = @credits; > my $i = 0; >@@ -133,7 +133,7 @@ while ( $i < $count ) { > > my %rows2 = ( > creditbranch => $credits[$i]->{'branchcode'}, >- creditdate => $credits[$i]->{'date'}, >+ creditdate => $credits[$i]->{'timestamp'}, > creditsurname => $credits[$i]->{'surname'}, > creditfirstname => $credits[$i]->{'firstname'}, > creditdescription => $credits[$i]->{'description'}, >@@ -151,7 +151,7 @@ $totalcredits = substr( $totalcredits, 1 ); > > my $totalrefunds = 0; > my @loop3; >-my @refunds = getrefunds( $date, $date2 ); >+my @refunds = GetRefunds( $date, $date2 ); > $count = @refunds; > $i = 0; > >diff --git a/t/db_dependent/lib/KohaTest/Accounts.pm b/t/db_dependent/lib/KohaTest/Accounts.pm >index ac3a78e..766afe9 100644 >--- a/t/db_dependent/lib/KohaTest/Accounts.pm >+++ b/t/db_dependent/lib/KohaTest/Accounts.pm >@@ -18,9 +18,9 @@ sub methods : Test( 1 ) { > manualinvoice > fixcredit > refund >- getcharges >- getcredits >- getrefunds >+ GetCharges >+ GetCredits >+ GetRefunds > ); # removed fixaccounts (unused by codebase) > > can_ok( $self->testing_class, @methods ); >-- >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 7560
:
7772
|
11475
|
16044
|
16045
|
16047
|
16048
|
18194
|
18195
|
18196
|
18198
|
18199
|
18200
|
20004
|
20005
|
20006
|
42595
|
42596
|
42597
|
43587
|
43777
|
50398