From c5651754689f5072d6f9896af9c85312128d6e18 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 29 Apr 2013 12:49:30 +0200 Subject: [PATCH] OE::, DO::order_details und IC::prepare_parts_for_printing mit lokaler form ... und myconfig arbeiten lassen Betrifft #2247. --- SL/DO.pm | 7 ++----- SL/Form.pm | 2 +- SL/IC.pm | 4 ++-- SL/IS.pm | 2 +- SL/OE.pm | 2 +- bin/mozilla/io.pl | 2 +- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/SL/DO.pm b/SL/DO.pm index 14a499a7c..15e16cc16 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -740,10 +740,7 @@ sub retrieve { sub order_details { $main::lxdebug->enter_sub(); - my ($self) = @_; - - my $myconfig = \%main::myconfig; - my $form = $main::form; + my ($self, $myconfig, $form) = @_; # connect to database my $dbh = $form->get_standard_dbh($myconfig); @@ -808,7 +805,7 @@ sub order_details { my $ic_cvar_configs = CVar->get_configs(module => 'IC'); $form->{TEMPLATE_ARRAYS} = { }; - IC->prepare_parts_for_printing(); + IC->prepare_parts_for_printing(myconfig => $myconfig, form => $form); my @arrays = qw(runningnumber number description longdescription qty unit diff --git a/SL/Form.pm b/SL/Form.pm index 7aa380a15..810891ef9 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -3407,7 +3407,7 @@ sub prepare_for_printing { IC->retrieve_accounts(\%::myconfig, $self, map { $_ => $self->{"id_$_"} } 1 .. $self->{rowcount}); if ($self->{type} =~ /_delivery_order$/) { - DO->order_details(); + DO->order_details(\%::myconfig, $self); } elsif ($self->{type} =~ /sales_order|sales_quotation|request_quotation|purchase_order/) { OE->order_details(\%::myconfig, $self); } else { diff --git a/SL/IC.pm b/SL/IC.pm index 96e3a94a1..74cfe1702 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -1632,8 +1632,8 @@ sub prepare_parts_for_printing { my $self = shift; my %params = @_; - my $myconfig = \%main::myconfig; - my $form = $main::form; + my $myconfig = $params{myconfig} || \%main::myconfig; + my $form = $params{form} || $main::form; my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig); diff --git a/SL/IS.pm b/SL/IS.pm index 28323326f..ce8db64b9 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -144,7 +144,7 @@ sub invoice_details { $form->{discount} = []; - IC->prepare_parts_for_printing(); + IC->prepare_parts_for_printing(myconfig => $myconfig, form => $form); my $ic_cvar_configs = CVar->get_configs(module => 'IC'); diff --git a/SL/OE.pm b/SL/OE.pm index 94b97e998..3b3845c50 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -1111,7 +1111,7 @@ sub order_details { $form->{discount} = []; $form->{TEMPLATE_ARRAYS} = { }; - IC->prepare_parts_for_printing(); + IC->prepare_parts_for_printing(myconfig => $myconfig, form => $form); my $ic_cvar_configs = CVar->get_configs(module => 'IC'); diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index d15676739..a7be6d7be 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1393,7 +1393,7 @@ sub print_form { # create the form variables if ($form->{type} =~ /_delivery_order$/) { - DO->order_details(); + DO->order_details(\%myconfig, \%$form); } elsif ($order) { OE->order_details(\%myconfig, \%$form); } else { -- 2.20.1