-
-<P>
-Currently, custnum, setup, bill, susp, expire, and cancel may be changed.
-
-<P>
-Changing pkgpart may have disasterous effects. See the order subroutine.
-
-<P>
-setup and bill are normally updated by calling the bill method of a
-customer object (see <A HREF="../FS/cust_main.html">FS::cust_main</A>).
-
-<P>
-suspend is normally updated by the suspend and unsuspend methods.
-
-<P>
-cancel is normally updated by the cancel method (and also the order
-subroutine in some cases).
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid billing item. If there is an
-error, returns the error, otherwise returns false. Called by the insert and
+<P>sub insert {
+ my $self = shift;</P>
+<PRE>
+ # custnum might not have have been defined in sub check (for one-shot new
+ # customers), so check it here instead</PRE>
+<PRE>
+ my $error = $self->ut_number('custnum');
+ return $error if $error</PRE>
+<PRE>
+ return "Unknown customer"
+ unless qsearchs( 'cust_main', { 'custnum' => $self->custnum } );</PRE>
+<PRE>
+ $self->SUPER::insert;</PRE>
+<P>}</P>
+<P></P>
+<DT><STRONG><A NAME="item_delete">delete</A></STRONG><BR>
+<DD>
+Currently unimplemented. You don't want to delete billing items, because there
+would then be no record the customer ever purchased the item. Instead, see
+the cancel method.
+<P></P>
+<DT><STRONG><A NAME="item_replace_OLD_RECORD">replace OLD_RECORD</A></STRONG><BR>
+<DD>
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+<P>Currently, custnum, setup, bill, susp, expire, and cancel may be changed.</P>
+<P>Changing pkgpart may have disasterous effects. See the order subroutine.</P>
+<P>setup and bill are normally updated by calling the bill method of a customer
+object (see <A HREF=".././FS/cust_main.html">the FS::cust_main manpage</A>).</P>
+<P>suspend is normally updated by the suspend and unsuspend methods.</P>
+<P>cancel is normally updated by the cancel method (and also the order subroutine
+in some cases).</P>
+<P></P>
+<DT><STRONG><A NAME="item_check">check</A></STRONG><BR>
+<DD>
+Checks all fields to make sure this is a valid billing item. If there is an
+error, returns the error, otherwise returns false. Called by the insert and