X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/f45b296fb0bb9491d86d80e9f7a7d79c3e0295ba..0dc65e8532e92daacbef328f3df2f92e7e221cb5:/SL/IS.pm diff --git a/SL/IS.pm b/SL/IS.pm index da801fd52..3aa0d3ca9 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -353,7 +353,9 @@ sub invoice_details { $sth->finish; } - map { push @{ $form->{TEMPLATE_ARRAYS}->{"ic_cvar_$_->{name}"} }, $form->{"ic_cvar_$_->{name}_$i"} } @{ $ic_cvar_configs }; + push @{ $form->{TEMPLATE_ARRAYS}->{"ic_cvar_$_->{name}"} }, + CVar->format_to_template(CVar->parse($form->{"ic_cvar_$_->{name}_$i"}, $_), $_) + for @{ $ic_cvar_configs }; } } @@ -877,7 +879,7 @@ sub post_invoice { # record payments and offsetting AR if (!$form->{storno}) { for my $i (1 .. $form->{paidaccounts}) { - + if ($form->{"acc_trans_id_$i"} && $payments_only && ($::lx_office_conf{features}->{payments_changeable} == 0)) { @@ -1438,7 +1440,7 @@ sub retrieve_invoice { my ($sth, $ref, $query); - my $query_transdate = ", current_date AS invdate" if !$form->{id}; + my $query_transdate = !$form->{id} ? ", current_date AS invdate" : ''; $query = qq|SELECT @@ -1478,6 +1480,8 @@ sub retrieve_invoice { $ref = selectfirst_hashref_query($form, $dbh, $query, $id); map { $form->{$_} = $ref->{$_} } keys %{ $ref }; + # remove any trailing whitespace + $form->{currency} =~ s/\s*$//; $form->{exchangerate} = $form->get_exchangerate($dbh, $form->{currency}, $form->{invdate}, "buy");