View | Details | Raw Unified | Return to bug 14368
Collapse All | Expand All

(-)a/members/discharge.pl (-2 / +1 lines)
Lines 67-75 if ( $input->param('borrowernumber') ) { Link Here
67
67
68
    # Generating discharge if needed
68
    # Generating discharge if needed
69
    if ( $input->param('discharge') and $can_be_discharged ) {
69
    if ( $input->param('discharge') and $can_be_discharged ) {
70
        my $is_discharged = Koha::Borrower::Discharge::count({
70
        my $is_discharged = Koha::Borrower::Discharge::is_discharged({
71
            borrowernumber => $borrowernumber,
71
            borrowernumber => $borrowernumber,
72
            validated      => 1,
73
        });
72
        });
74
        unless ($is_discharged) {
73
        unless ($is_discharged) {
75
            Koha::Borrower::Discharge::discharge({
74
            Koha::Borrower::Discharge::discharge({
(-)a/t/db_dependent/Borrower_Discharge.t (-2 / +7 lines)
Lines 1-7 Link Here
1
#!/usr/bin/perl;
1
#!/usr/bin/perl;
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
use Test::More tests => 15;
4
use Test::More tests => 17;
5
use Test::Warn;
5
use Test::Warn;
6
use MARC::Record;
6
use MARC::Record;
7
7
Lines 73-78 Koha::Borrower::Debarments::DelUniqueDebarment( { 'borrowernumber' => $borrower- Link Here
73
ok( !Koha::Borrower::Debarments::IsDebarred( $borrower->{borrowernumber} ), 'The debarment has been lifted' );
73
ok( !Koha::Borrower::Debarments::IsDebarred( $borrower->{borrowernumber} ), 'The debarment has been lifted' );
74
ok( !Koha::Borrower::Discharge::is_discharged( { borrowernumber => $borrower->{borrowernumber} } ), 'The patron is not discharged after the restriction has been lifted' );
74
ok( !Koha::Borrower::Discharge::is_discharged( { borrowernumber => $borrower->{borrowernumber} } ), 'The patron is not discharged after the restriction has been lifted' );
75
75
76
# Verify that the discharge works multiple times
77
Koha::Borrower::Discharge::request({ borrowernumber => $borrower->{borrowernumber} });
78
is(scalar( @{ Koha::Borrower::Discharge::get_pendings() }), 1, 'There is a pending discharge request (second time)');
79
Koha::Borrower::Discharge::discharge( { borrowernumber => $borrower->{borrowernumber} } );
80
is_deeply( Koha::Borrower::Discharge::get_pendings(), [], 'There is no pending discharge request (second time)');
81
76
# Check if PDF::FromHTML is installed.
82
# Check if PDF::FromHTML is installed.
77
my $check = eval { require PDF::FromHTML; };
83
my $check = eval { require PDF::FromHTML; };
78
84
79
- 

Return to bug 14368