Lines 38-49
my $builder = t::lib::TestBuilder->new;
Link Here
|
38 |
my $dbh = C4::Context->dbh; |
38 |
my $dbh = C4::Context->dbh; |
39 |
$dbh->do(q|DELETE FROM discharges|); |
39 |
$dbh->do(q|DELETE FROM discharges|); |
40 |
|
40 |
|
41 |
my $library = $builder->build({ |
41 |
my $library = $builder->build({ source => 'Branch' }); |
42 |
source => 'Branch', |
42 |
my $another_library = $builder->build({ source => 'Branch' }); |
43 |
}); |
43 |
my $itemtype = $builder->build({ source => 'Itemtype' })->{itemtype}; |
44 |
my $another_library = $builder->build({ |
|
|
45 |
source => 'Branch', |
46 |
}); |
47 |
|
44 |
|
48 |
C4::Context->_new_userenv('xxx'); |
45 |
C4::Context->_new_userenv('xxx'); |
49 |
C4::Context->set_userenv(0, 0, 0, 'firstname', 'surname', $library->{branchcode}, $library->{branchcode}, '', '', '', '', ''); |
46 |
C4::Context->set_userenv(0, 0, 0, 'firstname', 'surname', $library->{branchcode}, $library->{branchcode}, '', '', '', '', ''); |
Lines 69-75
my $patron3 = $builder->build({
Link Here
|
69 |
# Discharge not possible with issues |
66 |
# Discharge not possible with issues |
70 |
my ( $biblionumber ) = AddBiblio( MARC::Record->new, ''); |
67 |
my ( $biblionumber ) = AddBiblio( MARC::Record->new, ''); |
71 |
my $barcode = 'BARCODE42'; |
68 |
my $barcode = 'BARCODE42'; |
72 |
my ( undef, undef, $itemnumber ) = AddItem({ homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, barcode => $barcode }, $biblionumber); |
69 |
my ( undef, undef, $itemnumber ) = AddItem( |
|
|
70 |
{ homebranch => $library->{branchcode}, |
71 |
holdingbranch => $library->{branchcode}, |
72 |
barcode => $barcode, |
73 |
itype => $itemtype |
74 |
}, |
75 |
$biblionumber |
76 |
); |
77 |
|
73 |
AddIssue( $patron, $barcode ); |
78 |
AddIssue( $patron, $barcode ); |
74 |
is( Koha::Patron::Discharge::can_be_discharged({ borrowernumber => $patron->{borrowernumber} }), 0, 'A patron with issues cannot be discharged' ); |
79 |
is( Koha::Patron::Discharge::can_be_discharged({ borrowernumber => $patron->{borrowernumber} }), 0, 'A patron with issues cannot be discharged' ); |
75 |
|
80 |
|
76 |
- |
|
|