Revision bc74b812
Von Bernd Bleßmann vor etwa 1 Jahr hinzugefügt
SL/WH.pm | ||
---|---|---|
637 | 637 |
"stock_value" => ($form->{stock_value_basis} // '') eq 'list_price' ? "p.listprice / COALESCE(pfac.factor, 1)" : "p.lastcost / COALESCE(pfac.factor, 1)", |
638 | 638 |
"purchase_price" => "p.lastcost", |
639 | 639 |
"list_price" => "p.listprice", |
640 |
"price_factor" => ($form->{l_purchase_price} || $form->{l_list_price}) ? "pfac.description" : undef, |
|
640 | 641 |
); |
641 | 642 |
$form->{l_classification_id} = 'Y'; |
642 | 643 |
$form->{l_part_type} = 'Y'; |
644 |
$form->{l_price_factor} = 'Y' if $form->{l_purchase_price} || $form->{l_list_price}; |
|
643 | 645 |
|
644 | 646 |
my $select_clause = join ', ', map { +/^l_/; "$select_tokens{$'} AS $'" } |
645 | 647 |
( grep( { !/qty/ and !/^l_cvar/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), |
... | ... | |
651 | 653 |
|
652 | 654 |
my @join_values = (); |
653 | 655 |
my %join_tokens = ( |
654 |
"stock_value" => "LEFT JOIN price_factors pfac ON (p.price_factor_id = pfac.id)", |
|
655 |
); |
|
656 |
"stock_value" => "LEFT JOIN price_factors pfac ON (p.price_factor_id = pfac.id)", |
|
657 |
); |
|
658 |
$join_tokens{price_factor} = "LEFT JOIN price_factors pfac ON (p.price_factor_id = pfac.id)" if !$form->{l_stock_value}; |
|
656 | 659 |
|
657 | 660 |
my $joins = join ' ', grep { $_ } map { +/^l_/; $join_tokens{"$'"} } |
658 | 661 |
( grep( { !/qty/ and !/^l_cvar/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), |
bin/mozilla/wh.pl | ||
---|---|---|
871 | 871 |
my $sort_col = $form->{sort}; |
872 | 872 |
|
873 | 873 |
my %filter; |
874 |
my @columns = qw(warehouse bin partnumber type_and_classific partdescription chargenumber bestbefore comment qty partunit list_price purchase_price stock_value); |
|
874 |
my @columns = qw(warehouse bin partnumber type_and_classific partdescription chargenumber bestbefore comment qty partunit list_price purchase_price price_factor stock_value);
|
|
875 | 875 |
|
876 | 876 |
# filter stuff |
877 | 877 |
map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id classification_id partnumber description partsgroup_id chargenumber bestbefore date include_invalid_warehouses); |
... | ... | |
970 | 970 |
'stock_value' => { 'text' => $locale->text('Stock value'), }, |
971 | 971 |
'purchase_price' => { 'text' => $locale->text('Purchase price'), }, |
972 | 972 |
'list_price' => { 'text' => $locale->text('List Price'), }, |
973 |
'price_factor' => { 'text' => $locale->text('Price Factor'), }, |
|
973 | 974 |
); |
974 | 975 |
|
975 | 976 |
my %column_defs_cvars = map { +"cvar_$_->{name}" => { 'text' => $_->{description} } } @includeable_custom_variables; |
... | ... | |
987 | 988 |
grep {!/^cvar_/ or $cvar_is_text{$_}} |
988 | 989 |
@columns; |
989 | 990 |
|
990 |
my %column_alignment = map { $_ => 'right' } qw(qty list_price purchase_price stock_value); |
|
991 |
my %column_alignment = map { $_ => 'right' } qw(qty list_price purchase_price price_factor stock_value);
|
|
991 | 992 |
|
992 | 993 |
map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns; |
993 | 994 |
|
Auch abrufbar als: Unified diff
Lagerbestand: Preisfaktor anzeigen, wenn ein Preis angezeigt wird