Revision 074e54e7
Von Moritz Bunkus vor fast 11 Jahren hinzugefügt
SL/DB/Invoice.pm | ||
---|---|---|
160 | 160 |
$args{quodate} = $source->transdate; |
161 | 161 |
} |
162 | 162 |
|
163 |
my $invoice = $class->new(%args, %params);
|
|
163 |
my $invoice = $class->new(%args, %{ $params{attributes} || {} });
|
|
164 | 164 |
|
165 | 165 |
my @items = map { |
166 | 166 |
my $source_item = $_; |
... | ... | |
313 | 313 |
|
314 | 314 |
=over 4 |
315 | 315 |
|
316 |
=item C<new_from $source> |
|
316 |
=item C<new_from $source, %params>
|
|
317 | 317 |
|
318 | 318 |
Creates a new C<SL::DB::Invoice> instance and copies as much |
319 | 319 |
information from C<$source> as possible. At the moment only sales |
... | ... | |
323 | 323 |
as appropriate, e.g. the C<transdate> field from an order will be |
324 | 324 |
copied into the invoice's C<orddate> field. |
325 | 325 |
|
326 |
C<%params> can include the following options: |
|
327 |
|
|
328 |
=over 2 |
|
329 |
|
|
330 |
=item C<attributes> |
|
331 |
|
|
332 |
An optional hash reference. If it exists then it is passed to C<new> |
|
333 |
allowing the caller to set certain attributes for the new delivery |
|
334 |
order. |
|
335 |
|
|
336 |
=back |
|
337 |
|
|
326 | 338 |
Amounts, prices and taxes are not |
327 | 339 |
calculated. L<SL::DB::Helper::PriceTaxCalculator::calculate_prices_and_taxes> |
328 | 340 |
can be used for this. |
Auch abrufbar als: Unified diff
SL::DB::Invoice->new_from: %params nicht mehr direkt an new übergeben, sondern nur $params{attributes}
Gründe: Konsistenz mit DeliveryOrder, und Erweiterbarkeit durch
Steuerungsoptionen.