From: Moritz Bunkus Date: Mon, 18 May 2009 13:07:33 +0000 (+0000) Subject: List::MoreUtils für kompakteren Code benutzen. X-Git-Tag: release-2.6.0rc1~41 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d6369b1f946980f0e22fc18da3fc54a14501b3c5;p=kivitendo-erp.git List::MoreUtils für kompakteren Code benutzen. --- diff --git a/SL/IC.pm b/SL/IC.pm index fdeecc473..5314d4b8e 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -35,6 +35,7 @@ package IC; use Data::Dumper; +use List::MoreUtils qw(all); use YAML; use SL::DBUtils; @@ -343,11 +344,7 @@ sub save { # Check whether or not the prices have changed. If they haven't # then 'priceupdate' should not be updated. my $previous_values = selectfirst_hashref_query($form, $dbh, qq|SELECT * FROM parts WHERE id = ?|, conv_i($form->{id})) || {}; - if ( ($previous_values->{sellprice} == $form->{sellprice}) - && ($previous_values->{lastcost} == $form->{lastcost}) - && ($previous_values->{listprice} == $form->{listprice})) { - $priceupdate = ''; - } + $priceupdate = '' if (all { $previous_values->{$_} == $form->{$_} } qw(sellprice lastcost listprice)); } else { my ($count) = selectrow_query($form, $dbh, qq|SELECT COUNT(*) FROM parts WHERE partnumber = ?|, $form->{partnumber});