use Koha::Account::DebitTypes;
use Koha::Exceptions;
use Koha::Exceptions::Account;
+use Koha::Plugins;
=head1 NAME
}
my $patron = Koha::Patrons->find( $self->{patron_id} );
- my @account_offsets = $payment->debit_offsets;
+ my @account_offsets = $payment->credit_offsets({ type => 'APPLY' })->as_list;
if ( C4::Context->preference('UseEmailReceipts') ) {
if (
my $letter = C4::Letters::GetPreparedLetter(
}
my $renew_outcomes = [];
- for my $message ( @{$payment->messages} ) {
+ for my $message ( @{$payment->object_messages} ) {
push @{$renew_outcomes}, $message->payload;
}
- 'OVERPAYMENT'
- 'PAYMENT'
- 'WRITEOFF'
+ - 'PROCESSING_FOUND'
=cut
Koha::Exceptions::Account::RegisterRequired->throw()
if ( C4::Context->preference("UseCashRegisters")
&& defined($payment_type)
- && ( $payment_type eq 'CASH' )
+ && ( $payment_type eq 'CASH' || $payment_type eq 'SIP00' )
&& !defined($cash_register) );
my $line;
{
credit_id => $line->id,
type => 'CREATE',
- amount => $amount
+ amount => $amount * -1
}
)->store();
}
) if grep { $credit_type eq $_ } ( 'PAYMENT', 'WRITEOFF' );
+ Koha::Plugins->call(
+ 'after_account_action',
+ {
+ action => "add_credit",
+ payload => {
+ type => lc($credit_type),
+ line => $line->get_from_storage, #TODO Seems unneeded
+ }
+ }
+ );
+
if ( C4::Context->preference("FinesLog") ) {
logaction(
"FINES", 'CREATE',
Koha::Exceptions::Account::RegisterRequired->throw()
if ( C4::Context->preference("UseCashRegisters")
&& defined( $params->{payment_type} )
- && ( $params->{payment_type} eq 'CASH' )
+ && ( $params->{payment_type} eq 'CASH' || $params->{payment_type} eq 'SIP00' )
&& !defined($params->{cash_register}) );
# amount should always be passed as a positive value
Koha::Exceptions::Account::RegisterRequired->throw()
if ( C4::Context->preference("UseCashRegisters")
&& defined( $params->{transaction_type} )
- && ( $params->{transaction_type} eq 'CASH' )
+ && ( $params->{transaction_type} eq 'CASH' || $params->{payment_type} eq 'SIP00' )
&& !defined( $params->{cash_register} ) );
# amount should always be a positive value
# Check for mandatory register
Koha::Exceptions::Account::RegisterRequired->throw()
if ( C4::Context->preference("UseCashRegisters")
- && ( $params->{payout_type} eq 'CASH' )
+ && ( $params->{payout_type} eq 'CASH' || $params->{payout_type} eq 'SIP00' )
&& !defined($params->{cash_register}) );
# Amount should always be passed as a positive value
type => 'PAYOUT',
transaction_type => $params->{payout_type},
amountoutstanding => $params->{amount},
- manager_id => $params->{staff_id},
+ user_id => $params->{staff_id},
interface => $params->{interface},
branchcode => $params->{branch},
cash_register => $params->{cash_register}
It returns the debit lines with outstanding amounts for the patron.
-In scalar context, it returns a Koha::Account::Lines iterator. In list context, it will
-return a list of Koha::Account::Line objects.
+It returns a Koha::Account::Lines iterator.
=cut
It returns the credit lines with outstanding amounts for the patron.
-In scalar context, it returns a Koha::Account::Lines iterator. In list context, it will
-return a list of Koha::Account::Line objects.
+It returns a Koha::Account::Lines iterator.
=cut