yet more mod_perl stuff
authorivan <ivan>
Mon, 25 Jan 1999 12:26:17 +0000 (12:26 +0000)
committerivan <ivan>
Mon, 25 Jan 1999 12:26:17 +0000 (12:26 +0000)
15 files changed:
htdocs/view/cust_bill.cgi
htdocs/view/cust_main.cgi
site_perl/CGI.pm
site_perl/Record.pm
site_perl/cust_bill.pm
site_perl/cust_credit.pm
site_perl/cust_main.pm
site_perl/cust_main_invoice.pm
site_perl/cust_pay.pm
site_perl/cust_pkg.pm
site_perl/cust_refund.pm
site_perl/svc_Common.pm
site_perl/svc_acct.pm
site_perl/svc_acct_sm.pm
site_perl/svc_domain.pm

index 44e3a4a..1989726 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -Tw
 #
 #!/usr/bin/perl -Tw
 #
-# $Id: cust_bill.cgi,v 1.6 1999-01-19 05:14:18 ivan Exp $
+# $Id: cust_bill.cgi,v 1.7 1999-01-25 12:26:03 ivan Exp $
 #
 # Note: Should be run setuid freeside as user nobody.
 #
 #
 # Note: Should be run setuid freeside as user nobody.
 #
 # also print 'printed' field ivan@sisd.com 98-jul-10
 #
 # $Log: cust_bill.cgi,v $
 # also print 'printed' field ivan@sisd.com 98-jul-10
 #
 # $Log: cust_bill.cgi,v $
-# Revision 1.6  1999-01-19 05:14:18  ivan
+# Revision 1.7  1999-01-25 12:26:03  ivan
+# yet more mod_perl stuff
+#
+# Revision 1.6  1999/01/19 05:14:18  ivan
 # for mod_perl: no more top-level my() variables; use vars instead
 # also the last s/create/new/;
 #
 # for mod_perl: no more top-level my() variables; use vars instead
 # also the last s/create/new/;
 #
