summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/packages/status.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/view/cust_main/packages/status.html')
-rw-r--r--httemplate/view/cust_main/packages/status.html36
1 files changed, 35 insertions, 1 deletions
diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html
index 9d5a88e0f..24a4dfcd0 100644
--- a/httemplate/view/cust_main/packages/status.html
+++ b/httemplate/view/cust_main/packages/status.html
@@ -14,6 +14,8 @@
<% pkg_status_row($cust_pkg, emt('Cancelled'), 'cancel', 'color'=>'FF0000', %opt ) %>
+ <% pkg_status_row_detached($cust_pkg, %opt) %>
+
<% pkg_reason_row($cust_pkg, $cpr, color => 'ff0000', %opt) %>
% unless ( $cust_pkg->get('setup') ) {
@@ -29,7 +31,7 @@
% }
%
-% if ( $part_pkg->freq and !$supplemental ) { #?
+% if ( $part_pkg->freq && !$supplemental && !$cust_pkg->change_custnum ) { #?
<TR>
<TD COLSPAN=<%$opt{colspan}%>>
@@ -360,6 +362,38 @@ sub pkg_status_row_changed {
$html;
}
+sub pkg_status_row_detached {
+ my( $cust_pkg, %opt ) = @_;
+
+warn $cust_pkg->pkgnum;
+warn $cust_pkg->change_custnum;
+
+ return '' unless $cust_pkg->change_custnum;
+
+ my $html = '';
+
+ my $cust_main = $cust_pkg->change_cust_main;
+ if ( $cust_main ) {
+
+ my $cust_link = '<A HREF="cust_main.cgi?'. $cust_pkg->change_custnum. '">'.
+ encode_entities( $cust_main->name ).
+ '</A>';
+
+ $html .= pkg_status_row_colspan( $cust_pkg,
+ emt("Detached to customer #[_1]: ",
+ $cust_pkg->change_custnum
+ ).
+ $cust_link,
+ '',
+ 'size' => '-1',
+ 'align' => 'right',
+ 'colspan' => 4,
+ );
+ }
+
+ $html;
+}
+
sub pkg_status_row_noauto {
my( $cust_pkg, %opt ) = @_;
my $part_pkg = $opt{'part_pkg'};