X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/0a02b827a5c14cdd46a1faa13cb7fdda832a6aa2..168c0a5f71da53e17ff90b9dc1ece9557336314f:/SL/AP.pm diff --git a/SL/AP.pm b/SL/AP.pm index 2da4eca6c..66020933c 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -765,7 +765,7 @@ sub storno { $storno_row->{invnumber} = 'Storno-' . $storno_row->{invnumber}; $storno_row->{amount} *= -1; $storno_row->{netamount} *= -1; - $storno_row->{paid} = $storno_amount->{amount}; + $storno_row->{paid} = $storno_row->{amount}; delete @$storno_row{qw(itime mtime)}; @@ -776,7 +776,7 @@ sub storno { do_query($form, $dbh, $query, $id); # now copy acc_trans entries - $query = qq|SELECT a.*, c.link FROM acc_trans a LEFT JOIN chart c ON a.chart_id = c.id WHERE a.trans_id = ?|; + $query = qq|SELECT a.*, c.link FROM acc_trans a LEFT JOIN chart c ON a.chart_id = c.id WHERE a.trans_id = ? ORDER BY a.oid|; my $rowref = selectall_hashref_query($form, $dbh, $query, $id); # kill all entries containing payments, which are the last 2n rows, of which the last has link =~ /paid/