4 use base qw( FS::otaker_Mixin FS::Record );
5 use FS::Record; # qw( qsearch qsearchs );
11 FS::quotation - Object methods for quotation records
17 $record = new FS::quotation \%hash;
18 $record = new FS::quotation { 'column' => 'value' };
20 $error = $record->insert;
22 $error = $new_record->replace($old_record);
24 $error = $record->delete;
26 $error = $record->check;
30 An FS::quotation object represents a quotation. FS::quotation inherits from
31 FS::Record. The following fields are currently supported:
68 Creates a new quotation. To add the quotation to the database, see L<"insert">.
70 Note that this stores the hash reference, not a distinct copy of the hash it
71 points to. You can ask the object for a copy with the I<hash> method.
75 sub table { 'quotation'; }
79 Adds this record to the database. If there is an error, returns the error,
80 otherwise returns false.
84 Delete this record from the database.
86 =item replace OLD_RECORD
88 Replaces the OLD_RECORD with this one in the database. If there is an error,
89 returns the error, otherwise returns false.
93 Checks all fields to make sure this is a valid quotation. If there is
94 an error, returns the error, otherwise returns false. Called by the insert
103 $self->ut_numbern('quotationnum')
104 || $self->ut_foreign_keyn('prospectnum', 'prospect_main', 'prospectnum' )
105 || $self->ut_foreign_keyn('custnum', 'cust_main', 'custnum' )
106 || $self->ut_numbern('_date')
107 || $self->ut_enum('disabled', [ '', 'Y' ])
108 || $self->ut_numbern('usernum')
110 return $error if $error;
112 $self->_date(time) unless $self->_date;
125 qsearchs('prospect_main', { 'prospectnum' => $self->prospectnum } );
134 qsearchs('cust_main', { 'custnum' => $self->custnum } );
143 L<FS::Record>, schema.html from the base documentation.