Lines 87-104
sub pay {
Link Here
|
87 |
|
87 |
|
88 |
my $userenv = C4::Context->userenv; |
88 |
my $userenv = C4::Context->userenv; |
89 |
|
89 |
|
90 |
Koha::Exceptions::Account::PaymentTypeRequired->throw() |
90 |
unless ( $type eq 'WRITEOFF' ) { |
91 |
if ( C4::Context->preference("RequirePaymentType") |
91 |
Koha::Exceptions::Account::PaymentTypeRequired->throw() |
92 |
&& !defined($payment_type) ); |
92 |
if ( C4::Context->preference("RequirePaymentType") |
|
|
93 |
&& !defined($payment_type) ); |
93 |
|
94 |
|
94 |
my $av = Koha::AuthorisedValues->search_with_library_limits({ category => 'PAYMENT_TYPE', authorised_value => $payment_type }); |
95 |
my $av = Koha::AuthorisedValues->search_with_library_limits( |
|
|
96 |
{ category => 'PAYMENT_TYPE', authorised_value => $payment_type } ); |
95 |
|
97 |
|
96 |
if ( !$av->count && C4::Context->preference("RequirePaymentType")) { |
98 |
if ( !$av->count && C4::Context->preference("RequirePaymentType") ) { |
97 |
Koha::Exceptions::Account::InvalidPaymentType->throw( |
99 |
Koha::Exceptions::Account::InvalidPaymentType->throw( error => 'Invalid payment type' ); |
98 |
error => 'Invalid payment type' |
100 |
} |
99 |
); |
|
|
100 |
} |
101 |
} |
101 |
|
|
|
102 |
my $manager_id = $userenv ? $userenv->{number} : undef; |
102 |
my $manager_id = $userenv ? $userenv->{number} : undef; |
103 |
my $interface = $params ? ( $params->{interface} || C4::Context->interface ) : C4::Context->interface; |
103 |
my $interface = $params ? ( $params->{interface} || C4::Context->interface ) : C4::Context->interface; |
104 |
my $payment = $self->payin_amount( |
104 |
my $payment = $self->payin_amount( |