<<

NAME

Koha::Charges::Sale - Module for collecting sales in Koha

SYNOPSIS

  use Koha::Charges::Sale;

  my $sale =
    Koha::Charges::Sale->new( { cash_register => $register, staff_id => $staff_id } );
  $sale->add_item($item);
  $sale->purchase( { payment_type => 'CASH' } );

Class methods

new

  Koha::Charges::Sale->new(
    {
        cash_register  => $cash_register,
        staff_id        => $staff_id,
        [ payment_type => $payment_type ],
        [ items        => $items ],
        [ patron       => $patron ],
    }
  );

payment_type

  my $payment_type = $sale->payment_type( $payment_type );

A getter/setter for this instances associated payment type.

_get_valid_payments

  my $valid_payments = $sale->_get_valid_payments;

A getter which returns a hashref whose keys represent valid payment types.

add_item

  my $item = { price => 0.25, quantity => 1, code => 'COPY' };
  $sale->add_item( $item );

_get_valid_items

  my $valid_items = $sale->_get_valid_items;

A getter which returns a hashref whose keys represent valid sale items.

purchase

  my $credit_line = $sale->purchase;

AUTHOR

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

<<