X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fcust_main_county.cgi;h=e8c09e434ffedd4eb95405f3b2ca5b1d2cda8d93;hb=7d34aacffa38c4cac09b54080487a66c264e4668;hp=c6484cacd589fb0aaa752c9b26d29c0ff91b6bd7;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984;p=freeside.git diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index c6484cacd..e8c09e434 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -10,7 +10,9 @@ 'table' => 'cust_main_county', 'hashref' => $hashref, 'order_by' => - 'ORDER BY country, state, county, city, taxclass', + 'ORDER BY country, state, county, city, '. + 'district, taxclass, '. + "COALESCE(taxname, '')", }, 'count_query' => $count_query, 'header' => \@header, @@ -440,11 +442,12 @@ if ( $taxclass ) { $cell_style = ''; -my @header = ( 'Country', 'State/Province', 'County', 'City' ); -my @header2 = ( '', '', '', '', ); -my @links = ( '', '', '', '', ); -my @link_onclicks = ( '', '', '', '', ); -my $align = 'llll'; +my @header = ( 'Country', 'State/Province', 'County', 'City', '' ); +# last column is 'district', but usually unused +my @header2 = ( '', '', '', '', '' ); +my @links = ( '', '', '', '', '' ); +my @link_onclicks = ( '', '', '', '', '' ); +my $align = 'lllll'; my %seen_country = (); my %seen_state = (); @@ -532,7 +535,8 @@ my @fields = ( my $r = shift; if ( $r->city ) { - if ( $r->taxclass ) { #but if it has a taxclass, can't remove + if ( $r->taxclass #but if it has a taxclass, can't remove + or $r->district ) { # or a district $r->city; } else { $r->city. ' '. @@ -551,6 +555,21 @@ my @fields = ( ); } }, + + #district + sub { + my $r = shift; + if ( $r->district ) { + $r->district . ' '. + remove_link( col => 'district', + label=> 'remove district', + row => $r, + cgi => $cgi, + ); + } + # manually editing districts is not exactly intended + }, + ); my @color = ( @@ -607,7 +626,8 @@ my $cb_sub = sub { my $cust_main_county = shift; if ( $cb_oldrow ) { - if ( $cb_oldrow->city ne $cust_main_county->city + if ( $cb_oldrow->district ne $cust_main_county->district + || $cb_oldrow->city ne $cust_main_county->city || $cb_oldrow->county ne $cust_main_county->county || $cb_oldrow->state ne $cust_main_county->state || $cb_oldrow->country ne $cust_main_county->country