1 package FS::quotation_pkg_discount;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
9 FS::quotation_pkg_discount - Object methods for quotation_pkg_discount records
13 use FS::quotation_pkg_discount;
15 $record = new FS::quotation_pkg_discount \%hash;
16 $record = new FS::quotation_pkg_discount { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::quotation_pkg_discount object represents a quotation package discount.
29 FS::quotation_pkg_discount inherits from FS::Record. The following fields are
34 =item quotationpkgdiscountnum
55 Creates a new quotation package discount. To add the quotation package
56 discount to the database, see L<"insert">.
58 Note that this stores the hash reference, not a distinct copy of the hash it
59 points to. You can ask the object for a copy with the I<hash> method.
63 # the new method can be inherited from FS::Record, if a table method is defined
65 sub table { 'quotation_pkg_discount'; }
69 Adds this record to the database. If there is an error, returns the error,
70 otherwise returns false.
74 # the insert method can be inherited from FS::Record
78 Delete this record from the database.
82 # the delete method can be inherited from FS::Record
84 =item replace OLD_RECORD
86 Replaces the OLD_RECORD with this one in the database. If there is an error,
87 returns the error, otherwise returns false.
91 # the replace method can be inherited from FS::Record
95 Checks all fields to make sure this is a valid quotation package discount.
96 If there is an error, returns the error, otherwise returns false.
97 Called by the insert and replace methods.
101 # the check method should currently be supplied - FS::Record contains some
102 # data checking routines
108 $self->ut_numbern('quotationpkgdiscountnum')
109 || $self->ut_foreign_key('quotationpkgnum', 'quotation_pkg', 'quotationpkgnum' )
110 || $self->ut_foreign_key('discountnum', 'discount', 'discountnum' )
112 return $error if $error;
123 L<FS::Record>, schema.html from the base documentation.