X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/1a106c11e3f0e22b84e92d6f52c232b5b47d3d99..58aebf4e4fa2281b7670815d4106e5efe538ce3f:/SL/CVar.pm diff --git a/SL/CVar.pm b/SL/CVar.pm index bd58cbd7e..6d04f35a9 100644 --- a/SL/CVar.pm +++ b/SL/CVar.pm @@ -357,7 +357,7 @@ sub save_custom_variables { $sth->finish(); - $dbh->commit(); + $dbh->commit() unless $params{dbh}; $main::lxdebug->leave_sub(); } @@ -575,7 +575,7 @@ sub add_custom_variables_to_report { $cfg->{type} eq 'date' ? $ref->{date_value} : $cfg->{type} eq 'timestamp' ? $ref->{timestamp_value} : $cfg->{type} eq 'number' ? $form->format_amount($myconfig, $ref->{number_value} * 1, $cfg->{precision}) - : $cfg->{type} eq 'customer' ? SL::DB::Manager::Customer->find_by(id => 1* $ref->{number_value})->name + : $cfg->{type} eq 'customer' ? (SL::DB::Manager::Customer->find_by(id => 1*$ref->{number_value}) || SL::DB::Customer->new)->name : $cfg->{type} eq 'bool' ? ($ref->{bool_value} ? $locale->text('Yes') : $locale->text('No')) : $ref->{text_value}; } @@ -658,7 +658,7 @@ sub save_custom_variables_validity { $sth->finish(); - $dbh->commit(); + $dbh->commit() unless $params{dbh}; $main::lxdebug->leave_sub(); } @@ -721,7 +721,7 @@ sub format_to_template { # stupid template expects everything formated. except objects # do not use outside of print routines for legacy templates - return $::form->parse_amount(\%::myconfig, $value) if $config->{type} eq 'number'; + return $::form->format_amount(\%::myconfig, $value) if $config->{type} eq 'number'; return $value->to_lxoffice if $config->{type} eq 'date' && blessed $value && $value->can('to_lxoffice'); return $value; }