Lines 32-37
use C4::Circulation;
Link Here
|
32 |
use Koha::Holds; |
32 |
use Koha::Holds; |
33 |
use Koha::Patron; |
33 |
use Koha::Patron; |
34 |
use Koha::Patrons; |
34 |
use Koha::Patrons; |
|
|
35 |
use Koha::Patron::Categories; |
35 |
use Koha::Database; |
36 |
use Koha::Database; |
36 |
use Koha::DateUtils; |
37 |
use Koha::DateUtils; |
37 |
use Koha::Virtualshelves; |
38 |
use Koha::Virtualshelves; |
Lines 375-388
subtest "delete" => sub {
Link Here
|
375 |
subtest 'add_enrolment_fee_if_needed' => sub { |
376 |
subtest 'add_enrolment_fee_if_needed' => sub { |
376 |
plan tests => 4; |
377 |
plan tests => 4; |
377 |
|
378 |
|
378 |
my $enrolmentfee_K = 5; |
379 |
my $enrolmentfees = { K => 5, J => 10, YA => 20 }; |
379 |
my $enrolmentfee_J = 10; |
380 |
foreach( keys %{$enrolmentfees} ) { |
380 |
my $enrolmentfee_YA = 20; |
381 |
( Koha::Patron::Categories->find( $_ ) // $builder->build_object({ class => 'Koha::Patron::Categories', value => { categorycode => $_ } }) )->enrolmentfee( $enrolmentfees->{$_} )->store; |
381 |
|
382 |
} |
382 |
my $dbh = C4::Context->dbh; |
383 |
my $enrolmentfee_K = $enrolmentfees->{K}; |
383 |
$dbh->do(q|UPDATE categories set enrolmentfee=? where categorycode=?|, undef, $enrolmentfee_K, 'K'); |
384 |
my $enrolmentfee_J = $enrolmentfees->{J}; |
384 |
$dbh->do(q|UPDATE categories set enrolmentfee=? where categorycode=?|, undef, $enrolmentfee_J, 'J'); |
385 |
my $enrolmentfee_YA = $enrolmentfees->{YA}; |
385 |
$dbh->do(q|UPDATE categories set enrolmentfee=? where categorycode=?|, undef, $enrolmentfee_YA, 'YA'); |
|
|
386 |
|
386 |
|
387 |
my %borrower_data = ( |
387 |
my %borrower_data = ( |
388 |
firstname => 'my firstname', |
388 |
firstname => 'my firstname', |
389 |
- |
|
|