Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision bbb98e03

Von Moritz Bunkus vor mehr als 9 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
160 160

  
161 161
  } @{ $items };
162 162

  
163
  @items = grep { $params{item_filter}->($_) } @items if $params{item_filter};
163 164
  @items = grep { $_->qty * 1 } @items if $params{skip_items_zero_qty};
164 165
  @items = grep { $_->qty >=0 } @items if $params{skip_items_negative_qty};
165 166

  
......
245 246

  
246 247
If trueish then items with a quantity of 0 are skipped.
247 248

  
249
=item C<item_filter>
250

  
251
An optional code reference that is called for each item with the item
252
as its sole parameter. Items for which the code reference returns a
253
falsish value will be skipped.
254

  
248 255
=item C<attributes>
249 256

  
250 257
An optional hash reference. If it exists then it is passed to C<new>

Auch abrufbar als: Unified diff