Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 69aed970

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID 69aed9704073794ddb211cf65842c8ac80157d0c
  • Vorgänger eb0fa244
  • Nachfolger f0d79175

DeliveryOrder: nicht genutzter Code entfernt

Unterschiede anzeigen:

SL/Controller/DeliveryOrder.pm
150 150
  );
151 151
}
152 152

  
153
# edit a collective order (consisting of one or more existing orders)
154
sub action_edit_collective {
155
  my ($self) = @_;
156

  
157
  # collect order ids
158
  my @multi_ids = map {
159
    $_ =~ m{^multi_id_(\d+)$} && $::form->{'multi_id_' . $1} && $::form->{'trans_id_' . $1} && $::form->{'trans_id_' . $1}
160
  } grep { $_ =~ m{^multi_id_\d+$} } keys %$::form;
161

  
162
  # fall back to add if no ids are given
163
  if (scalar @multi_ids == 0) {
164
    $self->action_add();
165
    return;
166
  }
167

  
168
  # fall back to save as new if only one id is given
169
  if (scalar @multi_ids == 1) {
170
    $self->order(SL::DB::DeliveryOrder->new(id => $multi_ids[0])->load);
171
    $self->action_save_as_new();
172
    return;
173
  }
174

  
175
  # make new order from given orders
176
  my @multi_orders = map { SL::DB::DeliveryOrder->new(id => $_)->load } @multi_ids;
177
  $self->{converted_from_oe_id} = join ' ', map { $_->id } @multi_orders;
178
  my $target_type = SALES_DELIVERY_ORDER_TYPE();
179
  my $delivery_order = SL::Model::Record->new_from_workflow_multi(\@multi_orders, $target_type, sort_sources_by => 'transdate');
180
  $self->order($delivery_order);
181

  
182
  $self->action_edit();
183
}
184

  
185 153
# delete the order
186 154
sub action_delete {
187 155
  my ($self) = @_;
......
231 199
  my $new_order = SL::Model::Record->clone_for_save_as_new($saved_order, $order);
232 200
  $self->order($new_order);
233 201

  
234
  # no linked records on save as new
235
  delete $::form->{$_} for qw(converted_from_oe_id converted_from_orderitems_ids);
236

  
237 202
  if (!$::form->{form_validity_token}) {
238 203
    $::form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_DELIVERY_ORDER_SAVE())->token;
239 204
  }
......
515 480
  );
516 481
}
517 482

  
518
# save the order and redirect to the frontend subroutine for a new
519
# delivery order
520
sub action_save_and_delivery_order {
521
  my ($self) = @_;
522

  
523
  $self->save_and_redirect_to(
524
    controller => 'oe.pl',
525
    action     => 'oe_delivery_order_from_order',
526
  );
527
}
528

  
529 483
# save the order and redirect to the frontend subroutine for a new
530 484
# invoice
531 485
sub action_save_and_invoice {
......
537 491
  );
