X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fdo.pl;h=1a304e7978c985feaf9aa6598a8159c1cf33b590;hb=7070f3a0b8267b58ee39b7b0a524a97951ae64a9;hp=07988dbb2cfeb211080bbd7ea0d5896a11e65612;hpb=e7913c4ca30470b30b0585205c6badbe2f99e655;p=kivitendo-erp.git diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 07988dbb2..1a304e797 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -246,6 +246,7 @@ sub setup_do_action_bar { action => [ t8('Update'), submit => [ '#form', { action => "update" } ], + id => 'update_button', accesskey => 'enter', ], @@ -295,13 +296,13 @@ sub setup_do_action_bar { action => [ t8('Transfer out via default'), submit => [ '#form', { action => "transfer_out_default" } ], - checks => [ @req_trans_desc, @transfer_qty ], + checks => [ @req_trans_desc ], disabled => $::form->{delivered} ? t8('This record has already been delivered.') : undef, only_if => $is_customer && $::instance_conf->get_transfer_default, ], action => [ t8('Transfer in'), - submit => [ '#form', { action => "transfer_in"> 1 } ], + submit => [ '#form', { action => "transfer_in" } ], checks => [ @req_trans_desc, @transfer_qty ], disabled => $::form->{delivered} ? t8('This record has already been delivered.') : undef, only_if => !$is_customer, @@ -309,7 +310,7 @@ sub setup_do_action_bar { action => [ t8('Transfer in via default'), submit => [ '#form', { action => "transfer_in_default" } ], - checks => [ @req_trans_desc, @transfer_qty ], + checks => [ @req_trans_desc ], disabled => $::form->{delivered} ? t8('This record has already been delivered.') : undef, only_if => !$is_customer && $::instance_conf->get_transfer_default, ], @@ -376,10 +377,15 @@ sub setup_do_orders_action_bar { $bar->add( action => [ t8('New invoice'), - submit => [ '#orders_form' ], - checks => [ [ 'kivi.check_if_entries_selected', '#orders_form tbody input[type=checkbox]' ] ], + submit => [ '#form', { action => 'invoice_multi' } ], + checks => [ [ 'kivi.check_if_entries_selected', '#form tbody input[type=checkbox]' ] ], accesskey => 'enter', ], + action => [ + t8('Print'), + call => [ 'kivi.SalesPurchase.show_print_dialog', 'js:kivi.MassDeliveryOrderPrint.submitMultiOrders' ], + checks => [ [ 'kivi.check_if_entries_selected', '#form tbody input[type=checkbox]' ] ], + ], ); } } @@ -395,8 +401,12 @@ sub form_header { my $class = "SL::DB::" . ($form->{vc} eq 'customer' ? 'Customer' : 'Vendor'); $form->{VC_OBJ} = $class->load_cached($form->{ $form->{vc} . '_id' }); - $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id}; - $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id}; + $form->{CONTACT_OBJ} = $form->{cp_id} ? SL::DB::Contact->load_cached($form->{cp_id}) : undef; + my $current_employee = SL::DB::Manager::Employee->current; + $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id}; + $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id}; + $form->{employee_id} ||= $current_employee->id; + $form->{salesman_id} ||= $current_employee->id; my $vc = $form->{vc} eq "customer" ? "customers" : "vendors"; $form->get_lists("price_factors" => "ALL_PRICE_FACTORS", @@ -448,7 +458,7 @@ sub form_header { $::request->{layout}->add_javascripts_inline("\$(function(){$dispatch_to_popup});"); - $form->{follow_up_trans_info} = $form->{donumber} .'('. $form->{VC_OBJ}->name .')'; + $form->{follow_up_trans_info} = $form->{donumber} .'('. $form->{VC_OBJ}->name .')' if $form->{VC_OBJ}; $::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.File kivi.MassDeliveryOrderPrint kivi.SalesPurchase kivi.Part ckeditor/ckeditor ckeditor/adapters/jquery kivi.io autocomplete_customer)); @@ -659,7 +669,7 @@ sub orders { my $locale = $main::locale; my $cgi = $::request->{cgi}; - $::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.MassDeliveryOrderPrint)); + $::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.MassDeliveryOrderPrint kivi.SalesPurchase)); ($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) = split(/--/, $form->{ $form->{vc} }); report_generator_set_default_sort('transdate', 1); @@ -801,9 +811,17 @@ sub orders { $form->{printer_id} = $pr->id; } + my $print_options = SL::Helper::PrintOptions->get_print_options( + options => { + hide_language_id => 1, + show_bothsided => 1, + show_headers => 1, + }, + ); + $report->set_options('top_info_text' => join("\n", @options), 'raw_top_info_text' => $form->parse_html_template('do/orders_top'), - 'raw_bottom_info_text' => $form->parse_html_template('do/orders_bottom', { print_options => print_options(inline => 1,hide_language_id => 1) }), + 'raw_bottom_info_text' => $form->parse_html_template('do/orders_bottom', { print_options => $print_options }), 'output_format' => 'HTML', 'title' => $form->{title}, 'attachment_basename' => $attachment_basename . strftime('_%Y%m%d', localtime time), @@ -951,7 +969,9 @@ sub invoice { $main::auth->assert($form->{type} eq 'purchase_delivery_order' ? 'vendor_invoice_edit' : 'invoice_edit'); $form->{convert_from_do_ids} = $form->{id}; - $form->{deliverydate} = $form->{transdate}; + # if we have a reqdate (Liefertermin), this is definetely the preferred + # deliverydate for invoices + $form->{deliverydate} = $form->{reqdate} || $form->{transdate}; $form->{transdate} = $form->{invdate} = $form->current_date(\%myconfig); $form->{duedate} = $form->current_date(\%myconfig, $form->{invdate}, $form->{terms} * 1); $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); @@ -1788,7 +1808,7 @@ sub transfer_in_out_default { # ... and do not create a hash entry in %qty_parts below (will skip check for bins for the transfer == out case) # ... and push only a empty (undef) element to @all_requests (will skip check for bin_id and warehouse_id and will not alter the row) - $qty = 0 if (!$::instance_conf->get_transfer_default_services && !defined($part_info_map{$form->{"id_$i"}}->{inventory_accno_id}) && !$part_info_map{$form->{"id_$i"}}->{assembly}); + $qty = 0 if (!$::instance_conf->get_transfer_default_services && $part_info_map{$form->{"id_$i"}}->{part_type} eq 'service'); $qty_parts{$form->{"id_$i"}} += $qty; if ($qty == 0) { delete $qty_parts{$form->{"id_$i"}} unless $qty_parts{$form->{"id_$i"}};