1 package FS::cust_pkg_detail;
2 use base qw(FS::Record);
8 FS::cust_pkg_detail - Object methods for cust_pkg_detail records
12 use FS::cust_pkg_detail;
14 $record = new FS::cust_pkg_detail \%hash;
15 $record = new FS::cust_pkg_detail { 'column' => 'value' };
17 $error = $record->insert;
19 $error = $new_record->replace($old_record);
21 $error = $record->delete;
23 $error = $record->check;
27 An FS::cust_pkg_detail object represents additional customer package details.
28 FS::cust_pkg_detail inherits from FS::Record. The following fields are
39 pkgnum (see L<FS::cust_pkg>)
47 "I" for Invoice details or "C" for comments
51 Optional display weight
61 Creates a new record. To add the record to the database, see L<"insert">.
63 Note that this stores the hash reference, not a distinct copy of the hash it
64 points to. You can ask the object for a copy with the I<hash> method.
68 # the new method can be inherited from FS::Record, if a table method is defined
70 sub table { 'cust_pkg_detail'; }
74 Adds this record to the database. If there is an error, returns the error,
75 otherwise returns false.
79 # the insert method can be inherited from FS::Record
83 Delete this record from the database.
87 # the delete method can be inherited from FS::Record
89 =item replace OLD_RECORD
91 Replaces the OLD_RECORD with this one in the database. If there is an error,
92 returns the error, otherwise returns false.
96 # the replace method can be inherited from FS::Record
100 Checks all fields to make sure this is a valid record. If there is
101 an error, returns the error, otherwise returns false. Called by the insert
106 # the check method should currently be supplied - FS::Record contains some
107 # data checking routines
113 $self->ut_numbern('pkgdetailnum')
114 || $self->ut_foreign_key('pkgnum', 'cust_pkg', 'pkgnum')
115 || $self->ut_text('detail')
116 || $self->ut_enum('detailtype', [ 'I', 'C' ] )
117 || $self->ut_numbern('weight')
119 return $error if $error;
121 $self->weight(0) unless $self->weight;
132 L<FS::cust_pkg>, L<FS::Record>, schema.html from the base documentation.