|
Lines 87-92
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() |
| 91 |
if ( C4::Context->preference("RequirePaymentType") |
| 92 |
&& !defined($payment_type) ); |
| 93 |
|
| 94 |
my $av = Koha::AuthorisedValues->search_with_library_limits({ category => 'PAYMENT_TYPE', authorised_value => $payment_type }); |
| 95 |
|
| 96 |
if ( !$av->count && C4::Context->preference("RequirePaymentType")) { |
| 97 |
Koha::Exceptions::Account::InvalidPaymentType->throw( |
| 98 |
error => 'Invalid payment type' |
| 99 |
); |
| 100 |
} |
| 101 |
|
| 90 |
my $manager_id = $userenv ? $userenv->{number} : undef; |
102 |
my $manager_id = $userenv ? $userenv->{number} : undef; |
| 91 |
my $interface = $params ? ( $params->{interface} || C4::Context->interface ) : C4::Context->interface; |
103 |
my $interface = $params ? ( $params->{interface} || C4::Context->interface ) : C4::Context->interface; |
| 92 |
my $payment = $self->payin_amount( |
104 |
my $payment = $self->payin_amount( |
|
Lines 105-114
sub pay {
Link Here
|
| 105 |
} |
117 |
} |
| 106 |
); |
118 |
); |
| 107 |
|
119 |
|
| 108 |
Koha::Exceptions::Account::PaymentTypeRequired->throw() |
|
|
| 109 |
if ( C4::Context->preference("RequirePaymentType") |
| 110 |
&& !defined($payment_type) ); |
| 111 |
|
| 112 |
# NOTE: Pay historically always applied as much credit as it could to all |
120 |
# NOTE: Pay historically always applied as much credit as it could to all |
| 113 |
# existing outstanding debits, whether passed specific debits or otherwise. |
121 |
# existing outstanding debits, whether passed specific debits or otherwise. |
| 114 |
if ( $payment->amountoutstanding ) { |
122 |
if ( $payment->amountoutstanding ) { |