<<

NAME

Koha::Cash::Register - Koha cashregister Object class

API

Class methods

library

Return the library linked to this cash register

cashups

Return a set of cashup actions linked to this cash register

last_cashup

Return a set of cashup actions linked to this cash register

accountlines

Return a set of accountlines linked to this cash register

outstanding_accountlines

  my $lines = Koha::Cash::Registers->find($id)->outstanding_accountlines;

Return a set of accountlines linked to this cash register since the last cashup action

cashup_in_progress

Check if there is currently a cashup in progress (CASHUP_START without corresponding CASHUP). Returns the CASHUP_START action if in progress, undef otherwise.

store

Local store method to prevent direct manipulation of the 'branch_default' field

make_default

Set the current cash register as the branch default

drop_default

Drop the current cash register as the branch default

start_cashup

    my $cashup_start = $cash_register->start_cashup(
        {
            manager_id => $logged_in_user->id,
        }
    );

Start a new cashup period. This marks the beginning of the cash counting process and creates a snapshot point for calculating outstanding amounts. Returns the CASHUP_START action.

add_cashup

    my $cashup = $cash_register->add_cashup(
        {
            manager_id            => $logged_in_user->id,
            amount                => $amount_removed_from_register,
            [ reconciliation_note => $reconciliation_note ]
        }
    );

Complete a cashup period started with start_cashup(). This performs the actual reconciliation against the amount counted and creates surplus/deficit accountlines if needed. Returns the completed CASHUP action.

_get_session_start_timestamp

Internal method to determine the start timestamp for the current "open" session. This handles the following cashup scenarios:

1. No cashups ever → undef (returns all accountlines)
2. Quick cashup completed → Uses CASHUP timestamp
3. Two-phase started → Uses CASHUP_START timestamp
4. Two-phase completed → Uses the CASHUP_START timestamp that led to the last CASHUP
5. Mixed workflows → Correctly distinguishes between quick and two-phase cashups

to_api_mapping

This method returns the mapping for representing a Koha::Cash::Register object on the API.

Internal methods

_type

AUTHORS

Martin Renvoize <martin.renvoize@ptfs-europe.com>

<<