Lines 66-73
my $can_be_discharged = Koha::Patron::Discharge::can_be_discharged({
Link Here
|
66 |
borrowernumber => $borrowernumber |
66 |
borrowernumber => $borrowernumber |
67 |
}); |
67 |
}); |
68 |
|
68 |
|
|
|
69 |
my $is_discharged = Koha::Patron::Discharge::is_discharged({borrowernumber => $loggedinuser}); |
70 |
|
71 |
my $pending = Koha::Patron::Discharge::count({ |
72 |
borrowernumber => $borrowernumber, |
73 |
pending => 1, |
74 |
}); |
75 |
|
76 |
$template->param( can_be_discharged => $can_be_discharged ); |
77 |
$template->param( is_discharged => $is_discharged ); |
78 |
$template->param( pending => $pending ); |
79 |
|
80 |
if ( ! $pending and $can_be_discharged and $input->param('request') ) { |
81 |
my $success = Koha::Patron::Discharge::request({ |
82 |
borrowernumber => $borrowernumber, |
83 |
}); |
84 |
if ( $success ) { |
85 |
$template->param( pending => 1 ); |
86 |
} |
87 |
} |
88 |
|
69 |
# Generating discharge if needed |
89 |
# Generating discharge if needed |
70 |
if ( $input->param('discharge') and $can_be_discharged ) { |
90 |
if ( $input->param('discharge') and $can_be_discharged ) { |
|
|
91 |
|
71 |
my $is_discharged = Koha::Patron::Discharge::is_discharged({ |
92 |
my $is_discharged = Koha::Patron::Discharge::is_discharged({ |
72 |
borrowernumber => $borrowernumber, |
93 |
borrowernumber => $borrowernumber, |
73 |
}); |
94 |
}); |
74 |
- |
|
|