X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a823f2b0dcf59d7344f7b112272849018e1bbf91..745a3fccc0e8ff6aaf338f7e200576e74a7f5352:/SL/Controller/Order.pm diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 1309f141e..d4395b5f9 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -629,7 +629,7 @@ sub action_show_customer_vendor_details_dialog { $details{language} = $cv->language_obj->description if $cv->language_obj; $details{delivery_terms} = $cv->delivery_term->description if $cv->delivery_term; $details{payment_terms} = $cv->payment->description if $cv->payment; - $details{pricegroup} = $cv->pricegroup->pricegroup if $cv->pricegroup; + $details{pricegroup} = $cv->pricegroup->pricegroup if $is_customer && $cv->pricegroup; foreach my $entry (@{ $cv->shipto }) { push @{ $details{SHIPTO} }, { map { $_ => $entry->$_ } @{$entry->meta->columns} }; @@ -1367,6 +1367,8 @@ sub _workflow_sales_or_purchase_order { my $destination_type = $::form->{type} eq _sales_quotation_type() ? _sales_order_type() : $::form->{type} eq _request_quotation_type() ? _purchase_order_type() + : $::form->{type} eq _purchase_order_type() ? _sales_order_type() + : $::form->{type} eq _sales_order_type() ? _purchase_order_type() : ''; $self->order(SL::DB::Order->new_from($self->order, destination_type => $destination_type)); @@ -1379,7 +1381,8 @@ sub _workflow_sales_or_purchase_order { # change form type $::form->{type} = $destination_type; - $self->init_type; + $self->type($self->init_type); + $self->cv ($self->init_cv); $self->_check_auth; $self->_recalc(); @@ -1469,7 +1472,9 @@ sub _setup_edit_action_bar { combobox => [ action => [ t8('Save'), - call => [ 'kivi.Order.save', 'save', $::instance_conf->get_order_warn_duplicate_parts ], + call => [ 'kivi.Order.save', 'save', $::instance_conf->get_order_warn_duplicate_parts, + $::instance_conf->get_order_warn_no_deliverydate, + ], checks => [ 'kivi.Order.check_save_active_periodic_invoices' ], ], action => [ @@ -1480,7 +1485,9 @@ sub _setup_edit_action_bar { ], action => [ t8('Save and Delivery Order'), - call => [ 'kivi.Order.save', 'save_and_delivery_order', $::instance_conf->get_order_warn_duplicate_parts ], + call => [ 'kivi.Order.save', 'save_and_delivery_order', $::instance_conf->get_order_warn_duplicate_parts, + $::instance_conf->get_order_warn_no_deliverydate, + ], checks => [ 'kivi.Order.check_save_active_periodic_invoices' ], only_if => (any { $self->type eq $_ } (_sales_order_type(), _purchase_order_type())) ], @@ -1498,13 +1505,13 @@ sub _setup_edit_action_bar { action => [ t8('Sales Order'), submit => [ '#order_form', { action => "Order/sales_order" } ], - only_if => (any { $self->type eq $_ } (_sales_quotation_type())), + only_if => (any { $self->type eq $_ } (_sales_quotation_type(), _purchase_order_type())), disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef, ], action => [ t8('Purchase Order'), submit => [ '#order_form', { action => "Order/purchase_order" } ], - only_if => (any { $self->type eq $_ } (_request_quotation_type())), + only_if => (any { $self->type eq $_ } (_sales_order_type(), _request_quotation_type())), disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef, ], ], # end of combobox "Workflow" @@ -1823,6 +1830,8 @@ java script functions =item * custom shipto address +=item * check for direct delivery (workflow sales order -> purchase order) + =item * language / part translations =item * access rights