Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision bc7f4566

Von Kivitendo Admin vor mehr als 7 Jahren hinzugefügt

  • ID bc7f45666f262ea425b14494669627a4e268bb46
  • Vorgänger 5fcefdf7
  • Nachfolger bf9801d4

neue Methode parsed_snumber in SL::DB::History

Unterschiede anzeigen:

SL/DB/History.pm
12 12
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
13 13
__PACKAGE__->meta->make_manager_class;
14 14

  
15
sub parsed_snumber {
16
  my ($self) = @_;
17

  
18
  my ($snumber) = $self->snumbers =~ /^.*?_(.*)/;
19
  return $snumber ? $snumber : $self->snumbers;
20
}
21

  
22
1
23

  
24
__END__
25

  
26
=pod
27

  
28
=encoding utf-8
29

  
30
=head1 NAME
31

  
32
SL::DB::History: Model for the 'history_erp' table
33

  
34
=head1 SYNOPSIS
35

  
36
This is a standard Rose::DB::Object based model and can be used as one.
37

  
38
=head1 METHODS
39

  
40
=over 4
41

  
42
=item C<parsed_snumber>
43

  
44
The column snumbers contains entries such as "partnumber_3" or
45
"customernumber_23".
46

  
47
To be able to print only the number, parsed_snumber returns only the part of
48
the string following the first "_".
49

  
50
Returns the whole string if the regex doesn't match anything.
51

  
52
=back
53

  
54
=head1 AUTHORS
55

  
56
G. Richardson E<lt>grichardson@kivitendo-premium.deE<gt>
57

  
58
=cut
59

  
15 60
1;

Auch abrufbar als: Unified diff