1 package FS::cust_class;
2 use base qw( FS::class_Common );
9 FS::cust_class - Object methods for cust_class records
15 $record = new FS::cust_class \%hash;
16 $record = new FS::cust_class { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::pkg_class object represents an customer class. Every customer (see
29 L<FS::cust_main>) has, optionally, a customer class. FS::cust_class inherits
30 from FS::Record. The following fields are currently supported:
40 Text name of this customer class
44 Number of associated cust_category (see L<FS::cust_category>)
48 Tax exempt flag, empty or 'Y'. Used when the cust_class-tax_exempt
49 configuration setting is turned on.
53 Disabled flag, empty or 'Y'
63 Creates a new customer class. To add the customer class to the database, see
68 sub table { 'cust_class'; }
69 sub _target_table { 'cust_main'; }
73 Adds this customer class to the database. If there is an error, returns the
74 error, otherwise returns false.
78 Delete this customer class from the database. Only customer classes with no
79 associated customers can be deleted. If there is an error, returns
80 the error, otherwise returns false.
82 =item replace [ OLD_RECORD ]
84 Replaces OLD_RECORD with this one in the database. If there is an error,
85 returns the error, otherwise returns false.
89 Checks all fields to make sure this is a valid customer class. If there is
90 an error, returns the error, otherwise returns false. Called by the insert
98 $self->ut_enum('tax', [ '', 'Y' ])
99 || $self->SUPER::check;
107 Returns the cust_category record associated with this class, or false if there
119 Returns the category name associated with this class, or false if there
130 L<FS::cust_main>, L<FS::Record>