|
Lines 27-32
use C4::Circulation qw( barcodedecode CanBookBeRenewed GetLatestAutoRenewDate Ad
Link Here
|
| 27 |
use Koha::DateUtils qw( dt_from_string ); |
27 |
use Koha::DateUtils qw( dt_from_string ); |
| 28 |
use Koha::Database; |
28 |
use Koha::Database; |
| 29 |
use Koha::BiblioFrameworks; |
29 |
use Koha::BiblioFrameworks; |
|
|
30 |
use Koha::Patrons; |
| 30 |
|
31 |
|
| 31 |
my $cgi = CGI->new; |
32 |
my $cgi = CGI->new; |
| 32 |
|
33 |
|
|
Lines 46-56
my $unseen = $cgi->param('unseen') || 0;
Link Here
|
| 46 |
$barcode = barcodedecode($barcode) if $barcode; |
47 |
$barcode = barcodedecode($barcode) if $barcode; |
| 47 |
my $override_limit = $cgi->param('override_limit'); |
48 |
my $override_limit = $cgi->param('override_limit'); |
| 48 |
my $override_holds = $cgi->param('override_holds'); |
49 |
my $override_holds = $cgi->param('override_holds'); |
|
|
50 |
my $override_debt = $cgi->param('override_debt'); |
| 49 |
my $hard_due_date = $cgi->param('hard_due_date'); |
51 |
my $hard_due_date = $cgi->param('hard_due_date'); |
| 50 |
|
52 |
|
| 51 |
my ( $item, $checkout, $patron ); |
53 |
my ( $item, $checkout, $patron ); |
| 52 |
my $error = q{}; |
54 |
my $error = q{}; |
| 53 |
my ( $soonest_renew_date, $latest_auto_renew_date ); |
55 |
my ( $soonest_renew_date, $latest_auto_renew_date, $balance ); |
| 54 |
|
56 |
|
| 55 |
if ($barcode) { |
57 |
if ($barcode) { |
| 56 |
$barcode = barcodedecode($barcode) if $barcode; |
58 |
$barcode = barcodedecode($barcode) if $barcode; |
|
Lines 64-69
if ($barcode) {
Link Here
|
| 64 |
|
66 |
|
| 65 |
$patron = $checkout->patron; |
67 |
$patron = $checkout->patron; |
| 66 |
|
68 |
|
|
|
69 |
$balance = $patron->account->balance; |
| 70 |
my $amountlimit = C4::Context->preference("noissuescharge"); |
| 71 |
|
| 67 |
if ( ( $patron->is_debarred || q{} ) lt dt_from_string()->ymd() ) { |
72 |
if ( ( $patron->is_debarred || q{} ) lt dt_from_string()->ymd() ) { |
| 68 |
my $can_renew; |
73 |
my $can_renew; |
| 69 |
my $info; |
74 |
my $info; |
|
Lines 89-94
if ($barcode) {
Link Here
|
| 89 |
$checkout, |
94 |
$checkout, |
| 90 |
); |
95 |
); |
| 91 |
} |
96 |
} |
|
|
97 |
|
| 98 |
if ( $balance > $amountlimit ) { |
| 99 |
$error = "too_much_debt"; |
| 100 |
$can_renew = 0; |
| 101 |
if($override_debt){ |
| 102 |
$can_renew = 1; |
| 103 |
$error = undef; |
| 104 |
} |
| 105 |
} |
| 106 |
|
| 92 |
if ($can_renew) { |
107 |
if ($can_renew) { |
| 93 |
my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; |
108 |
my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; |
| 94 |
my $date_due = |
109 |
my $date_due = |
|
Lines 127-132
if ($barcode) {
Link Here
|
| 127 |
error => $error, |
142 |
error => $error, |
| 128 |
soonestrenewdate => $soonest_renew_date, |
143 |
soonestrenewdate => $soonest_renew_date, |
| 129 |
latestautorenewdate => $latest_auto_renew_date, |
144 |
latestautorenewdate => $latest_auto_renew_date, |
|
|
145 |
balance => $balance, |
| 130 |
); |
146 |
); |
| 131 |
} |
147 |
} |
| 132 |
|
148 |
|