View | Details | Raw Unified | Return to bug 12768
Collapse All | Expand All

(-)a/C4/Accounts.pm (-8 / +16 lines)
Lines 469-485 sub manualinvoice { Link Here
469
469
470
sub getcharges {
470
sub getcharges {
471
    my ( $borrowerno, $accountno ) = @_;
471
    my ( $borrowerno, $accountno ) = @_;
472
	my $dbh        = C4::Context->dbh;
472
    my $dbh = C4::Context->dbh;
473
	my $query      = "";
473
474
	my $sth = $dbh->prepare(
474
    my @params;
475
			"SELECT * FROM accountlines WHERE borrowernumber=? AND accountno = ?"
475
476
          );
476
    my $query = "SELECT * FROM accountlines WHERE borrowernumber = ?";
477
	$sth->execute( $borrowerno, $accountno );
477
    push( @params, $borrowerno );
478
479
    if ( $accountno ) {
480
        $query .= " AND accountno = ?";
481
        push( @params, $accountno );
482
    }
483
484
    my $sth = $dbh->prepare( $query );
485
    $sth->execute( @params );
478
	
486
	
479
    my @results;
487
    my @results;
480
    while ( my $data = $sth->fetchrow_hashref ) {
488
    while ( my $data = $sth->fetchrow_hashref ) {
481
		push @results,$data;
489
        push @results,$data;
482
	}
490
    }
483
    return (@results);
491
    return (@results);
484
}
492
}
485
493
(-)a/t/db_dependent/Circulation/Chargelostitem.t (-4 / +3 lines)
Lines 76-84 my $issues; Link Here
76
$issues = C4::Circulation::GetIssues({biblionumber => $biblionumber1});
76
$issues = C4::Circulation::GetIssues({biblionumber => $biblionumber1});
77
my $issue=$issues->[0];
77
my $issue=$issues->[0];
78
$issue->{'processfee'} = $processfee;
78
$issue->{'processfee'} = $processfee;
79
my $accountlineId = C4::Accounts::chargelostitem($issue, 'test');
79
C4::Accounts::chargelostitem($issue, 'test');
80
80
81
my @accountline = C4::Accounts::getcharges($borrowernumber, $accountlineId);
81
my @accountline = C4::Accounts::getcharges($borrowernumber);
82
82
83
is( scalar(@accountline), 1, 'accountline should have 1 row' );
83
is( scalar(@accountline), 1, 'accountline should have 1 row' );
84
is( int($accountline[0]->{amount}), $processfee, "The accountline amount should be precessfee value " );
84
is( int($accountline[0]->{amount}), $processfee, "The accountline amount should be precessfee value " );
Lines 86-89 is( $accountline[0]->{accounttype}, 'PF', "The accountline accounttype should be Link Here
86
is( $accountline[0]->{borrowernumber}, $borrowernumber, "The accountline borrowernumber should be the exemple borrownumber" );
86
is( $accountline[0]->{borrowernumber}, $borrowernumber, "The accountline borrowernumber should be the exemple borrownumber" );
87
my $itemnumber = C4::Items::GetItemnumberFromBarcode('0101');
87
my $itemnumber = C4::Items::GetItemnumberFromBarcode('0101');
88
is( $accountline[0]->{itemnumber}, $itemnumber, "The accountline itemnumber should the linked with barcode '0101'" );
88
is( $accountline[0]->{itemnumber}, $itemnumber, "The accountline itemnumber should the linked with barcode '0101'" );
89
is( $accountline[0]->{description}, 'test', "The accountline description should be 'test'" );
89
is( $accountline[0]->{description}, 'test ' . $issue->{itemnumber}, "The accountline description should be 'test'" );
90
- 

Return to bug 12768