Revision 54a2608c
Von Werner Hahn vor mehr als 2 Jahren hinzugefügt
| SL/Controller/DeliveryOrder.pm | ||
|---|---|---|
|   $self->action_add;
 | ||
| }
 | ||
|  | ||
| sub action_add_from_reclamation {
 | ||
|   my ($self) = @_;
 | ||
|  | ||
|   require SL::DB::Reclamation;
 | ||
|   my $reclamation = SL::DB::Reclamation->new(id => $::form->{from_id})->load;
 | ||
|   my ($delivery_order, $error) = $reclamation->convert_to_delivery_order();
 | ||
|   if($error) {
 | ||
|     croak("Error while converting: " . $error);
 | ||
|   }
 | ||
|  | ||
|   $self->order($delivery_order);
 | ||
|  | ||
|   $self->action_add;
 | ||
| }
 | ||
|  | ||
| # edit an existing order
 | ||
| sub action_edit {
 | ||
|   my ($self) = @_;
 | ||
| SL/Controller/Reclamation.pm | ||
|---|---|---|
|  | ||
| # save the reclamation and redirect to the frontend subroutine for a new
 | ||
| # delivery order
 | ||
|  | ||
| sub action_save_and_delivery_order {
 | ||
|   my ($self) = @_;
 | ||
|  | ||
|   my $to_type = $self->reclamation->is_sales ? 'sales_delivery_order'
 | ||
|                                              : 'purchase_delivery_order';
 | ||
|   my $to_type = $self->reclamation->is_sales ? 'rma_delivery_order'
 | ||
|                                              : 'supplier_delivery_order';
 | ||
|   $self->save_and_redirect_to(
 | ||
|     controller => 'do.pl',
 | ||
|     action     => 'add_from_reclamation',
 | ||
|     controller => 'controller.pl',
 | ||
|     action     => 'DeliveryOrder/add_from_reclamation',
 | ||
|     type       => $to_type,
 | ||
|     from_id    => $self->reclamation->id,
 | ||
|   );
 | ||
Auch abrufbar als: Unified diff
Reclamation: Workflow Reclamation→Lieferschein ...
neuen DeliveryOrderController benutzen einlagern geht nicht