Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 245056d0

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID 245056d021280e3887724c1a5e96a2d6915b28ca
  • Vorgänger d982e9f4
  • Nachfolger e141beb6

Model::Record: FIX: Workflow mit ausgewählten Positionen

Unterschiede anzeigen:

SL/Controller/DeliveryOrder.pm
123 123
    my %use_item = map { $_ => 1 } @{$::form->{from_item_ids}};
124 124
    $flags{item_filter} = sub {
125 125
      my ($item) = @_;
126
      return %use_item{$item->id};
126
      return %use_item{$item->{RECORD_ITEM_ID()}};
127 127
    }
128 128
  }
129 129

  
......
533 533
  my $to_type = $::form->{to_type};
534 534
  my $to_controller = get_object_name_from_type($to_type);
535 535

  
536
  $self->save();
537

  
536 538
  my %additional_params = ();
537
  if ($::form->{only_selected_items}) {
538
    my $from_item_ids = $::form->{selected_items} || [];
539
    $additional_params{from_item_ids} = $from_item_ids;
539
  if ($::form->{only_selected_item_positions}) { # ids can be unset before save
540
    my $item_positions = $::form->{selected_item_positions} || [];
541
    my @from_item_ids = map { $self->order->items_sorted->[$_]->id } @$item_positions;
542
    $additional_params{from_item_ids} = \@from_item_ids;
540 543
  }
541 544

  
542
  $self->save();
543 545
  flash_later('info', $self->type_data->text('saved'));
544 546

  
545 547
  $self->redirect_to(
SL/Controller/Order.pm
111 111
    my %use_item = map { $_ => 1 } @{$::form->{from_item_ids}};
112 112
    $flags{item_filter} = sub {
113 113
      my ($item) = @_;
114
      return %use_item{$item->id};
114
      return %use_item{$item->{RECORD_ITEM_ID()}};
115 115
    }
116 116
  }
117 117

  
......
786 786
  flash_later('info', $self->type_data->text('saved'));
787 787

  
788 788
  my %additional_params = ();
789
  if ($::form->{only_selected_items}) {
790
    my $from_item_ids = $::form->{selected_items} || [];
791
    $additional_params{from_item_ids} = $from_item_ids;
789
  if ($::form->{only_selected_item_positions}) { # ids can be unset before save
790
    my $item_positions = $::form->{selected_item_positions} || [];
791
    my @from_item_ids = map { $self->order->items_sorted->[$_]->id } @$item_positions;
792
    $additional_params{from_item_ids} = \@from_item_ids;
792 793
  }
793 794

  
794 795
  $self->redirect_to(
SL/Controller/Reclamation.pm
125 125
    my %use_item = map { $_ => 1 } @{$::form->{from_item_ids}};
126 126
    $flags{item_filter} = sub {
127 127
      my ($item) = @_;
128
      return %use_item{$item->id};
128
      return %use_item{$item->{RECORD_ITEM_ID()}};
129 129
    }
130 130
  }
131 131

  
......
513 513
  my $to_type = $::form->{to_type};
514 514
  my $to_controller = get_object_name_from_type($to_type);
515 515

  
516
  my %additional_params = ();
517
  if ($::form->{only_selected_items}) {
518
    my $from_item_ids = $::form->{selected_items} || [];
519
    $additional_params{from_item_ids} = $from_item_ids;
520
  }
521

  
522 516
  $self->save();
523 517
  flash_later('info', t8('The reclamation has been saved'));
524 518

  
519
  my %additional_params = ();
520
  if ($::form->{only_selected_item_positions}) { # ids can be unset before save
521
    my $item_positions = $::form->{selected_item_positions} || [];
522
    my @from_item_ids = map { $self->order->items_sorted->[$_]->id } @$item_positions;
523
    $additional_params{from_item_ids} = \@from_item_ids;
524
  }
525

  
525 526
  $self->redirect_to(
526 527
    controller => $to_controller,
527 528
    action     => 'add_from_record',
js/kivi.Order.js
970 970
    data.push({ name: 'action', value: 'Order/show_conversion_to_purchase_delivery_order_item_selection' });
971 971

  
972 972
    kivi.popup_dialog({
973
      id:     "convert_to_purchase_delivery_order_item_selection",
973
      id:     "convert_to_purchase_delivery_order_item_position_selection",
974 974
      url:    "controller.pl",
975 975
      data:   data,
976 976
      type:   "POST",
977 977
      dialog: { title: kivi.t8("Select items for delivery order") },
978 978
      load:   function() {
979
        $("body").data("convert_to_purchase_delivery_order_item_selection_params", params);
979
        $("body").data("convert_to_purchase_delivery_order_item_position_selection_params", params);
980 980
      }
981 981
    });
982 982
  };
983 983

  
984 984
  ns.convert_to_purchase_delivery_order_item_selection = function() {
985
    let params = $("body").data("convert_to_purchase_delivery_order_item_selection_params");
985
    let params = $("body").data("convert_to_purchase_delivery_order_item_position_selection_params");
986 986

  
987
    let $dialog = $("#convert_to_purchase_delivery_order_item_selection");
988
    let selected_items = $dialog.find("tbody input.item_selection_checkall").serializeArray();
987
    let $dialog = $("#convert_to_purchase_delivery_order_item_position_selection");
988
    let selected_items = $dialog.find("tbody input.item_position_selection_checkall").serializeArray();
989 989
    params.data = selected_items;
990 990

  
991
    additional_param = { name: 'only_selected_items', value: 1 };
991
    additional_param = { name: 'only_selected_item_positions', value: 1 };
992 992
    if (params.form_params) {
993 993
      if (Array.isArray(params.form_params)) {
994 994
        params.form_params.push(additional_param);
templates/design40_webpages/order/tabs/_purchase_delivery_order_item_selection.html
7 7
  <table class="tbl-list">
8 8
    <thead>
9 9
      <tr class="listheading">
10
        <th>[% L.checkbox_tag("item_selection_checkall", checkall="input.item_selection_checkall") %]</th>
10
        <th>[% L.checkbox_tag("item_position_selection_checkall", checkall="input.item_position_selection_checkall") %]</th>
11 11
        <th>[% LxERP.t8("Position") %]</th>
12 12
        <th>[% LxERP.t8("Partnumber") %]</th>
13 13
        <th>[% LxERP.t8("Vendor Part Number") %]</th>
......
17 17
      </tr>
18 18
    </thead>
19 19

  
20
    <tbody id="item_selection" class="row_entry listrow">
20
    <tbody id="item_position_selection" class="row_entry listrow">
21 21
      [% FOREACH item = ITEMS %]
22 22
        <tr class="listrow">
23
          <td>[% L.checkbox_tag("selected_items[+]", class="item_selection_checkall", value=item.id, checked="checked") %]</td>
23
          <td>[% L.checkbox_tag("selected_item_positions[+]", class="item_position_selection_checkall", value=loop.count, checked="checked") %]</td>
24 24
          <td class="numeric">[% loop.count %]</td>
25 25
          <td>[% HTML.escape(item.partnumber) %]</td>
26 26
          <td>[% HTML.escape(item.vendor_partnumber) %]</td>
templates/webpages/order/tabs/_purchase_delivery_order_item_selection.html
7 7
  <table>
8 8
    <thead>
9 9
      <tr class="listheading">
10
        <th>[% L.checkbox_tag("item_selection_checkall", checkall="input.item_selection_checkall") %]</th>
10
        <th>[% L.checkbox_tag("item_position_selection_checkall", checkall="input.item_position_selection_checkall") %]</th>
11 11
        <th>[% LxERP.t8("Position") %]</th>
12 12
        <th>[% LxERP.t8("Partnumber") %]</th>
13 13
        <th>[% LxERP.t8("Vendor Part Number") %]</th>
......
17 17
      </tr>
18 18
    </thead>
19 19

  
20
    <tbody id="item_selection" class="row_entry listrow">
20
    <tbody id="item_position_selection" class="row_entry listrow">
21 21
      [% FOREACH item = ITEMS %]
22 22
        <tr class="listrow">
23
          <td>[% L.checkbox_tag("selected_items[+]", class="item_selection_checkall", value=item.id, checked="checked") %]</td>
23
          <td>[% L.checkbox_tag("selected_item_positions[+]", class="item_position_selection_checkall", value=loop.count, checked="checked") %]</td>
24 24
          <td align="right">[% loop.count %]</td>
25 25
          <td>[% HTML.escape(item.partnumber) %]</td>
26 26
          <td>[% HTML.escape(item.vendor_partnumber) %]</td>

Auch abrufbar als: Unified diff