X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fdo.pl;h=1a304e7978c985feaf9aa6598a8159c1cf33b590;hb=7070f3a0b8267b58ee39b7b0a524a97951ae64a9;hp=adaeb275786d8bab081890c27f4e524c79910abe;hpb=08e820fa7a9aa4beae1da564b69a1362e6020121;p=kivitendo-erp.git diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index adaeb2757..1a304e797 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -296,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, @@ -310,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, ], @@ -401,6 +401,7 @@ sub form_header { my $class = "SL::DB::" . ($form->{vc} eq 'customer' ? 'Customer' : 'Vendor'); $form->{VC_OBJ} = $class->load_cached($form->{ $form->{vc} . '_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}; @@ -457,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)); @@ -968,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); @@ -1805,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"}};