Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 049e49fe

Von Sven Schöling vor etwa 10 Jahren hinzugefügt

  • ID 049e49fea3e4a3c7c78d7aebf055936b3cab40c5
  • Vorgänger ed83bf47
  • Nachfolger b776c6ba

PriceSource: Preisselektion auf Popup umgestellt.

- Logik für geänderte Preise implementiert
- Visualisierung verbessert
- fix für emptied rows
- nachricht wenn invalid und missing
- benachrichtigung für höher/niedriger
- js ausgelagert
- best price benachrichtigung

noch offene bugs:
- preise mit mehr als 2 stellen werden abgeschnitten
- interaktive preise noch nicht möglich
- symbol für "besser preis" ist nicht schön
- beide make_record_item implementierungen sind leicht unterschiedlich
- pricesource controller grösstenteils ungetestet
- performance ist im moment mies

Unterschiede anzeigen:

bin/mozilla/io.pl
44 44
use SL::CVar;
45 45
use SL::Common;
46 46
use SL::CT;
47
use SL::Locale::String qw(t8);
47 48
use SL::IC;
48 49
use SL::IO;
49 50
use SL::PriceSource;
......
325 326
    if ($form->{"id_${i}"}) {
326 327
      my $price_source = SL::PriceSource->new(record_item => $record_item, record => $record);
327 328
      my $price = $price_source->price_from_source($::form->{"active_price_source_$i"});
328
      $::form->{price_sources}[$i] = $price_source;
329
      $column_data{price_source} .= $cgi->button(-value => $price->full_description, -onClick => "toggle_price_source($i)");
329
      $column_data{price_source} .= $cgi->button(-value => $price->full_description, -onClick => "kivi.io.price_chooser($i)");
330
      if ($price->source) {
331
        $column_data{price_source} .= ' ' . $cgi->img({src => 'image/flag-red.png', alt => $price->invalid, title => $price->invalid }) if $price->invalid;
332
        $column_data{price_source} .= ' ' . $cgi->img({src => 'image/flag-red.png', alt => $price->missing, title => $price->missing }) if $price->missing;
333
        $column_data{price_source} .= ' ' . $cgi->img({src => 'image/up.png',   alt => t8('This price has since gone up'),      title => t8('This price has since gone up' )     }) if $price->price > $record_item->sellprice;
334
        $column_data{price_source} .= ' ' . $cgi->img({src => 'image/down.png', alt => t8('This price has since gone down'),    title => t8('This price has since gone down')    }) if $price->price < $record_item->sellprice;
335
        $column_data{price_source} .= ' ' . $cgi->img({src => 'image/ok.png',   alt => t8('There is a better price available'), title => t8('There is a better price available') }) if $price->source ne $price_source->best_price->source;
336
      }
330 337
    }
331 338

  
332 339
    if ($is_delivery_order) {
......
702 709
                price_old price_new unit_old ordnumber donumber
703 710
                transdate longdescription basefactor marge_total marge_percent
704 711
                marge_price_factor lastcost price_factor_id partnotes
705
                stock_out stock_in has_sernumber reqdate orderitems_id);
712
                stock_out stock_in has_sernumber reqdate orderitems_id
713
                active_price_source);
706 714

  
707 715
  my $ic_cvar_configs = CVar->get_configs(module => 'IC');
708 716
  push @flds, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs };
......
1931 1939
    next unless $obj->meta->column($method);
1932 1940
    if ($obj->meta->column($method)->isa('Rose::DB::Object::Metadata::Column::Date')) {
1933 1941
      $obj->${\"$method\_as_date"}($::form->{"$method\_$row"});
1934
    } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) {
1935
      $obj->${\"$method\_as\_number"}($::form->{$method});
1936 1942
    } else {
1937 1943
      $obj->$method($::form->{"$method\_$row"});
1938 1944
    }
......
1978 1984
    if ($obj->meta->column($method)->isa('Rose::DB::Object::Metadata::Column::Date')) {
1979 1985
      $obj->${\"$method\_as_date"}($::form->{$method});
1980 1986
    } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) {
1981
      $obj->${\"$method\_as\_number"}($::form->{$method});
1987
      $obj->${\"$method\_as_number"}($::form->{$method});
1982 1988
    } else {
1983 1989
      $obj->$method($::form->{$method});
1984 1990
    }

Auch abrufbar als: Unified diff