From a4624332120f499e324cc8300af478a998d1af76 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 29 Sep 2021 10:16:44 +0200 Subject: [PATCH] =?utf8?q?S:D:Order:=20convert=5Fto=5Finvoice=20params=20a?= =?utf8?q?n=20Invoice::new=5Ffrom=20=C3=BCbergeben?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Analog zum Verhalten in SL::DB::DeliveryOrder. Siehe auch commit "convert_to_invoice params an Invoice::new_from(%params)" (386660077eb786611dc1649d0e1617a29ffc4091) --- SL/DB/Order.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SL/DB/Order.pm b/SL/DB/Order.pm index cfe8af48c..261cb7f23 100644 --- a/SL/DB/Order.pm +++ b/SL/DB/Order.pm @@ -238,7 +238,7 @@ sub convert_to_invoice { my $invoice; if (!$self->db->with_transaction(sub { require SL::DB::Invoice; - $invoice = SL::DB::Invoice->new_from($self)->post(%params) || die; + $invoice = SL::DB::Invoice->new_from($self, %params)->post || die; $self->link_to_record($invoice); # TODO extend link_to_record for items, otherwise long-term no d.r.y. foreach my $item (@{ $invoice->items }) { @@ -616,7 +616,7 @@ L. That invoice is posted, and C<$self> is linked to the new invoice via L. C<$self>'s C attribute is set to C, and C<$self> is saved. -The arguments in C<%params> are passed to L. +The arguments in C<%params> are passed to L. Returns the new invoice instance on success and C on failure. The whole process is run inside a transaction. On failure -- 2.20.1