]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/Object.pm
CSV-Import Kunden/Lieferanten: Ungültige Zeichen (\r\n) durch Leerzeichen ersetzen
[mfinanz.git] / SL / DB / Object.pm
index fc13652132f2cb6f9a9efb806e6efe868aed62e1..1c7c050ea2d54924138c0f1b508fde76c62b0a35 100755 (executable)
@@ -60,6 +60,15 @@ sub _assign_attributes {
 
   my %types      = map { $_->name => $_->type } ref($self)->meta->columns;
 
+  # Special case for *_as_man_days / *_as_man_days_string /
+  # *_as_man_days_unit: the _unit variation must always be called
+  # after the non-unit methods.
+  my @man_days_attributes = grep { m/_as_man_days(?:_string)?$/ } keys %attributes;
+  foreach my $attribute (@man_days_attributes) {
+    my $value = delete $attributes{$attribute};
+    $self->$attribute(defined($value) && ($value eq '') ? undef : $value);
+  }
+
   while (my ($attribute, $value) = each %attributes) {
     my $type = lc($types{$attribute} || 'text');
     $value   = $type eq 'boolean'                ? ($value ? 't' : 'f')