1 package FS::cust_class;
4 use base qw( FS::class_Common );
10 FS::cust_class - Object methods for cust_class records
16 $record = new FS::cust_class \%hash;
17 $record = new FS::cust_class { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::pkg_class object represents an customer class. Every customer (see
30 L<FS::cust_main>) has, optionally, a customer class. FS::cust_class inherits
31 from FS::Record. The following fields are currently supported:
41 Text name of this customer class
45 Number of associated cust_category (see L<FS::cust_category>)
49 Tax exempt flag, empty or 'Y'. Used when the cust_class-tax_exempt
50 configuration setting is turned on.
54 Disabled flag, empty or 'Y'
64 Creates a new customer class. To add the customer class to the database, see
69 sub table { 'cust_class'; }
70 sub _target_table { 'cust_main'; }
74 Adds this customer class to the database. If there is an error, returns the
75 error, otherwise returns false.
79 Delete this customer class from the database. Only customer classes with no
80 associated customers can be deleted. If there is an error, returns
81 the error, otherwise returns false.
83 =item replace [ OLD_RECORD ]
85 Replaces OLD_RECORD with this one in the database. If there is an error,
86 returns the error, otherwise returns false.
90 Checks all fields to make sure this is a valid customer class. If there is
91 an error, returns the error, otherwise returns false. Called by the insert
99 $self->ut_enum('tax', [ '', 'Y' ])
100 || $self->SUPER::check;
108 Returns the cust_category record associated with this class, or false if there
120 Returns the category name associated with this class, or false if there
131 L<FS::cust_main>, L<FS::Record>