From: Sven Schöling Date: Mon, 22 Oct 2007 15:35:14 +0000 (+0000) Subject: ...und das gemoddete Templating X-Git-Tag: release-2.6.0beta1~463 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2ef21b8f2aaae439a9408977458bdeb9b0fd9e25;p=kivitendo-erp.git ...und das gemoddete Templating --- diff --git a/SL/Template/Plugin/LxERP.pm b/SL/Template/Plugin/LxERP.pm new file mode 100644 index 000000000..a97344af2 --- /dev/null +++ b/SL/Template/Plugin/LxERP.pm @@ -0,0 +1,27 @@ +package SL::Template::Plugin::LxERP; + +use base qw( Template::Plugin ); +use Template::Plugin; + +sub new { + my $class = shift; + my $context = shift; + + bless { }, $class; +} + +sub format_amount { + my ($self, $var, $places, $skip_zero) = @_; + + return $main::form->format_amount(\%main::myconfig, $var * 1, $places) unless $skip_zero && $var == 0; + return ''; +} + +sub format_percent { + my ($self, $var, $places, $skip_zero) = @_; + + return $self->format_amount($var * 100, $places, $skip_zero); +} + +1; +