From: G. Richardson Date: Fri, 4 Nov 2011 12:40:51 +0000 (+0100) Subject: Merge branch 'master' of git@vc.linet-services.de:public/lx-office-erp X-Git-Tag: release-2.7.0beta1~182^2^2 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/commitdiff_plain/65e4c07fd92b11481265ab49f9bae88734832acf?hp=5f0c4f2d9d5c087cd763f53f6dc0c67e5ca938b5 Merge branch 'master' of git@vc.linet-services.de:public/lx-office-erp --- diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index c30634b96..9cca6cd80 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -168,6 +168,8 @@ sub test_and_import { my $worker = $self->create_worker($file); $worker->run; + + $self->num_imported(0); $worker->save_objects if !$params{test}; $self->num_importable(scalar grep { !$_ } map { scalar @{ $_->{errors} } } @{ $self->data || [] }); diff --git a/SL/DB/Helper/CustomVariables.pm b/SL/DB/Helper/CustomVariables.pm index 2519c3690..ef6a0a9bc 100644 --- a/SL/DB/Helper/CustomVariables.pm +++ b/SL/DB/Helper/CustomVariables.pm @@ -44,7 +44,7 @@ sub make_cvar_accessor { my ($caller_package, %params) = @_; my @module_filter = $params{module} ? - ("config.module" => $params{module}) : + ("config_id" => [ \"(SELECT custom_variable_configs.id FROM custom_variable_configs WHERE custom_variable_configs.module = '$params{module}')" ]) : (); $caller_package->meta->add_relationships( @@ -52,7 +52,6 @@ sub make_cvar_accessor { type => 'one to many', class => 'SL::DB::CustomVariable', column_map => { ($params{id} || 'id') => 'trans_id' }, - manager_args => { with_objects => 'config' }, query_args => [ sub_module => $params{sub_module}, @module_filter ], } ); diff --git a/SL/Template/Simple.pm b/SL/Template/Simple.pm index 9960908da..d29ec8f5c 100644 --- a/SL/Template/Simple.pm +++ b/SL/Template/Simple.pm @@ -125,10 +125,12 @@ sub substitute_vars { while ($text =~ /$self->{substitute_vars_re}/) { my ($tag_pos, $tag_len) = ($-[0], $+[0] - $-[0]); - my ($var, @options) = split(/\s+/, $1); + my ($var, @option_list) = split(/\s+/, $1); + my %options = map { ($_ => 1) } @option_list; my $value = $self->_get_loop_variable($var, 0, @indices); - $value = $self->format_string($value) unless (grep(/^NOESCAPE$/, @options)); + $value = $form->parse_amount({ numberformat => $::myconfig{output_numberformat} || $::myconfig{numberformat} }, $value) if $options{NOFORMAT}; + $value = $self->format_string($value) unless $options{NOESCAPE}; substr($text, $tag_pos, $tag_len, $value); } diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 2d23c76ae..c569ef8a5 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1341,6 +1341,10 @@ sub print_form { $output_longdates = 1; } + # Store the output number format so that the template modules know + # how to parse the amounts back if requested. + $myconfig{output_numberformat} = $output_numberformat || $myconfig{numberformat}; + ($form->{employee}) = split /--/, $form->{employee}; # create the form variables diff --git a/doc/dokumentenvorlagen-und-variablen.html b/doc/dokumentenvorlagen-und-variablen.html index c9a7ebb98..91e245da8 100644 --- a/doc/dokumentenvorlagen-und-variablen.html +++ b/doc/dokumentenvorlagen-und-variablen.html @@ -48,6 +48,9 @@ td {
  • Zuordnung von Dateinamen zu den Funktionen
  • +
  • Variablen ausgeben +
  • +
  • Anfang und Ende der Tags verändern
  • @@ -192,6 +195,43 @@ td { zum Inhaltsverzeichnis

    +

    Variablen ausgeben

    + +

    Um eine Variable auszugeben, müssen sie einfach nur zwischen die + Tags geschrieben werden, also + z.B. <%variablenname%>.

    + +

    + Optional kann man auch mit Leerzeichen getrennte Flags angeben, die + man aber nur selten brauchen wird. Die Syntax sieht also so + aus: <%variablenname FLAG1 FLAG2%>. Momentan werden + die folgenden Flags unterstützt: +

    + + + +

    + Beispiel: <%quototal NOFORMAT%> +

    + + + zum Inhaltsverzeichnis
    +
    +

    Anfang und Ende der Tags verändern

    diff --git a/templates/webpages/csv_import/_errors.html b/templates/webpages/csv_import/_errors.html index e96ac5010..1a7d661cf 100644 --- a/templates/webpages/csv_import/_errors.html +++ b/templates/webpages/csv_import/_errors.html @@ -11,7 +11,7 @@ [%- LxERP.t8('Error') %] [% FOREACH err = SELF.errors %] - + [% err.4 %]:[% err.3 %] [% err.0 %] [% err.2 %] diff --git a/templates/webpages/io/select_item.html b/templates/webpages/io/select_item.html index 2e3c91d32..f57ef7750 100644 --- a/templates/webpages/io/select_item.html +++ b/templates/webpages/io/select_item.html @@ -23,10 +23,10 @@ [% HTML.escape(item.partnumber) %] [% HTML.escape(item.description) %] + [% LxERP.format_amount(item.display_sellprice, 2) %] [%- IF IS_PURCHASE %] [% LxERP.format_amount(item.rop, '') %] [%- END %] - [% LxERP.format_amount(item.display_sellprice, 2) %] [% LxERP.format_amount(item.onhand, '') %] [% HTML.escape(item.unit) %]