changes from 1.2.3 release, fixes from webdemo
[freeside.git] / htdocs / docs / man / FS / part_pkg.html
1 <HTML>
2 <HEAD>
3 <TITLE>FS::part_pkg - Object methods for part_pkg objects</TITLE>
4 <LINK REV="made" HREF="mailto:none">
5 </HEAD>
6
7 <BODY>
8
9 <!-- INDEX BEGIN -->
10
11 <UL>
12
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>
20 </UL>
21 <!-- INDEX END -->
22
23 <HR>
24 <P>
25 <H1><A NAME="NAME">NAME</A></H1>
26 <P>
27 FS::part_pkg - Object methods for part_pkg objects
28
29 <P>
30 <HR>
31 <H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
32 <P>
33 <PRE>  use FS::part_pkg;
34 </PRE>
35 <P>
36 <PRE>  $record = new FS::part_pkg \%hash
37   $record = new FS::part_pkg { 'column' =&gt; 'value' };
38 </PRE>
39 <P>
40 <PRE>  $custom_record = $template_record-&gt;clone;
41 </PRE>
42 <P>
43 <PRE>  $error = $record-&gt;insert;
44 </PRE>
45 <P>
46 <PRE>  $error = $new_record-&gt;replace($old_record);
47 </PRE>
48 <P>
49 <PRE>  $error = $record-&gt;delete;
50 </PRE>
51 <P>
52 <PRE>  $error = $record-&gt;check;
53 </PRE>
54 <P>
55 <PRE>  @pkg_svc = $record-&gt;pkg_svc;
56 </PRE>
57 <P>
58 <PRE>  $svcnum = $record-&gt;svcpart;
59   $svcnum = $record-&gt;svcpart( 'svc_acct' );
60 </PRE>
61 <P>
62 <HR>
63 <H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
64 <P>
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:
67
68 <DL>
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>
75 </DL>
76 <P>
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.
79
80 <P>
81 <HR>
82 <H1><A NAME="METHODS">METHODS</A></H1>
83 <DL>
84 <DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
85 <P>
86 Creates a new billing item definition. To add the billing item definition
87 to the database, see <A HREF="#insert">insert</A>.
88
89 <DT><STRONG><A NAME="item_clone">clone</A></STRONG><DD>
90 <P>
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
94 the database, see
95 <A HREF="#insert">insert</A>.
96
97 <DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
98 <P>
99 Adds this billing item definition to the database. If there is an error,
100 returns the error, otherwise returns false.
101
102 <DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
103 <P>
104 Currently unimplemented.
105
106 <DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
107 <P>
108 Replaces OLD_RECORD with this one in the database. If there is an error,
109 returns the error, otherwise returns false.
110
111 <DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
112 <P>
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.
116
117 <DT><STRONG><A NAME="item_pkg_svc">pkg_svc</A></STRONG><DD>
118 <P>
119 Returns all FS::pkg_svc objects (see <A HREF="../FS/pkg_svc.html">FS::pkg_svc</A>) for this package definition (with non-zero quantity).
120
121 <DT><STRONG><A NAME="item_svcpart">svcpart [ SVCDB ]</A></STRONG><DD>
122 <P>
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
125 definition, 
126
127 </DL>
128 <P>
129 <HR>
130 <H1><A NAME="VERSION">VERSION</A></H1>
131 <P>
132 $Id: part_pkg.html,v 1.2 2000-03-03 18:22:43 ivan Exp $
133
134 <P>
135 <HR>
136 <H1><A NAME="BUGS">BUGS</A></H1>
137 <P>
138 The delete method is unimplemented.
139
140 <P>
141 setup and recur semantics are not yet defined (and are implemented in
142 FS::cust_bill. hmm.).
143
144 <P>
145 <HR>
146 <H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
147 <P>
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.
149
150 </BODY>
151
152 </HTML>