<<

NAME

Koha::Accounts - Module for managing payments and fees for patrons

pay

This method allows payments to be made against fees/fines

Koha::Account->new( { patron_id => $borrowernumber } )->pay( { amount => $amount, note => $note, description => $description, library_id => $branchcode, lines => $lines, # Arrayref of Koha::Account::Line objects to pay credit_type => $type, # credit_type_code code offset_type => $offset_type, # offset type code item_id => $itemnumber, # pass the itemnumber if this is a credit pertianing to a specific item (i.e LOST_FOUND) } );

add_credit

This method allows adding credits to a patron's account

my $credit_line = Koha::Account->new({ patron_id => $patron_id })->add_credit( { amount => $amount, description => $description, note => $note, user_id => $user_id, interface => $interface, library_id => $library_id, payment_type => $payment_type, type => $credit_type, item_id => $item_id } );

$credit_type can be any of: - 'CREDIT' - 'PAYMENT' - 'FORGIVEN' - 'LOST_FOUND' - 'WRITEOFF'

add_debit

This method allows adding debits to a patron's account

my $debit_line = Koha::Account->new({ patron_id => $patron_id })->add_debit( { amount => $amount, description => $description, note => $note, user_id => $user_id, interface => $interface, library_id => $library_id, type => $debit_type, item_id => $item_id, issue_id => $issue_id } );

$debit_type can be any of: - ACCOUNT - ACCOUNT_RENEW - RESERVE_EXPIRED - LOST - sundry - NEW_CARD - OVERDUE - PROCESSING - RENT - RENT_DAILY - RENT_RENEW - RENT_DAILY_RENEW - RESERVE

balance

my $balance = $self->balance

Return the balance (sum of amountoutstanding columns)

outstanding_debits

my $lines = Koha::Account->new({ patron_id => $patron_id })->outstanding_debits;

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.

outstanding_credits

my $lines = Koha::Account->new({ patron_id => $patron_id })->outstanding_credits;

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.

non_issues_charges

my $non_issues_charges = $self->non_issues_charges

Calculates amount immediately owing by the patron - non-issue charges.

Charges exempt from non-issue are: * Res (holds) if HoldsInNoissuesCharge syspref is set to false * Rent (rental) if RentalsInNoissuesCharge syspref is set to false * Manual invoices if ManInvInNoissuesCharge syspref is set to false

lines

my $lines = $self->lines;

Return all credits and debits for the user, outstanding or otherwise

reconcile_balance

$account->reconcile_balance();

Find outstanding credits and use them to pay outstanding debits. Currently, this implicitly uses the 'First In First Out' rule for applying credits against debits.

Name mappings

$offset_type

AUTHORS

Kyle M Hall <kyle.m.hall@gmail.com> Tomás Cohen Arazi <tomascohen@gmail.com> Martin Renvoize <martin.renvoize@ptfs-europe.com>

<<