]> wagnertech.de Git - mfinanz.git/blobdiff - bin/mozilla/oe.pl
Einkaufs- & Verkaufsbelege: Bearbeiter*in & Verkäufer*in mit aktueller Benutzer*in...
[mfinanz.git] / bin / mozilla / oe.pl
index e49e462f370a4e284b71298f021d0fa6598a1d61..8f4f28ac479f7e71312824acd3051283ae68d402 100644 (file)
@@ -362,13 +362,13 @@ sub setup_oe_action_bar {
           t8('Sales Order'),
           submit   => [ '#form', { action => "sales_order" } ],
           disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
-          only_if  => $params{is_sales_quo},
+          only_if  => $params{is_sales_quo} || $params{is_pur_ord},
         ],
         action => [
           t8('Purchase Order'),
-          submit   => [ '#form', { action => "sales_order" } ],
+          submit   => [ '#form', { action => "purchase_order" } ],
           disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
-          only_if  => $params{is_req_quo},
+          only_if  => $params{is_sales_ord} || $params{is_req_quo},
         ],
         action => [
           t8('Delivery Order'),
@@ -386,11 +386,13 @@ sub setup_oe_action_bar {
           t8('Quotation'),
           submit   => [ '#form', { action => "quotation" } ],
           disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+          only_if  => $params{is_sales_ord},
         ],
         action => [
           t8('Request for Quotation'),
-          submit   => [ '#form', { action => "reqest_for_quotation" } ],
+          submit   => [ '#form', { action => "request_for_quotation" } ],
           disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+          only_if  => $params{is_pur_ord},
         ],
       ], # end of combobox "Workflow"
 
@@ -484,8 +486,11 @@ sub form_header {
 
   $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
 
-  $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id};
-  $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id};
+  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;
 
   # openclosed checkboxes
   my @tmp;