<<

NAME

Koha::Acquisition::Order Object class

API

Class methods

new

Overloaded new method for backwards compatibility.

store

Overloaded store method for backwards compatibility.

cancel

    $order->cancel(
        {
            [
                reason        => $reason,
                delete_biblio => $delete_biblio
            ]
        }
    );

This method marks an order as cancelled, optionally using the reason parameter. As the order is cancelled, the (eventual) items linked to it are removed. If delete_biblio is passed, it will try to remove the linked biblio.

If either the items or biblio removal fails, an error message is added to the object so the caller can take appropriate actions.

add_item

  $order->add_item( $itemnumber );

Link an item to this order.

basket

    my $basket = $order->basket;

Returns the Koha::Acquisition::Basket object for the basket associated to the order.

fund

    my $fund = $order->fund;

Returns the Koha::Acquisition::Fund object for the fund (aqbudgets) associated to the order.

invoice

    my $invoice = $order->invoice;

Returns the Koha::Acquisition::Invoice object for the invoice associated to the order.

It returns undef if no linked invoice is found.

subscription

    my $subscription = $order->subscription

Returns the Koha::Subscription object for the subscription associated to the order.

It returns undef if no linked subscription is found.

current_item_level_holds

    my $holds = $order->current_item_level_holds;

Returns the current item-level holds associated to the order. It returns a Koha::Holds resultset.

items

    my $items = $order->items

Returns the items associated to the order.

biblio

    my $biblio = $order->biblio

Returns the bibliographic record associated to the order

claims

    my $claims = $order->claims

Return the claims history for this order

claim

    my $claim = $order->claim

Do claim for this order

claims_count

my $nb_of_claims = $order->claims_count;

This is the equivalent of $order->claims->count. Keeping it for retrocompatibilty.

claimed_date

my $last_claim_date = $order->claimed_date;

This is the equivalent of $order->claims->last->claimed_on. Keeping it for retrocompatibilty.

creator

my $creator = $order->creator;

Retrieves patron that created this order.

duplicate_to

    my $duplicated_order = $order->duplicate_to($basket, [$default_values]);

Duplicate an existing order and attach it to a basket. $default_values can be specified as a hashref that contain default values for the different order's attributes. Items will be duplicated as well but barcodes will be set to null.

populate_with_prices_for_ordering

Sets calculated values for an order - all values are stored with full precision regardless of rounding preference except for tax value which is calculated on rounded values if requested

    $order->populate_with_prices_for_ordering()

The values set are: rrp_tax_included rrp_tax_excluded ecost_tax_included ecost_tax_excluded tax_value_on_ordering

populate_with_prices_for_receiving

Sets calculated values for an order - all values are stored with full precision regardless of rounding preference except for tax value which is calculated on rounded values if requested

    $order->populate_with_prices_for_receiving()

The values set are: unitprice_tax_included unitprice_tax_excluded tax_value_on_receiving

Note: When receiving, if the rounded value of the unitprice matches the rounded value of the ecost then then ecost (full precision) is used.

to_api_mapping

This method returns the mapping for representing a Koha::Acquisition::Order object on the API.

Internal methods

_type

<<