Lines 18-24
Link Here
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
use utf8; |
19 |
use utf8; |
20 |
|
20 |
|
21 |
use Test::More tests => 45; |
21 |
use Test::More tests => 46; |
22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
23 |
|
23 |
|
24 |
use Data::Dumper; |
24 |
use Data::Dumper; |
Lines 3341-3346
subtest 'CanBookBeIssued & RentalFeesCheckoutConfirmation' => sub {
Link Here
|
3341 |
$itemtype->rentalcharge_daily('0')->store; |
3341 |
$itemtype->rentalcharge_daily('0')->store; |
3342 |
}; |
3342 |
}; |
3343 |
|
3343 |
|
|
|
3344 |
subtest "Test Backdating of Returns" => sub { |
3345 |
plan tests => 2; |
3346 |
|
3347 |
my $branch = $library2->{branchcode}; |
3348 |
my $biblio = $builder->build_sample_biblio(); |
3349 |
my $item = $builder->build_sample_item( |
3350 |
{ |
3351 |
biblionumber => $biblio->biblionumber, |
3352 |
library => $branch, |
3353 |
itype => $itemtype, |
3354 |
} |
3355 |
); |
3356 |
|
3357 |
my %a_borrower_data = ( |
3358 |
firstname => 'Kyle', |
3359 |
surname => 'Hall', |
3360 |
categorycode => $patron_category->{categorycode}, |
3361 |
branchcode => $branch, |
3362 |
); |
3363 |
my $borrowernumber = Koha::Patron->new(\%a_borrower_data)->store->borrowernumber; |
3364 |
my $borrower = Koha::Patrons->find( $borrowernumber )->unblessed; |
3365 |
|
3366 |
my $due_date = dt_from_string; |
3367 |
my $issue = AddIssue( $borrower, $item->barcode, $due_date ); |
3368 |
UpdateFine( |
3369 |
{ |
3370 |
issue_id => $issue->id(), |
3371 |
itemnumber => $item->itemnumber, |
3372 |
borrowernumber => $borrowernumber, |
3373 |
amount => .25, |
3374 |
amountoutstanding => .25, |
3375 |
type => q{} |
3376 |
} |
3377 |
); |
3378 |
|
3379 |
|
3380 |
my ( undef, $message ) = AddReturn( $item->barcode, $branch, undef, $due_date ); |
3381 |
|
3382 |
my $accountline = Koha::Account::Lines->find( { issue_id => $issue->id } ); |
3383 |
is( $accountline->amountoutstanding, '0.000000', 'Fee amount outstanding was reduced to 0' ); |
3384 |
is( $accountline->amount, '0.000000', 'Fee amount was reduced to 0' ); |
3385 |
}; |
3386 |
|
3344 |
$schema->storage->txn_rollback; |
3387 |
$schema->storage->txn_rollback; |
3345 |
C4::Context->clear_syspref_cache(); |
3388 |
C4::Context->clear_syspref_cache(); |
3346 |
$cache->clear_from_cache('single_holidays'); |
3389 |
$cache->clear_from_cache('single_holidays'); |
3347 |
- |
|
|