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 ssh://lx-office/~/lx-office-erp
[kivitendo-erp.git]
/
SL
/
Form.pm
diff --git
a/SL/Form.pm
b/SL/Form.pm
index
8d17720
..
86f6433
100644
(file)
--- a/
SL/Form.pm
+++ b/
SL/Form.pm
@@
-270,7
+270,7
@@
sub new {
$self->{action} = lc $self->{action};
$self->{action} =~ s/( |-|,|\#)/_/g;
$self->{action} = lc $self->{action};
$self->{action} =~ s/( |-|,|\#)/_/g;
- $self->{version} = "2.6.
0
";
+ $self->{version} = "2.6.
1
";
$main::lxdebug->leave_sub();
$main::lxdebug->leave_sub();
@@
-656,7
+656,7
@@
sub header {
? "$self->{title} - $self->{titlebar}"
: $self->{titlebar};
my $ajax = "";
? "$self->{title} - $self->{titlebar}"
: $self->{titlebar};
my $ajax = "";
- for
each my $item (@ { $self->{AJAX}
}) {
+ for
my $item (@ { $self->{AJAX} || []
}) {
$ajax .= $item->show_javascript();
}
$ajax .= $item->show_javascript();
}
@@
-720,7
+720,7
@@
sub _prepare_html_template {
my ($self, $file, $additional_params) = @_;
my $language;
my ($self, $file, $additional_params) = @_;
my $language;
- if (!
defined(%main::myconfig) || !defined($main::myconfig{"countrycode"})
) {
+ if (!
%::myconfig || !$::myconfig{"countrycode"}
) {
$language = $main::language;
} else {
$language = $main::myconfig{"countrycode"};
$language = $main::language;
} else {
$language = $main::myconfig{"countrycode"};
@@
-772,6
+772,7
@@
sub _prepare_html_template {
$additional_params->{"conf_latex_templates"} = $main::latex;
$additional_params->{"conf_opendocument_templates"} = $main::opendocument_templates;
$additional_params->{"conf_vertreter"} = $main::vertreter;
$additional_params->{"conf_latex_templates"} = $main::latex;
$additional_params->{"conf_opendocument_templates"} = $main::opendocument_templates;
$additional_params->{"conf_vertreter"} = $main::vertreter;
+ $additional_params->{"conf_show_best_before"} = $main::show_best_before;
if (%main::debug_options) {
map { $additional_params->{'DEBUG_' . uc($_)} = $main::debug_options{$_} } keys %main::debug_options;
if (%main::debug_options) {
map { $additional_params->{'DEBUG_' . uc($_)} = $main::debug_options{$_} } keys %main::debug_options;
@@
-1177,6
+1178,10
@@
sub parse_template {
} elsif ( $self->{"format"} =~ /elstertaxbird/i ) {
$template = XMLTemplate->new($self->{"IN"}, $self, $myconfig, $userspath);
} elsif ( $self->{"format"} =~ /elstertaxbird/i ) {
$template = XMLTemplate->new($self->{"IN"}, $self, $myconfig, $userspath);
+ } elsif ( $self->{"format"} =~ /excel/i ) {
+ $template = ExcelTemplate->new($self->{"IN"}, $self, $myconfig, $userspath);
+ $ext_for_format = 'xls';
+
} elsif ( defined $self->{'format'}) {
$self->error("Outputformat not defined. This may be a future feature: $self->{'format'}");
} elsif ( defined $self->{'format'}) {
$self->error("Outputformat not defined. This may be a future feature: $self->{'format'}");
@@
-1384,6
+1389,7
@@
sub get_extension_for_format {
my $extension = $self->{format} =~ /pdf/i ? ".pdf"
: $self->{format} =~ /postscript/i ? ".ps"
: $self->{format} =~ /opendocument/i ? ".odt"
my $extension = $self->{format} =~ /pdf/i ? ".pdf"
: $self->{format} =~ /postscript/i ? ".ps"
: $self->{format} =~ /opendocument/i ? ".odt"
+ : $self->{format} =~ /excel/i ? ".xls"
: $self->{format} =~ /html/i ? ".html"
: "";
: $self->{format} =~ /html/i ? ".html"
: "";
@@
-1738,7
+1744,7
@@
sub check_exchangerate {
return $exchangerate;
}
return $exchangerate;
}
-sub get_
default_currency
{
+sub get_
all_currencies
{
$main::lxdebug->enter_sub();
my ($self, $myconfig) = @_;
$main::lxdebug->enter_sub();
my ($self, $myconfig) = @_;
@@
-1746,14
+1752,24
@@
sub get_default_currency {
my $query = qq|SELECT curr FROM defaults|;
my $query = qq|SELECT curr FROM defaults|;
- my ($curr)
= selectrow_query($self, $dbh, $query);
- my
($defaultcurrency) =
split m/:/, $curr;
+ my ($curr) = selectrow_query($self, $dbh, $query);
+ my
@currencies = grep { $_ } map { s/\s//g; $_ }
split m/:/, $curr;
$main::lxdebug->leave_sub();
$main::lxdebug->leave_sub();
- return
$defaultcurrency
;
+ return
@currencies
;
}
}
+sub get_default_currency {
+ $main::lxdebug->enter_sub();
+
+ my ($self, $myconfig) = @_;
+ my @currencies = $self->get_all_currencies($myconfig);
+
+ $main::lxdebug->leave_sub();
+
+ return $currencies[0];
+}
sub set_payment_options {
$main::lxdebug->enter_sub();
sub set_payment_options {
$main::lxdebug->enter_sub();
@@
-1802,6
+1818,7
@@
sub set_payment_options {
$amounts{invtotal} = $self->{invtotal};
$amounts{total} = $self->{total};
}
$amounts{invtotal} = $self->{invtotal};
$amounts{total} = $self->{total};
}
+ $amounts{skonto_in_percent} = 100.0 * $self->{percent_skonto};
map { $amounts{$_} = $self->parse_amount($myconfig, $amounts{$_}) } keys %amounts;
map { $amounts{$_} = $self->parse_amount($myconfig, $amounts{$_}) } keys %amounts;
@@
-1855,6
+1872,8
@@
sub set_payment_options {
map { $self->{payment_terms} =~ s/<%${_}%>/$formatted_amounts{$_}/g; } keys %formatted_amounts;
map { $self->{payment_terms} =~ s/<%${_}%>/$formatted_amounts{$_}/g; } keys %formatted_amounts;
+ $self->{skonto_in_percent} = $formatted_amounts{skonto_in_percent};
+
$main::lxdebug->leave_sub();
}
$main::lxdebug->leave_sub();
}
@@
-2576,7
+2595,7
@@
sub all_vc {
my ($count) = selectrow_query($self, $dbh, $query);
# build selection list
my ($count) = selectrow_query($self, $dbh, $query);
# build selection list
- if ($count < $myconfig->{vclimit}) {
+ if ($count <
=
$myconfig->{vclimit}) {
$query = qq|SELECT id, name, salesman_id
FROM $table WHERE NOT obsolete
ORDER BY name|;
$query = qq|SELECT id, name, salesman_id
FROM $table WHERE NOT obsolete
ORDER BY name|;