Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision bbb98e03

Von Moritz Bunkus vor etwa 10 Jahren hinzugefügt

  • ID bbb98e034f3fe6f7ca508f3482a51c6d8a120c92
  • Vorgänger c51601f0
  • Nachfolger b8b6cdf3

SL::DB::{Invoice,DeliveryOrder}->new_from: manuelles Filtern von Items via coderef

Unterschiede anzeigen:

SL/DB/DeliveryOrder.pm
} @{ $items };
@items = grep { $params{item_filter}->($_) } @items if $params{item_filter};
@items = grep { $_->qty * 1 } @items if $params{skip_items_zero_qty};
@items = grep { $_->qty >=0 } @items if $params{skip_items_negative_qty};
......
If trueish then items with a quantity of 0 are skipped.
=item C<item_filter>
An optional code reference that is called for each item with the item
as its sole parameter. Items for which the code reference returns a
falsish value will be skipped.
=item C<attributes>
An optional hash reference. If it exists then it is passed to C<new>
SL/DB/Invoice.pm
$current_invoice_item;
} @{ $items };
@items = grep { $params{item_filter}->($_) } @items if $params{item_filter};
@items = grep { $_->qty * 1 } @items if $params{skip_items_zero_qty};
@items = grep { $_->qty >=0 } @items if $params{skip_items_negative_qty};
......
If trueish then items with a quantity of 0 are skipped.
=item C<item_filter>
An optional code reference that is called for each item with the item
as its sole parameter. Items for which the code reference returns a
falsish value will be skipped.
=item C<attributes>
An optional hash reference. If it exists then it is passed to C<new>

Auch abrufbar als: Unified diff