-my $packages = get_packages($cust_main, $conf);
-
-my $colspan = $conf->exists('cust_pkg-display_times') ? 8 : 4;
-my $width = $conf->exists('cust_pkg-display_times') ? '38%' : '56%';
-
-sub pkg_status_row {
- my( $cust_pkg, $title, $field, %opt ) = @_;
-
- my $color = $opt{'color'};
-
- my $html = qq(<TR><TD WIDTH="<%$width%>" ALIGN="right">);
- $html .= qq(<FONT COLOR="#$color"><B>) if length($color);
- $html .= qq($title );
- $html .= qq(</B></FONT>) if length($color);
- $html .= qq(</TD>);
- $html .= pkg_datestr($cust_pkg, $field, $conf).'</TR>';
-
- $html;
-}
-
-sub pkg_status_row_if {
- my( $cust_pkg, $title, $field, %opt ) = @_;
- $cust_pkg->get($field) ? pkg_status_row(@_) : '';
-}
-
-sub pkg_status_row_changed {
- my($cust_pkg) = @_;
- return '' unless $cust_pkg->change_date;
- my $html = pkg_status_row( $cust_pkg, 'Package changed', 'change_date' );
- my $old = $cust_pkg->old_cust_pkg;
- if ( $old ) {
- my $part_pkg = $old->part_pkg;
- my $label = 'Changed from '. $cust_pkg->change_pkgnum. ': '.
- $part_pkg->pkg. ' - '. $part_pkg->comment;
- $html .= pkg_status_row_colspan( $label, '', size=>'-1', align=>'right' );
- }
- $html;
-}
-
-sub pkg_status_row_colspan {
- my($title, $addl, %opt) = @_;
-
- my $align = $opt{'align'} ? 'ALIGN="'. $opt{'align'}.'"' : '';
- my $color = $opt{'color'} ? 'COLOR="#'.$opt{'color'}.'"' : '';
- my $size = $opt{'size'} ? 'SIZE="'. $opt{'size'}. '"' : '';
-
- my $html = qq(<TR><TD COLSPAN=$colspan $align>);
- $html .= qq(<FONT $color $size>) if length($color) || $size;
- $html .= qq(<B>) if $color && !$size;
- $html .= $title;
- $html .= qq(</B>) if $color && !$size;
- $html .= qq(</FONT>) if length($color) || $size;
- $html .= ", $addl" if length($addl);
- $html .= qq(</TD></TR>);
-
- $html;
-
-}
-
-</%init>
-<%once>
+my( $packages, $num_old_packages ) = get_packages($cust_main, $conf);
+
+my $show_location = $conf->exists('cust_pkg-always_show_location')
+ || ( grep $_->locationnum, @$packages ); # ? '1' : '0';
+
+my $countrydefault = scalar($conf->config('countrydefault')) || 'US';
+my %conf_opt = (
+ #for services.html and status.html
+ 'cust_pkg-display_times' => $conf->exists('cust_pkg-display_times'),
+
+ #for status.html
+ 'cust_pkg-show_autosuspend' => $conf->exists('cust_pkg-show_autosuspend'),
+ #for status.html pkg-balances
+ 'pkg-balances' => $conf->exists('pkg-balances'),
+ 'money_char' => ( $conf->config('money_char') || '$' ),
+
+ #for location.html
+ 'countrydefault' => $countrydefault,
+ 'statedefault' => ( scalar($conf->config('statedefault'))
+ || ($countrydefault eq 'US' ? 'CA' : '') ),
+ #for services.html
+ 'svc_external-skip_manual' => $conf->exists('svc_external-skip_manual'),
+ 'legacy_link' => $conf->exists('legacy_link'),
+ 'svc_broadband-manage_link' => scalar($conf->config('svc_broadband-manage_link')),
+ 'maestro-status_test' => $conf->exists('maestro-status_test'),
+);