Bug 23321: (follow-up) Correction to exception logic

This patch reduces the noisy warning of uninitialised variables

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Martin Renvoize 2019-09-13 17:03:02 +01:00
parent db66a57f2b
commit 1d42b5fbff
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 6 additions and 4 deletions

View File

@ -89,8 +89,9 @@ sub pay {
my $interface = $params ? ( $params->{interface} || C4::Context->interface ) : C4::Context->interface;
Koha::Exceptions::Account::RegisterRequired->throw()
if ( C4::Context->preference("UseCashRegisters")
&& !defined($cash_register)
&& ( $interface ne 'opac' ) );
&& defined($payment_type)
&& ( $payment_type eq 'CASH' )
&& !defined($cash_register) );
my @fines_paid; # List of account lines paid on with this payment
@ -352,8 +353,9 @@ sub add_credit {
Koha::Exceptions::Account::RegisterRequired->throw()
if ( C4::Context->preference("UseCashRegisters")
&& !defined($cash_register)
&& ( $payment_type eq 'CASH' ) );
&& defined($payment_type)
&& ( $payment_type eq 'CASH' )
&& !defined($cash_register) );
my $schema = Koha::Database->new->schema;