From dfa1e92c5af9bd54186cd46f47ea528622f60894 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Sun, 26 Aug 2012 23:03:51 -0700 Subject: avoid displaying default service addresses on invoices, #940 --- FS/FS/Template_Mixin.pm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm index 8277c0046..d35fd55f2 100644 --- a/FS/FS/Template_Mixin.pm +++ b/FS/FS/Template_Mixin.pm @@ -894,7 +894,6 @@ sub print_generic { warn "$me setting options\n" if $DEBUG > 1; - my $multilocation = scalar($cust_main->cust_location); #too expensive? my %options = (); $options{'section'} = $section if $multisection; $options{'format'} = $format; @@ -904,7 +903,6 @@ sub print_generic { $options{'summary_page'} = $summarypage; $options{'skip_usage'} = scalar(@$extra_sections) && !grep{$section == $_} @$extra_sections; - $options{'multilocation'} = $multilocation; $options{'multisection'} = $multisection; warn "$me searching for line items\n" @@ -2111,8 +2109,6 @@ ignored. multisection: a flag indicating that this is a multisection invoice, which does something complicated. -multilocation: a flag to display the location label for the package. - Returns a list of hashrefs, each of which may contain: pkgnum, description, amount, unit_amount, quantity, _is_setup, and @@ -2134,13 +2130,13 @@ sub _items_cust_bill_pkg { my $unsquelched = $opt{unsquelched} || ''; #unused my $section = $opt{section}->{description} if $opt{section}; my $summary_page = $opt{summary_page} || ''; #unused - my $multilocation = $opt{multilocation} || ''; my $multisection = $opt{multisection} || ''; my $discount_show_always = 0; my $maxlength = $conf->config('cust_bill-latex_lineitem_maxlength') || 50; my $cust_main = $self->cust_main;#for per-agent cust_bill-line_item-ate_style + # and location labels my @b = (); my ($s, $r, $u) = ( undef, undef, undef ); @@ -2255,7 +2251,7 @@ sub _items_cust_bill_pkg { $cust_pkg->h_labels_short($self->_date, undef, 'I') unless $cust_bill_pkg->pkgpart_override; #don't redisplay services - if ( $multilocation ) { + if ( $cust_pkg->locationnum != $cust_main->ship_locationnum ) { my $loc = $cust_pkg->location_label; $loc = substr($loc, 0, $maxlength). '...' if $format eq 'latex' && length($loc) > $maxlength; @@ -2357,7 +2353,7 @@ sub _items_cust_bill_pkg { warn "$me _items_cust_bill_pkg done adding service details\n" if $DEBUG > 1; - if ( $multilocation ) { + if ( $cust_pkg->locationnum != $cust_main->ship_locationnum ) { my $loc = $cust_pkg->location_label; $loc = substr($loc, 0, $maxlength). '...' if $format eq 'latex' && length($loc) > $maxlength; -- cgit v1.2.1 From abb5095e4f202875934937166af1efe912f77d34 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Sun, 26 Aug 2012 23:04:19 -0700 Subject: make address fields work in customer search results, #940 --- FS/FS/cust_main/Search.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index 7b2f30dc4..b07223ec5 100644 --- a/FS/FS/cust_main/Search.pm +++ b/FS/FS/cust_main/Search.pm @@ -798,6 +798,9 @@ sub search { my @select = ( 'cust_main.custnum', + # there's a good chance that we'll need these + 'cust_main.bill_locationnum', + 'cust_main.ship_locationnum', FS::UI::Web::cust_sql_fields($params->{'cust_fields'}), ); -- cgit v1.2.1 From 7acc76e0ead0d88cb225c88016c778c8feb9a075 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Sun, 26 Aug 2012 23:05:04 -0700 Subject: only show coordinate fields where necessary, #940 --- httemplate/edit/cust_main.cgi | 2 ++ httemplate/elements/location.html | 8 ++++++++ httemplate/elements/tr-select-cust_location.html | 1 + httemplate/misc/payment.cgi | 6 +++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 9b30d31b0..e3e812f19 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -53,6 +53,7 @@ <& /elements/location.html, object => $cust_main->bill_location, prefix => 'bill_', + enable_coords => 1, &> <& cust_main/after_bill_location.html, $cust_main &> @@ -77,6 +78,7 @@ prefix => 'ship_', enable_censustract => 1, enable_district => 1, + enable_coords => 1, &> 0, #set true to disable the red asterisks next #to required fields 'address1_label' => 'Address', #label for address + 'enable_coords' => 1, #show latitude/longitude fields 'enable_district' => 1, #show tax district field 'enable_censustract' => 1, #show censustract field + ) @@ -175,6 +177,7 @@ Example: +% if ( $opt{enable_coords} ) { +% } else { +% foreach (qw(latitude longitude)) { + +% } +% } diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index d9e3e9e27..b804f4548 100644 --- a/httemplate/elements/tr-select-cust_location.html +++ b/httemplate/elements/tr-select-cust_location.html @@ -216,6 +216,7 @@ Example: 'no_asterisks' => 1, 'no_bold' => $opt{'no_bold'}, 'alt_format' => $opt{'alt_format'}, + 'enable_coords'=> 1, ) %>
<% include('/elements/select-country.html', %select_hash ) %>
<% mt('Latitude') |h %> @@ -195,6 +198,11 @@ Example: >