X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/9aa58dc1c8cf72ad95a90688ae2245abe589dd78..29254bae64b881dba588f7a02027dac0d1c7b022:/bin/mozilla/io.pl diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index bfe2819eb..ece721f33 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -142,7 +142,6 @@ sub display_row { $form->{weightunit} = $defaults->{weightunit}; my $is_purchase = (first { $_ eq $form->{type} } qw(request_quotation purchase_order purchase_delivery_order)) || ($form->{script} eq 'ir.pl'); - my $show_min_order_qty = first { $_ eq $form->{type} } qw(request_quotation purchase_order); my $is_delivery_order = $form->{type} =~ /_delivery_order$/; my $is_quotation = $form->{type} =~ /_quotation$/; my $is_invoice = $form->{type} =~ /invoice/; @@ -911,7 +910,7 @@ sub order { _order(); - if ($::instance_conf->get_feature_experimental) { + if ($::instance_conf->get_feature_experimental_order) { my $order = _make_record(); $order->globalproject_id(undef) if !$order->globalproject_id; $order->payment_id(undef) if !$order->payment_id; @@ -1041,7 +1040,7 @@ sub quotation { if ($form->{second_run}) { $form->{print_and_post} = 0; } - delete $form->{$_} foreach (qw(id printed emailed queued)); + delete $form->{$_} foreach (qw(id printed emailed queued quonumber transaction_description)); my $buysell; if ($form->{script} eq 'ir.pl' || $form->{type} eq 'purchase_order') { @@ -2024,7 +2023,12 @@ sub show_sales_purchase_email_dialog { if ($::form->{cp_id}) { $email = SL::DB::Contact->load_cached($::form->{cp_id})->cp_email; } - + my $invoice_mail; + if ($::form->{type} eq 'invoice' && !$email) { + # check for invoice_mail + $email = SL::DB::Customer->load_cached($::form->{vc_id})->invoice_mail; + $invoice_mail = 1 if $email; + } if (!$email && $::form->{vc} && $::form->{vc_id}) { $email = SL::DB::Customer->load_cached($::form->{vc_id})->email if 'customer' eq $::form->{vc}; $email = SL::DB::Vendor ->load_cached($::form->{vc_id})->email if 'vendor' eq $::form->{vc}; @@ -2046,6 +2050,7 @@ sub show_sales_purchase_email_dialog { show_bcc => $::auth->assert('email_bcc', 'may fail'), FILES => \%files, is_customer => $::form->{vc} eq 'customer', + is_invoice_mail => $invoice_mail, }); print $::form->ajax_response_header, $html;