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>
This commit is contained in:
parent
b15a15df9e
commit
df4285adb2
1 changed files with 4 additions and 0 deletions
|
@ -145,6 +145,10 @@ sub add_credit {
|
|||
my $note = $body->{note};
|
||||
my $library_id = $body->{library_id};
|
||||
|
||||
if ( C4::Context->preference("RequirePaymentType") && !defined($payment_type) ) {
|
||||
Koha::Exceptions::Account::PaymentTypeRequired->throw();
|
||||
}
|
||||
|
||||
my $credit = $account->add_credit(
|
||||
{
|
||||
amount => $amount,
|
||||
|
|
Loading…
Reference in a new issue