X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a59f11b0bc1e3ce6d98f704a061be0c09e23086f..08e820fa7a9aa4beae1da564b69a1362e6020121:/bin/mozilla/oe.pl diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index f19a2876c..8f4f28ac4 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -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; @@ -1017,7 +1022,7 @@ sub orders { $form->{l_open} = $form->{l_closed} = "Y" if ($form->{open} && $form->{closed}); $form->{l_delivered} = "Y" if ($form->{delivered} && $form->{notdelivered}); $form->{l_periodic_invoices} = "Y" if ($form->{periodic_invoices_active} && $form->{periodic_invoices_inactive}); - $form->{l_edit_exp} = "Y" if (any { $form->{type} eq $_ } qw(sales_order purchase_order)); + $form->{l_edit_exp} = "Y" if $::instance_conf->get_feature_experimental && (any { $form->{type} eq $_ } qw(sales_order purchase_order)); map { $form->{"l_${_}"} = 'Y' } qw(order_probability expected_billing_date expected_netamount) if $form->{l_order_probability_expected_billing_date}; my $attachment_basename; @@ -1289,6 +1294,8 @@ sub check_delivered_flag { foreach my $i (1 .. $form->{rowcount}) { next if (!$form->{"id_$i"}); + $form->{"ship_$i"} = 0 if $form->{saveasnew}; + if ($form->parse_amount(\%myconfig, $form->{"qty_$i"}) == $form->parse_amount(\%myconfig, $form->{"ship_$i"})) { $all_delivered = 1; next; @@ -1299,6 +1306,7 @@ sub check_delivered_flag { } $form->{delivered} = 1 if $all_delivered; + $form->{delivered} = 0 if $form->{saveasnew}; $main::lxdebug->leave_sub(); }