From 074e54e7e10904f2cee7a01f2e7595b8640f4e1f Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 24 Feb 2014 10:10:13 +0100 Subject: [PATCH] =?utf8?q?SL::DB::Invoice->new=5Ffrom:=20%params=20nicht?= =?utf8?q?=20mehr=20direkt=20an=20new=20=C3=BCbergeben,=20sondern=20nur=20?= =?utf8?q?$params{attributes}?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Gründe: Konsistenz mit DeliveryOrder, und Erweiterbarkeit durch Steuerungsoptionen. --- SL/DB/Invoice.pm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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. -- 2.20.1