Bug 20603: Remove ModNote, getcredits and getrefunds from C4::Accounts

Test plan:
0) Do not apply the patch
1) Run these 3 commands
    git grep ModNote
    git grep getcredits
    git grep getrefunds
all should return occurances only in C4/Accounts.pm - the sub definition
and in t/db_dependent/Accounts.t
2) Apply the patch
3) Run commands from 1) again, now there should be no occurence
4) prove t/db_dependent/Accounts.t
    should return green

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Josef Moravec 2018-04-18 10:25:19 +00:00 committed by Jonathan Druart
parent 3277ca88fd
commit 4de8790482
2 changed files with 0 additions and 54 deletions

View File

@ -41,9 +41,6 @@ BEGIN {
&manualinvoice
&getnextacctno
&getcharges
&ModNote
&getcredits
&getrefunds
&chargelostitem
&ReversePayment
&purge_zero_balance_fees
@ -332,54 +329,6 @@ sub getcharges {
return (@results);
}
sub ModNote {
my ( $accountlines_id, $note ) = @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare('UPDATE accountlines SET note = ? WHERE accountlines_id = ?');
$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 not like '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 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);
}
#FIXME: ReversePayment should be replaced with a Void Payment feature
sub ReversePayment {
my ($accountlines_id) = @_;

View File

@ -43,9 +43,6 @@ can_ok( 'C4::Accounts',
chargelostitem
manualinvoice
getcharges
ModNote
getcredits
getrefunds
ReversePayment
purge_zero_balance_fees )
);