Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c8774e89

Von Tamino Steinert vor etwa 2 Jahren hinzugefügt

  • ID c8774e89fea91da739dd83b9b867ad0ab6eb9956
  • Vorgänger 08e12ce7
  • Nachfolger 6fb26f9a

Workflow: delivery_order ↔ reclamation

Unterschiede anzeigen:

SL/Controller/Reclamation.pm
69 69
                          save_and_show_email_dialog
70 70
                          workflow_save_and_sales_or_purchase_reclamation
71 71
                          save_and_order
72
                          save_and_delivery_order
72 73
                       )]);
73 74

  
74 75
__PACKAGE__->run_before('get_unalterable_data',
......
77 78
                          save_and_show_email_dialog
78 79
                          workflow_save_and_sales_or_purchase_reclamation
79 80
                          save_and_order
81
                          save_and_delivery_order
80 82
                        )]);
81 83

  
82 84
#
......
121 123
  );
122 124
}
123 125

  
126
sub action_add_from_delivery_order {
127
  my ($self) = @_;
128

  
129
  unless ($::form->{from_id}) {
130
    $self->js->flash('error', t8("Can't create new reclamation. No 'from_id' was given."));
131
    return $self->js->render();
132
  }
133

  
134
  require SL::DB::DeliveryOrder;
135
  my $delivery_order = SL::DB::DeliveryOrder->new(id => $::form->{from_id})->load;
136
  my $reclamation = $delivery_order->convert_to_reclamation();
137

  
138
  $self->reclamation($reclamation);
139

  
140
  $self->reinit_after_new_reclamation();
141

  
142
  $self->render(
143
    'reclamation/form',
144
    title => $self->get_title_for('add'),
145
    %{$self->{template_args}},
146
  );
147
}
148

  
124 149
# edit an existing reclamation
125 150
sub action_edit {
126 151
  my ($self) = @_;
......
515 540
  $_[0]->workflow_save_and_sales_or_purchase_reclamation();
516 541
}
517 542

  
543
# save the reclamation and redirect to the frontend subroutine for a new
544
# delivery order
545
sub action_save_and_delivery_order {
546
  my ($self) = @_;
547

  
548
  my $to_type = $self->reclamation->is_sales ? 'sales_delivery_order'
549
                                             : 'purchase_delivery_order';
550
  $self->save_and_redirect_to(
551
    controller => 'do.pl',
552
    action     => 'add_from_reclamation',
553
    type       => $to_type,
554
    from_id    => $self->reclamation->id,
555
  );
556
}
557

  
518 558
# set form elements in respect to a changed customer or vendor
519 559
#
520 560
# This action is called on an change of the customer/vendor picker.
......
1617 1657
  my %allowed_linked_records = map {$_ => 1} qw(
1618 1658
    SL::DB::Reclamation
1619 1659
    SL::DB::Order
1660
    SL::DB::DeliveryOrder
1620 1661
  );
1621 1662
  my %allowed_linked_record_items = map {$_ => 1} qw(
1622 1663
    SL::DB::ReclamationItem
1623 1664
    SL::DB::OrderItem
1665
    SL::DB::DeliveryOrderItem
1624 1666
  );
1625 1667

  
1626 1668
  my $from_record_id = delete $::form->{converted_from_record_id};
......
2133 2175
            $::instance_conf->get_reclamation_warn_no_reqdate,
2134 2176
          ],
2135 2177
        ],
2178
        action => [
2179
          t8('Save and Delivery Order'),
2180
          call      => [
2181
            'kivi.Reclamation.save', 'save_and_delivery_order',
2182
            $::instance_conf->get_reclamation_warn_duplicate_parts,
2183
            $::instance_conf->get_reclamation_warn_no_reqdate,
2184
          ],
2185
        ],
2136 2186
      ], # end of combobox "Workflow"
2137 2187

  
2138 2188
      combobox => [

Auch abrufbar als: Unified diff