From 55e9890ade8594530039a7fe1d4ab91a95017752 Mon Sep 17 00:00:00 2001 From: David Ohlbrecht Date: Thu, 10 Dec 2009 10:30:37 +0100 Subject: [PATCH] =?utf8?q?Zus=C3=A4tzliche=20Auftragsfelder=20beim=20Laden?= =?utf8?q?=20von=20Rechnungen=20holen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/IS.pm | 32 ++++++++++++++++++++++++++++++++ bin/mozilla/is.pl | 9 +++++++++ 2 files changed, 41 insertions(+) diff --git a/SL/IS.pm b/SL/IS.pm index 7c923b0dd..3b0e15666 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1954,6 +1954,38 @@ sub retrieve_item { $main::lxdebug->leave_sub(); } +########################## +# Get data for the submitted order id +# from database +# +sub get_order_data { + + $main::lxdebug->enter_sub(); + + my $self = shift; + my $form = $main::form; + my %myconfig = %main::myconfig; + my $dbh = $form->get_standard_dbh(); + + my @values = (conv_i($form->{ordnumber})); + + # We query the database for the fields we need using the submitted "ordnumber" + my $query = <disconnect; + + $main::lxdebug->leave_sub(); + + return $result; +} + ########################## # get pricegroups from database # build up selected pricegroup diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 4b8b8175d..ad0c99080 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -155,6 +155,14 @@ sub invoice_links { $ref->{name} = $form->quote($ref->{name}); } + # Load data for a specific order and update form fields + my $order_data = IS->get_order_data(); + + # Copy the fields we need to %form + for my $key (qw(payment_id salesman_id orddate taxzone_id quonumber)) { + $form->{$key} = $order_data->{$key}; + } + $form->restore_vars(qw(id)); IS->retrieve_invoice(\%myconfig, \%$form); @@ -162,6 +170,7 @@ sub invoice_links { $form->restore_vars(qw(taxincluded)) if $form->{id}; $form->restore_vars(qw(salesman_id)) if $main::editing; + # build vendor/customer drop down comatibility... don't ask if (@{ $form->{"all_customer"} }) { $form->{"selectcustomer"} = 1; -- 2.20.1