X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FTemplate%2FPlugin%2FLxERP.pm;h=66424fc6332a7b0d3ccc52c2c313aa43da497d1d;hb=b74d1c197c8365b14587838d999244274de12884;hp=dded29777913a777b375558d55eead40795ddaa1;hpb=91ee6cb28c37fe07d001da04808f9c49e1959502;p=kivitendo-erp.git diff --git a/SL/Template/Plugin/LxERP.pm b/SL/Template/Plugin/LxERP.pm index dded29777..66424fc63 100644 --- a/SL/Template/Plugin/LxERP.pm +++ b/SL/Template/Plugin/LxERP.pm @@ -1,6 +1,7 @@ package SL::Template::Plugin::LxERP; use base qw( Template::Plugin ); +use Scalar::Util qw(); use Template::Plugin; use List::Util qw(min); @@ -16,6 +17,16 @@ sub new { bless { }, $class; } +sub is_rdbo { + my ($self, $obj, $wanted_class) = @_; + + $wanted_class = !$wanted_class ? 'Rose::DB::Object' + : $wanted_class =~ m{::} ? $wanted_class + : "SL::DB::${wanted_class}"; + + return Scalar::Util::blessed($obj) ? $obj->isa($wanted_class) : 0; +} + sub format_amount { my ($self, $var, $places, $skip_zero, $dash) = @_; @@ -30,15 +41,6 @@ sub round_amount { return ''; } -sub format_amount_units { - my ($self, $amount, $amount_unit, $part_unit) = @_; - - return $main::form->format_amount_units('amount' => $amount, - 'part_unit' => $part_unit, - 'amount_unit' => $amount_unit, - 'conv_units' => 'convertible_not_smaller'); -} - sub format_percent { my ($self, $var, $places, $skip_zero) = @_; @@ -109,9 +111,8 @@ sub abs { } sub t8 { - my ($self, $text, $args) = @_; - $self->{locale} ||= Locale->new($::myconfig{countrycode}, 'all'); - return $self->{locale}->text($text, @args) || $text; + my ($self, $text, @args) = @_; + return $::locale->text($text, @args) || $text; } 1;