From 6f1ffd59a04dab30e87d6ea38c5884624f4b926a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Tue, 25 Aug 2020 16:09:21 +0200 Subject: [PATCH] Lieferscheine: Benutzerdef. Variablen in Lieferadressen gefixt --- bin/mozilla/do.pl | 14 ++++++++------ templates/webpages/do/form_footer.html | 2 +- templates/webpages/do/form_header.html | 3 --- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index fef0940ce..bd906d40a 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -466,11 +466,6 @@ sub form_header { $::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.File kivi.MassDeliveryOrderPrint kivi.SalesPurchase kivi.Part kivi.CustomerVendor kivi.Validator ckeditor/ckeditor ckeditor/adapters/jquery kivi.io)); - my @custom_hidden; - push @custom_hidden, map { "shiptocvar_" . $_->name } @{ SL::DB::Manager::CustomVariableConfig->get_all(where => [ module => 'ShipTo' ]) }; - - $::form->{HIDDENS} = [ map { +{ name => $_, value => $::form->{$_} } } (@custom_hidden) ]; - setup_do_action_bar(); $form->header(); @@ -501,8 +496,15 @@ sub form_footer { $form->{PRINT_OPTIONS} = setup_sales_purchase_print_options(); $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted(); + my $shipto_cvars = SL::DB::Shipto->new->cvars_by_config; + foreach my $var (@{ $shipto_cvars }) { + my $name = "shiptocvar_" . $var->config->name; + $var->value($form->{$name}) if exists $form->{$name}; + } + print $form->parse_html_template('do/form_footer', - {transfer_default => ($::instance_conf->get_transfer_default)}); + {transfer_default => ($::instance_conf->get_transfer_default), + shipto_cvars => $shipto_cvars}); $main::lxdebug->leave_sub(); } diff --git a/templates/webpages/do/form_footer.html b/templates/webpages/do/form_footer.html index 68d8f0737..1ad546c0a 100644 --- a/templates/webpages/do/form_footer.html +++ b/templates/webpages/do/form_footer.html @@ -67,7 +67,7 @@ [%- IF !delivered %] [%- END %] diff --git a/templates/webpages/do/form_header.html b/templates/webpages/do/form_header.html index 6e7c49984..59fa98edc 100644 --- a/templates/webpages/do/form_header.html +++ b/templates/webpages/do/form_header.html @@ -120,9 +120,6 @@ -[%- FOREACH row = HIDDENS %] - [% L.hidden_tag(row.name, row.value) %] -[%- END %]

-- 2.20.1