1 package FS::part_pkg_discount;
2 use base qw( FS::Record );
8 FS::part_pkg_discount - Object methods for part_pkg_discount records
12 use FS::part_pkg_discount;
14 $record = new FS::part_pkg_discount \%hash;
15 $record = new FS::part_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::part_pkg_discount object represents a link from a package definition
28 to a discount. This permits discounts for lengthened terms. FS::part_pkg_discount inherits from
29 FS::Record. The following fields are currently supported:
54 Creates a new part_pkg_discount. To add the example to the database, see L<"insert">.
56 Note that this stores the hash reference, not a distinct copy of the hash it
57 points to. You can ask the object for a copy with the I<hash> method.
61 sub table { 'part_pkg_discount'; }
65 Adds this record to the database. If there is an error, returns the error,
66 otherwise returns false.
72 Delete this record from the database.
76 =item replace OLD_RECORD
78 Replaces the OLD_RECORD with this one in the database. If there is an error,
79 returns the error, otherwise returns false.
85 Checks all fields to make sure this is a valid example. If there is
86 an error, returns the error, otherwise returns false. Called by the insert
95 $self->ut_numbern('pkgdiscountnum')
96 || $self->ut_number('pkgpart')
97 || $self->ut_number('discountnum')
99 return $error if $error;
106 Returns the discount associated with this part_pkg_discount.
114 L<FS::Record>, schema.html from the base documentation.