Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision bc74b812

Von Bernd Bleßmann vor etwa 1 Jahr hinzugefügt

  • ID bc74b812082fc92cf46de68bf2cda575223e1dc2
  • Vorgänger e1bb8e62
  • Nachfolger e88abf24

Lagerbestand: Preisfaktor anzeigen, wenn ein Preis angezeigt wird

Unterschiede anzeigen:

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),

Auch abrufbar als: Unified diff