5 use base qw( FS::Record );
6 use Business::CreditCard 0.28;
7 use FS::Record qw( dbh qsearch qsearchs );
15 @ISA = qw( FS::m2m_Common FS::Record );
19 FS::sales - Object methods for sales records
25 $record = new FS::sales \%hash;
26 $record = new FS::sales { 'column' => 'value' };
28 $error = $record->insert;
30 $error = $new_record->replace($old_record);
32 $error = $record->delete;
34 $error = $record->check;
38 An FS::sales object represents an example. FS::sales inherits from
39 FS::Record. The following fields are currently supported:
64 Creates a new example. To add the example 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 # the new method can be inherited from FS::Record, if a table method is defined
73 sub table { 'sales'; }
77 Adds this record to the database. If there is an error, returns the error,
78 otherwise returns false.
82 # the insert method can be inherited from FS::Record
86 Delete this record from the database.
90 # the delete method can be inherited from FS::Record
92 =item replace OLD_RECORD
94 Replaces the OLD_RECORD with this one in the database. If there is an error,
95 returns the error, otherwise returns false.
99 # the replace method can be inherited from FS::Record
103 Checks all fields to make sure this is a valid example. If there is
104 an error, returns the error, otherwise returns false. Called by the insert
109 # the check method should currently be supplied - FS::Record contains some
110 # data checking routines
116 $self->ut_numbern('salesnum')
117 || $self->ut_numbern('agentnum')
119 return $error if $error;
121 if ( $self->dbdef_table->column('disabled') ) {
122 $error = $self->ut_enum('disabled', [ '', 'Y' ] );
123 return $error if $error;
133 The author forgot to customize this manpage.
137 L<FS::Record>, schema.html from the base documentation.