X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FDB%2FHistory.pm;fp=SL%2FDB%2FHistory.pm;h=98c465ade850de5cf42fda15bbafd430aa4a8b41;hb=53593baa211863fbf66540cf1bcc36c8fb37257f;hp=7528b73f140d8fa3e735c64654c56ba64c983669;hpb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44;p=kivitendo-erp.git diff --git a/SL/DB/History.pm b/SL/DB/History.pm index 7528b73f1..98c465ade 100644 --- a/SL/DB/History.pm +++ b/SL/DB/History.pm @@ -12,4 +12,49 @@ __PACKAGE__->meta->initialize; # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. __PACKAGE__->meta->make_manager_class; +sub parsed_snumber { + my ($self) = @_; + + my ($snumber) = $self->snumbers =~ /^.*?_(.*)/; + return $snumber ? $snumber : $self->snumbers; +} + +1 + +__END__ + +=pod + +=encoding utf-8 + +=head1 NAME + +SL::DB::History: Model for the 'history_erp' table + +=head1 SYNOPSIS + +This is a standard Rose::DB::Object based model and can be used as one. + +=head1 METHODS + +=over 4 + +=item C + +The column snumbers contains entries such as "partnumber_3" or +"customernumber_23". + +To be able to print only the number, parsed_snumber returns only the part of +the string following the first "_". + +Returns the whole string if the regex doesn't match anything. + +=back + +=head1 AUTHORS + +G. Richardson Egrichardson@kivitendo-premium.deE + +=cut + 1;