Revision 6802a9e9
Von Sven Schöling vor etwa 3 Jahren hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
4 | 4 |
use parent qw(SL::Controller::Base); |
5 | 5 |
|
6 | 6 |
use SL::Helper::Flash qw(flash_later); |
7 |
use SL::Helper::Number qw(_format_number_units); |
|
7 | 8 |
use SL::Presenter::Tag qw(select_tag hidden_tag div_tag); |
8 | 9 |
use SL::Locale::String qw(t8); |
9 | 10 |
use SL::SessionFile::Random; |
... | ... | |
1930 | 1931 |
return @errors; |
1931 | 1932 |
} |
1932 | 1933 |
|
1934 |
sub calculate_stock_in_out { |
|
1935 |
my ($self, $item) = @_; |
|
1936 |
|
|
1937 |
return "" if !$item->part || !$item->part->unit; |
|
1938 |
|
|
1939 |
my $in_out = $self->type_data->properties("transfer"); |
|
1940 |
|
|
1941 |
my $do_qty = $item->qty; |
|
1942 |
my $sum = sum0 map { $_->unit_obj->convert_to($_->qty, $item->unit_obj) } @{ $item->delivery_order_stock_entries }; |
|
1943 |
|
|
1944 |
my $matches = $do_qty == $sum; |
|
1945 |
my $content = _format_number_units($sum, 2, $item->unit_obj, $item->part->unit_obj); |
|
1946 |
|
|
1947 |
return $content; |
|
1948 |
} |
|
1949 |
|
|
1933 | 1950 |
sub init_type_data { |
1934 | 1951 |
SL::Controller::DeliveryOrder::TypeData->new($_[0]); |
1935 | 1952 |
} |
templates/webpages/delivery_order/tabs/_row.html | ||
---|---|---|
85 | 85 |
value_key = 'name', |
86 | 86 |
class = 'unitselect') %] |
87 | 87 |
</td> |
88 |
|
|
89 |
<td> |
|
90 |
<span id="stock_[% ID %]">[% SELF.calculate_stock_in_out(ITEM) %]</span> |
|
91 |
<input type=hidden id='stock_in_out_qty_matches_[% ID %]' value='$matches'> |
|
92 |
<input type="button" onclick="kivi.DeliveryOrder.open_stock_in_out_window('[% in_out %]', ID);" value="?"> |
|
93 |
</td> |
|
88 | 94 |
</tr> |
89 | 95 |
|
90 | 96 |
<tr [%- IF !MYCONFIG.show_form_details -%]style="display:none"[%- END -%]> |
templates/webpages/delivery_order/tabs/basic_data.html | ||
---|---|---|
222 | 222 |
[%- END -%] |
223 | 223 |
<th id="qty_header_id" class="listheading" nowrap width="5" ><a href='#' onClick='javascript:kivi.DeliveryOrder.reorder_items("qty")'> [%- 'Qty' | $T8 %]</a></th> |
224 | 224 |
<th class="listheading" nowrap width="5" >[%- 'Unit' | $T8 %] </th> |
225 |
[% IF inout == 'in' %] |
|
226 |
<th class="listheading" nowrap width="5" >[%- 'Transfer To Stock' | $T8 %] </th> |
|
227 |
[% END %] |
|
228 |
[% IF inout == 'out' %] |
|
229 |
<th class="listheading" nowrap width="5" >[%- 'Release From Stock' | $T8 %] </th> |
|
230 |
[% END %] |
|
225 | 231 |
</tr> |
226 | 232 |
</thead> |
227 | 233 |
|
Auch abrufbar als: Unified diff
DeliveryOrder: Lagermengen Spalte