Bug 33176: Enforce RequirePaymentType with API
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> (cherry picked from commitdf4285adb2
) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> (cherry picked from commit68c725afee
) Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
This commit is contained in:
parent
db6758b8c2
commit
7310866d36
1 changed files with 4 additions and 0 deletions
|
@ -109,6 +109,10 @@ sub add_credit {
|
||||||
my $note = $body->{note};
|
my $note = $body->{note};
|
||||||
my $library_id = $body->{library_id};
|
my $library_id = $body->{library_id};
|
||||||
|
|
||||||
|
if ( C4::Context->preference("RequirePaymentType") && !defined($payment_type) ) {
|
||||||
|
Koha::Exceptions::Account::PaymentTypeRequired->throw();
|
||||||
|
}
|
||||||
|
|
||||||
my $credit = $account->add_credit(
|
my $credit = $account->add_credit(
|
||||||
{ amount => $amount,
|
{ amount => $amount,
|
||||||
type => $credit_type,
|
type => $credit_type,
|
||||||
|
|
Loading…
Reference in a new issue