1 package FS::part_pkg_usageprice;
2 use base qw( FS::Record );
5 #use FS::Record qw( qsearch qsearchs );
9 FS::part_pkg_usageprice - Object methods for part_pkg_usageprice records
13 use FS::part_pkg_usageprice;
15 $record = new FS::part_pkg_usageprice \%hash;
16 $record = new FS::part_pkg_usageprice { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::part_pkg_usageprice object represents a usage pricing add-on.
29 FS::part_pkg_usageprice inherits from FS::Record. The following fields are
71 Creates a new record. To add the record to the database, see L<"insert">.
73 Note that this stores the hash reference, not a distinct copy of the hash it
74 points to. You can ask the object for a copy with the I<hash> method.
78 sub table { 'part_pkg_usageprice'; }
82 Adds this record to the database. If there is an error, returns the error,
83 otherwise returns false.
87 Delete this record from the database.
89 =item replace OLD_RECORD
91 Replaces the OLD_RECORD with this one in the database. If there is an error,
92 returns the error, otherwise returns false.
96 Checks all fields to make sure this is a valid record. If there is
97 an error, returns the error, otherwise returns false. Called by the insert
106 $self->ut_numbern('usagepricepart')
107 || $self->ut_number('pkgpart')
108 || $self->ut_money('price')
109 || $self->ut_currencyn('currency')
110 || $self->ut_enum('action', [ 'increment', 'set' ])
111 || $self->ut_enum('target', [ 'svc_acct.totalbytes', 'svc_acct.seconds',
112 'svc_conferencing.participants',
113 'svc_conferencing.confqualitynum'
116 || $self->ut_text('amount')
118 return $error if $error;
129 L<FS::part_pkg>, L<FS::Record>