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

(-)a/t/db_dependent/Circulation/issue.t (-8 / +7 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 32;
20
use Test::More tests => 33;
21
use DateTime::Duration;
21
use DateTime::Duration;
22
22
23
use t::lib::Mocks;
23
use t::lib::Mocks;
Lines 191-206 is ($countissue,1,"1 issues have been added"); Link Here
191
$query = " SELECT count(*) FROM accountlines";
191
$query = " SELECT count(*) FROM accountlines";
192
$sth = $dbh->prepare($query);
192
$sth = $dbh->prepare($query);
193
$sth->execute;
193
$sth->execute;
194
my $countaccount = $sth -> fetchrow_array;
194
my $countaccount = $sth->fetchrow_array;
195
is ($countaccount,0,"0 accountline exists");
195
is ($countaccount,0,"0 accountline exists");
196
my $checkout = Koha::Checkouts->find( $issue_id1 );
196
my $checkout = Koha::Checkouts->find( $issue_id1 );
197
my $offset = C4::Circulation::AddIssuingCharge( $checkout, 10 );
197
my $charge = C4::Circulation::AddIssuingCharge( $checkout, 10 );
198
is( ref( $offset ), 'Koha::Account::Offset', "An issuing charge has been added" );
198
is( ref( $charge ), 'Koha::Account::Line', "An issuing charge has been added" );
199
my $charge = Koha::Account::Lines->find( $offset->debit_id );
200
is( $charge->issue_id, $issue_id1, 'Issue id is set correctly for issuing charge' );
199
is( $charge->issue_id, $issue_id1, 'Issue id is set correctly for issuing charge' );
201
my $account_id = $dbh->last_insert_id( undef, undef, 'accountlines', undef );
200
my $offset = Koha::Account::Offsets->find( { debit_id => $charge->id } );
201
is( $offset->credit_id, undef, 'Offset was created');
202
$sth->execute;
202
$sth->execute;
203
$countaccount = $sth -> fetchrow_array;
203
$countaccount = $sth->fetchrow_array;
204
is ($countaccount,1,"1 accountline has been added");
204
is ($countaccount,1,"1 accountline has been added");
205
205
206
# Test AddRenewal
206
# Test AddRenewal
207
- 

Return to bug 21720