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 |
} |
Auch abrufbar als: Unified diff
DeliveryOrder: Lagermengen Spalte