538 492
}
539 493

  
540
# workflow from sales order to sales quotation
541
sub action_sales_quotation {
542
  $_[0]->workflow_sales_or_request_for_quotation(SALES_QUOTATION_TYPE());
543
}
544

  
545
# workflow from sales order to sales quotation
546
sub action_request_for_quotation {
547
  $_[0]->workflow_sales_or_request_for_quotation(REQUEST_QUOTATION_TYPE());
548
}
549

  
550
# workflow from sales quotation to sales order
551
sub action_sales_order {
552
  $_[0]->workflow_sales_or_purchase_order(SALES_ORDER_TYPE());
553
}
554

  
555
# workflow from rfq to purchase order
556
sub action_purchase_order {
557
  $_[0]->workflow_sales_or_purchase_order(PURCHASE_ORDER_TYPE());
558
}
559

  
560 494
# workflow from purchase order to ap transaction
561 495
sub action_save_and_ap_transaction {
562 496
  my ($self) = @_;
......
838 772
    ->render;
839 773
}
840 774

  
841
# show the popup to choose a price/discount source
842
sub action_price_popup {
843
  my ($self) = @_;
844

  
845
  my $idx  = first_index { $_ eq $::form->{item_id} } @{ $::form->{orderitem_ids} };
846
  my $item = $self->order->items_sorted->[$idx];
847

  
848
  $self->render_price_dialog($item);
849
}
850

  
851 775
# save the order in a session variable and redirect to the part controller
852 776
sub action_create_part {
853 777
  my ($self) = @_;
......
1271 1195
  $_[0]->make_order;
1272 1196
}
1273 1197

  
1274
sub init_all_price_factors {
1275
  SL::DB::Manager::PriceFactor->get_all;
1276
}
1277

  
1278 1198
sub init_part_picker_classification_ids {
1279 1199
  my ($self)    = @_;
1280 1200

  
......
1787 1707
        action => [
1788 1708
          t8('Workflow'),
1789 1709
        ],
1790
        action => [
1791
          t8('Save and Quotation'),
1792
          submit   => [ '#order_form', { action => "DeliveryOrder/sales_quotation" } ],
1793
          only_if  => $self->type_data->show_menu("save_and_quotation"),
1794
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
1795
        ],
1796
        action => [
1797
          t8('Save and RFQ'),
1798
          submit   => [ '#order_form', { action => "DeliveryOrder/request_for_quotation" } ],
1799
          only_if  => $self->type_data->show_menu("save_and_rfq"),
1800
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
1801
        ],
1802
        action => [
1803
          t8('Save and Sales Order'),
1804
          submit   => [ '#order_form', { action => "DeliveryOrder/sales_order" } ],
1805
          only_if  => $self->type_data->show_menu("save_and_sales_order"),
1806
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
1807
        ],
1808
        action => [
1809
          t8('Save and Purchase Order'),
1810
          call     => [ 'kivi.DeliveryOrder.purchase_order_check_for_direct_delivery' ],
1811
          only_if  => $self->type_data->show_menu("save_and_purchase_order"),
1812
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
1813
        ],
1814
        action => [
1815
          t8('Save and Delivery Order'),
1816
          call     => [ 'kivi.DeliveryOrder.save', {
1817
              action             => 'save_and_delivery_order',
1818
              warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
1819
              warn_on_reqdate    => $::instance_conf->get_order_warn_no_deliverydate,
1820
            }],
1821
          only_if  => $self->type_data->show_menu("save_and_delivery_order"),
1822
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
1823
        ],
1824 1710
        action => [
1825 1711
          t8('Save and Invoice'),
1826 1712
          call     => [ 'kivi.DeliveryOrder.save', {
SL/DB/DeliveryOrder/TypeData.pm
28 28
      attachment => t8("sales_delivery_order_list"),
29 29
    },
30 30
    show_menu => {
31
      save_and_quotation      => 0,
32
      save_and_rfq            => 0,
33
      save_and_sales_order    => 0,
34
      save_and_purchase_order => 0,
35
      save_and_delivery_order => 0,
36 31
      save_and_ap_transaction => 0,
37 32
      save_and_invoice        => 0,
38 33
      delete                  => sub { $::instance_conf->get_sales_delivery_order_show_delete },
......
70 65
      attachment => t8("purchase_delivery_order_list"),
71 66
    },
72 67
    show_menu => {
73
      save_and_quotation      => 0,
74
      save_and_rfq            => 0,
75
      save_and_sales_order    => 0,
76
      save_and_purchase_order => 0,
77
      save_and_delivery_order => 0,
78 68
      save_and_ap_transaction => 0,
79 69
      save_and_invoice        => 0,
80 70
      delete                  => sub { $::instance_conf->get_sales_delivery_order_show_delete },
......
112 102
      attachment => t8("supplier_delivery_order_list"),
113 103
    },
114 104
    show_menu => {
115
      save_and_quotation      => 0,
116
      save_and_rfq            => 0,
117
      save_and_sales_order    => 0,
118
      save_and_purchase_order => 0,
119
      save_and_delivery_order => 0,
120 105
      save_and_ap_transaction => 0,
121 106
      save_and_invoice        => 0,
122 107
      delete                  => sub { $::instance_conf->get_sales_delivery_order_show_delete },
......
154 139
      attachment => t8("rma_delivery_order_list"),
155 140
    },
156 141
    show_menu => {
157
      save_and_quotation      => 0,
158
      save_and_rfq            => 0,
159
      save_and_sales_order    => 0,
160
      save_and_purchase_order => 0,
161
      save_and_delivery_order => 0,
162 142
      save_and_ap_transaction => 0,
163 143
      save_and_invoice        => 0,
164 144
      delete                  => sub { $::instance_conf->get_sales_delivery_order_show_delete },

Auch abrufbar als: Unified diff