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

(-)a/C4/Accounts.pm (-6 / +14 lines)
Lines 467-478 sub manualinvoice { Link Here
467
467
468
sub getcharges {
468
sub getcharges {
469
	my ( $borrowerno, $accountno ) = @_;
469
	my ( $borrowerno, $accountno ) = @_;
470
	my $dbh        = C4::Context->dbh;
470
	my $dbh = C4::Context->dbh;
471
	my $query      = "";
471
472
	my $sth = $dbh->prepare(
472
    my @params;
473
			"SELECT * FROM accountlines WHERE borrowernumber=? AND accountno = ?"
473
474
          );
474
	my $query = "SELECT * FROM accountlines WHERE borrowernumber = ?";
475
	$sth->execute( $borrowerno, $accountno );
475
    push( @params, $borrowerno );
476
477
    if ( $accountno ) {
478
        $query .= " AND accountno = ?";
479
        push( @params, $accountno );
480
    }
481
482
	my $sth = $dbh->prepare( $query );
483
	$sth->execute( @params );
476
	
484
	
477
    my @results;
485
    my @results;
478
    while ( my $data = $sth->fetchrow_hashref ) {
486
    while ( my $data = $sth->fetchrow_hashref ) {
(-)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