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 204-219
is ($countissue,1,"1 issues have been added");
Link Here
|
204 |
$query = " SELECT count(*) FROM accountlines"; |
204 |
$query = " SELECT count(*) FROM accountlines"; |
205 |
$sth = $dbh->prepare($query); |
205 |
$sth = $dbh->prepare($query); |
206 |
$sth->execute; |
206 |
$sth->execute; |
207 |
my $countaccount = $sth -> fetchrow_array; |
207 |
my $countaccount = $sth->fetchrow_array; |
208 |
is ($countaccount,0,"0 accountline exists"); |
208 |
is ($countaccount,0,"0 accountline exists"); |
209 |
my $checkout = Koha::Checkouts->find( $issue_id1 ); |
209 |
my $checkout = Koha::Checkouts->find( $issue_id1 ); |
210 |
my $offset = C4::Circulation::AddIssuingCharge( $checkout, 10 ); |
210 |
my $charge = C4::Circulation::AddIssuingCharge( $checkout, 10 ); |
211 |
is( ref( $offset ), 'Koha::Account::Offset', "An issuing charge has been added" ); |
211 |
is( ref( $charge ), 'Koha::Account::Line', "An issuing charge has been added" ); |
212 |
my $charge = Koha::Account::Lines->find( $offset->debit_id ); |
|
|
213 |
is( $charge->issue_id, $issue_id1, 'Issue id is set correctly for issuing charge' ); |
212 |
is( $charge->issue_id, $issue_id1, 'Issue id is set correctly for issuing charge' ); |
214 |
my $account_id = $dbh->last_insert_id( undef, undef, 'accountlines', undef ); |
213 |
my $offset = Koha::Account::Offsets->find( { debit_id => $charge->id } ); |
|
|
214 |
is( $offset->credit_id, undef, 'Offset was created'); |
215 |
$sth->execute; |
215 |
$sth->execute; |
216 |
$countaccount = $sth -> fetchrow_array; |
216 |
$countaccount = $sth->fetchrow_array; |
217 |
is ($countaccount,1,"1 accountline has been added"); |
217 |
is ($countaccount,1,"1 accountline has been added"); |
218 |
|
218 |
|
219 |
# Test AddRenewal |
219 |
# Test AddRenewal |
220 |
- |
|
|