From: Bernd Bleßmann Date: Wed, 29 Sep 2021 08:16:44 +0000 (+0200) Subject: S:D:Order: convert_to_invoice params an Invoice::new_from übergeben X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~335 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a4624332120f499e324cc8300af478a998d1af76;p=kivitendo-erp.git S:D:Order: convert_to_invoice params an Invoice::new_from übergeben Analog zum Verhalten in SL::DB::DeliveryOrder. Siehe auch commit "convert_to_invoice params an Invoice::new_from(%params)" (386660077eb786611dc1649d0e1617a29ffc4091) --- 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