7 @ISA = qw( FS::Record );
11 FS::part_pkg - Object methods for part_pkg objects
17 $record = new FS::part_pkg \%hash
18 $record = new FS::part_pkg { 'column' => 'value' };
20 $custom_record = $template_record->clone;
22 $error = $record->insert;
24 $error = $new_record->replace($old_record);
26 $error = $record->delete;
28 $error = $record->check;
32 An FS::part_pkg object represents a billing item definition. FS::part_pkg
33 inherits from FS::Record. The following fields are currently supported:
37 =item pkgpart - primary key (assigned automatically for new billing item definitions)
39 =item pkg - Text name of this billing item definition (customer-viewable)
41 =item comment - Text name of this billing item definition (non-customer-viewable)
43 =item setup - Setup fee
45 =item freq - Frequency of recurring fee
47 =item recur - Recurring fee
51 setup and recur are evaluated as Safe perl expressions. You can use numbers
52 just as you would normally. More advanced semantics are not yet defined.
60 Creates a new billing item definition. To add the billing item definition to
61 the database, see L<"insert">.
65 sub table { 'part_pkg'; }
69 An alternate constructor. Creates a new billing item definition by duplicating
70 an existing definition. A new pkgpart is assigned and `(CUSTOM) ' is prepended
71 to the comment field. To add the billing item definition to the database, see
78 my $class = ref($self);
79 my %hash = $self->hash;
80 $hash{'pkgpart'} = '';
81 $hash{'comment'} = "(CUSTOM) ". $hash{'comment'}
82 unless $hash{'comment'} =~ /^\(CUSTOM\) /;
83 #new FS::part_pkg ( \%hash ); # ?
84 new $class ( \%hash ); # ?
89 Adds this billing item definition to the database. If there is an error,
90 returns the error, otherwise returns false.
94 Currently unimplemented.
99 return "Can't (yet?) delete package definitions.";
100 # check & make sure the pkgpart isn't in cust_pkg or type_pkgs?
103 =item replace OLD_RECORD
105 Replaces OLD_RECORD with this one in the database. If there is an error,
106 returns the error, otherwise returns false.
110 Checks all fields to make sure this is a valid billing item definition. If
111 there is an error, returns the error, otherwise returns false. Called by the
112 insert and replace methods.
119 $self->ut_numbern('pkgpart')
120 || $self->ut_text('pkg')
121 || $self->ut_text('comment')
122 || $self->ut_anything('setup')
123 || $self->ut_number('freq')
124 || $self->ut_anything('recur')
132 $Id: part_pkg.pm,v 1.5 1998-12-31 01:04:16 ivan Exp $
136 It doesn't properly override FS::Record yet.
138 The delete method is unimplemented.
140 setup and recur semantics are not yet defined (and are implemented in
141 FS::cust_bill. hmm.).
145 L<FS::Record>, L<FS::cust_pkg>, L<FS::type_pkgs>, L<FS::pkg_svc>, L<Safe>.
146 schema.html from the base documentation.
150 ivan@sisd.com 97-dec-5
152 pod ivan@sisd.com 98-sep-21
154 $Log: part_pkg.pm,v $
155 Revision 1.5 1998-12-31 01:04:16 ivan
158 Revision 1.3 1998/11/15 13:00:15 ivan
159 bugfix in clone method, clone method doc clarification