Koha::Accounts - Module for managing payments and fees for patrons
This method allows payments to be made against fees/fines
Koha::Account->new( { patron_id => $borrowernumber } )->pay( { amount => $amount, sip => $sipmode, note => $note, description => $description, library_id => $branchcode, lines => $lines, # Arrayref of Koha::Account::Line objects to pay account_type => $type, # accounttype code offset_type => $offset_type, # offset type code } );
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, library_id => $library_id, sip => $sip, payment_type => $payment_type, type => $credit_type, item_id => $item_id } );
$credit_type can be any of: - 'credit' - 'payment' - 'forgiven' - 'lost_item_return' - 'writeoff'
my $balance = $self->balance
Return the balance (sum of amountoutstanding columns)
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.
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.
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
my $lines = $self->lines;
Return all credits and debits for the user, outstanding or otherwise
$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.
Kyle M Hall <kyle.m.hall@gmail.com>