From 2ef21b8f2aaae439a9408977458bdeb9b0fd9e25 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Sven=20Sch=C3=B6ling?= <s.schoeling@linet-services.de>
Date: Mon, 22 Oct 2007 15:35:14 +0000
Subject: [PATCH] ...und das gemoddete Templating

---
 SL/Template/Plugin/LxERP.pm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 SL/Template/Plugin/LxERP.pm

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;
+
-- 
2.20.1