3 <TITLE>FS::part_pkg - Object methods for part_pkg objects</TITLE>
4 <LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
13 <LI><A HREF="#NAME">NAME</A>
14 <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
15 <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
16 <LI><A HREF="#METHODS">METHODS</A>
17 <LI><A HREF="#VERSION">VERSION</A>
18 <LI><A HREF="#BUGS">BUGS</A>
19 <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
25 <H1><A NAME="NAME">NAME</A></H1>
27 FS::part_pkg - Object methods for part_pkg objects
31 <H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
33 <PRE> use FS::part_pkg;
36 <PRE> $record = new FS::part_pkg \%hash
37 $record = new FS::part_pkg { 'column' => 'value' };
40 <PRE> $custom_record = $template_record->clone;
43 <PRE> $error = $record->insert;
46 <PRE> $error = $new_record->replace($old_record);
49 <PRE> $error = $record->delete;
52 <PRE> $error = $record->check;
55 <PRE> @pkg_svc = $record->pkg_svc;
58 <PRE> $svcnum = $record->svcpart;
59 $svcnum = $record->svcpart( 'svc_acct' );
63 <H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
65 An FS::part_pkg object represents a billing item definition. FS::part_pkg
66 inherits from FS::Record. The following fields are currently supported:
69 <DT><STRONG><A NAME="item_pkgpart">pkgpart - primary key (assigned automatically for new billing item definitions)</A></STRONG><DD>
70 <DT><STRONG><A NAME="item_pkg">pkg - Text name of this billing item definition (customer-viewable)</A></STRONG><DD>
71 <DT><STRONG><A NAME="item_comment">comment - Text name of this billing item definition (non-customer-viewable)</A></STRONG><DD>
72 <DT><STRONG><A NAME="item_setup">setup - Setup fee</A></STRONG><DD>
73 <DT><STRONG><A NAME="item_freq">freq - Frequency of recurring fee</A></STRONG><DD>
74 <DT><STRONG><A NAME="item_recur">recur - Recurring fee</A></STRONG><DD>
77 setup and recur are evaluated as Safe perl expressions. You can use numbers
78 just as you would normally. More advanced semantics are not yet defined.
82 <H1><A NAME="METHODS">METHODS</A></H1>
84 <DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
86 Creates a new billing item definition. To add the billing item definition
87 to the database, see <A HREF="#insert">insert</A>.
89 <DT><STRONG><A NAME="item_clone">clone</A></STRONG><DD>
91 An alternate constructor. Creates a new billing item definition by
92 duplicating an existing definition. A new pkgpart is assigned and `(CUSTOM)
93 ' is prepended to the comment field. To add the billing item definition to
95 <A HREF="#insert">insert</A>.
97 <DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
99 Adds this billing item definition to the database. If there is an error,
100 returns the error, otherwise returns false.
102 <DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
104 Currently unimplemented.
106 <DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
108 Replaces OLD_RECORD with this one in the database. If there is an error,
109 returns the error, otherwise returns false.
111 <DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
113 Checks all fields to make sure this is a valid billing item definition. If
114 there is an error, returns the error, otherwise returns false. Called by
115 the insert and replace methods.
117 <DT><STRONG><A NAME="item_pkg_svc">pkg_svc</A></STRONG><DD>
119 Returns all FS::pkg_svc objects (see <A HREF="../FS/pkg_svc.html">FS::pkg_svc</A>) for this package definition.
121 <DT><STRONG><A NAME="item_svcpart">svcpart [ SVCDB ]</A></STRONG><DD>
123 Returns the svcpart of a single service definition (see <A HREF="../FS/part_svc.html">FS::part_svc</A>) associated with this billing item definition (see <A HREF="../FS/pkg_svc.html">FS::pkg_svc</A>). Returns false if there not exactly one service definition with quantity
124 1, or if SVCDB is specified and does not match the svcdb of the service
130 <H1><A NAME="VERSION">VERSION</A></H1>
132 $Id: part_pkg.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
136 <H1><A NAME="BUGS">BUGS</A></H1>
138 The delete method is unimplemented.
141 setup and recur semantics are not yet defined (and are implemented in
142 FS::cust_bill. hmm.).
146 <H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
148 <A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>, <A HREF="../FS/type_pkgs.html">FS::type_pkgs</A>, <A HREF="../FS/pkg_svc.html">FS::pkg_svc</A>, <EM>Safe</EM>. schema.html from the base documentation.