Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision bc74b812

Von Bernd Bleßmann vor mehr als 1 Jahr hinzugefügt

  • ID bc74b812082fc92cf46de68bf2cda575223e1dc2
  • Vorgänger e1bb8e62
  • Nachfolger e88abf24

Lagerbestand: Preisfaktor anzeigen, wenn ein Preis angezeigt wird

Unterschiede anzeigen:

SL/WH.pm
"stock_value" => ($form->{stock_value_basis} // '') eq 'list_price' ? "p.listprice / COALESCE(pfac.factor, 1)" : "p.lastcost / COALESCE(pfac.factor, 1)",
"purchase_price" => "p.lastcost",
"list_price" => "p.listprice",
"price_factor" => ($form->{l_purchase_price} || $form->{l_list_price}) ? "pfac.description" : undef,
);
$form->{l_classification_id} = 'Y';
$form->{l_part_type} = 'Y';
$form->{l_price_factor} = 'Y' if $form->{l_purchase_price} || $form->{l_list_price};
my $select_clause = join ', ', map { +/^l_/; "$select_tokens{$'} AS $'" }
( grep( { !/qty/ and !/^l_cvar/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form),
......
my @join_values = ();
my %join_tokens = (
"stock_value" => "LEFT JOIN price_factors pfac ON (p.price_factor_id = pfac.id)",
);
"stock_value" => "LEFT JOIN price_factors pfac ON (p.price_factor_id = pfac.id)",
);
$join_tokens{price_factor} = "LEFT JOIN price_factors pfac ON (p.price_factor_id = pfac.id)" if !$form->{l_stock_value};
my $joins = join ' ', grep { $_ } map { +/^l_/; $join_tokens{"$'"} }
( grep( { !/qty/ and !/^l_cvar/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form),
bin/mozilla/wh.pl
my $sort_col = $form->{sort};
my %filter;
my @columns = qw(warehouse bin partnumber type_and_classific partdescription chargenumber bestbefore comment qty partunit list_price purchase_price stock_value);
my @columns = qw(warehouse bin partnumber type_and_classific partdescription chargenumber bestbefore comment qty partunit list_price purchase_price price_factor stock_value);
# filter stuff
map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id classification_id partnumber description partsgroup_id chargenumber bestbefore date include_invalid_warehouses);
......
'stock_value' => { 'text' => $locale->text('Stock value'), },
'purchase_price' => { 'text' => $locale->text('Purchase price'), },
'list_price' => { 'text' => $locale->text('List Price'), },
'price_factor' => { 'text' => $locale->text('Price Factor'), },
);
my %column_defs_cvars = map { +"cvar_$_->{name}" => { 'text' => $_->{description} } } @includeable_custom_variables;
......
grep {!/^cvar_/ or $cvar_is_text{$_}}
@columns;
my %column_alignment = map { $_ => 'right' } qw(qty list_price purchase_price stock_value);
my %column_alignment = map { $_ => 'right' } qw(qty list_price purchase_price price_factor stock_value);
map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns;

Auch abrufbar als: Unified diff