X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FTemplate%2FPlugin%2FLxERP.pm;h=8f3a9980dc4eecce184a5273eafd6e9aa77ed904;hb=49b7cab6d1510010fac0345701ba8e46ea9b39a5;hp=d1d93d13c4a6f75e2878314fe07cfe4027af3de1;hpb=34366eda748e1198b8b2ead0c3fffd8edba9f23d;p=kivitendo-erp.git diff --git a/SL/Template/Plugin/LxERP.pm b/SL/Template/Plugin/LxERP.pm index d1d93d13c..8f3a9980d 100644 --- a/SL/Template/Plugin/LxERP.pm +++ b/SL/Template/Plugin/LxERP.pm @@ -7,6 +7,8 @@ use List::Util qw(min); use SL::AM; +use strict; + sub new { my $class = shift; my $context = shift; @@ -21,6 +23,13 @@ sub format_amount { return ''; } +sub round_amount { + my ($self, $var, $places, $skip_zero) = @_; + + return $main::form->round_amount($var * 1, $places) unless $skip_zero && $var == 0; + return ''; +} + sub format_amount_units { my ($self, $amount, $amount_unit, $part_unit) = @_; @@ -90,4 +99,17 @@ sub turn90 { } } +sub abs { + my $self = shift; + my $var = shift; + + return $var < 0 ? $var * -1 : $var; +} + +sub t8 { + my ($self, $text, $args) = @_; + $self->{locale} ||= Locale->new($::myconfig{countrycode}, 'all'); + return $self->{locale}->text($text, @args) || $text; +} + 1;