freeside/FS/FS h_cust_svc.pm,1.3,1.4 h_svc_forward.pm,1.3,1.4 h_svc_www.pm,1.4,1.5
Kristian Hoffmann
khoff at pouncequick.420.am
Wed Apr 6 20:28:24 PDT 2005
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory pouncequick:/tmp/cvs-serv31516
Modified Files:
h_cust_svc.pm h_svc_forward.pm h_svc_www.pm
Log Message:
Using current (non-history) records in place of missing history records.
Index: h_svc_www.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/h_svc_www.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- h_svc_www.pm 1 Apr 2005 22:52:11 -0000 1.4
+++ h_svc_www.pm 7 Apr 2005 03:28:20 -0000 1.5
@@ -40,7 +40,7 @@
) || $self->SUPER::domain_record
or die "no history domain_record.recnum for svc_www.recnum ". $self->domsvc;
- carp 'Using FS::svc_acct record in place of missing FS::h_svc_acct record.'
+ carp 'Using domain_record in place of missing h_domain_record record.'
if ($domain_record->isa('FS::domain_record') and $DEBUG);
return $domain_record;
Index: h_cust_svc.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/h_cust_svc.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- h_cust_svc.pm 1 Apr 2005 22:52:11 -0000 1.3
+++ h_cust_svc.pm 7 Apr 2005 03:28:20 -0000 1.4
@@ -9,7 +9,7 @@
@ISA = qw( FS::h_Common FS::cust_svc );
-$DEBUG = 0;
+$DEBUG = 1;
sub table { 'h_cust_svc'; }
@@ -73,16 +73,21 @@
sub h_svc_x {
my $self = shift;
my $svcdb = $self->part_svc->svcdb;
- #if ( $svcdb eq 'svc_acct' && $self->{'_svc_acct'} ) {
- # $self->{'_svc_acct'};
- #} else {
- warn "requiring FS/h_$svcdb.pm" if $DEBUG;
- require "FS/h_$svcdb.pm";
- qsearchs( "h_$svcdb",
- { 'svcnum' => $self->svcnum, },
- "FS::h_$svcdb"->sql_h_searchs(@_),
- );
- #}
+
+ warn "requiring FS/h_$svcdb.pm" if $DEBUG;
+ require "FS/h_$svcdb.pm";
+ my $svc_x = qsearchs(
+ "h_$svcdb",
+ { 'svcnum' => $self->svcnum, },
+ "FS::h_$svcdb"->sql_h_searchs(@_),
+ ) || $self->SUPER::svc_x
+ or die "no history ${svcdb}.svcnum for cust_svc.svcnum ". $self->svcnum;
+
+ carp "Using $svcdb in place of missing h_${svcdb} record."
+ if ($svc_x->isa('FS::' . $svcdb) and $DEBUG);
+
+ return $svc_x;
+
}
=back
Index: h_svc_forward.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/h_svc_forward.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- h_svc_forward.pm 31 Mar 2005 00:31:29 -0000 1.3
+++ h_svc_forward.pm 7 Apr 2005 03:28:20 -0000 1.4
@@ -1,12 +1,17 @@
package FS::h_svc_forward;
use strict;
-use vars qw( @ISA );
+use vars qw( @ISA $DEBUG );
use FS::Record qw(qsearchs);
use FS::h_Common;
use FS::svc_forward;
+use FS::svc_acct;
use FS::h_svc_acct;
+use Carp qw(carp);
+
+$DEBUG = 1;
+
@ISA = qw( FS::h_Common FS::svc_forward );
sub table { 'h_svc_forward' };
@@ -27,10 +32,18 @@
sub srcsvc_acct {
my $self = shift;
- qsearchs( 'h_svc_acct',
- { 'svcnum' => $self->srcsvc },
- FS::h_svc_acct->sql_h_searchs(@_),
- );
+ my $h_svc_acct = qsearchs(
+ 'h_svc_acct',
+ { 'svcnum' => $self->srcsvc },
+ FS::h_svc_acct->sql_h_searchs(@_),
+ ) || $self->SUPER::srcsvc_acct
+ or die "no history svc_acct.svcnum for svc_forward.srcsvc ". $self->srcsvc;
+
+ carp 'Using svc_acct in place of missing h_svc_acct record.'
+ if ($h_svc_acct->isa('FS::domain_record') and $DEBUG);
+
+ return $h_svc_acct;
+
}
=item dstsvc_acct
@@ -39,10 +52,17 @@
sub dstsvc_acct {
my $self = shift;
- qsearchs( 'h_svc_acct',
- { 'svcnum' => $self->dstsvc },
- FS::h_svc_acct->sql_h_searchs(@_),
- );
+ my $h_svc_acct = qsearchs(
+ 'h_svc_acct',
+ { 'svcnum' => $self->dstsvc },
+ FS::h_svc_acct->sql_h_searchs(@_),
+ ) || $self->SUPER::dstsvc_acct
+ or die "no history svc_acct.svcnum for svc_forward.dstsvc ". $self->dstsvc;
+
+ carp 'Using svc_acct in place of missing h_svc_acct record.'
+ if ($h_svc_acct->isa('FS::domain_record') and $DEBUG);
+
+ return $h_svc_acct;
}
=back
More information about the freeside-commits
mailing list