projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[kivitendo-erp.git]
/
SL
/
Template
/
Plugin
/
LxERP.pm
diff --git
a/SL/Template/Plugin/LxERP.pm
b/SL/Template/Plugin/LxERP.pm
index
d1d93d1
..
40bf195
100644
(file)
--- 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 SL::AM;
+use strict;
+
sub new {
my $class = shift;
my $context = shift;
sub new {
my $class = shift;
my $context = shift;
@@
-21,6
+23,13
@@
sub format_amount {
return '';
}
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) = @_;
sub format_amount_units {
my ($self, $amount, $amount_unit, $part_unit) = @_;
@@
-33,6
+42,8
@@
sub format_amount_units {
sub format_percent {
my ($self, $var, $places, $skip_zero) = @_;
sub format_percent {
my ($self, $var, $places, $skip_zero) = @_;
+ $places ||= 2;
+
return $self->format_amount($var * 100, $places, $skip_zero);
}
return $self->format_amount($var * 100, $places, $skip_zero);
}
@@
-90,4
+101,16
@@
sub turn90 {
}
}
}
}
+sub abs {
+ my $self = shift;
+ my $var = shift;
+
+ return $var < 0 ? $var * -1 : $var;
+}
+
+sub t8 {
+ my ($self, $text, @args) = @_;
+ return $::locale->text($text, @args) || $text;
+}
+
1;
1;