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>
SL/DB/Invoice.pm
203 203
    $current_invoice_item;
204 204
  } @{ $items };
205 205

  
206
  @items = grep { $params{item_filter}->($_) } @items if $params{item_filter};
206 207
  @items = grep { $_->qty * 1 } @items if $params{skip_items_zero_qty};
207 208
  @items = grep { $_->qty >=0 } @items if $params{skip_items_negative_qty};
208 209

  
......
411 412

  
412 413
If trueish then items with a quantity of 0 are skipped.
413 414

  
415
=item C<item_filter>
416

  
417
An optional code reference that is called for each item with the item
418
as its sole parameter. Items for which the code reference returns a
419
falsish value will be skipped.
420

  
414 421
=item C<attributes>
415 422

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

Auch abrufbar als: Unified diff