From: Sven Schöling Date: Mon, 8 Nov 2021 03:24:04 +0000 (+0100) Subject: Order: Workflow Beistelllieferschein erstellen X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~216^2~61 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=72589ebeb899e839f353eac75d3788be4b32ff39;p=kivitendo-erp.git Order: Workflow Beistelllieferschein erstellen --- diff --git a/SL/Controller/DeliveryOrder.pm b/SL/Controller/DeliveryOrder.pm index 653342549..3878e5a64 100644 --- a/SL/Controller/DeliveryOrder.pm +++ b/SL/Controller/DeliveryOrder.pm @@ -78,6 +78,16 @@ sub action_add { ); } +sub action_add_from_order { + my ($self) = @_; + # this interfers with init_order + $self->{converted_from_oe_id} = delete $::form->{id}; + + # TODO copy data and remember to link them on save + + $self->action_add; +} + # edit an existing order sub action_edit { my ($self) = @_; diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index b4328a1e2..524d9045b 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -677,6 +677,16 @@ sub action_save_and_delivery_order { ); } +sub action_save_and_supplier_delivery_order { + my ($self) = @_; + + $self->save_and_redirect_to( + controller => 'controller.pl', + action => 'DeliveryOrder/add_from_order', + type => 'supplier_delivery_order', + ); +} + # save the order and redirect to the frontend subroutine for a new # invoice sub action_save_and_invoice { @@ -2065,6 +2075,16 @@ sub setup_edit_action_bar { ], only_if => (any { $self->type eq $_ } (sales_order_type(), purchase_order_type())) ], + action => [ + t8('Save and Supplier Delivery Order'), + call => [ 'kivi.Order.save', 'save_and_supplier_delivery_order', $::instance_conf->get_order_warn_duplicate_parts, + $::instance_conf->get_order_warn_no_deliverydate, + ], + checks => [ 'kivi.Order.check_save_active_periodic_invoices', + @req_trans_cost_art, @req_cusordnumber, + ], + only_if => (any { $self->type eq $_ } (sales_order_type())) + ], action => [ t8('Save and Invoice'), call => [ 'kivi.Order.save', 'save_and_invoice', $::instance_conf->get_order_warn_duplicate_parts ],