[freeside-commits] freeside/httemplate/view cust_pay.html, 1.4, 1.5 cust_refund.html, 1.2, 1.3 svc_external.cgi, 1.8, 1.9 cust_bill.cgi, 1.40, 1.41 svc_broadband.cgi, 1.14, 1.15 svc_domain.cgi, 1.26, 1.27 svc_forward.cgi, 1.17, 1.18 svc_www.cgi, 1.18, 1.19
Ivan,,,
ivan at wavetail.420.am
Wed Dec 3 13:12:22 PST 2008
Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory wavetail.420.am:/tmp/cvs-serv18628
Modified Files:
cust_pay.html cust_refund.html svc_external.cgi cust_bill.cgi
svc_broadband.cgi svc_domain.cgi svc_forward.cgi svc_www.cgi
Log Message:
fix real customer numbers showing on view pages, RT#4099/4379
Index: cust_bill.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_bill.cgi,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- cust_bill.cgi 30 Mar 2008 02:42:53 -0000 1.40
+++ cust_bill.cgi 3 Dec 2008 21:12:20 -0000 1.41
@@ -1,5 +1,5 @@
<% include("/elements/header.html",'Invoice View', menubar(
- "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
)) %>
@@ -109,6 +109,7 @@
die "Invoice #$invnum not found!" unless $cust_bill;
my $custnum = $cust_bill->custnum;
+my $display_custnum = $cust_bill->cust_main->display_custnum;
#my $printed = $cust_bill->printed;
Index: svc_domain.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/svc_domain.cgi,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- svc_domain.cgi 15 Mar 2008 00:30:27 -0000 1.26
+++ svc_domain.cgi 3 Dec 2008 21:12:20 -0000 1.27
@@ -1,6 +1,6 @@
<% include("/elements/header.html",'Domain View', menubar(
( ( $pkgnum || $custnum )
- ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
)
: ( "Delete this (unaudited) domain" =>
"javascript:areyousure('${p}misc/cancel-unaudited.cgi?$svcnum', 'Delete $domain and all records?' )" )
@@ -136,10 +136,11 @@
my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
my $pkgnum = $cust_svc->getfield('pkgnum');
-my($cust_pkg, $custnum);
+my($cust_pkg, $custnum, $display_custnum);
if ($pkgnum) {
- $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
- $custnum=$cust_pkg->getfield('custnum');
+ $cust_pkg =qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+ $custnum = $cust_pkg->custnum;
+ $custnum = $cust_pkg->cust_main->display_custnum;
} else {
$cust_pkg = '';
$custnum = '';
Index: svc_www.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/svc_www.cgi,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- svc_www.cgi 13 Jan 2008 20:46:44 -0000 1.18
+++ svc_www.cgi 3 Dec 2008 21:12:20 -0000 1.19
@@ -1,52 +1,6 @@
-% die "access denied"
-% unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
-%
-%my($query) = $cgi->keywords;
-%$query =~ /^(\d+)$/;
-%my $svcnum = $1;
-%my $svc_www = qsearchs({
-% 'select' => 'svc_www.*',
-% 'table' => 'svc_www',
-% 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
-% ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
-% ' LEFT JOIN cust_main USING ( custnum ) ',
-% 'hashref' => { 'svcnum' => $svcnum },
-% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-%}) or die "svc_www: Unknown svcnum $svcnum";
-%
-%#false laziness w/all svc_*.cgi
-%my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $svcnum } );
-%my $pkgnum = $cust_svc->getfield('pkgnum');
-%my($cust_pkg, $custnum);
-%if ($pkgnum) {
-% $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } );
-% $custnum = $cust_pkg->custnum;
-%} else {
-% $cust_pkg = '';
-% $custnum = '';
-%}
-%#eofalse
-%
-%my $part_svc=qsearchs('part_svc',{'svcpart'=>$cust_svc->svcpart})
-% or die "svc_www: Unknown svcpart" . $cust_svc->svcpart;
-
-%my $usersvc = $svc_www->usersvc;
-%my $svc_acct = '';
-%my $email = '';
-%if ( $usersvc ) {
-% $svc_acct = qsearchs('svc_acct', { 'svcnum' => $usersvc } )
-% or die "svc_www: Unknown usersvc $usersvc";
-% $email = $svc_acct->email;
-%}
-%
-%my $domain_record = qsearchs('domain_record', { 'recnum' => $svc_www->recnum } )
-% or die "svc_www: Unknown recnum ". $svc_www->recnum;
-%
-%my $www = $domain_record->zone;
-
<% include("/elements/header.html", "Website View", menubar(
( ( $custnum )
- ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
)
: ( "Cancel this (unaudited) website" =>
"${p}misc/cancel-unaudited.cgi?$svcnum" )
@@ -54,35 +8,97 @@
))
%>
-%print qq!<A HREF="${p}edit/svc_www.cgi?$svcnum">Edit this information</A><BR>!.
-% ntable("#cccccc"). '<TR><TD>'. ntable("#cccccc",2).
-% qq!<TR><TD ALIGN="right">Service number</TD>!.
-% qq!<TD BGCOLOR="#ffffff">$svcnum</TD></TR>!.
-% qq!<TR><TD ALIGN="right">Website name</TD>!.
-% qq!<TD BGCOLOR="#ffffff"><A HREF="http://$www">$www<A></TD></TR>!;
-%if ( $part_svc->part_svc_column('usersvc')->columnflag ne 'F'
-% || $part_svc->part_svc_column('usersvc')->columnvalue !~ /^\s*$/) {
-% print qq!<TR><TD ALIGN="right">Account</TD>!.
-% qq!<TD BGCOLOR="#ffffff">!;
-%
-% if ( $usersvc ) {
-% print qq!<A HREF="${p}view/svc_acct.cgi?$usersvc">$email</A>!;
-% } else {
-% print '</i>(none)</i>';
-% }
-%
-% print '</TD></TR>';
-%}
- <% qq!<TR><TD ALIGN="right">Config lines</TD>! %>
- <% qq!<TD BGCOLOR="#ffffff"><pre>!.$cgi->escapeHTML(join("\n",$svc_www->config))."</pre></TD></TR>" %>
-%
-%foreach (sort { $a cmp $b } $svc_www->virtual_fields) {
-% print $svc_www->pvf($_)->widget('HTML', 'view', $svc_www->getfield($_)),
-% "\n";
-%}
-%
-%
-%print '</TABLE></TD></TR></TABLE>'.
-% '<BR>'. joblisting({'svcnum'=>$svcnum}, 1);
+<A HREF="<% $p %>edit/svc_www.cgi?<% $svcnum %>">Edit this information</A><BR>
+
+<% ntable("#cccccc", 2) %>
+
+ <TR>
+ <TD ALIGN="right">Service number</TD>
+ <TD BGCOLOR="#ffffff"><% $svcnum %></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">Website name</TD>
+ <TD BGCOLOR="#ffffff"><A HREF="http://<% $www %>"><% $www %></A></TD>
+ </TR>
+
+% if ( $part_svc->part_svc_column('usersvc')->columnflag ne 'F'
+% || $part_svc->part_svc_column('usersvc')->columnvalue !~ /^\s*$/) {
+
+ <TR>
+ <TD ALIGN="right">Account</TD>
+ <TD BGCOLOR="#ffffff">
+% if ( $usersvc ) {
+ <A HREF="<% $p %>view/svc_acct.cgi?<% $usersvc %>"><% $email %></A>
+% } else {
+ </i>(none)</i>
+% }
+ </TD>
+ </TR>
+
+% }
+
+ <TR>
+ <TD ALIGN="right">Config lines</TD>
+ <TD BGCOLOR="#ffffff"><PRE><% join("\n", $svc_www->config) |h %>"</PRE></TD>
+ </TR>
+
+% foreach (sort { $a cmp $b } $svc_www->virtual_fields) {
+ <% $svc_www->pvf($_)->widget('HTML', 'view', $svc_www->getfield($_)) %>
+% }
+
+</TABLE>
+
+<BR>
+<% joblisting({'svcnum'=>$svcnum}, 1) %>
<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
+
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $svcnum = $1;
+my $svc_www = qsearchs({
+ 'select' => 'svc_www.*',
+ 'table' => 'svc_www',
+ 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
+ ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
+ ' LEFT JOIN cust_main USING ( custnum ) ',
+ 'hashref' => { 'svcnum' => $svcnum },
+ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+}) or die "svc_www: Unknown svcnum $svcnum";
+
+#false laziness w/all svc_*.cgi
+my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $svcnum } );
+my $pkgnum = $cust_svc->getfield('pkgnum');
+my($cust_pkg, $custnum, $display_custnum);
+if ($pkgnum) {
+ $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } );
+ $custnum = $cust_pkg->custnum;
+ $display_custnum = $cust_pkg->cust_main->display_custnum;
+} else {
+ $cust_pkg = '';
+ $custnum = '';
+}
+#eofalse
+
+my $part_svc=qsearchs('part_svc',{'svcpart'=>$cust_svc->svcpart})
+ or die "svc_www: Unknown svcpart" . $cust_svc->svcpart;
+
+my $usersvc = $svc_www->usersvc;
+my $svc_acct = '';
+my $email = '';
+if ( $usersvc ) {
+ $svc_acct = qsearchs('svc_acct', { 'svcnum' => $usersvc } )
+ or die "svc_www: Unknown usersvc $usersvc";
+ $email = $svc_acct->email;
+}
+
+my $domain_record = qsearchs('domain_record', { 'recnum' => $svc_www->recnum } )
+ or die "svc_www: Unknown recnum ". $svc_www->recnum;
+
+my $www = $domain_record->zone;
+
+</%init>
Index: cust_pay.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_pay.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cust_pay.html 27 Mar 2008 20:19:52 -0000 1.4
+++ cust_pay.html 3 Dec 2008 21:12:19 -0000 1.5
@@ -11,7 +11,7 @@
% #it would be nice if the menubar could be hidden for print, but better to
% # have it available than not, otherwise the user winds up at a dead end
<% menubar(
- "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
)
%>
<BR><BR>
@@ -19,7 +19,7 @@
% } else {
<% include('/elements/header.html', "Payment Receipt", menubar(
- "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
'Print receipt' => $pr_link,
))
%>
@@ -124,6 +124,7 @@
my $pr_link = "${p}view/cust_pay.html?link=print;paynum=$paynum";
my $custnum = $cust_pay->custnum;
+my $display_custnum = $cust_pay->cust_main->display_custnum;
my $conf = new FS::Conf;
Index: cust_refund.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_refund.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cust_refund.html 3 Sep 2008 01:46:14 -0000 1.2
+++ cust_refund.html 3 Dec 2008 21:12:19 -0000 1.3
@@ -11,7 +11,7 @@
% #it would be nice if the menubar could be hidden for print, but better to
% # have it available than not, otherwise the user winds up at a dead end
<% menubar(
- "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
)
%>
<BR><BR>
@@ -19,7 +19,7 @@
% } else {
<% include('/elements/header.html', "Refund Receipt", menubar(
- "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
'Print receipt' => $pr_link,
))
%>
@@ -131,6 +131,7 @@
my $pr_link = "${p}view/cust_refund.html?link=print;refundnum=$refundnum";
my $custnum = $cust_refund->custnum;
+my $display_custnum = $cust_refund->cust_main->display_custnum;
my $conf = new FS::Conf;
Index: svc_external.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/svc_external.cgi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- svc_external.cgi 13 Jan 2008 20:46:44 -0000 1.8
+++ svc_external.cgi 3 Dec 2008 21:12:20 -0000 1.9
@@ -1,6 +1,6 @@
<% include("/elements/header.html",'External Service View', menubar(
( ( $custnum )
- ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
)
: ( "Cancel this (unaudited) external service" =>
"${p}misc/cancel-unaudited.cgi?$svcnum" )
@@ -49,10 +49,11 @@
#false laziness w/all svc_*.cgi
my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $svcnum } );
my $pkgnum = $cust_svc->getfield('pkgnum');
-my($cust_pkg, $custnum);
+my($cust_pkg, $custnum, $display_custnum);
if ($pkgnum) {
$cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } );
$custnum = $cust_pkg->custnum;
+ $display_custnum = $cust_pkg->cust_main->display_custnum;
} else {
$cust_pkg = '';
$custnum = '';
Index: svc_broadband.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/svc_broadband.cgi,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- svc_broadband.cgi 13 Jan 2008 20:46:44 -0000 1.14
+++ svc_broadband.cgi 3 Dec 2008 21:12:20 -0000 1.15
@@ -1,6 +1,6 @@
<%include("/elements/header.html",'Broadband Service View', menubar(
( ( $custnum )
- ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
)
: ( "Cancel this (unaudited) website" =>
"${p}misc/cancel-unaudited.cgi?$svcnum" )
@@ -161,10 +161,11 @@
#false laziness w/all svc_*.cgi
my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $svcnum } );
my $pkgnum = $cust_svc->getfield('pkgnum');
-my($cust_pkg, $custnum);
+my($cust_pkg, $custnum, $display_custnum);
if ($pkgnum) {
$cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } );
$custnum = $cust_pkg->custnum;
+ $display_custnum = $cust_pkg->cust_main->display_custnum;
} else {
$cust_pkg = '';
$custnum = '';
Index: svc_forward.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/svc_forward.cgi,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- svc_forward.cgi 14 Aug 2008 01:38:15 -0000 1.17
+++ svc_forward.cgi 3 Dec 2008 21:12:20 -0000 1.18
@@ -1,92 +1,105 @@
-% die "access denied"
-% unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
-%
-%my $conf = new FS::Conf;
-%
-%my($query) = $cgi->keywords;
-%$query =~ /^(\d+)$/;
-%my $svcnum = $1;
-%my $svc_forward = qsearchs({
-% 'select' => 'svc_forward.*',
-% 'table' => 'svc_forward',
-% 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
-% ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
-% ' LEFT JOIN cust_main USING ( custnum ) ',
-% 'hashref' => {'svcnum'=>$svcnum},
-% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-%});
-%die "Unknown svcnum" unless $svc_forward;
-%
-%my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
-%my $pkgnum = $cust_svc->getfield('pkgnum');
-%my($cust_pkg, $custnum);
-%if ($pkgnum) {
-% $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-% $custnum=$cust_pkg->getfield('custnum');
-%} else {
-% $cust_pkg = '';
-% $custnum = '';
-%}
-%
-%my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } )
-% or die "Unknown svcpart";
-%
-%print header('Mail Forward View', menubar(
-% ( ( $pkgnum || $custnum )
-% ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
-% )
-% : ( "Cancel this (unaudited) mail forward" =>
-% "${p}misc/cancel-unaudited.cgi?$svcnum" )
-% )
-%));
-%
-%my($srcsvc,$dstsvc,$dst) = (
-% $svc_forward->srcsvc,
-% $svc_forward->dstsvc,
-% $svc_forward->dst,
-%);
-%my $src = $svc_forward->dbdef_table->column('src') ? $svc_forward->src : '';
-%
-%my $svc = $part_svc->svc;
-%
-%my $source;
-%if ($srcsvc) {
-% my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$srcsvc})
-% or die "Corrupted database: no svc_acct.svcnum matching srcsvc $srcsvc";
-% $source = $svc_acct->email;
-%} else {
-% $source = $src;
-%}
-%
-%my $destination;
-%if ($dstsvc) {
-% my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$dstsvc})
-% or die "Corrupted database: no svc_acct.svcnum matching dstsvc $dstsvc";
-% $destination = $svc_acct->email;
-%} else {
-% $destination = $dst;
-%}
-%
-%print qq!<A HREF="${p}edit/svc_forward.cgi?$svcnum">Edit this information</A>!.
-% ntable("#cccccc",2).
-% '<TR><TD ALIGN="right">Service number</TD>'.
-% qq!<TD BGCOLOR="#ffffff">$svcnum</TD></TR>!.
-% '<TR><TD ALIGN="right">Service</TD>'.
-% qq!<TD BGCOLOR="#ffffff">$svc</TD></TR>!.
-% qq!<TR><TD ALIGN="right">Email to</TD>!.
-% qq!<TD BGCOLOR="#ffffff">$source</TD></TR>!.
-% qq!<TR><TD ALIGN="right">Forwards to </TD>!.
-% qq!<TD BGCOLOR="#ffffff">$destination</TD></TR>!;
-%
-%foreach (sort { $a cmp $b } $svc_forward->virtual_fields) {
-% print $svc_forward->pvf($_)->widget('HTML', 'view', $svc_forward->getfield($_)),
-% "\n";
-%}
-%
-%print qq! </TABLE>!.
-% '<BR>'. joblisting({'svcnum'=>$svcnum}, 1).
-% '</BODY></HTML>'
-%;
-%
-%
+<% include('/elements/header.html', 'Mail Forward View', menubar(
+ ( ( $pkgnum || $custnum )
+ ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
+ )
+ : ( "Cancel this (unaudited) mail forward" =>
+ "${p}misc/cancel-unaudited.cgi?$svcnum" )
+ )
+))
+%>
+
+<A HREF="<% $p %>edit/svc_forward.cgi?<% $svcnum %>">Edit this information</A>
+<% ntable("#cccccc",2) %>
+
+ <TR>
+ <TD ALIGN="right">Service number</TD>
+ <TD BGCOLOR="#ffffff"><% $svcnum %></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">Service</TD>
+ <TD BGCOLOR="#ffffff"><% $svc %></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">Email to</TD>
+ <TD BGCOLOR="#ffffff"><% $source %></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">Forwards to </TD>
+ <TD BGCOLOR="#ffffff"><% $destination %></TD>
+ </TR>
+
+% foreach (sort { $a cmp $b } $svc_forward->virtual_fields) {
+ <% $svc_forward->pvf($_)->widget('HTML', 'view', $svc_forward->getfield($_)) %>
+% }
+
+</TABLE>
+
+<BR>
+<% joblisting({'svcnum'=>$svcnum}, 1) %>
+
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
+
+my $conf = new FS::Conf;
+
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $svcnum = $1;
+my $svc_forward = qsearchs({
+ 'select' => 'svc_forward.*',
+ 'table' => 'svc_forward',
+ 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
+ ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
+ ' LEFT JOIN cust_main USING ( custnum ) ',
+ 'hashref' => {'svcnum'=>$svcnum},
+ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+});
+die "Unknown svcnum" unless $svc_forward;
+
+my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
+my $pkgnum = $cust_svc->getfield('pkgnum');
+my($cust_pkg, $custnum, $display_custnum);
+if ($pkgnum) {
+ $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+ $custnum=$cust_pkg->getfield('custnum');
+ $display_custnum = $cust_pkg->cust_main->display_custnum;
+} else {
+ $cust_pkg = '';
+ $custnum = '';
+}
+
+my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } )
+ or die "Unknown svcpart";
+
+my($srcsvc,$dstsvc,$dst) = (
+ $svc_forward->srcsvc,
+ $svc_forward->dstsvc,
+ $svc_forward->dst,
+);
+my $src = $svc_forward->dbdef_table->column('src') ? $svc_forward->src : '';
+
+my $svc = $part_svc->svc;
+
+my $source;
+if ($srcsvc) {
+ my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$srcsvc})
+ or die "Corrupted database: no svc_acct.svcnum matching srcsvc $srcsvc";
+ $source = $svc_acct->email;
+} else {
+ $source = $src;
+}
+
+my $destination;
+if ($dstsvc) {
+ my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$dstsvc})
+ or die "Corrupted database: no svc_acct.svcnum matching dstsvc $dstsvc";
+ $destination = $svc_acct->email;
+} else {
+ $destination = $dst;
+}
+
+</%init>
More information about the freeside-commits
mailing list