1 package FS::cust_main_credit_limit;
2 use base qw( FS::Record );
5 #use FS::Record qw( qsearch qsearchs );
10 FS::cust_main_credit_limit - Object methods for cust_main_credit_limit records
14 use FS::cust_main_credit_limit;
16 $record = new FS::cust_main_credit_limit \%hash;
17 $record = new FS::cust_main_credit_limit { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::cust_main_credit_limit object represents a specific incident where a
30 customer exceeds their credit limit. FS::cust_main_credit_limit inherits from
31 FS::Record. The following fields are currently supported:
41 Customer (see L<FS::cust_main>)
45 Ppecified as a UNIX timestamp; see L<perlfunc/"time">. Also see
46 L<Time::Local> and L<Date::Parse> for conversion functions.
50 Amount of credit of the incident
54 Appliable customer or default credit_limit at the time of the incident
64 Creates a new record. To add the record to the database, see L<"insert">.
66 Note that this stores the hash reference, not a distinct copy of the hash it
67 points to. You can ask the object for a copy with the I<hash> method.
71 sub table { 'cust_main_credit_limit'; }
75 Adds this record to the database. If there is an error, returns the error,
76 otherwise returns false.
80 Delete this record from the database.
82 =item replace OLD_RECORD
84 Replaces the 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 record. If there is
90 an error, returns the error, otherwise returns false. Called by the insert
99 $self->ut_numbern('creditlimitnum')
100 || $self->ut_foreign_keyn('custnum', 'cust_main', 'custnum')
101 || $self->ut_number('_date')
102 || $self->ut_money('amount')
103 || $self->ut_money('credit_limit')
105 return $error if $error;