1 package FS::rate_tier_detail;
2 use base qw( FS::Record );
5 use FS::Record; # qw( qsearch qsearchs );
10 FS::rate_tier_detail - Object methods for rate_tier_detail records
14 use FS::rate_tier_detail;
16 $record = new FS::rate_tier_detail \%hash;
17 $record = new FS::rate_tier_detail { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::rate_tier_detail object represents rate tier pricing.
30 FS::rate_tier_detail inherits from FS::Record. The following fields are
60 Creates a new record. To add the record to the database, see L<"insert">.
62 Note that this stores the hash reference, not a distinct copy of the hash it
63 points to. You can ask the object for a copy with the I<hash> method.
67 # the new method can be inherited from FS::Record, if a table method is defined
69 sub table { 'rate_tier_detail'; }
73 Adds this record to the database. If there is an error, returns the error,
74 otherwise returns false.
78 # the insert method can be inherited from FS::Record
82 Delete this record from the database.
86 # the delete method can be inherited from FS::Record
88 =item replace OLD_RECORD
90 Replaces the OLD_RECORD with this one in the database. If there is an error,
91 returns the error, otherwise returns false.
95 # the replace method can be inherited from FS::Record
99 Checks all fields to make sure this is a valid record. If there is
100 an error, returns the error, otherwise returns false. Called by the insert
105 # the check method should currently be supplied - FS::Record contains some
106 # data checking routines
111 my $min_quan = $self->min_quan;
112 $min_quan =~ s/[ ,]//g;
113 $self->min_quan($min_quan);
115 $self->min_quan(0) if $self->min_quan eq '';
118 $self->ut_numbern('tierdetailnum')
119 || $self->ut_foreign_key('tiernum', 'rate_tier', 'tiernum')
120 || $self->ut_number('min_quan')
121 || $self->ut_textn('min_charge') #XXX money? but we use 4 decimal places
123 return $error if $error;
134 L<FS::Record>, schema.html from the base documentation.