Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 295c1205

Von Tamino Steinert vor etwa 2 Jahren hinzugefügt

  • ID 295c12050babc963eb5acc22fc66f66325bead98
  • Vorgänger d71c833a
  • Nachfolger ad4c5883

Controller: DeliveryOrder: stock_dialog um Einlagern erweitert

Unterschiede anzeigen:

SL/Controller/DeliveryOrder.pm
930 930

  
931 931
  $self->merge_stock_data($stock_info, \@contents, $part, $unit);
932 932

  
933
    my @collection = (
934
    { 'description' => 'foo_1', 'id' => '1',
935
      'key_1' => [
936
        { 'id' => 3, 'description' => "bar_1",
937
          'key_2' => [
938
            { 'id' => 1, 'value' => "foobar_1", },
939
            { 'id' => 2, 'value' => "foobar_2", },
940
          ],
941
        },
942
        { 'id' => 4, 'description' => "bar_2",
943
        'key_2' => [],
944
        },
945
      ],
946
    },
947
    { 'description' => 'foo_2', 'id' => '2',
948
      'key_1' => [
949
        { 'id' => 1, 'description' => "bar_1",
950
          'key_2' => [
951
            { 'id' => 3, 'value' => "foobar_3", },
952
            { 'id' => 4, 'value' => "foobar_4", },
953
          ],
954
        },
955
        { 'id' => 2, 'description' => "bar_2",
956
          'stock' => [
957
            { 'id' => 5, 'value' => "test_5", },
958
          ],
959
        },
960
      ],
961
    },
962
  );
963

  
964 933
  $self->render("delivery_order/stock_dialog", { layout => 0 },
965
    WHCONTENTS => $self->order->delivered ? $stock_info : \@contents,
934
    WHCONTENTS => \@contents,
935
    STOCK_INFO => $stock_info,
966 936
    WAREHOUSES => SL::DB::Manager::Warehouse->get_all(with_objects=> ["bins",]),
967
    COLLECTION => \@collection,
968 937
    part       => $part,
969 938
    do_qty     => $qty,
970 939
    do_unit    => $unit->unit,
......
975 944
  );
976 945
}
977 946

  
947
sub action_add_stock_in_line_to_dialog {
948
  my ($self) = @_;
949

  
950
  my $do_qty       = _parse_number($::form->{do_qty});
951
  my $qty_sum   = $::form->{qty_sum};
952
  my $row_count = $::form->{row_count};
953
  my $part      = SL::DB::Part->load_cached($::form->{parts_id}) or die "need parts_id";
954

  
955
  my $row_as_html = $self->p->render('delivery_order/stock_dialog/_stock_in_new_row',
956
    WAREHOUSES => SL::DB::Manager::Warehouse->get_all(with_objects=> ["bins",]),
957
    PART => $part,
958
    pos  => $row_count + 1,
959
    remaining_qty => $do_qty - $qty_sum,
960
  );
961

  
962
  $self->js->append('#stock-in-out-table', $row_as_html)->render();
963
}
964

  
978 965
sub action_update_stock_information {
979 966
  my ($self) = @_;
980 967

  
js/kivi.DeliveryOrder.js
109 109
    });
110 110
  };
111 111

  
112
  ns.add_stock_in_line_to_dialog = function() {
113
    console.log("clicked");
114
    console.log($("#parts_id"));
115
    console.log($("#parts_id").val());
116
    console.log($("#do_qty"));
117
    console.log($("#do_qty").val());
118

  
119
    let qty_sum = 0;
120
    let row_count = 0;
121
    $("#stock-in-out-table tr.listrow").each((i,row) => {
122
      let qty = kivi.parse_amount($(row).find(".data-qty").val());
123

  
124
      row_count = row_count + 1;
125
      if (qty === 0) return;
126
      if (qty === null) return;
127
      qty_sum = qty_sum + qty;
128
    });
129

  
130
    let data = [];
131
    data.push(
132
      { name: 'action', value: 'DeliveryOrder/add_stock_in_line_to_dialog' },
133
      { name: 'type', value: $("#type").val()},
134
      { name: 'qty_sum', value: qty_sum },
135
      { name: 'row_count', value: row_count},
136
      { name: 'parts_id', value: $("#parts_id").val()},
137
      { name: 'do_qty', value:  $("#do_qty").val()},
138
    );
139

  
140
    $.post("controller.pl", data, kivi.eval_json_result);
141
  };
