5 use FS::Record qw( qsearchs );
9 @ISA = qw( FS::Record );
13 FS::pkg_svc - Object methods for pkg_svc records
19 $record = new FS::pkg_svc \%hash;
20 $record = new FS::pkg_svc { 'column' => 'value' };
22 $error = $record->insert;
24 $error = $new_record->replace($old_record);
26 $error = $record->delete;
28 $error = $record->check;
30 $part_pkg = $record->part_pkg;
32 $part_svc = $record->part_svc;
36 An FS::pkg_svc record links a billing item definition (see L<FS::part_pkg>) to
37 a service definition (see L<FS::part_svc>). FS::pkg_svc inherits from
38 FS::Record. The following fields are currently supported:
42 =item pkgpart - Billing item definition (see L<FS::part_pkg>)
44 =item svcpart - Service definition (see L<FS::part_svc>)
46 =item quantity - Quantity of this service definition that this billing item
57 Create a new record. To add the record to the database, see L<"insert">.
61 sub table { 'pkg_svc'; }
65 Adds this record to the database. If there is an error, returns the error,
66 otherwise returns false.
70 Deletes this record from the database. If there is an error, returns the
71 error, otherwise returns false.
73 =item replace OLD_RECORD
75 Replaces OLD_RECORD with this one in the database. If there is an error,
76 returns the error, otherwise returns false.
81 my ( $new, $old ) = ( shift, shift );
83 return "Can't change pkgpart!" if $old->pkgpart != $new->pkgpart;
84 return "Can't change svcpart!" if $old->svcpart != $new->svcpart;
86 $new->SUPER::replace($old);
91 Checks all fields to make sure this is a valid record. If there is an error,
92 returns the error, otherwise returns false. Called by the insert and replace
102 $self->ut_number('pkgpart')
103 || $self->ut_number('svcpart')
104 || $self->ut_number('quantity')
106 return $error if $error;
108 return "Unknown pkgpart!" unless $self->part_pkg;
109 return "Unknown svcpart!" unless $self->part_svc;
116 Returns the FS::part_pkg object (see L<FS::part_pkg>).
122 qsearchs( 'part_pkg', { 'pkgpart' => $self->pkgpart } );
127 Returns the FS::part_svc object (see L<FS::part_svc>).
133 qsearchs( 'part_svc', { 'svcpart' => $self->svcpart } );
140 $Id: pkg_svc.pm,v 1.4 1999-07-20 10:37:05 ivan Exp $
146 L<FS::Record>, L<FS::part_pkg>, L<FS::part_svc>, schema.html from the base
151 ivan@voicenet.com 97-jul-1
154 ivan@sisd.com 97-nov-13
156 pod ivan@sisd.com 98-sep-22
159 Revision 1.4 1999-07-20 10:37:05 ivan
160 cleaned up the new one-screen signup bits in htdocs/edit/cust_main.cgi to
161 prepare for a signup server
163 Revision 1.3 1999/01/18 21:58:08 ivan
164 esthetic: eq and ne were used in a few places instead of == and !=
166 Revision 1.2 1998/12/29 11:59:51 ivan
167 mostly properly OO, some work still to be done with svc_ stuff