From: Sven Schöling Date: Mon, 12 Jan 2015 16:04:47 +0000 (+0100) Subject: PriceSource: Bessere Behandlung von Boolean Werten X-Git-Tag: release-3.2.0beta~95 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a64337532dfca30b712f0a02aeb2df557c0b2c47;p=kivitendo-erp.git PriceSource: Bessere Behandlung von Boolean Werten --- diff --git a/SL/Controller/PriceSource.pm b/SL/Controller/PriceSource.pm index 9f8257c69..df505a60e 100644 --- a/SL/Controller/PriceSource.pm +++ b/SL/Controller/PriceSource.pm @@ -97,6 +97,8 @@ sub _make_record_item { $obj->${\"$method\_as_date"}($::form->{"$method\_$row"}); } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) { $obj->${\"$method\_as_number"}($::form->{"$method\_$row"}); + } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) { + $obj->$method(!!$::form->{$method}); } else { $obj->$method($::form->{"$method\_$row"}); } @@ -147,6 +149,8 @@ sub _make_record { $obj->${\"$method\_as_date"}($::form->{$method}); } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) { $obj->${\"$method\_as\_number"}($::form->{$method}); + } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) { + $obj->$method(!!$::form->{$method}); } else { $obj->$method($::form->{$method}); } diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index f28c7b0de..64eb764ec 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1958,6 +1958,8 @@ sub _make_record_item { $obj->${\"$method\_as_date"}($::form->{"$method\_$row"}); } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) { $obj->${\"$method\_as_number"}($::form->{"$method\_$row"}); + } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) { + $obj->$method(!!$::form->{$method}); } else { $obj->$method($::form->{"$method\_$row"}); } @@ -2004,6 +2006,8 @@ sub _make_record { $obj->${\"$method\_as_date"}($::form->{$method}); } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) { $obj->${\"$method\_as_number"}($::form->{$method}); + } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) { + $obj->$method(!!$::form->{$method}); } else { $obj->$method($::form->{$method}); }