From 210ea1a8d40b76912f71478f8f034fb5b515fa6f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Thu, 9 Jun 2016 16:59:01 +0200 Subject: [PATCH] =?utf8?q?Verkauf=20Storno-Rechnungen=20auch=20verkn=C3=BC?= =?utf8?q?pfen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Ähnlich wie bei Gutschriften sollten Stornorechnungen auch mit der Ursprungsrechnung verknüpft sein. closes #132 --- bin/mozilla/is.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 50f377686..c4d884984 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -966,6 +966,8 @@ sub storno { $form->{paidaccounts} = 0; map { my $key = $_; delete $form->{$key} if grep { $key =~ /^$_/ } qw(datepaid_ gldate_ acc_trans_id_ source_ memo_ paid_ exchangerate_ AR_paid_) } keys %{ $form }; + # record link invoice to storno + $form->{convert_from_ar_ids} = $form->{id}; $form->{storno_id} = $form->{id}; $form->{storno} = 1; $form->{id} = ""; @@ -973,7 +975,8 @@ sub storno { $form->{invdate} = DateTime->today->to_lxoffice; $form->{rowcount}++; # set new ids for storno invoice - delete $form->{"invoice_id_$_"} for 1 .. $form->{"rowcount"}; + # set new persistent ids for storno invoice items + $form->{"converted_from_invoice_id_$_"} = delete $form->{"invoice_id_$_"} for 1 .. $form->{"rowcount"}; post(); $main::lxdebug->leave_sub(); -- 2.20.1