1 package FS::quotation_pkg_discount;
2 use base qw( FS::Record );
8 FS::quotation_pkg_discount - Object methods for quotation_pkg_discount records
12 use FS::quotation_pkg_discount;
14 $record = new FS::quotation_pkg_discount \%hash;
15 $record = new FS::quotation_pkg_discount { 'column' => 'value' };
17 $error = $record->insert;
19 $error = $new_record->replace($old_record);
21 $error = $record->delete;
23 $error = $record->check;
27 An FS::quotation_pkg_discount object represents a quotation package discount.
28 FS::quotation_pkg_discount inherits from FS::Record. The following fields are
33 =item quotationpkgdiscountnum
54 Creates a new quotation package discount. To add the quotation package
55 discount to the database, see L<"insert">.
57 Note that this stores the hash reference, not a distinct copy of the hash it
58 points to. You can ask the object for a copy with the I<hash> method.
62 # the new method can be inherited from FS::Record, if a table method is defined
64 sub table { 'quotation_pkg_discount'; }
68 Adds this record to the database. If there is an error, returns the error,
69 otherwise returns false.
73 # the insert method can be inherited from FS::Record
77 Delete this record from the database.
81 # the delete method can be inherited from FS::Record
83 =item replace OLD_RECORD
85 Replaces the OLD_RECORD with this one in the database. If there is an error,
86 returns the error, otherwise returns false.
90 # the replace method can be inherited from FS::Record
94 Checks all fields to make sure this is a valid quotation package discount.
95 If there is an error, returns the error, otherwise returns false.
96 Called by the insert and replace methods.
100 # the check method should currently be supplied - FS::Record contains some
101 # data checking routines
107 $self->ut_numbern('quotationpkgdiscountnum')
108 || $self->ut_foreign_key('quotationpkgnum', 'quotation_pkg', 'quotationpkgnum' )
109 || $self->ut_foreign_key('discountnum', 'discount', 'discountnum' )
111 return $error if $error;
122 L<FS::Record>, schema.html from the base documentation.