1 package FS::did_order_item;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
9 FS::did_order_item - Object methods for did_order_item records
13 use FS::did_order_item;
15 $record = new FS::did_order_item \%hash;
16 $record = new FS::did_order_item { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::did_order_item object represents an item in a bulk DID order.
29 FS::did_order_item inherits from FS::Record.
30 The following fields are currently supported:
75 Creates a new DID order item. To add it to the database, see L<"insert">.
77 Note that this stores the hash reference, not a distinct copy of the hash it
78 points to. You can ask the object for a copy with the I<hash> method.
82 # the new method can be inherited from FS::Record, if a table method is defined
84 sub table { 'did_order_item'; }
88 Adds this record to the database. If there is an error, returns the error,
89 otherwise returns false.
93 # the insert method can be inherited from FS::Record
97 Delete this record from the database.
101 # the delete method can be inherited from FS::Record
103 =item replace OLD_RECORD
105 Replaces the OLD_RECORD with this one in the database. If there is an error,
106 returns the error, otherwise returns false.
110 # the replace method can be inherited from FS::Record
114 Checks all fields to make sure this is a valid DID order item. If there is
115 an error, returns the error, otherwise returns false. Called by the insert
120 # the check method should currently be supplied - FS::Record contains some
121 # data checking routines
127 $self->ut_numbern('orderitemnum')
128 || $self->ut_number('ordernum')
129 || $self->ut_textn('msa')
130 || $self->ut_numbern('npa')
131 || $self->ut_foreign_keyn('latanum', 'lata', 'latanum')
132 || $self->ut_textn('rate_center')
133 || $self->ut_textn('state')
134 || $self->ut_number('quantity')
136 return $error if $error;
145 L<FS::Record>, schema.html from the base documentation.