Revision 53aad992
Von Moritz Bunkus vor etwa 11 Jahren hinzugefügt
SL/DB/DeliveryOrder.pm | ||
---|---|---|
}
|
||
|
||
my $delivery_order = $class->new(%args, %{ $params{attributes} || {} });
|
||
my $items = delete($params{items}) || $source->items_sorted;
|
||
|
||
my @items = map {
|
||
my $source_item = $_;
|
||
... | ... | |
)),
|
||
custom_variables => \@custom_variables);
|
||
|
||
} @{ $source->items_sorted };
|
||
} @{ $items };
|
||
|
||
@items = grep { $_->qty * 1 } @items if $params{skip_items_zero_qty};
|
||
|
||
... | ... | |
|
||
=over 2
|
||
|
||
=item C<items>
|
||
|
||
An optional array reference of RDBO instances for the items to use. If
|
||
missing then the method C<items_sorted> will be called on
|
||
C<$source>. This option can be used to override the sorting, to
|
||
exclude certain positions or to add additional ones.
|
||
|
||
=item C<skip_items_zero_qty>
|
||
|
||
If trueish then items with a quantity of 0 are skipped.
|
SL/DB/Invoice.pm | ||
---|---|---|
}
|
||
|
||
my $invoice = $class->new(%args, %{ $params{attributes} || {} });
|
||
my $items = delete($params{items}) || $source->items_sorted;
|
||
|
||
my @items = map {
|
||
my $source_item = $_;
|
||
... | ... | |
custom_variables => \@custom_variables,
|
||
);
|
||
|
||
} @{ $source->items_sorted };
|
||
} @{ $items };
|
||
|
||
$invoice->invoiceitems(\@items);
|
||
|
||
... | ... | |
|
||
=over 2
|
||
|
||
=item C<items>
|
||
|
||
An optional array reference of RDBO instances for the items to use. If
|
||
missing then the method C<items_sorted> will be called on
|
||
C<$source>. This option can be used to override the sorting, to
|
||
exclude certain positions or to add additional ones.
|
||
|
||
=item C<attributes>
|
||
|
||
An optional hash reference. If it exists then it is passed to C<new>
|
Auch abrufbar als: Unified diff
SL::DB::{DeliveryOrder,Invoice}->new_from: Option items für Übergabe der zu verwendenden Positionen
Gründe dafür können sein:
- eigene Sortierung
- gewisse Positionen herauslassen
- weitere Positionen hinzufügen