Revision d6369b1f
Von Moritz Bunkus vor mehr als 15 Jahren hinzugefügt
SL/IC.pm | ||
---|---|---|
35 | 35 |
package IC; |
36 | 36 |
|
37 | 37 |
use Data::Dumper; |
38 |
use List::MoreUtils qw(all); |
|
38 | 39 |
use YAML; |
39 | 40 |
|
40 | 41 |
use SL::DBUtils; |
... | ... | |
343 | 344 |
# Check whether or not the prices have changed. If they haven't |
344 | 345 |
# then 'priceupdate' should not be updated. |
345 | 346 |
my $previous_values = selectfirst_hashref_query($form, $dbh, qq|SELECT * FROM parts WHERE id = ?|, conv_i($form->{id})) || {}; |
346 |
if ( ($previous_values->{sellprice} == $form->{sellprice}) |
|
347 |
&& ($previous_values->{lastcost} == $form->{lastcost}) |
|
348 |
&& ($previous_values->{listprice} == $form->{listprice})) { |
|
349 |
$priceupdate = ''; |
|
350 |
} |
|
347 |
$priceupdate = '' if (all { $previous_values->{$_} == $form->{$_} } qw(sellprice lastcost listprice)); |
|
351 | 348 |
|
352 | 349 |
} else { |
353 | 350 |
my ($count) = selectrow_query($form, $dbh, qq|SELECT COUNT(*) FROM parts WHERE partnumber = ?|, $form->{partnumber}); |
Auch abrufbar als: Unified diff
List::MoreUtils für kompakteren Code benutzen.