|
Lines 29-34
use C4::Context;
Link Here
|
| 29 |
use C4::Items; |
29 |
use C4::Items; |
| 30 |
use C4::Members; |
30 |
use C4::Members; |
| 31 |
use C4::Reserves; |
31 |
use C4::Reserves; |
|
|
32 |
use Koha::Checkouts; |
| 32 |
use Koha::Database; |
33 |
use Koha::Database; |
| 33 |
use Koha::DateUtils; |
34 |
use Koha::DateUtils; |
| 34 |
use Koha::Holds; |
35 |
use Koha::Holds; |
|
Lines 191-201
like(
Link Here
|
| 191 |
qr/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, |
192 |
qr/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, |
| 192 |
"Koha::Schema::Result::Issue->date_due() returns a date" |
193 |
"Koha::Schema::Result::Issue->date_due() returns a date" |
| 193 |
); |
194 |
); |
| 194 |
my $issue_id1 = $dbh->last_insert_id( undef, undef, 'issues', undef ); |
195 |
my $issue_id1 = $issue1->issue_id; |
| 195 |
|
196 |
|
| 196 |
my $issue2 = C4::Circulation::AddIssue( $borrower_1, 'nonexistent_barcode' ); |
197 |
my $issue2 = C4::Circulation::AddIssue( $borrower_1, 'nonexistent_barcode' ); |
| 197 |
is( $issue2, undef, "AddIssue returns undef if no datedue is specified" ); |
198 |
is( $issue2, undef, "AddIssue returns undef if no datedue is specified" ); |
| 198 |
my $issue_id2 = $dbh->last_insert_id( undef, undef, 'issues', undef ); |
|
|
| 199 |
|
199 |
|
| 200 |
$sth->execute; |
200 |
$sth->execute; |
| 201 |
$countissue = $sth -> fetchrow_array; |
201 |
$countissue = $sth -> fetchrow_array; |
|
Lines 207-213
$sth = $dbh->prepare($query);
Link Here
|
| 207 |
$sth->execute; |
207 |
$sth->execute; |
| 208 |
my $countaccount = $sth -> fetchrow_array; |
208 |
my $countaccount = $sth -> fetchrow_array; |
| 209 |
is ($countaccount,0,"0 accountline exists"); |
209 |
is ($countaccount,0,"0 accountline exists"); |
| 210 |
my $offset = C4::Circulation::AddIssuingCharge( $item_id1, $borrower_id1, $issue_id1, 10 ); |
210 |
my $checkout = Koha::Checkouts->find( $issue_id1 ); |
|
|
211 |
my $offset = C4::Circulation::AddIssuingCharge( $checkout, 10 ); |
| 211 |
is( ref( $offset ), 'Koha::Account::Offset', "An issuing charge has been added" ); |
212 |
is( ref( $offset ), 'Koha::Account::Offset', "An issuing charge has been added" ); |
| 212 |
my $charge = Koha::Account::Lines->find( $offset->debit_id ); |
213 |
my $charge = Koha::Account::Lines->find( $offset->debit_id ); |
| 213 |
is( $charge->issue_id, $issue_id1, 'Issue id is set correctly for issuing charge' ); |
214 |
is( $charge->issue_id, $issue_id1, 'Issue id is set correctly for issuing charge' ); |
| 214 |
- |
|
|