1 package FS::cdr_cust_pkg_usage;
2 use base qw( FS::Record );
8 FS::cdr_cust_pkg_usage - Object methods for cdr_cust_pkg_usage records
12 use FS::cdr_cust_pkg_usage;
14 $record = new FS::cdr_cust_pkg_usage \%hash;
15 $record = new FS::cdr_cust_pkg_usage { 'column' => 'value' };
17 $error = $record->insert;
19 $error = $new_record->replace($old_record);
21 $error = $record->delete;
23 $error = $record->check;
27 An FS::cdr_cust_pkg_usage object represents an allocation of included
28 usage minutes to a call. FS::cdr_cust_pkg_usage inherits from
29 FS::Record. The following fields are currently supported:
33 =item cdrusagenum - primary key
35 =item acctid - foreign key to cdr.acctid
37 =item pkgusagenum - foreign key to cust_pkg_usage.pkgusagenum
39 =item minutes - the number of minutes allocated
49 Creates a new example. To add the example to the database, see L<"insert">.
51 Note that this stores the hash reference, not a distinct copy of the hash it
52 points to. You can ask the object for a copy with the I<hash> method.
56 # the new method can be inherited from FS::Record, if a table method is defined
58 sub table { 'cdr_cust_pkg_usage'; }
62 Adds this record to the database. If there is an error, returns the error,
63 otherwise returns false.
67 Delete this record from the database.
69 =item replace OLD_RECORD
71 Replaces the OLD_RECORD with this one in the database. If there is an error,
72 returns the error, otherwise returns false.
76 Checks all fields to make sure this is a valid example. If there is
77 an error, returns the error, otherwise returns false. Called by the insert
86 $self->ut_numbern('cdrusagenum')
87 || $self->ut_foreign_key('acctid', 'cdr', 'acctid')
88 || $self->ut_foreign_key('pkgusagenum', 'cust_pkg_usage', 'pkgusagenum')
89 || $self->ut_float('minutes')
91 return $error if $error;
98 Returns the L<FS::cust_pkg_usage> object that this usage allocation came from.
102 Returns the L<FS::cdr> object that the usage was applied to.
108 L<FS::Record>, schema.html from the base documentation.