X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/2dbb0236bbcc475e01701bd2794eac9f0cbc5ed5..9bd3030a376850c427c102c6e0c54f19bd19332e:/bin/mozilla/is.pl diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 4b9b1a5eb..b90209f94 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -34,6 +34,7 @@ use SL::FU; use SL::IS; use SL::PE; +use SL::OE; use Data::Dumper; use List::Util qw(max sum); @@ -155,6 +156,14 @@ sub invoice_links { $ref->{name} = $form->quote($ref->{name}); } + # Load data for a specific order and update form fields + my $order_data = OE->get_order_data_by_ordnumber(%$form) if $form->{ordnumber}; + + # 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 +171,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;