Revision 7991ed2b
Von Sven Schöling vor etwa 10 Jahren hinzugefügt
bin/mozilla/io.pl | ||
---|---|---|
325 | 325 |
$column_data{weight} = $form->format_amount(\%myconfig, $form->{"qty_$i"} * $form->{"weight_$i"}, 3) . ' ' . $defaults->{weightunit} if $defaults->{show_weight}; |
326 | 326 |
|
327 | 327 |
if ($form->{"id_${i}"} && !$is_delivery_order) { |
328 |
my $price_source = SL::PriceSource->new(record_item => $record_item, record => $record); |
|
329 |
my $price = $price_source->price_from_source($::form->{"active_price_source_$i"}); |
|
330 |
my $discount = $price_source->price_from_source($::form->{"active_discount_source_$i"}); |
|
328 |
my $price_source = SL::PriceSource->new(record_item => $record_item, record => $record); |
|
329 |
my $price = $price_source->price_from_source($::form->{"active_price_source_$i"}); |
|
330 |
my $discount = $price_source->price_from_source($::form->{"active_discount_source_$i"}); |
|
331 |
my $best_price = $price_source->best_price; |
|
332 |
my $best_discount = $price_source->best_discount; |
|
331 | 333 |
$column_data{price_source} .= $cgi->button(-value => $price->source_description, -onClick => "kivi.io.price_chooser($i)"); |
332 | 334 |
if ($price->source) { |
333 | 335 |
$column_data{price_source} .= ' ' . $cgi->img({src => 'image/flag-red.png', alt => $price->invalid, title => $price->invalid }) if $price->invalid; |
... | ... | |
335 | 337 |
if (!$price->missing && !$price->invalid) { |
336 | 338 |
$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; |
337 | 339 |
$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; |
338 |
$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; |
|
340 |
$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 $best_price && $price->source ne $price_source->best_price->source;
|
|
339 | 341 |
} |
340 | 342 |
} |
341 | 343 |
if ($discount->source) { |
... | ... | |
344 | 346 |
if (!$discount->missing && !$discount->invalid) { |
345 | 347 |
$column_data{price_source} .= ' ' . $cgi->img({src => 'image/up.png', alt => t8('This discount has since gone up'), title => t8('This discount has since gone up') }) if $discount->discount * 100 > $record_item->discount; |
346 | 348 |
$column_data{price_source} .= ' ' . $cgi->img({src => 'image/down.png', alt => t8('This discount has since gone down'), title => t8('This discount has since gone down') }) if $discount->discount * 100 < $record_item->discount; |
347 |
$column_data{price_source} .= ' ' . $cgi->img({src => 'image/ok.png', alt => t8('There is a better discount available'), title => t8('There is a better discount available') }) if $discount->source ne $price_source->best_discount->source; |
|
349 |
$column_data{price_source} .= ' ' . $cgi->img({src => 'image/ok.png', alt => t8('There is a better discount available'), title => t8('There is a better discount available') }) if $best_discount && $discount->source ne $price_source->best_discount->source;
|
|
348 | 350 |
} |
349 | 351 |
} |
350 | 352 |
} |
Auch abrufbar als: Unified diff
PriceSource: Keine Fehler werfen wenn best_price nicht existiert