@@ -75,7 +78,7 @@ print $cgi->header( '-expires' => 'now' ), header('Invoice View', menubar(
       <A HREF="${p}edit/cust_pay.cgi?$invnum">Enter payments (check/cash) against this invoice</A>
       <BR><A HREF="${p}misc/print-invoice.cgi?$invnum">Reprint this invoice</A>
       <BR><BR>(Printed $printed times)
       <A HREF="${p}edit/cust_pay.cgi?$invnum">Enter payments (check/cash) against this invoice</A>
       <BR><A HREF="${p}misc/print-invoice.cgi?$invnum">Reprint this invoice</A>
       <BR><BR>(Printed $printed times)
-    <FONT SIZE=-1><PRE>
+    <PRE>
 END
 
 print $cust_bill->print_text;
 END
 
 print $cust_bill->print_text;
index 7c5f4be..2119b3e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -Tw
 #
 #!/usr/bin/perl -Tw
 #
-# $Id: cust_main.cgi,v 1.10 1999-01-19 05:14:19 ivan Exp $
+# $Id: cust_main.cgi,v 1.11 1999-01-25 12:26:04 ivan Exp $
 #
 # Usage: cust_main.cgi custnum
 #        http://server.name/path/cust_main.cgi?custnum
 #
 # Usage: cust_main.cgi custnum
 #        http://server.name/path/cust_main.cgi?custnum
 # lose background, FS::CGI ivan@sisd.com 98-sep-2
 #
 # $Log: cust_main.cgi,v $
 # lose background, FS::CGI ivan@sisd.com 98-sep-2
 #
 # $Log: cust_main.cgi,v $
-# Revision 1.10  1999-01-19 05:14:19  ivan
+# Revision 1.11  1999-01-25 12:26:04  ivan
+# yet more mod_perl stuff
+#
+# Revision 1.10  1999/01/19 05:14:19  ivan
 # for mod_perl: no more top-level my() variables; use vars instead
 # also the last s/create/new/;
 #
 # for mod_perl: no more top-level my() variables; use vars instead
 # also the last s/create/new/;
 #
 use strict;
 use vars qw ( $cgi $query $custnum $cust_main $hashref $agent $referral 
               @packages $package @history @bills $bill @credits $credit
 use strict;
 use vars qw ( $cgi $query $custnum $cust_main $hashref $agent $referral 
               @packages $package @history @bills $bill @credits $credit
-              $balance $item ); 
+              $balance $item @agents @referrals @invoicing_list $n1 ); 
 use CGI;
 use CGI::Carp qw(fatalsToBrowser);
 use Date::Format;
 use FS::UID qw(cgisuidsetup);
 use FS::Record qw(qsearchs qsearch);
 use CGI;
 use CGI::Carp qw(fatalsToBrowser);
 use Date::Format;
 use FS::UID qw(cgisuidsetup);
 use FS::Record qw(qsearchs qsearch);
-use FS::CGI qw(header menubar popurl table);
+use FS::CGI qw(header menubar popurl table itable ntable);
 use FS::cust_credit;
 use FS::cust_pay;
 use FS::cust_bill;
 use FS::cust_credit;
 use FS::cust_pay;
 use FS::cust_bill;
@@ -88,9 +91,7 @@ $cgi = new CGI;
 
 print $cgi->header( '-expires' => 'now' ), header("Customer View", menubar(
   'Main Menu' => popurl(2)
 
 print $cgi->header( '-expires' => 'now' ), header("Customer View", menubar(
   'Main Menu' => popurl(2)
-)),<<END;
-    <BASEFONT SIZE=3>
-END
+));
 
 die "No customer specified (bad URL)!" unless $cgi->keywords;
 ($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
 
 die "No customer specified (bad URL)!" unless $cgi->keywords;
 ($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
@@ -100,120 +101,133 @@ $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
 die "Customer not found!" unless $cust_main;
 $hashref = $cust_main->hashref;
 
 die "Customer not found!" unless $cust_main;
 $hashref = $cust_main->hashref;
 
-#custnum
-print "<FONT SIZE=+1><CENTER>Customer #<B>$custnum</B></CENTER></FONT>",
-      qq!<CENTER><A HREF="#cust_main">Customer Information</A> | !,
-      qq!<A HREF="#cust_comments">Comments</A> | !,
-      qq!<A HREF="#cust_pkg">Packages</A> | !,
-      qq!<A HREF="#history">Payment History</A> </CENTER>!;
+print itable(), '<TR><TD><A NAME="cust_main"></A>';
 
 
-#bill now linke
-print qq!<HR><CENTER><A HREF="!, popurl(2), qq!/misc/bill.cgi?$custnum">!,
-      qq!Bill this customer now</A></CENTER>!;
+print qq!<A HREF="!, popurl(2), 
+      qq!edit/cust_main.cgi?$custnum">Edit this customer</A>!,
+      ntable("#c0c0c0"), "<TR><TD>", ntable("#c0c0c0",2),
+      '<TR><TD ALIGN="right">Customer number</TD><TD BGCOLOR="#ffffff">',
+      $custnum, '</TD></TR>',
+;
 
 
-#formatting
-print qq!<HR><A NAME="cust_main"><CENTER><FONT SIZE=+1>Customer Information!,
-      qq!</FONT>!,
-      qq!<BR><A HREF="!, popurl(2), qq!edit/cust_main.cgi?$custnum!,
-      qq!">Edit this information</A></CENTER><FONT SIZE=-1>!;
-
-#agentnum
-$agent = qsearchs('agent',{
-  'agentnum' => $cust_main->getfield('agentnum')
-} );
-die "Agent not found!" unless $agent;
-print "<BR>Agent #<B>" , $agent->getfield('agentnum') , ": " ,
-                         $agent->getfield('agent') , "</B>";
-
-#refnum
-$referral = qsearchs('part_referral',{'refnum' => $cust_main->refnum});
-die "Referral not found!" unless $referral;
-print "<BR>Referral #<B>", $referral->refnum, ": ",
-      $referral->referral, "<\B>"; 
-
-#last, first
-print "<P><B>", $hashref->{'last'}, ", ", $hashref->{first}, "</B>";
-
-#ss
-print " (SS# <B>", $hashref->{ss}, "</B>)" if $hashref->{ss};
-
-#company
-print "<BR><B>", $hashref->{company}, "</B>" if $hashref->{company};
-
-#address1
-print "<BR><B>", $hashref->{address1}, "</B>";
-
-#address2
-print "<BR><B>", $hashref->{address2}, "</B>" if $hashref->{address2};
-
-#city
-print "<BR><B>", $hashref->{city}, "</B>";
-
-#county
-print " (<B>", $hashref->{county}, "</B> county)" if $hashref->{county};
-
-#state
-print ",<B>", $hashref->{state}, "</B>";
-
-#zip
-print "  <B>", $hashref->{zip}, "</B>";
-
-#country
-print "<BR><B>", $hashref->{country}, "</B>"
-  unless $hashref->{country} eq "US";
-
-#daytime
-print "<P><B>", $hashref->{daytime}, "</B>" if $hashref->{daytime};
-print " (Day)" if $hashref->{daytime} && $hashref->{night};
-
-#night
-print "<BR><B>", $hashref->{night}, "</B>" if $hashref->{night};
-print " (Night)" if $hashref->{daytime} && $hashref->{night};
-
-#fax
-print "<BR><B>", $hashref->{fax}, "</B> (Fax)" if $hashref->{fax};
-
-#payby/payinfo/paydate/payname
-if ($hashref->{payby} eq "CARD") {
-  print "<P>Card #<B>", $hashref->{payinfo}, "</B> Exp. <B>",
-    $hashref->{paydate}, "</B>";
-  print " (<B>", $hashref->{payname}, "</B>)" if $hashref->{payname};
-} elsif ($hashref->{payby} eq "BILL") {
-  print "<P>Bill";
-  print " on P.O. #<B>", $hashref->{payinfo}, "</B>"
-    if $hashref->{payinfo};
-  print " until <B>", $hashref->{paydate}, "</B>"
-    if $hashref->{paydate};
-  print " to <B>", $hashref->{payname}, "</B> at above address"
-    if $hashref->{payname};
-} elsif ($hashref->{payby} eq "COMP") {
-  print "<P>Access complimentary";
-  print " courtesy of <B>", $hashref->{payinfo}, "</B>"
-    if $hashref->{payinfo};
-  print " until <B>", $hashref->{paydate}, "</B>"
-    if $hashref->{paydate};
-} else {
-  print "Unknown payment type ", $hashref->{payby}, "!";
+@agents = qsearch( 'agent', {} );
+unless ( scalar(@agents) == 1 ) {
+  $agent = qsearchs('agent',{
+    'agentnum' => $cust_main->agentnum
+  } );
+  print '<TR><TD ALIGN="right">Agent</TD><TD BGCOLOR="#ffffff">',
+        $agent->agentnum, ": ", $agent->agent, '</TD></TR>';
+}
+@referrals = qsearch( 'part_referral', {} );
+unless ( scalar(@referrals) == 1 ) {
+  my $referral = qsearchs('part_referral', {
+    'refnum' => $cust_main->refnum
+  } );
+  print '<TR><TD ALIGN="right">Referral</TD><TD BGCOLOR="#ffffff">',
+        $referral->refnum, ": ", $referral->referral, '</TD></TR>';
+}
+print '<TR><TD ALIGN="right">Order taker</TD><TD BGCOLOR="#ffffff">',
+  $cust_main->otaker, '</TD></TR>';
+
+print '</TABLE></TD></TR></TABLE>';
+
+print '</TD><TD ROWSPAN=2>';
+
+print "Contact information", ntable("#c0c0c0"), "<TR><TD>",
+      ntable("#c0c0c0",2),
+  '<TR><TD ALIGN="right">Contact name<BR>(last, first)</TD>',
+    '<TD COLSPAN=3 BGCOLOR="#ffffff">',
+    $cust_main->last, ', ', $cust_main->first,
+    '</TD><TD ALIGN="right">SS#</TD><TD BGCOLOR="#ffffff">',
+    $cust_main->ss || '&nbsp', '</TD></TR>',
+  '<TR><TD ALIGN="right">Company</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+    $cust_main->company,
+    '</TD></TR>',
+  '<TR><TD ALIGN="right">Address</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+    $cust_main->address1,
+    '</TD></TR>',
+;
+print '<TR><TD ALIGN="right">&nbsp;</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+      $cust_main->address2, '</TD></TR>'
+  if $cust_main->address2;
+print '<TR><TD ALIGN="right">City</TD><TD BGCOLOR="#ffffff">',
+        $cust_main->city,
+        '</TD><TD ALIGN="right">State</TD><TD BGCOLOR="#ffffff">',
+        $cust_main->state,
+        '</TD><TD ALIGN="right">Zip</TD><TD BGCOLOR="#ffffff">',
+        $cust_main->zip, '</TD></TR>',
+      '<TR><TD ALIGN="right">Country</TD><TD BGCOLOR="#ffffff">',
+        $cust_main->country,
+        '</TD></TR>',
+;
+print '<TR><TD ALIGN="right">Day Phone</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+        $cust_main->daytime || '&nbsp', '</TD></TR>',
+      '<TR><TD ALIGN="right">Night Phone</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+        $cust_main->night || '&nbsp', '</TD></TR>',
+      '<TR><TD ALIGN="right">Fax</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+        $cust_main->fax || '&nbsp', '</TD></TR>',
+      '</TABLE>', "</TD></TR></TABLE>"
+;
+
+print '</TD></TR><TR><TD>';
+
+@invoicing_list = $cust_main->invoicing_list;
+print "Billing information (",
+      qq!<A HREF="!, popurl(2), qq!/misc/bill.cgi?$custnum">!, "Bill now</A>)",
+      ntable("#c0c0c0"), "<TR><TD>", ntable("#c0c0c0",2),
+      '<TR><TD ALIGN="right">Tax exempt</TD><TD BGCOLOR="#ffffff">',
+      $cust_main->tax ? 'yes' : 'no',
+      '</TD></TR>',
+      '<TR><TD ALIGN="right">Postal invoices</TD><TD BGCOLOR="#ffffff">',
+      ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no',
+      '</TD></TR>',
+      '<TR><TD ALIGN="right">Email invoices</TD><TD BGCOLOR="#ffffff">',
+      join(', ', grep { $_ ne 'POST' } @invoicing_list ),
+      '</TD></TR>',
+      '<TR><TD ALIGN="right">Billing type</TD><TD BGCOLOR="#ffffff">',
+;
+
+if ( $cust_main->payby eq 'CARD' ) {
+  print 'Credit card</TD></TR>',
+        '<TR><TD ALIGN="right">Card number</TD><TD BGCOLOR="#ffffff">',
+        $cust_main->payinfo, '</TD></TR>',
+        '<TR><TD ALIGN="right">Expiration</TD><TD BGCOLOR="#ffffff">',
+        $cust_main->paydate, '</TD></TR>',
+        '<TR><TD ALIGN="right">Name on card</TD><TD BGCOLOR="#ffffff">',
+        $cust_main->payname, '</TD></TR>'
+  ;
+} elsif ( $cust_main->payby eq 'BILL' ) {
+  print 'Billing</TD></TR>';
+  print '<TR><TD ALIGN="right">P.O. </TD><TD BGCOLOR="#ffffff">',
+        $cust_main->payinfo, '</TD></TR>',
+    if $cust_main->payinfo;
+  print '<TR><TD ALIGN="right">Expiration</TD><TD BGCOLOR="#ffffff">',
+        $cust_main->paydate, '</TD></TR>',
+        '<TR><TD ALIGN="right">Attention</TD><TD BGCOLOR="#ffffff">',
+        $cust_main->payname, '</TD></TR>',
+  ;
+} elsif ( $cust_main->payby eq 'COMP' ) {
+  print 'Complimentary</TD></TR>',
+        '<TR><TD ALIGN="right">Authorized by</TD><TD BGCOLOR="#ffffff">',
+        $cust_main->payinfo, '</TD></TR>',
+        '<TR><TD ALIGN="right">Expiration</TD><TD BGCOLOR="#ffffff">',
+        $cust_main->paydate, '</TD></TR>',
+  ;
 }
 
 }
 
-#tax
-print "<BR>(Tax exempt)" if $hashref->{tax};
-
-#otaker
-print "<P>Order taken by <B>", $hashref->{otaker}, "</B>";
+print "</TABLE></TD></TR></TABLE></TD></TR></TABLE>";
 
 
-#formatting    
-print qq!<HR><FONT SIZE=+1><A NAME="cust_pkg"><CENTER>Packages</A></FONT>!,
-      qq!<BR>Click on package number to view/edit package.!,
-      qq!<BR><A HREF="!, popurl(2), qq!/edit/cust_pkg.cgi?$custnum">Add/Edit packages</A>!,
-      qq!</CENTER><BR>!;
+print qq!<BR><BR><A NAME="cust_pkg">Packages</A> !,
+#      qq!<BR>Click on package number to view/edit package.!,
+      qq!( <A HREF="!, popurl(2), qq!/edit/cust_pkg.cgi?$custnum">Order and cancel packages</A> )!,
+;
 
 #display packages
 
 #formatting
 
 #display packages
 
 #formatting
-print qq!<CENTER>!, table, "\n",
-      qq!<TR><TH ROWSPAN=2>#</TH><TH ROWSPAN=2>Package</TH><TH COLSPAN=5>!,
-      qq!Dates</TH></TR>\n!,
+print qq!!, table, "\n",
+      qq!<TR><TH COLSPAN=2 ROWSPAN=2>Package</TH><TH COLSPAN=5>!,
+      qq!Dates</TH><TH COLSPAN=2 ROWSPAN=2>Services</TH></TR>\n!,
       qq!<TR><TH><FONT SIZE=-1>Setup</FONT></TH><TH>!,
       qq!<FONT SIZE=-1>Next bill</FONT>!,
       qq!</TH><TH><FONT SIZE=-1>Susp.</FONT></TH><TH><FONT SIZE=-1>Expire!,
       qq!<TR><TH><FONT SIZE=-1>Setup</FONT></TH><TH>!,
       qq!<FONT SIZE=-1>Next bill</FONT>!,
       qq!</TH><TH><FONT SIZE=-1>Susp.</FONT></TH><TH><FONT SIZE=-1>Expire!,
@@ -222,55 +236,68 @@ print qq!<CENTER>!, table, "\n",
       qq!</TR>\n!;
 
 #get package info
       qq!</TR>\n!;
 
 #get package info
-@packages = qsearch('cust_pkg',{'custnum'=>$custnum});
+@packages = $cust_main->all_pkgs;
+#@packages = $cust_main->ncancelled_pkgs;
+
+$n1 = '';
 foreach $package (@packages) {
 foreach $package (@packages) {
-  my($pref)=$package->hashref;
-  my($part_pkg)=qsearchs('part_pkg',{
-    'pkgpart' => $pref->{pkgpart}
-  } );
-  print qq!<TR><TD><FONT SIZE=-1><A HREF="!, popurl(2), qq!view/cust_pkg.cgi?!,
-        $pref->{pkgnum}, qq!">!, 
-        $pref->{pkgnum}, qq!</A></FONT></TD>!,
-        "<TD><FONT SIZE=-1>", $part_pkg->getfield('pkg'), " - ",
-        $part_pkg->getfield('comment'), 
-          qq!<FORM ACTION="!, popurl(2), qq!edit/part_pkg.cgi" METHOD=POST>!,
-          qq!<INPUT TYPE="hidden" NAME="clone" VALUE="!, $part_pkg->pkgpart, qq!">!,
-          qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="!, $package->pkgnum, qq!">!,
-          qq!<INPUT TYPE="submit" VALUE="Customize Pricing">!,
-          "</FORM></FONT></TD>",
-        "<TD><FONT SIZE=-1>", 
-        $pref->{setup} ? time2str("%D",$pref->{setup} ) : "" ,
-        "</FONT></TD>",
-        "<TD><FONT SIZE=-1>", 
-        $pref->{bill} ? time2str("%D",$pref->{bill} ) : "" ,
-        "</FONT></TD>",
-        "<TD><FONT SIZE=-1>",
-        $pref->{susp} ? time2str("%D",$pref->{susp} ) : "" ,
-        "</FONT></TD>",
-        "<TD><FONT SIZE=-1>",
-        $pref->{expire} ? time2str("%D",$pref->{expire} ) : "" ,
-        "</FONT></TD>",
-        "<TD><FONT SIZE=-1>",
-        $pref->{cancel} ? time2str("%D",$pref->{cancel} ) : "" ,
-        "</FONT></TD>",
-        "</TR>";
-}
+  my $pkgnum = $package->pkgnum;
+  my $pkg = $package->part_pkg->pkg;
+  my $comment = $package->part_pkg->comment;
+  my $pkgview = popurl(2). "view/cust_pkg.cgi?$pkgnum";
+  my @cust_svc = qsearch( 'cust_svc', { 'pkgnum' => $pkgnum } );
+  my $rowspan = scalar(@cust_svc) || 1;
+
+  my $button_cgi = new CGI;
+  $button_cgi->param('clone', $package->part_pkg->pkgpart);
+  $button_cgi->param('pkgnum', $package->pkgnum);
+  my $button_url = popurl(2). "edit/part_pkg.cgi?". $button_cgi->query_string;
+
+  #print $n1, qq!<TD ROWSPAN=$rowspan><A HREF="$pkgview">$pkgnum</A></TD>!,
+  print $n1, qq!<TD ROWSPAN=$rowspan>$pkgnum</TD>!,
+        qq!<TD ROWSPAN=$rowspan><FONT SIZE=-1>!,
+        #qq!<A HREF="$pkgview">$pkg - $comment</A>!,
+        qq!$pkg - $comment!,
+        qq! ( <A HREF="$pkgview">Edit</A> | <A HREF="$button_url">Customize pricing</A>)</FONT></TD>!,
+  ;
+  for ( qw( setup bill susp expire cancel ) ) {
+    print "<TD ROWSPAN=$rowspan><FONT SIZE=-1>", ( $package->getfield($_)
+            ? time2str("%D", $package->getfield($_) )
+            :  '&nbsp'
+          ), '</FONT></TD>',
+    ;
+  }
+
+  my $n2 = '';
+  foreach my $cust_svc ( @cust_svc ) {
+     my($label, $value, $svcdb) = $cust_svc->label;
+     my($svcnum) = $cust_svc->svcnum;
+     my($sview) = popurl(2). "/view";
+     print $n2,qq!<TD><A HREF="$sview/$svcdb.cgi?$svcnum"><FONT SIZE=-1>$label</FONT></A></TD>!,
+           qq!<TD><A HREF="$sview/$svcdb.cgi?$svcnum"><FONT SIZE=-1>$value</FONT></A></TD>!;
+     $n2="</TR><TR>";
+  }
+  $n1="</TR><TR>";
+}  
+print "</TR>";
 
 #formatting
 
 #formatting
-print "</TABLE></CENTER>";
+print "</TABLE>";
 
 #formatting
 
 #formatting
-print qq!<CENTER><HR><A NAME="history"><FONT SIZE=+1>Payment History!,
-      qq!</FONT></A><BR>!,
-      qq!Click on invoice to view invoice/enter payment.<BR>!,
+print qq!<BR><BR><A NAME="history">Payment History!,
+      qq!</A>!,
+      qq! ( Click on invoice to view invoice/enter payment. | !,
       qq!<A HREF="!, popurl(2), qq!edit/cust_credit.cgi?$custnum">!,
       qq!<A HREF="!, popurl(2), qq!edit/cust_credit.cgi?$custnum">!,
-      qq!Post Credit / Refund</A></CENTER><BR>!;
+      qq!Post credit / refund</A> )!;
 
 #get payment history
 #
 # major problem: this whole thing is way too sloppy.
 # minor problem: the description lines need better formatting.
 
 
 #get payment history
 #
 # major problem: this whole thing is way too sloppy.
 # minor problem: the description lines need better formatting.
 
+@history = (); #needed for mod_perl :)
+
 @bills = qsearch('cust_bill',{'custnum'=>$custnum});
 foreach $bill (@bills) {
   my($bref)=$bill->hashref;
 @bills = qsearch('cust_bill',{'custnum'=>$custnum});
 foreach $bill (@bills) {
   my($bref)=$bill->hashref;
@@ -283,7 +310,6 @@ foreach $bill (@bills) {
   my(@payments)=qsearch('cust_pay',{'invnum'=> $bref->{invnum} } );
   my($payment);
   foreach $payment (@payments) {
   my(@payments)=qsearch('cust_pay',{'invnum'=> $bref->{invnum} } );
   my($payment);
   foreach $payment (@payments) {
-#    my($pref)=$payment->hashref;
     my($date,$invnum,$payby,$payinfo,$paid)=($payment->getfield('_date'),
                                              $payment->getfield('invnum'),
                                              $payment->getfield('payby'),
     my($date,$invnum,$payby,$payinfo,$paid)=($payment->getfield('_date'),
                                              $payment->getfield('invnum'),
                                              $payment->getfield('payby'),
@@ -316,7 +342,7 @@ foreach $credit (@credits) {
 }
 
         #formatting
 }
 
         #formatting
-        print "<CENTER>", table, <<END;
+        print table(), <<END;
 <TR>
   <TH>Date</TH>
   <TH>Description</TH>
 <TR>
   <TH>Date</TH>
   <TH>Description</TH>
@@ -360,7 +386,7 @@ foreach $item (sort keyfield_numerically @history) {
 }
 
 #formatting
 }
 
 #formatting
-print "</TABLE></CENTER>";
+print "</TABLE>";
 
 #end
 
 
 #end
 
index 97dedad..142438e 100644 (file)
@@ -9,7 +9,7 @@ use CGI::Carp qw(fatalsToBrowser);
 use FS::UID;
 
 @ISA = qw(Exporter);
 use FS::UID;
 
 @ISA = qw(Exporter);
-@EXPORT_OK = qw(header menubar idiot eidiot popurl table itable);
+@EXPORT_OK = qw(header menubar idiot eidiot popurl table itable ntable);
 
 =head1 NAME
 
 
 =head1 NAME
 
@@ -53,7 +53,7 @@ sub header {
         </TITLE>
       </HEAD>
       <BODY BGCOLOR="#e8e8e8">
         </TITLE>
       </HEAD>
       <BODY BGCOLOR="#e8e8e8">
-          <FONT COLOR="#FF0000" SIZE=7>
+          <FONT SIZE=7>
             $title
           </FONT>
           <BR><BR>
             $title
           </FONT>
           <BR><BR>
@@ -79,11 +79,14 @@ sub menubar { #$menubar=menubar('Main Menu', '../', 'Item', 'url', ... );
 
 =item idiot ERROR
 
 
 =item idiot ERROR
 
+This is depriciated.  Don't use it.
+
 Sends headers and an HTML error message.
 
 =cut
 
 sub idiot {
 Sends headers and an HTML error message.
 
 =cut
 
 sub idiot {
+  #warn "idiot depriciated";
   my($error)=@_;
   my($cgi)=FS::UID::cgi;
   if ( $cgi->isa('CGI::Base') ) {
   my($error)=@_;
   my($cgi)=FS::UID::cgi;
   if ( $cgi->isa('CGI::Base') ) {
@@ -103,7 +106,6 @@ sub idiot {
     </CENTER>
     Your request could not be processed because of the following error:
     <P><B>$error</B>
     </CENTER>
     Your request could not be processed because of the following error:
     <P><B>$error</B>
-    <P>Hit the <I>Back</I> button in your web browser, correct this mistake, and try again.
   </BODY>
 </HTML>
 END
   </BODY>
 </HTML>
 END
@@ -112,11 +114,14 @@ END
 
 =item eidiot ERROR
 
 
 =item eidiot ERROR
 
+This is depriciated.  Don't use it.
+
 Sends headers and an HTML error message, then exits.
 
 =cut
 
 sub eidiot {
 Sends headers and an HTML error message, then exits.
 
 =cut
 
 sub eidiot {
+  #warn "eidiot depriciated";
   idiot(@_);
   exit;
 }
   idiot(@_);
   exit;
 }
@@ -148,7 +153,7 @@ Returns HTML tag for beginning a table.
 sub table {
   my $col = shift;
   if ( $col ) {
 sub table {
   my $col = shift;
   if ( $col ) {
-    "<TABLE BGCOLOR=$col BORDER=1 WIDTH=\"100%\">";
+    qq!<TABLE BGCOLOR="$col" BORDER=1 WIDTH="100%">!;
   } else { 
     "<TABLE BORDER=1>";
   }
   } else { 
     "<TABLE BORDER=1>";
   }
@@ -162,11 +167,29 @@ Returns HTML tag for beginning an (invisible) table.
 
 sub itable {
   my $col = shift;
 
 sub itable {
   my $col = shift;
+  my $cellspacing = shift || 0;
+  if ( $col ) {
+    qq!<TABLE BGCOLOR="$col" BORDER=0 CELLSPACING=$cellspacing WIDTH="100%">!;
+  } else {
+    qq!<TABLE BORDER=0 $cellspacing=$cellspacing WIDTH="100%">!;
+  }
+}
+
+=item ntable
+
+This is getting silly.
+
+=cut
+
+sub ntable {
+  my $col = shift;
+  my $cellspacing = shift || 0;
   if ( $col ) {
   if ( $col ) {
-    qq!<TABLE BGCOLOR=$col BORDER=0 CELLSPACING=0 WIDTH=\"100%\">!;
+    qq!<TABLE BGCOLOR="$col" BORDER=0 CELLSPACING=$cellspacing>!;
   } else {
   } else {
-    "<TABLE>";
+    "<TABLE BORDER>";
   }
   }
+
 }
 
 =back
 }
 
 =back
@@ -193,7 +216,10 @@ lose the background, eidiot ivan@sisd.com 98-sep-2
 pod ivan@sisd.com 98-sep-12
 
 $Log: CGI.pm,v $
 pod ivan@sisd.com 98-sep-12
 
 $Log: CGI.pm,v $
-Revision 1.15  1999-01-18 09:41:48  ivan
+Revision 1.16  1999-01-25 12:26:05  ivan
+yet more mod_perl stuff
+
+Revision 1.15  1999/01/18 09:41:48  ivan
 all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
 (good idea anyway)
 
 all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
 (good idea anyway)
 
index 8157413..aa8d75b 100644 (file)
@@ -353,6 +353,7 @@ sub insert {
   local $SIG{QUIT} = 'IGNORE'; 
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE'; 
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   $sth->execute or return $sth->errstr;
 
 
   $sth->execute or return $sth->errstr;
 
@@ -396,6 +397,7 @@ sub delete {
   local $SIG{QUIT} = 'IGNORE'; 
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE'; 
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   my $rc = $sth->execute or return $sth->errstr;
   #not portable #return "Record not found, statement:\n$statement" if $rc eq "0E0";
 
   my $rc = $sth->execute or return $sth->errstr;
   #not portable #return "Record not found, statement:\n$statement" if $rc eq "0E0";
@@ -462,6 +464,7 @@ sub replace {
   local $SIG{QUIT} = 'IGNORE'; 
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE'; 
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   my $rc = $sth->execute or return $sth->errstr;
   #not portable #return "Record not found (or records identical)." if $rc eq "0E0";
 
   my $rc = $sth->execute or return $sth->errstr;
   #not portable #return "Record not found (or records identical)." if $rc eq "0E0";
@@ -590,9 +593,10 @@ is an error, returns the error, otherwise returns false.
 
 sub ut_money {
   my($self,$field)=@_;
 
 sub ut_money {
   my($self,$field)=@_;
+  $self->setfield($field, 0) if $self->getfield($field) eq '';
   $self->getfield($field) =~ /^(\-)? ?(\d*)(\.\d{2})?$/
     or return "Illegal (money) $field!";
   $self->getfield($field) =~ /^(\-)? ?(\d*)(\.\d{2})?$/
     or return "Illegal (money) $field!";
-  $self->setfield($field,"$1$2$3" || 0);
+  $self->setfield($field, "$1$2$3" || 0);
   '';
 }
 
   '';
 }
 
@@ -805,7 +809,7 @@ sub hfields {
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-$Id: Record.pm,v 1.11 1999-01-18 09:22:38 ivan Exp $
+$Id: Record.pm,v 1.12 1999-01-25 12:26:06 ivan Exp $
 
 =head1 BUGS
 
 
 =head1 BUGS
 
@@ -927,7 +931,10 @@ added pod documentation ivan@sisd.com 98-sep-6
 ut_phonen got ''; at the end ivan@sisd.com 98-sep-27
 
 $Log: Record.pm,v $
 ut_phonen got ''; at the end ivan@sisd.com 98-sep-27
 
 $Log: Record.pm,v $
-Revision 1.11  1999-01-18 09:22:38  ivan
+Revision 1.12  1999-01-25 12:26:06  ivan
+yet more mod_perl stuff
+
+Revision 1.11  1999/01/18 09:22:38  ivan
 changes to track email addresses for email invoicing
 
 Revision 1.10  1998/12/29 11:59:33  ivan
 changes to track email addresses for email invoicing
 
 Revision 1.10  1998/12/29 11:59:33  ivan
index 5de1d92..6d87b1b 100644 (file)
@@ -15,7 +15,7 @@ use FS::cust_pkg;
 #ask FS::UID to run this stuff for us later
 $FS::UID::callback{'FS::cust_bill'} = sub { 
   $conf = new FS::Conf;
 #ask FS::UID to run this stuff for us later
 $FS::UID::callback{'FS::cust_bill'} = sub { 
   $conf = new FS::Conf;
-  ( $add1, $add2, $add3, $add4 ) = $conf->config('address');
+  ( $add1, $add2, $add3, $add4 ) = ( $conf->config('address'), '', '', '', '' );
 };
 
 =head1 NAME
 };
 
 =head1 NAME
@@ -264,172 +264,156 @@ sub print_text {
 
   #printing bits here (yuck!)
 
 
   #printing bits here (yuck!)
 
-  local($SIG{CHLD}) = sub { wait() };
-  $|=1;
-  my($pid)=open(CHILD,"-|");
-  die "Can't fork: $!" unless defined($pid); 
+  my @collect = ();
 
 
-  if ($pid) { #parent
-    my(@collect)=<CHILD>;
-    close CHILD;
-    return @collect;
-  } else { #child
-
-    my($description,$amount);
-    my(@buf);
-
-    #define format stuff
-    $%=0;
-    $= = 35;
-    local($^L) = <<END;
-
-
-
-
-
-
-
-END
-
-    #format address
-    my($l,@address)=(0,'','','','','');
-    $address[$l++]=$cust_main->company if $cust_main->company;
-    $address[$l++]=$cust_main->address1;
-    $address[$l++]=$cust_main->address2 if $cust_main->address2;
-    $address[$l++]=$cust_main->city. ", ". $cust_main->state. "  ".
-                   $cust_main->zip;
-    $address[$l++]=$cust_main->country unless $cust_main->country eq 'US';
-
-    #previous balance
-    foreach ( @pr_cust_bill ) {
-      push @buf, (
-        "Previous Balance, Invoice #". $_->invnum. 
-                   " (". time2str("%x",$_->_date). ")",
-        '$'. sprintf("%10.2f",$_->owed)
-      );
-    }
-    if (@pr_cust_bill) {
-      push @buf,('','-----------');
-      push @buf,('Total Previous Balance','$' . sprintf("%10.2f",$pr_total ) );
-      push @buf,('','');
-    }
-
-    #new charges
-    foreach ( $self->cust_bill_pkg ) {
-
-      if ( $_->pkgnum ) {
-
-        my($cust_pkg)=qsearchs('cust_pkg', { 'pkgnum', $_->pkgnum } );
-        my($part_pkg)=qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->pkgpart});
-        my($pkg)=$part_pkg->pkg;
-
-        push @buf, ( "$pkg Setup",'$' . sprintf("%10.2f",$_->setup) )
-          if $_->setup != 0;
-        push @buf, (
-          "$pkg (" . time2str("%x",$_->sdate) . " - " .
-                                time2str("%x",$_->edate) . ")",
-          '$' . sprintf("%10.2f",$_->recur)
-        ) if $_->recur != 0;
-
-      } else { #pkgnum Tax
-        push @buf,("Tax",'$' . sprintf("%10.2f",$_->setup) ) 
-          if $_->setup != 0;
-      }
-    }
+  my($description,$amount);
+  my(@buf);
 
 
+  #format address
+  my($l,@address)=(0,'','','','','','','');
+  $address[$l++] =
+    $cust_main->payname.
+      ( ( $cust_main->payby eq 'BILL' ) && $cust_main->payinfo
+        ? " (P.O. #". $cust_main->payinfo. ")"
+        : ''
+      )
+  ;
+  $address[$l++]=$cust_main->company if $cust_main->company;
+  $address[$l++]=$cust_main->address1;
+  $address[$l++]=$cust_main->address2 if $cust_main->address2;
+  $address[$l++]=$cust_main->city. ", ". $cust_main->state. "  ".
+                 $cust_main->zip;
+  $address[$l++]=$cust_main->country unless $cust_main->country eq 'US';
+
+  #previous balance
+  foreach ( @pr_cust_bill ) {
+    push @buf, (
+      "Previous Balance, Invoice #". $_->invnum. 
+                 " (". time2str("%x",$_->_date). ")",
+      '$'. sprintf("%10.2f",$_->owed)
+    );
+  }
+  if (@pr_cust_bill) {
     push @buf,('','-----------');
     push @buf,('','-----------');
-    push @buf,('Total New Charges',
-               '$' . sprintf("%10.2f",$self->charged) );
+    push @buf,('Total Previous Balance','$' . sprintf("%10.2f",$pr_total ) );
     push @buf,('','');
     push @buf,('','');
+  }
 
 
-    push @buf,('','-----------');
-    push @buf,('Total Charges',
-               '$' . sprintf("%10.2f",$self->charged + $pr_total) );
-    push @buf,('','');
+  #new charges
+  foreach ( $self->cust_bill_pkg ) {
 
 
-    #credits
-    foreach ( @cr_cust_credit ) {
-      push @buf,(
-        "Credit #". $_->crednum. " (" . time2str("%x",$_->_date) .")",
-        '$' . sprintf("%10.2f",$_->credited)
-      );
-    }
+    if ( $_->pkgnum ) {
 
 
-    #get & print payments
-    foreach ( $self->cust_pay ) {
-      push @buf,(
-        "Payment received ". time2str("%x",$_->_date ),
-        '$' . sprintf("%10.2f",$_->paid )
-      );
-    }
-
-    #balance due
-    push @buf,('','-----------');
-    push @buf,('Balance Due','$' . 
-      sprintf("%10.2f",$self->owed + $pr_total - $cr_total ) );
+      my($cust_pkg)=qsearchs('cust_pkg', { 'pkgnum', $_->pkgnum } );
+      my($part_pkg)=qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->pkgpart});
+      my($pkg)=$part_pkg->pkg;
 
 
-    #now print
-
-    my($tot_pages)=int(scalar(@buf)/30); #15 lines, 2 values per line
-    $tot_pages++ if scalar(@buf) % 30;
-
-    while (@buf) {
+      push @buf, ( "$pkg Setup",'$' . sprintf("%10.2f",$_->setup) )
+        if $_->setup != 0;
+      push @buf, (
+        "$pkg (" . time2str("%x",$_->sdate) . " - " .
+                              time2str("%x",$_->edate) . ")",
+        '$' . sprintf("%10.2f",$_->recur)
+      ) if $_->recur != 0;
+
+    } else { #pkgnum Tax
+      push @buf,("Tax",'$' . sprintf("%10.2f",$_->setup) ) 
+        if $_->setup != 0;
+    }
+  }
+
+  push @buf,('','-----------');
+  push @buf,('Total New Charges',
+             '$' . sprintf("%10.2f",$self->charged) );
+  push @buf,('','');
+
+  push @buf,('','-----------');
+  push @buf,('Total Charges',
+             '$' . sprintf("%10.2f",$self->charged + $pr_total) );
+  push @buf,('','');
+
+  #credits
+  foreach ( @cr_cust_credit ) {
+    push @buf,(
+      "Credit #". $_->crednum. " (" . time2str("%x",$_->_date) .")",
+      '$' . sprintf("%10.2f",$_->credited)
+    );
+  }
+
+  #get & print payments
+  foreach ( $self->cust_pay ) {
+    push @buf,(
+      "Payment received ". time2str("%x",$_->_date ),
+      '$' . sprintf("%10.2f",$_->paid )
+    );
+  }
+
+  #balance due
+  push @buf,('','-----------');
+  push @buf,('Balance Due','$' . 
+    sprintf("%10.2f",$self->owed + $pr_total - $cr_total ) );
+
+  #now print
+
+  my $tot_lines = 50; #should be configurable
+   #header is 17 lines
+  my $tot_pages = int( scalar(@buf) / ( 2 * ( $tot_lines - 17 ) ) );
+  $tot_pages++ if scalar(@buf) % ( 2 * ( $tot_lines - 17 ) );
+
+  my $page = 1;
+  my $lines;
+  while (@buf) {
+    $lines = $tot_lines;
+    my @header = &header(
+      $page, $tot_pages, $self->_date, $self->invnum, @address
+    );
+    push @collect, @header;
+    $lines -= scalar(@header);
+
+    while ( $lines-- && @buf ) {
       $description=shift(@buf);
       $amount=shift(@buf);
       $description=shift(@buf);
       $amount=shift(@buf);
-      write;
+      push @collect, myswrite($description, $amount);
     }
     }
-      ($description,$amount)=('','');
-      write while ( $- );
-      print $^L;
-
-      exit; #kid
-
-    format STDOUT_TOP =
-
-                                      @|||||||||||||||||||
-                                     "Invoice"
-                                      @||||||||||||||||||| @<<<<<<< @<<<<<<<<<<<
-{
-              ( $tot_pages != 1 ) ? "Page $% of $tot_pages" : '',
-  time2str("%x",( $self->_date )), "FS-$invnum"
-}
-
-
-@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-$add1
-@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-$add2
-@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-$add3
-@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-$add4
-
-  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-{ $cust_main->payname,
-  ( ( $cust_main->payby eq 'BILL' ) && $cust_main->payinfo )
-  ? "P.O. #". $cust_main->payinfo : ''
-}
-  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-$address[0],''
-  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-$address[1],$overdue ? "* This invoice is now PAST DUE! *" : ''
-  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-$address[2],$overdue ? " Please forward payment promptly " : ''
-  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-$address[3],$overdue ? "to avoid interruption of service." : ''
-  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-$address[4],''
-
-
-
-.
-
-    format STDOUT =
+    $page++;
+  }
+  while ( $lines-- ) {
+    push @collect, myswrite('', '');
+  }
+
+  return @collect;
+
+  sub header { #17 lines
+    my ( $page, $tot_pages, $date, $invnum, @address ) = @_ ;
+    push @address, '', '', '', '';
+
+    my @return = ();
+    my $i = ' 'x32;
+    push @return,
+      '',
+      $i. 'Invoice',
+      $i. substr("Page $page of $tot_pages".' 'x10, 0, 20).
+        time2str("%x", $date ). "  FS-". $invnum,
+      '',
+      '',
+      $add1,
+      $add2,
+      $add3,
+      $add4,
+      '',
+      splice @address, 0, 7;
+    ;
+    return map $_. "\n", @return;
+  }
+
+  sub myswrite {
+    my $format = <<END;
   @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<
   @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<
-  $description,$amount
-.
-
-  } #endchild
+END
+    $^A = '';
+    formline( $format, @_ );
+    return $^A;
+  }
 
 }
 
 
 }
 
@@ -437,23 +421,18 @@ $address[4],''
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-$Id: cust_bill.pm,v 1.5 1999-01-18 21:58:03 ivan Exp $
+$Id: cust_bill.pm,v 1.6 1999-01-25 12:26:07 ivan Exp $
 
 =head1 BUGS
 
 The delete method.
 
 
 =head1 BUGS
 
 The delete method.
 
-print_text formatting (and some logic :/) is in source as a format declaration,
-which needs to be slurped in from a file.  the fork is rather kludgy as well.
-It could be cleaned with swrite from man perlform, and the picture could be
-put in a /var/spool/freeside/conf file.  Also number of lines ($=).
+print_text formatting (and some logic :/) is in source, but needs to be
+slurped in from a file.  Also number of lines ($=).
 
 missing print_ps for a nice postscript copy (maybe HylaFAX-cover-page-style
 or something similar so the look can be completely customized?)
 
 
 missing print_ps for a nice postscript copy (maybe HylaFAX-cover-page-style
 or something similar so the look can be completely customized?)
 
-There is an off-by-one error in print_text which causes a visual error: "Page 1
-of 2" printed on some single-page invoices?
-
 =head1 SEE ALSO
 
 L<FS::Record>, L<FS::cust_main>, L<FS::cust_pay>, L<FS::cust_bill_pkg>,
 =head1 SEE ALSO
 
 L<FS::Record>, L<FS::cust_main>, L<FS::cust_pay>, L<FS::cust_bill_pkg>,
@@ -470,7 +449,10 @@ charges can be negative ivan@sisd.com 98-jul-13
 pod, ingegrate with FS::Invoice ivan@sisd.com 98-sep-20
 
 $Log: cust_bill.pm,v $
 pod, ingegrate with FS::Invoice ivan@sisd.com 98-sep-20
 
 $Log: cust_bill.pm,v $
-Revision 1.5  1999-01-18 21:58:03  ivan
+Revision 1.6  1999-01-25 12:26:07  ivan
+yet more mod_perl stuff
+
+Revision 1.5  1999/01/18 21:58:03  ivan
 esthetic: eq and ne were used in a few places instead of == and !=
 
 Revision 1.4  1998/12/29 11:59:36  ivan
 esthetic: eq and ne were used in a few places instead of == and !=
 
 Revision 1.4  1998/12/29 11:59:36  ivan
index a050e30..b9a0583 100644 (file)
@@ -77,7 +77,12 @@ automatically set to amount).
 sub insert {
   my $self = shift;
 
 sub insert {
   my $self = shift;
 
-  $self->credited($self->amount) if $self->credited eq '';
+  my $error;
+  return $error if $error = $self->ut_money('credited')
+                         || $self->ut_money('amount');
+
+  $self->credited($self->amount) if $self->credited == 0
+                                 || $self->credited eq '';
   return "credited != amount!"
     unless $self->credited == $self->amount;
 
   return "credited != amount!"
     unless $self->credited == $self->amount;
 
@@ -152,7 +157,7 @@ sub check {
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-$Id: cust_credit.pm,v 1.3 1999-01-18 21:58:04 ivan Exp $
+$Id: cust_credit.pm,v 1.4 1999-01-25 12:26:08 ivan Exp $
 
 =head1 BUGS
 
 
 =head1 BUGS
 
@@ -170,7 +175,10 @@ ivan@sisd.com 98-mar-17
 pod, otaker from FS::UID ivan@sisd.com 98-sep-21
 
 $Log: cust_credit.pm,v $
 pod, otaker from FS::UID ivan@sisd.com 98-sep-21
 
 $Log: cust_credit.pm,v $
-Revision 1.3  1999-01-18 21:58:04  ivan
+Revision 1.4  1999-01-25 12:26:08  ivan
+yet more mod_perl stuff
+
+Revision 1.3  1999/01/18 21:58:04  ivan
 esthetic: eq and ne were used in a few places instead of == and !=
 
 Revision 1.2  1998/12/29 11:59:38  ivan
 esthetic: eq and ne were used in a few places instead of == and !=
 
 Revision 1.2  1998/12/29 11:59:38  ivan
index 979b6f4..a89896d 100644 (file)
@@ -356,7 +356,7 @@ If there is an error, returns the error, otherwise returns false.
 
 sub bill {
   my( $self, %options ) = @_;
 
 sub bill {
   my( $self, %options ) = @_;
-  my $time = $options{'time'} || $^T;
+  my $time = $options{'time'} || time;
 
   my $error;
 
 
   my $error;
 
@@ -366,6 +366,7 @@ sub bill {
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   # find the packages which are due for billing, find out how much they are
   # & generate invoice database.
 
   # find the packages which are due for billing, find out how much they are
   # & generate invoice database.
@@ -543,7 +544,7 @@ return an error.  By default, they don't.
 
 sub collect {
   my( $self, %options ) = @_;
 
 sub collect {
   my( $self, %options ) = @_;
-  my $invoice_time = $options{'invoice_time'} || $^T;
+  my $invoice_time = $options{'invoice_time'} || time;
 
   my $total_owed = $self->balance;
   return '' unless $total_owed > 0; #redundant?????
 
   my $total_owed = $self->balance;
   return '' unless $total_owed > 0; #redundant?????
@@ -554,6 +555,7 @@ sub collect {
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   foreach my $cust_bill (
     qsearch('cust_bill', { 'custnum' => $self->custnum, } )
 
   foreach my $cust_bill (
     qsearch('cust_bill', { 'custnum' => $self->custnum, } )
@@ -820,7 +822,10 @@ sub check_invoicing_list {
       'custnum' => $self->custnum,
       'dest'    => $address,
     } );
       'custnum' => $self->custnum,
       'dest'    => $address,
     } );
-    my $error = $cust_main_invoice->check;
+    my $error = $self->custnum
+                ? $cust_main_invoice->check
+                : $cust_main_invoice->checkdest
+    ;
     return $error if $error;
   }
   '';
     return $error if $error;
   }
   '';
@@ -830,7 +835,7 @@ sub check_invoicing_list {
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-$Id: cust_main.pm,v 1.9 1999-01-18 09:22:41 ivan Exp $
+$Id: cust_main.pm,v 1.10 1999-01-25 12:26:09 ivan Exp $
 
 =head1 BUGS
 
 
 =head1 BUGS
 
@@ -886,7 +891,10 @@ enable cybercash, cybercash v3 support, don't need to import
 FS::UID::{datasrc,checkruid} ivan@sisd.com 98-sep-19-21
 
 $Log: cust_main.pm,v $
 FS::UID::{datasrc,checkruid} ivan@sisd.com 98-sep-19-21
 
 $Log: cust_main.pm,v $
-Revision 1.9  1999-01-18 09:22:41  ivan
+Revision 1.10  1999-01-25 12:26:09  ivan
+yet more mod_perl stuff
+
+Revision 1.9  1999/01/18 09:22:41  ivan
 changes to track email addresses for email invoicing
 
 Revision 1.8  1998/12/29 11:59:39  ivan
 changes to track email addresses for email invoicing
 
 Revision 1.8  1998/12/29 11:59:39  ivan
index 6ae6425..2823294 100644 (file)
@@ -105,13 +105,28 @@ sub check {
 
   my $error = $self->ut_numbern('destnum')
            || $self->ut_number('custnum')
 
   my $error = $self->ut_numbern('destnum')
            || $self->ut_number('custnum')
-           || $self->ut_text('dest')
+           || $self->checkdest;
   ;
   return $error if $error;
 
   return "Unknown customer"
     unless qsearchs('cust_main',{ 'custnum' => $self->custnum });
 
   ;
   return $error if $error;
 
   return "Unknown customer"
     unless qsearchs('cust_main',{ 'custnum' => $self->custnum });
 
+  ''; #noerror
+}
+
+=item checkdest
+
+Checks the dest field only.
+
+=cut
+
+sub checkdest { 
+  my $self = shift;
+
+  my $error = $self->ut_text('dest');
+  return $error if $error;
+
   if ( $self->dest eq 'POST' ) {
     #contemplate our navel
   } elsif ( $self->dest =~ /^(\d+)$/ ) {
   if ( $self->dest eq 'POST' ) {
     #contemplate our navel
   } elsif ( $self->dest =~ /^(\d+)$/ ) {
@@ -152,7 +167,7 @@ sub address {
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-$Id: cust_main_invoice.pm,v 1.5 1999-01-18 21:58:05 ivan Exp $
+$Id: cust_main_invoice.pm,v 1.6 1999-01-25 12:26:10 ivan Exp $
 
 =head1 BUGS
 
 
 =head1 BUGS
 
@@ -168,7 +183,10 @@ added hfields
 ivan@sisd.com 97-nov-13
 
 $Log: cust_main_invoice.pm,v $
 ivan@sisd.com 97-nov-13
 
 $Log: cust_main_invoice.pm,v $
-Revision 1.5  1999-01-18 21:58:05  ivan
+Revision 1.6  1999-01-25 12:26:10  ivan
+yet more mod_perl stuff
+
+Revision 1.5  1999/01/18 21:58:05  ivan
 esthetic: eq and ne were used in a few places instead of == and !=
 
 Revision 1.4  1999/01/18 09:22:42  ivan
 esthetic: eq and ne were used in a few places instead of == and !=
 
 Revision 1.4  1999/01/18 09:22:42  ivan
index fc9112b..2cb256b 100644 (file)
@@ -89,6 +89,7 @@ sub insert {
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   $error = $new_cust_bill->replace($old_cust_bill);
   return "Error modifying cust_bill: $error" if $error;
 
   $error = $new_cust_bill->replace($old_cust_bill);
   return "Error modifying cust_bill: $error" if $error;
@@ -170,7 +171,7 @@ sub check {
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-$Id: cust_pay.pm,v 1.2 1998-12-29 11:59:43 ivan Exp $
+$Id: cust_pay.pm,v 1.3 1999-01-25 12:26:11 ivan Exp $
 
 =head1 BUGS
 
 
 =head1 BUGS
 
@@ -189,7 +190,10 @@ new api ivan@sisd.com 98-mar-13
 pod ivan@sisd.com 98-sep-21
 
 $Log: cust_pay.pm,v $
 pod ivan@sisd.com 98-sep-21
 
 $Log: cust_pay.pm,v $
-Revision 1.2  1998-12-29 11:59:43  ivan
+Revision 1.3  1999-01-25 12:26:11  ivan
+yet more mod_perl stuff
+
+Revision 1.2  1998/12/29 11:59:43  ivan
 mostly properly OO, some work still to be done with svc_ stuff
 
 
 mostly properly OO, some work still to be done with svc_ stuff
 
 
index 5b119ed..039b654 100644 (file)
@@ -193,6 +193,7 @@ sub cancel {
   local $SIG{QUIT} = 'IGNORE'; 
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE'; 
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   foreach my $cust_svc (
     qsearch( 'cust_svc', { 'pkgnum' => $self->pkgnum } )
 
   foreach my $cust_svc (
     qsearch( 'cust_svc', { 'pkgnum' => $self->pkgnum } )
@@ -219,7 +220,7 @@ sub cancel {
 
   unless ( $self->getfield('cancel') ) {
     my %hash = $self->hash;
 
   unless ( $self->getfield('cancel') ) {
     my %hash = $self->hash;
-    $hash{'cancel'} = $^T;
+    $hash{'cancel'} = time;
     my $new = new FS::cust_pkg ( \%hash );
     $error = $new->replace($self);
     return $error if $error;
     my $new = new FS::cust_pkg ( \%hash );
     $error = $new->replace($self);
     return $error if $error;
@@ -246,6 +247,7 @@ sub suspend {
   local $SIG{QUIT} = 'IGNORE'; 
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE'; 
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   foreach my $cust_svc (
     qsearch( 'cust_svc', { 'pkgnum' => $self->pkgnum } )
 
   foreach my $cust_svc (
     qsearch( 'cust_svc', { 'pkgnum' => $self->pkgnum } )
@@ -267,7 +269,7 @@ sub suspend {
 
   unless ( $self->getfield('susp') ) {
     my %hash = $self->hash;
 
   unless ( $self->getfield('susp') ) {
     my %hash = $self->hash;
-    $hash{'susp'} = $^T;
+    $hash{'susp'} = time;
     my $new = new FS::cust_pkg ( \%hash );
     $error = $new->replace($self);
     return $error if $error;
     my $new = new FS::cust_pkg ( \%hash );
     $error = $new->replace($self);
     return $error if $error;
@@ -294,6 +296,7 @@ sub unsuspend {
   local $SIG{QUIT} = 'IGNORE'; 
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE'; 
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   foreach my $cust_svc (
     qsearch('cust_svc',{'pkgnum'=> $self->pkgnum } )
 
   foreach my $cust_svc (
     qsearch('cust_svc',{'pkgnum'=> $self->pkgnum } )
@@ -417,38 +420,39 @@ sub order {
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE'; 
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE'; 
+  local $SIG{PIPE} = 'IGNORE'; 
 
   #first cancel old packages
 #  my($pkgnum);
   foreach $pkgnum ( @{$remove_pkgnums} ) {
     my($old) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
 
   #first cancel old packages
 #  my($pkgnum);
   foreach $pkgnum ( @{$remove_pkgnums} ) {
     my($old) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-    return "Package $pkgnum not found to remove!" unless $old;
+    die "Package $pkgnum not found to remove!" unless $old;
     my(%hash) = $old->hash;
     my(%hash) = $old->hash;
-    $hash{'cancel'}=$^T;   
-    my($new) = create FS::cust_pkg ( \%hash );
+    $hash{'cancel'}=time;   
+    my($new) = new FS::cust_pkg ( \%hash );
     my($error)=$new->replace($old);
     my($error)=$new->replace($old);
-    return $error if $error;
+    die "Couldn't update package $pkgnum: $error" if $error;
   }
 
   #now add new packages, changing cust_svc records if necessary
 #  my($pkgpart);
   while ($pkgpart=shift @{$pkgparts} ) {
  
   }
 
   #now add new packages, changing cust_svc records if necessary
 #  my($pkgpart);
   while ($pkgpart=shift @{$pkgparts} ) {
  
-    my($new) = create FS::cust_pkg ( {
+    my($new) = new FS::cust_pkg ( {
                                        'custnum' => $custnum,
                                        'pkgpart' => $pkgpart,
                                     } );
     my($error) = $new->insert;
                                        'custnum' => $custnum,
                                        'pkgpart' => $pkgpart,
                                     } );
     my($error) = $new->insert;
-    return $error if $error; 
+    die "Couldn't insert new cust_pkg record: $error" if $error; 
     my($pkgnum)=$new->getfield('pkgnum');
  
     my($cust_svc);
     foreach $cust_svc ( @{ shift @cust_svc } ) {
       my(%hash) = $cust_svc->hash;
       $hash{'pkgnum'}=$pkgnum;
     my($pkgnum)=$new->getfield('pkgnum');
  
     my($cust_svc);
     foreach $cust_svc ( @{ shift @cust_svc } ) {
       my(%hash) = $cust_svc->hash;
       $hash{'pkgnum'}=$pkgnum;
-      my($new) = create FS::cust_svc ( \%hash );
+      my($new) = new FS::cust_svc ( \%hash );
       my($error)=$new->replace($cust_svc);
       my($error)=$new->replace($cust_svc);
-      return $error if $error;
+      die "Couldn't link old service to new package: $error" if $error;
     }
   }  
 
     }
   }  
 
@@ -459,7 +463,7 @@ sub order {
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-$Id: cust_pkg.pm,v 1.5 1999-01-18 21:58:07 ivan Exp $
+$Id: cust_pkg.pm,v 1.6 1999-01-25 12:26:12 ivan Exp $
 
 =head1 BUGS
 
 
 =head1 BUGS
 
@@ -490,7 +494,10 @@ fixed for new agent->agent_type->type_pkgs in &order ivan@sisd.com 98-mar-7
 pod ivan@sisd.com 98-sep-21
 
 $Log: cust_pkg.pm,v $
 pod ivan@sisd.com 98-sep-21
 
 $Log: cust_pkg.pm,v $
-Revision 1.5  1999-01-18 21:58:07  ivan
+Revision 1.6  1999-01-25 12:26:12  ivan
+yet more mod_perl stuff
+
+Revision 1.5  1999/01/18 21:58:07  ivan
 esthetic: eq and ne were used in a few places instead of == and !=
 
 Revision 1.4  1998/12/29 11:59:45  ivan
 esthetic: eq and ne were used in a few places instead of == and !=
 
 Revision 1.4  1998/12/29 11:59:45  ivan
index 0778473..4ec5490 100644 (file)
@@ -91,6 +91,7 @@ sub insert {
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   $error = $new_cust_credit->replace($old_cust_credit);
   return "Error modifying cust_credit: $error" if $error;
 
   $error = $new_cust_credit->replace($old_cust_credit);
   return "Error modifying cust_credit: $error" if $error;
@@ -170,7 +171,7 @@ sub check {
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-$Id: cust_refund.pm,v 1.2 1998-12-29 11:59:46 ivan Exp $
+$Id: cust_refund.pm,v 1.3 1999-01-25 12:26:13 ivan Exp $
 
 =head1 BUGS
 
 
 =head1 BUGS
 
@@ -190,7 +191,10 @@ ivan@sisd.com 98-mar-18
 pod and finish up ivan@sisd.com 98-sep-21
 
 $Log: cust_refund.pm,v $
 pod and finish up ivan@sisd.com 98-sep-21
 
 $Log: cust_refund.pm,v $
-Revision 1.2  1998-12-29 11:59:46  ivan
+Revision 1.3  1999-01-25 12:26:13  ivan
+yet more mod_perl stuff
+
+Revision 1.2  1998/12/29 11:59:46  ivan
 mostly properly OO, some work still to be done with svc_ stuff
 
 
 mostly properly OO, some work still to be done with svc_ stuff
 
 
index e516e00..9c0c4e6 100644 (file)
@@ -46,6 +46,7 @@ sub insert {
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   $error = $self->check;
   return $error if $error;
 
   $error = $self->check;
   return $error if $error;
@@ -90,6 +91,7 @@ sub delete {
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   my $svcnum = $self->svcnum;
 
 
   my $svcnum = $self->svcnum;
 
@@ -163,7 +165,7 @@ sub cancel { ''; }
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-$Id: svc_Common.pm,v 1.1 1998-12-30 00:30:45 ivan Exp $
+$Id: svc_Common.pm,v 1.2 1999-01-25 12:26:14 ivan Exp $
 
 =head1 BUGS
 
 
 =head1 BUGS
 
@@ -180,7 +182,10 @@ from the base documentation.
 =head1 HISTORY
 
 $Log: svc_Common.pm,v $
 =head1 HISTORY
 
 $Log: svc_Common.pm,v $
-Revision 1.1  1998-12-30 00:30:45  ivan
+Revision 1.2  1999-01-25 12:26:14  ivan
+yet more mod_perl stuff
+
+Revision 1.1  1998/12/30 00:30:45  ivan
 svc_ stuff is more properly OO - has a common superclass FS::svc_Common
 
 
 svc_ stuff is more properly OO - has a common superclass FS::svc_Common
 
 
index c69f103..1ba92ae 100644 (file)
@@ -120,6 +120,7 @@ sub insert {
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   $error = $self->check;
   return $error if $error;
 
   $error = $self->check;
   return $error if $error;
@@ -188,6 +189,7 @@ sub delete {
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   $error = $self->SUPER::delete;
   return $error if $error;
 
   $error = $self->SUPER::delete;
   return $error if $error;
@@ -242,6 +244,7 @@ sub replace {
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   $error = $new->SUPER::replace($old);
   return $error if $error;
 
   $error = $new->SUPER::replace($old);
   return $error if $error;
@@ -440,7 +443,7 @@ sub check {
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-$Id: svc_acct.pm,v 1.5 1999-01-18 21:58:09 ivan Exp $
+$Id: svc_acct.pm,v 1.6 1999-01-25 12:26:15 ivan Exp $
 
 =head1 BUGS
 
 
 =head1 BUGS
 
@@ -482,7 +485,10 @@ arbitrary radius attributes ivan@sisd.com 98-aug-13
 pod and FS::conf ivan@sisd.com 98-sep-22
 
 $Log: svc_acct.pm,v $
 pod and FS::conf ivan@sisd.com 98-sep-22
 
 $Log: svc_acct.pm,v $
-Revision 1.5  1999-01-18 21:58:09  ivan
+Revision 1.6  1999-01-25 12:26:15  ivan
+yet more mod_perl stuff
+
+Revision 1.5  1999/01/18 21:58:09  ivan
 esthetic: eq and ne were used in a few places instead of == and !=
 
 Revision 1.4  1998/12/30 00:30:45  ivan
 esthetic: eq and ne were used in a few places instead of == and !=
 
 Revision 1.4  1998/12/30 00:30:45  ivan
index 5c0f510..b0eee11 100644 (file)
@@ -103,6 +103,7 @@ sub insert {
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   $error=$self->check;
   return $error if $error;
 
   $error=$self->check;
   return $error if $error;
@@ -229,7 +230,7 @@ sub check {
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-$Id: svc_acct_sm.pm,v 1.5 1999-01-18 21:58:10 ivan Exp $
+$Id: svc_acct_sm.pm,v 1.6 1999-01-25 12:26:16 ivan Exp $
 
 =head1 BUGS
 
 
 =head1 BUGS
 
index f86723f..76d666b 100644 (file)
@@ -121,6 +121,7 @@ sub insert {
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
   local $SIG{QUIT} = 'IGNORE';
   local $SIG{TERM} = 'IGNORE';
   local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
 
   $error = $self->check;
   return $error if $error;
 
   $error = $self->check;
   return $error if $error;
@@ -386,7 +387,7 @@ sub submit_internic {
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-$Id: svc_domain.pm,v 1.5 1998-12-30 00:30:47 ivan Exp $
+$Id: svc_domain.pm,v 1.6 1999-01-25 12:26:17 ivan Exp $
 
 =head1 BUGS
 
 
 =head1 BUGS
 
@@ -422,7 +423,10 @@ ivan@sisd.com 98-jul-17-19
 pod, some FS::Conf (not complete) ivan@sisd.com 98-sep-23
 
 $Log: svc_domain.pm,v $
 pod, some FS::Conf (not complete) ivan@sisd.com 98-sep-23
 
 $Log: svc_domain.pm,v $
-Revision 1.5  1998-12-30 00:30:47  ivan
+Revision 1.6  1999-01-25 12:26:17  ivan
+yet more mod_perl stuff
+
+Revision 1.5  1998/12/30 00:30:47  ivan
 svc_ stuff is more properly OO - has a common superclass FS::svc_Common
 
 Revision 1.3  1998/11/13 09:56:57  ivan
 svc_ stuff is more properly OO - has a common superclass FS::svc_Common
 
 Revision 1.3  1998/11/13 09:56:57  ivan