1 package FS::cust_bill_pkg_display;
5 use FS::Record qw( qsearch qsearchs );
11 FS::cust_bill_pkg_display - Object methods for cust_bill_pkg_display records
15 use FS::cust_bill_pkg_display;
17 $record = new FS::cust_bill_pkg_display \%hash;
18 $record = new FS::cust_bill_pkg_display { 'column' => 'value' };
20 $error = $record->insert;
22 $error = $new_record->replace($old_record);
24 $error = $record->delete;
26 $error = $record->check;
30 An FS::cust_bill_pkg_display object represents line item display information.
31 FS::cust_bill_pkg_display inherits from FS::Record. The following fields are
36 =item billpkgdisplaynum
51 my ( $self, $value ) = @_;
52 if ( defined($value) ) {
53 $self->setfield('section', $value);
55 my $section = $self->getfield('section');
57 my $part_pkg = $self->cust_bill_pkg->part_pkg;
58 $section = $part_pkg->categoryname if $part_pkg;
84 Creates a new line item display object. To add the record to the database, see L<"insert">.
86 Note that this stores the hash reference, not a distinct copy of the hash it
87 points to. You can ask the object for a copy with the I<hash> method.
91 sub table { 'cust_bill_pkg_display'; }
95 Adds this record to the database. If there is an error, returns the error,
96 otherwise returns false.
102 Delete this record from the database.
106 =item replace OLD_RECORD
108 Replaces the OLD_RECORD with this one in the database. If there is an error,
109 returns the error, otherwise returns false.
115 Checks all fields to make sure this is a valid line item display object.
116 If there is an error, returns the error, otherwise returns false. Called by
117 the insert and replace methods.
125 $self->ut_numbern('billpkgdisplaynum')
126 || $self->ut_number('billpkgnum')
127 || $self->ut_foreign_key('billpkgnum', 'cust_bill_pkg', 'billpkgnum')
128 || $self->ut_textn('section')
129 || $self->ut_enum('post_total', [ '', 'Y' ])
130 || $self->ut_enum('type', [ '', 'S', 'R', 'U' ])
131 || $self->ut_enum('summary', [ '', 'Y' ])
133 return $error if $error;
140 Returns the associated cust_bill_pkg (see L<FS::cust_bill_pkg>) for this
141 line item display object.
147 qsearchs( 'cust_bill_pkg', { 'billpkgnum' => $self->billpkgnum } ) ;
158 L<FS::Record>, L<FS::cust_bill_pkg>, schema.html from the base documentation.