Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
digibib
deichman
Commits
d619fb99
Commit
d619fb99
authored
Jun 14, 2021
by
Petter Goksøyr Åsen
Committed by
Petter Goksøyr Åsen
Jun 16, 2021
Browse files
DEICH-5938
rewrite and fix check for debt in canItemBeIssued
parent
4edde8c1
Changes
1
Show whitespace changes
Inline
Side-by-side
koha/Core/Circulation.pm
View file @
d619fb99
...
...
@@ -24,6 +24,7 @@ use Deichman::Patron::Loan;
use
Deichman::Patron::
Reserve
;
use
Deichman::Patron::
MessageQueue
;
use
Deichman::Patron::MessageQueue::
Digest
;
use
Deichman::Patron::
Purresak
;
use
Deichman::
Notice
;
use
Deichman::Spore::
DB
;
use
Deichman::Stats::
Transaction
;
...
...
@@ -651,14 +652,15 @@ sub canItemBeIssued {
#$self->Deichman::Patron::IsExpired() and $issuingimpossible->{EXPIRED} = 1;
# DEBTS
# Note: Koha::Account is different than other Koha Objects
my
$debt
=
Koha::
Account
->
new
({
patron_id
=>
$self
->
{
patron
}
->
{
borrowernumber
}})
->
balance
;
if
(
$debt
>
0
)
{
# TODO: if $self->{prefs}->{IssuingInProcess}
if
(
$debt
>
$self
->
{
prefs
}
->
{
noissuescharge
}
and
not
$self
->
{
prefs
}
->
{
AllowFineOverride
})
{
$self
->
Deichman::Patron::Purresak::
FindPendingByPatron
();
if
(
$self
->
{
purresak
})
{
my
$debt
=
$self
->
{
purresak
}
->
{
amount
};
if
(
$self
->
{
prefs
}
->
{
AllowFineOverride
})
{
$needsconfirmation
->
{
DEBT
}
=
sprintf
(
"
%.2f
",
$debt
);
}
else
{
$issuingimpossible
->
{
DEBT
}
=
sprintf
(
"
%.2f
",
$debt
);
$self
->
{
error
}
=
Deichman::Exception::Loan::
CannotCheckout
->
new
("
patronBlockedWithFees
");
}
$self
->
{
error
}
=
Deichman::Exception::Loan::
CannotCheckout
->
new
("
patronBlockedWithFees
");
}
elsif
(
$self
->
{
prefs
}
->
{
NoIssuesChargeGuarantees
})
{
my
$guarantees_charges
;
$self
->
Deichman::Patron::
Guarantees
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment