);
}
+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) = @_;
);
}
+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 {
],
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 ],