142

  
112 143
  ns.save_updated_stock = function() {
113 144
    // stock information is saved in DOM as a yaml dump.
114 145
    // we don't want to do this in javascript so we do a tiny roundtrip to the backend
......
118 149
      let qty = kivi.parse_amount($(row).find(".data-qty").val());
119 150

  
120 151
      if (qty === 0) return;
152
      if (qty === null) return;
121 153

  
122 154
      data.push({
123 155
        qty:                           qty,
templates/webpages/delivery_order/stock_dialog.html
4 4
[%- USE L %]
5 5

  
6 6
<form>
7
 [%- IF delivered %]
8
  [% PROCESS "delivery_order/stock_dialog/_stock_delivered_dialog.html" %]
9
 [%- ELSE %]
10

  
11 7
 <table>
12 8
  <tr>
13 9
   <td>[% 'Part Number' | $T8 %]</td>
......
23 19
  </tr>
24 20
 </table>
25 21

  
26
  [% L.hidden_tag("in_out", in_out) %]
27
  [% L.hidden_tag("parts_id", parts_id) %]
28
  [% L.hidden_tag("do_qty", do_qty) %]
29
  [% L.hidden_tag("do_unit", do_unit) %]
30
  [% L.hidden_tag("row", row, class="data-row") %]
31
  [% L.hidden_tag("item_id", item_id) %]
22
 [% L.hidden_tag("in_out", in_out) %]
23
 [% L.hidden_tag("parts_id", part.id) %]
24
 [% L.hidden_tag("do_qty", do_qty) %]
25
 [% L.hidden_tag("do_unit", do_unit) %]
26
 [% L.hidden_tag("row", row, class="data-row") %]
27
 [% L.hidden_tag("item_id", item_id) %]
28

  
29
 [%- IF delivered %]
30
  [% PROCESS "delivery_order/stock_dialog/_stock_delivered_dialog.html" %]
31
 [%- ELSE %]
32 32

  
33 33
  [%- IF in_out == "in" %]
34 34
  <p>
......
48 48
   </table>
49 49
  </p>
50 50

  
51
  [%- IF in_out == "in" %]
52
  [% L.button_tag('kivi.DeliveryOrder.add_stock_in_line_to_dialog()', LxERP.t8('+')) %]
53
  [%- END %]
54

  
51 55
  <hr size="3" noshade>
52 56

  
53 57
  <p>[% L.button_tag('kivi.DeliveryOrder.save_updated_stock()', LxERP.t8('Save')) %]</p>
templates/webpages/delivery_order/stock_dialog/_stock_delivered_dialog.html
2 2
[%- USE HTML %]
3 3
[%- USE LxERP %]
4 4
[%- USE L %]
5
 [%- IF delivered %]
6
 [%- SET RO = ' readonly' %]
7
 [%- END %]
8 5

  
9
 <table>
10
  <tr>
11
   <td>[% 'Part Number' | $T8 %]</td>
12
   <td>[% part.partnumber | html %]</td>
6
[%- UNLESS STOCK_INFO.size %]
7
<p>[% 'There are no items in stock.' | $T8 %]</p>
8
[%- ELSE %]
9

  
10
<p>
11
 <table id="stock-in-out-table">
12
  <tr class="listheading">
13
   <th>&nbsp;</th>
14
   <th>[% 'Warehouse' | $T8 %]</th>
15
   <th>[% 'Bin' | $T8 %]</th>
16
   <th>[% 'Charge Number' | $T8 %]</th>
17
   [% IF INSTANCE_CONF.get_show_bestbefore %]
18
   <th>[% 'Best Before' | $T8 %]</th>
19
   [% END %]
20
   <th align="right">[% 'Qty' | $T8 %]</th>
21
   <th align="right">[% 'Unit' | $T8 %]</th>
13 22
  </tr>
14
  <tr>
15
   <td>[% 'Description' | $T8 %]</td>
16
   <td>[% part.description | html %]</td>
17
  </tr>
18
  <tr>
19
   <td>[% 'Qty according to delivery order' | $T8 %]</td>
20
   <td>[% LxERP.format_amount(do_qty) %] [% do_unit | html %]</td>
21
  </tr>
22
 </table>
23

  
24
  [%- UNLESS WHCONTENTS.size %]
25
  <p>[% 'There are no items in stock.' | $T8 %]</p>
26
  [%- ELSE %]
27

  
28
  [% L.hidden_tag("in_out", in_out) %]
29
  [% L.hidden_tag("parts_id", parts_id) %]
30
  [% L.hidden_tag("do_qty", do_qty) %]
31
  [% L.hidden_tag("do_unit", do_unit) %]
32
  [% L.hidden_tag("row", row, class="data-row") %]
33
  [% L.hidden_tag("item_id", item_id) %]
34

  
35
  <p>
36
   <table id="stock-in-out-table">
37
    <tr class="listheading">
38
     <th>&nbsp;</th>
39
     <th>[% 'Warehouse' | $T8 %]</th>
40
     <th>[% 'Bin' | $T8 %]</th>
41
     <th>[% 'Charge Number' | $T8 %]</th>
42
     [% IF INSTANCE_CONF.get_show_bestbefore %]
43
     <th>[% 'Best Before' | $T8 %]</th>
44
     [% END %]
45
     [%- UNLESS delivered %]
46
     <th align="right">[% 'Available qty' | $T8 %]</th>
47
     [%- END %]
48
     <th align="right">[% 'Qty' | $T8 %]</th>
49
     <th align="right">[% 'Unit' | $T8 %]</th>
50
    </tr>
51

  
52
    [%- FOREACH row = WHCONTENTS %]
53
    <tr [% IF row.stock_error %] class="error"[% ELSE %]class="listrow"[% END %]>
54
     <td>[% loop.count %]</td>
55
     <td>[% row.warehousedescription | html %]</td>
56
     <td>[% row.bindescription | html %]</td>
57
     <td>[% row.chargenumber | html %]</td>
58
     [% IF INSTANCE_CONF.get_show_bestbefore %]
59
     <td>[% row.bestbefore | html %]</td>
60
     [% END %]
61

  
62
     [%- IF delivered %]
63

  
64
     <td>[% LxERP.format_amount(row.stock_qty) | html %]</td>
65
     <td>
66
      [% row.stock_unit | html %]
67
      [% L.hidden_tag("unit", row.stock_unit, class="data-unit") %]
68
     </td>
69

  
70
     [%- ELSE %]
71

  
72
     <td>[% row.available_qty | html %]</td>
73
     <td>
74
      [% L.input_tag("qty", row.stock_qty                              ? LxERP.format_amount(row.stock_qty)
75
                          : (WHCONTENTS.size == 1) && (!row.stock_qty) ? LxERP.format_amount(do_qty)
76
                          : "", class="numeric data-qty", size="12") %]</td>
77
     <td>[% L.select_tag("unit_" _ loop.count, part.unit_obj.convertible_units, value_key="name", default=row.stock_unit, class="data-unit") %]</td>
78

  
79
     [%- END %]
80
     <td style="display:none">
81
      [% L.hidden_tag("warehouse_id", row.warehouse_id, class="data-warehouse-id") %]
82
      [% L.hidden_tag("bin_id", row.bin_id, class="data-bin-id") %]
83
      [% L.hidden_tag("chargenumber", row.chargenumber, class="data-chargenumber") %]
84
      [% L.hidden_tag("delivery_order_items_stock_id", row.delivery_order_items_stock_id, class="data-stock-id") %]
85
      [% L.hidden_tag("bestbefore", row.bestbefore, class="data-bestbefore") IF INSTANCE_CONF.get_show_bestbefore %]
86
     </td>
87
    </tr>
88

  
89
    [%- END %]
90
   </table>
91
  </p>
92

  
93
  <hr size="3" noshade>
94

  
95
  <p>[% L.button_tag('kivi.DeliveryOrder.save_updated_stock()', LxERP.t8('Save')) IF !delivered %]</p>
96 23

  
24
  [%- FOREACH row = STOCK_INFO %]
25
  <tr [% IF row.stock_error %] class="error"[% ELSE %]class="listrow"[% END %]>
26
   <td>[% loop.count %]</td>
27
   <td>[% row.warehousedescription | html %]</td>
28
   <td>[% row.bindescription | html %]</td>
29
   <td>[% row.chargenumber | html %]</td>
30
   [% IF INSTANCE_CONF.get_show_bestbefore %]
31
   <td>[% row.bestbefore | html %]</td>
32
   [% END %]
33

  
34
   <td>[% LxERP.format_amount(row.stock_qty) | html %]</td>
35
   <td>
36
    [% row.stock_unit | html %]
37
    [% L.hidden_tag("unit", row.stock_unit, class="data-unit") %]
38
   </td>
39

  
40
   <td style="display:none">
41
    [% L.hidden_tag("warehouse_id", row.warehouse_id, class="data-warehouse-id") %]
42
    [% L.hidden_tag("bin_id", row.bin_id, class="data-bin-id") %]
43
    [% L.hidden_tag("chargenumber", row.chargenumber, class="data-chargenumber") %]
44
    [% L.hidden_tag("delivery_order_items_stock_id", row.delivery_order_items_stock_id, class="data-stock-id") %]
45
    [% L.hidden_tag("bestbefore", row.bestbefore, class="data-bestbefore") IF INSTANCE_CONF.get_show_bestbefore %]
46
   </td>
47
  </tr>
97 48
  [%- END %]
98
 </form>
99

  
100

  
49
 </table>
50
</p>
51
<hr size="3" noshade>
52
[%- END %]
templates/webpages/delivery_order/stock_dialog/_stock_in_new_row.html
1
[%- USE L %]
2
[%- USE LxERP %]
3
[% # L.dump( PART ) %] [% # L.dump( pos ) %] [% # L.dump( remaining_qty ) %]
4
<tr class="listrow" >
5
 [% L.multi_level_select_tag(
6
      "new_wh_bin_" _ pos, WAREHOUSES, 2, surround_tag="td",
7
      level_1={
8
        name="warehouse_id",
9
        value_key="id",
10
        title_key="description",
11
        default=PART.warehouse_id,
12
        class="data-warehouse-id",
13
      },
14
      level_2={
15
        object_key="bins",
16
        name="bin_id",
17
        value_key="id",
18
        title_key="description",
19
        default=PART.bin_id,
20
        class="data-bin-id",
21
      },
22
    ) %]
23

  
24
 <td>[% L.input_tag("chargenumber", "", class="numeric data-chargenumber", size="12") %]</td>
25
 [%- IF INSTANCE_CONF.get_show_bestbefore %]
26
 <td>[% L.date_tag('bestbefore', "", class="data-bestbefore") %]</td>
27
 [%- END %]
28
 <td>[% L.input_tag("qty", LxERP.format_amount(remaining_qty) , class="numeric data-qty", size="12") %]</td>
29
 <td>[% L.select_tag("unit", PART.unit_obj.convertible_units, value_key="name", default=PART.unit, class="data-unit") %]</td>
30
 <td style="display:none">
31
  [% L.hidden_tag("delivery_order_items_stock_id", '', class="data-stock-id") %]
32
 </td>
33
</tr>
templates/webpages/delivery_order/stock_dialog/_stock_in_row.html
1
[%- USE L %]
2
[%- USE LxERP %]
3
[% # L.dump( PART ) %] [% # L.dump( pos ) %] [% # L.dump( ROW ) %]
4
<tr class="listrow" >
5
 [% L.multi_level_select_tag(
6
      # name has to be unique
7
      "wh_bin_" _ pos, WAREHOUSES, 2, surround_tag="td",
8
      level_1={
9
        name="warehouse_id",
10
        value_key="id",
11
        title_key="description",
12
        default=ROW.warehouse_id,
13
        class="data-warehouse-id",
14
      },
15
      level_2={
16
        object_key="bins",
17
        name="bin_id",
18
        value_key="id",
19
        title_key="description",
20
        default=ROW.bin_id,
21
        class="data-bin-id",
22
      },
23
    ) %]
24

  
25
 <td>[% L.input_tag("chargenumber", ROW.chargenumber, class="numeric data-chargenumber", size="12") %]</td>
26
 [%- IF INSTANCE_CONF.get_show_bestbefore %]
27
 <td>[% L.date_tag("bestbefore", ROW.bestbefore, class="data-bestbefore") %]</td>
28
 [%- END %]
29
 <td>[% L.input_tag("qty", LxERP.format_amount(ROW.qty), class="numeric data-qty", size="12") %]</td>
30
 <td>[% L.select_tag("unit", PART.unit_obj.convertible_units, value_key="name", default=ROW.stock_unit, class="data-unit") %]</td>
31
 <td style="display:none">
32
  [% L.hidden_tag("delivery_order_items_stock_id", ROW.delivery_order_items_stock_id, class="data-stock-id") %]
33
 </td>
34
</tr>
templates/webpages/delivery_order/stock_dialog/_stock_in_table.html
1 1
<tr class="listheading">
2 2
 <th>[% 'Warehouse' | $T8 %]</th>
3 3
 <th>[% 'Bin' | $T8 %]</th>
4
 <th>[% 'Charge Number' | $T8 %]</th>
5
 [% IF INSTANCE_CONF.get_show_bestbefore %]
6
 <th>[% 'Best Before' | $T8 %]</th>
7
 [% END %]
4 8
 <th align="right">[% 'Qty' | $T8 %]</th>
5 9
 <th align="right">[% 'Unit' | $T8 %]</th>
6 10
</tr>
7 11

  
8
<tr>
9
 [% L.multi_level_select_tag(
10
      "test_tag", WAREHOUSES, 2, surround_tag="td",
11
      level_1={
12
        name="warehouse.id",
13
        value_key="id",
14
        title_key="description",
15
      },
16
      level_2={
17
        object_key="bins",
18
        name="bin.id",
19
        value_key="id",
20
        title_key="description",
21
      },
22
    ) %]
12
[%- FOREACH row = STOCK_INFO %]
13
[%- PROCESS delivery_order/stock_dialog/_stock_in_row.html PART=part ROW=row pos=loop.count %]
14
[%- END %]
23 15

  
24
 <td>
25
  [% L.input_tag("qty", LxERP.format_amount(do_qty), class="numeric data-qty", size="12") %]</td>
26
 <td>[% L.select_tag("unit_" _ loop.count, part.unit_obj.convertible_units, value_key="name", default=row.stock_unit, class="data-unit") %]</td>
27

  
28
 <td style="display:none">
29
  [% L.hidden_tag("warehouse_id", row.warehouse_id, class="data-warehouse-id") %]
30
  [% L.hidden_tag("bin_id", row.bin_id, class="data-bin-id") %]
31
  [% L.hidden_tag("chargenumber", row.chargenumber, class="data-chargenumber") %]
32
  [% L.hidden_tag("delivery_order_items_stock_id", row.delivery_order_items_stock_id, class="data-stock-id") %]
33
  [% L.hidden_tag("bestbefore", row.bestbefore, class="data-bestbefore") IF INSTANCE_CONF.get_show_bestbefore %]
34
 </td>
35
</tr>
36
<tr>
37
  [% L.multi_level_select_tag("multi_select_foo_bar_foobar", COLLECTION, 3,
38
      surround_tag="td",
39
      level_1={
40
        name="foo.id",
41
        value_key="id",
42
        title_key="description",
43
        default="2",
44
      },
45
      level_2={
46
        object_key="key_1",
47
        name="bar.id",
48
        value_key="id",
49
        title_key="description",
50
        default="1",
51
      },
52
      level_3={
53
        object_key="key_2",
54
        name="foobar.id",
55
        value_key="id",
56
        title_key="value",
57
        default="4",
58
      },
59
    ) %]
60
</tr>
16
[%- UNLESS STOCK_INFO.size %]
17
[%- PROCESS delivery_order/stock_dialog/_stock_in_new_row.html PART=part remaining_qty=do_qty pos=0 %]
18
[% END %]
templates/webpages/delivery_order/stock_dialog/_stock_info_table.html
10 10
</tr>
11 11

  
12 12
[%- FOREACH row = WHCONTENTS %]
13
<tr [% IF row.stock_error %] class="error"[% ELSE %]class="listrow"[% END %]>
13
<tr [% IF row.stock_error %] class="error" [% END %]>
14 14
 <td>[% loop.count %]</td>
15 15
 <td>[% row.warehousedescription | html %]</td>
16 16
 <td>[% row.bindescription | html %]</td>
templates/webpages/delivery_order/stock_dialog/_stock_out_table.html
2 2
[%- USE HTML %]
3 3
[%- USE LxERP %]
4 4
[%- USE L %]
5
 [%- IF delivered %]
6
 [%- SET RO = ' readonly' %]
7
 [%- END %]
8

  
9
 <table>
10
  <tr>
11
   <td>[% 'Part Number' | $T8 %]</td>
12
   <td>[% part.partnumber | html %]</td>
13
  </tr>
14
  <tr>
15
   <td>[% 'Description' | $T8 %]</td>
16
   <td>[% part.description | html %]</td>
17
  </tr>
18
  <tr>
19
   <td>[% 'Qty according to delivery order' | $T8 %]</td>
20
   <td>[% LxERP.format_amount(do_qty) %] [% do_unit | html %]</td>
21
  </tr>
22
 </table>
23

  
24
  [%- UNLESS WHCONTENTS.size %]
25
  <p>[% 'There are no items in stock.' | $T8 %]</p>
26
  [%- ELSE %]
27

  
28
  [% L.hidden_tag("in_out", in_out) %]
29
  [% L.hidden_tag("parts_id", parts_id) %]
30
  [% L.hidden_tag("do_qty", do_qty) %]
31
  [% L.hidden_tag("do_unit", do_unit) %]
32
  [% L.hidden_tag("row", row, class="data-row") %]
33
  [% L.hidden_tag("item_id", item_id) %]
34

  
35
  <p>
36
   <table id="stock-in-out-table">
37
    <tr class="listheading">
38
     <th>&nbsp;</th>
39
     <th>[% 'Warehouse' | $T8 %]</th>
40
     <th>[% 'Bin' | $T8 %]</th>
41
     <th>[% 'Charge Number' | $T8 %]</th>
42
     [% IF INSTANCE_CONF.get_show_bestbefore %]
43
     <th>[% 'Best Before' | $T8 %]</th>
44
     [% END %]
45
     [%- UNLESS delivered %]
46
     <th align="right">[% 'Available qty' | $T8 %]</th>
47
     [%- END %]
48
     <th align="right">[% 'Qty' | $T8 %]</th>
49
     <th align="right">[% 'Unit' | $T8 %]</th>
50
    </tr>
51

  
52
    [%- FOREACH row = WHCONTENTS %]
53
    <tr [% IF row.stock_error %] class="error"[% ELSE %]class="listrow"[% END %]>
54
     <td>[% loop.count %]</td>
55
     <td>[% row.warehousedescription | html %]</td>
56
     <td>[% row.bindescription | html %]</td>
57
     <td>[% row.chargenumber | html %]</td>
58
     [% IF INSTANCE_CONF.get_show_bestbefore %]
59
     <td>[% row.bestbefore | html %]</td>
60
     [% END %]
61

  
62
     [%- IF delivered %]
63

  
64
     <td>[% LxERP.format_amount(row.stock_qty) | html %]</td>
65
     <td>
66
      [% row.stock_unit | html %]
67
      [% L.hidden_tag("unit", row.stock_unit, class="data-unit") %]
68
     </td>
69

  
70
     [%- ELSE %]
71

  
72
     <td>[% row.available_qty | html %]</td>
73
     <td>
74
      [% L.input_tag("qty", row.stock_qty                              ? LxERP.format_amount(row.stock_qty)
75
                          : (WHCONTENTS.size == 1) && (!row.stock_qty) ? LxERP.format_amount(do_qty)
76
                          : "", class="numeric data-qty", size="12") %]</td>
77
     <td>[% L.select_tag("unit_" _ loop.count, part.unit_obj.convertible_units, value_key="name", default=row.stock_unit, class="data-unit") %]</td>
78

  
79
     [%- END %]
80
     <td style="display:none">
81
      [% L.hidden_tag("warehouse_id", row.warehouse_id, class="data-warehouse-id") %]
82
      [% L.hidden_tag("bin_id", row.bin_id, class="data-bin-id") %]
83
      [% L.hidden_tag("chargenumber", row.chargenumber, class="data-chargenumber") %]
84
      [% L.hidden_tag("delivery_order_items_stock_id", row.delivery_order_items_stock_id, class="data-stock-id") %]
85
      [% L.hidden_tag("bestbefore", row.bestbefore, class="data-bestbefore") IF INSTANCE_CONF.get_show_bestbefore %]
86
     </td>
87
    </tr>
88

  
89
    [%- END %]
90
   </table>
91
  </p>
92

  
93
  <hr size="3" noshade>
94

  
95
  <p>[% L.button_tag('kivi.DeliveryOrder.save_updated_stock()', LxERP.t8('Save')) IF !delivered %]</p>
96

  
97
  [%- END %]
98
 </form>
99

  
100 5

  
6
<tr class="listheading">
7
 <th>&nbsp;</th>
8
 <th>[% 'Warehouse' | $T8 %]</th>
9
 <th>[% 'Bin' | $T8 %]</th>
10
 <th>[% 'Charge Number' | $T8 %]</th>
11
 [% IF INSTANCE_CONF.get_show_bestbefore %]
12
 <th>[% 'Best Before' | $T8 %]</th>
13
 [% END %]
14
 <th align="right">[% 'Available qty' | $T8 %]</th>
15
 <th align="right">[% 'Qty' | $T8 %]</th>
16
 <th align="right">[% 'Unit' | $T8 %]</th>
17
</tr>
18

  
19
[%- FOREACH row = WHCONTENTS %]
20
<tr [% IF row.stock_error %] class="error"[% ELSE %]class="listrow"[% END %]>
21
 <td>[% loop.count %]</td>
22
 <td>[% row.warehousedescription | html %]</td>
23
 <td>[% row.bindescription | html %]</td>
24
 <td>[% row.chargenumber | html %]</td>
25
 [% IF INSTANCE_CONF.get_show_bestbefore %]
26
 <td>[% row.bestbefore | html %]</td>
27
 [% END %]
28

  
29
 <td>[% row.available_qty | html %]</td>
30
 <td>
31
  [% L.input_tag("qty", row.stock_qty                              ? LxERP.format_amount(row.stock_qty)
32
                      : (WHCONTENTS.size == 1) && (!row.stock_qty) ? LxERP.format_amount(do_qty)
33
                      : "", class="numeric data-qty", size="12") %]</td>
34
 <td>[% L.select_tag("unit_" _ loop.count, part.unit_obj.convertible_units, value_key="name", default=row.stock_unit, class="data-unit") %]</td>
35

  
36
 <td style="display:none">
37
  [% L.hidden_tag("warehouse_id", row.warehouse_id, class="data-warehouse-id") %]
38
  [% L.hidden_tag("bin_id", row.bin_id, class="data-bin-id") %]
39
  [% L.hidden_tag("chargenumber", row.chargenumber, class="data-chargenumber") %]
40
  [% L.hidden_tag("delivery_order_items_stock_id", row.delivery_order_items_stock_id, class="data-stock-id") %]
41
  [% L.hidden_tag("bestbefore", row.bestbefore, class="data-bestbefore") IF INSTANCE_CONF.get_show_bestbefore %]
42
 </td>
43
</tr>
44
[%- END %]

Auch abrufbar als: Unified diff