From: G. Richardson Date: Sat, 26 Mar 2016 10:53:52 +0000 (+0100) Subject: Konten speichern - Refaktoring von ->{link} X-Git-Tag: release-3.4.1~279 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=5101d6e16d3b486c9cd42746aad478ccffab75a7;p=kivitendo-erp.git Konten speichern - Refaktoring von ->{link} --- diff --git a/SL/AM.pm b/SL/AM.pm index 19407f8ce..ef6e5fa38 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -143,19 +143,8 @@ sub save_account { } } - $form->{link} = ""; - foreach my $item ($form->{AR}, $form->{AR_amount}, - $form->{AR_tax}, $form->{AR_paid}, - $form->{AP}, $form->{AP_amount}, - $form->{AP_tax}, $form->{AP_paid}, - $form->{IC}, $form->{IC_sale}, - $form->{IC_cogs}, $form->{IC_taxpart}, - $form->{IC_income}, $form->{IC_expense}, - $form->{IC_taxservice} - ) { - $form->{link} .= "${item}:" if ($item); - } - chop $form->{link}; + my @link_order = qw(AR AR_amount AR_tax AR_paid AP AP_amount AP_tax AP_paid IC IC_sale IC_cogs IC_taxpart IC_income IC_expense IC_taxservice); + $form->{link} = join ':', grep $_, map $form->{$_}, @link_order; # strip blanks from accno map { $form->{$_} =~ s/ //g; } qw(accno);