X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=b90209f948f79bd4edf3281eae992348b7b9fab4;hb=dc8f62cf5df4a7f8473e7d76fdd98846cea5721f;hp=2a4fc43f58fa1493b7f6e862bab5036b4ec95851;hpb=e78a0281d4137b527f4989278bd11ebf5a2fc5b7;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 2a4fc43f5..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; @@ -283,7 +293,6 @@ sub form_header { $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id}; $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); - $form->{radier} = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0; my $set_duedate_url = "$form->{script}?action=set_duedate"; @@ -908,10 +917,10 @@ sub yes { if (IS->delete_invoice(\%myconfig, \%$form, $main::spool)) { # saving the history - if(!exists $form->{addition}) { + if(!exists $form->{addition}) { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; - $form->{addition} = "DELETED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "DELETED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history $form->redirect($locale->text('Invoice deleted!'));