From: David Ohlbrecht Date: Thu, 10 Dec 2009 09:30:37 +0000 (+0100) Subject: Zusätzliche Auftragsfelder beim Laden von Rechnungen holen. X-Git-Tag: release-2.6.1beta1~80 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=55e9890a;p=kivitendo-erp.git Zusätzliche Auftragsfelder beim Laden von Rechnungen holen. --- 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;