From: Moritz Bunkus Date: Mon, 24 Feb 2014 09:10:13 +0000 (+0100) Subject: SL::DB::Invoice->new_from: %params nicht mehr direkt an new übergeben, sondern nur... X-Git-Tag: release-3.2.0beta~491^2~7 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=074e54e7e10904f2cee7a01f2e7595b8640f4e1f;p=kivitendo-erp.git 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. --- diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 8c6965fc4..46ecd9b09 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -160,7 +160,7 @@ sub new_from { $args{quodate} = $source->transdate; } - my $invoice = $class->new(%args, %params); + my $invoice = $class->new(%args, %{ $params{attributes} || {} }); my @items = map { my $source_item = $_; @@ -313,7 +313,7 @@ SL::DB::Invoice: Rose model for invoices (table "ar") =over 4 -=item C +=item C Creates a new C instance and copies as much information from C<$source> as possible. At the moment only sales @@ -323,6 +323,18 @@ The conversion copies order items into invoice items. Dates are copied as appropriate, e.g. the C field from an order will be copied into the invoice's C field. +C<%params> can include the following options: + +=over 2 + +=item C + +An optional hash reference. If it exists then it is passed to C +allowing the caller to set certain attributes for the new delivery +order. + +=back + Amounts, prices and taxes are not calculated. L can be used for this.