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
a6bd06a
..
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;
@@
-15,9
+17,16
@@
sub new {
}
sub format_amount {
}
sub format_amount {
+ my ($self, $var, $places, $skip_zero, $dash) = @_;
+
+ return $main::form->format_amount(\%main::myconfig, $var * 1, $places, $dash) unless $skip_zero && $var == 0;
+ return '';
+}
+
+sub round_amount {
my ($self, $var, $places, $skip_zero) = @_;
my ($self, $var, $places, $skip_zero) = @_;
- return $main::form->
format_amount(\%main::myconfig,
$var * 1, $places) unless $skip_zero && $var == 0;
+ return $main::form->
round_amount(
$var * 1, $places) unless $skip_zero && $var == 0;
return '';
}
return '';
}
@@
-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);
}
@@
-62,7
+73,7
@@
sub _turn90_word {
my $self = shift;
my $word = shift || "";
my $self = shift;
my $word = shift || "";
- return join '<br>', map { $main::
form->quote_html(
$_) } split(m//, $word);
+ return join '<br>', map { $main::
locale->quote_special_chars('HTML',
$_) } split(m//, $word);
}
sub turn90 {
}
sub turn90 {
@@
-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;