<<

NAME

Koha::Account::Line - Koha accountline Object class

API

Class methods

patron

Return the patron linked to this account line

item

Return the item linked to this account line if exists

checkout

Return the checkout linked to this account line if exists

library

Returns a Koha::Library object representing where the accountline was recorded

credit_type

Return the credit_type linked to this account line

debit_type

Return the debit_type linked to this account line

credit_offsets

Return the credit_offsets linked to this account line if some exist

debit_offsets

Return the debit_offsets linked to this account line if some exist

credits

  my $credits = $accountline->credits;
  my $credits = $accountline->credits( $cond, $attr );

Return the credits linked to this account line if some exist. Search conditions and attributes may be passed if you wish to filter the resultant resultant resultset.

debits

  my $debits = $accountline->debits;
  my $debits = $accountline->debits( $cond, $attr );

Return the debits linked to this account line if some exist. Search conditions and attributes may be passed if you wish to filter the resultant resultant resultset.

void

  $payment_accountline->void();

Used to 'void' (or reverse) a payment/credit. It will roll back any offsets created by the application of this credit upon any debits and mark the credit as 'void' by updating it's status to "VOID".

reduce

  $charge_accountline->reduce({
      reduction_type => $reduction_type
  });

Used to 'reduce' a charge/debit by adding a credit to offset against the amount outstanding.

May be used to apply a discount whilst retaining the original debit amounts or to apply a full or partial refund for example when a lost item is found and returned.

It will immediately be applied to the given debit unless the debit has already been paid, in which case a 'zero' offset will be added to maintain a link to the debit but the outstanding credit will be left so it may be applied to other debts.

Reduction type may be one of:

* REFUND * DISCOUNT

Returns the reduction accountline (which will be a credit)

apply

    my $debits = $account->outstanding_debits;
    my $outstanding_amount = $credit->apply( { debits => $debits, [ offset_type => $offset_type ] } );

Applies the credit to a given debits array reference.

arguments hashref

debits - Koha::Account::Lines object set of debits
offset_type (optional) - a string indicating the offset type (valid values are those from the 'account_offset_types' table)

payout

  $credit_accountline->payout(
    {
        payout_type => $payout_type,
        register_id => $register_id,
        staff_id    => $staff_id,
        interface   => 'intranet',
        amount      => $amount
    }
  );

Used to 'pay out' a credit to a user.

Payout type may be one of any existing payment types

Returns the payout debit line that is created via this transaction.

adjust

This method allows updating a debit or credit on a patron's account

    $account_line->adjust(
        {
            amount    => $amount,
            type      => $update_type,
            interface => $interface
        }
    );

$update_type can be any of: - overdue_update

Authors Note: The intention here is that this method is only used to adjust accountlines where the final amount is not yet known/fixed. Incrementing fines are the only existing case at the time of writing, all other forms of 'adjustment' should be recorded as distinct credits or debits and applied, via an offset, to the corresponding debit or credit.

is_credit

    my $bool = $line->is_credit;

is_debit

    my $bool = $line->is_debit;

to_api_mapping

This method returns the mapping for representing a Koha::Account::Line object on the API.

renewable

    my $bool = $line->renewable;

renew_item

    my $renew_result = $line->renew_item;

Conditionally attempt to renew an item and return the outcome. This is as a consequence of the fine on an item being fully paid off

Internal methods

_type

Name mappings

$allowed_update

AUTHORS

Kyle M Hall <kyle@bywatersolutions.com > Tomás Cohen Arazi <tomascohen@theke.io> Martin Renvoize <martin.renvoize@ptfs-europe.com>

<<