Lines 182-188
subtest 'outstanding_credits() tests' => sub {
Link Here
|
182 |
|
182 |
|
183 |
subtest 'add_credit() tests' => sub { |
183 |
subtest 'add_credit() tests' => sub { |
184 |
|
184 |
|
185 |
plan tests => 21; |
185 |
plan tests => 22; |
186 |
|
186 |
|
187 |
$schema->storage->txn_begin; |
187 |
$schema->storage->txn_begin; |
188 |
|
188 |
|
Lines 294-299
subtest 'add_credit() tests' => sub {
Link Here
|
294 |
# Disable cash registers |
294 |
# Disable cash registers |
295 |
t::lib::Mocks::mock_preference( 'UseCashRegisters', 0 ); |
295 |
t::lib::Mocks::mock_preference( 'UseCashRegisters', 0 ); |
296 |
|
296 |
|
|
|
297 |
my $item = $builder->build_sample_item; |
298 |
|
299 |
my $checkout = Koha::Checkout->new( |
300 |
{ |
301 |
borrowernumber => $patron->id, |
302 |
itemnumber => $item->id, |
303 |
date_due => \'NOW()', |
304 |
branchcode => $patron->branchcode, |
305 |
issuedate => \'NOW()', |
306 |
} |
307 |
)->store(); |
308 |
|
309 |
my $line_4 = $account->add_credit( |
310 |
{ |
311 |
amount => 20, |
312 |
description => 'Manual credit applied', |
313 |
library_id => $patron->branchcode, |
314 |
user_id => $patron->id, |
315 |
type => 'FORGIVEN', |
316 |
interface => 'commandline', |
317 |
issue_id => $checkout->id |
318 |
} |
319 |
); |
320 |
|
321 |
is( $line_4->issue_id, $checkout->id, 'The issue ID matches the checkout ID' ); |
322 |
|
297 |
$schema->storage->txn_rollback; |
323 |
$schema->storage->txn_rollback; |
298 |
}; |
324 |
}; |
299 |
|
325 |
|
300 |
- |
|
|