X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=e5f289ca3b1a695d4b50368e62dda26382f44b87;hb=55f003404af6a2416571138356d11c5ad3755e58;hp=e7cdd21d4476506148948201492b3a118dc961aa;hpb=73e346e819dc56fb4447f9eb1624a49df1f58ab7;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index e7cdd21d4..e5f289ca3 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -41,6 +41,7 @@ use FS::part_referral; use FS::cust_main_county; use FS::cust_location; use FS::cust_main_exemption; +use FS::cust_tax_adjustment; use FS::tax_rate; use FS::tax_rate_location; use FS::cust_tax_location; @@ -2661,6 +2662,35 @@ sub bill { } + #add tax adjustments + warn "adding tax adjustments...\n" if $DEBUG > 2; + foreach my $cust_tax_adjustment ( + qsearch('cust_tax_adjustment', { 'custnum' => $self->custnum, + 'billpkgnum' => '', + } + ) + ) { + + my $tax = sprintf('%.2f', $cust_tax_adjustment->amount ); + $total_setup = sprintf('%.2f', $total_setup+$tax ); + + my $itemdesc = $cust_tax_adjustment->taxname; + $itemdesc = '' if $itemdesc eq 'Tax'; + + push @cust_bill_pkg, new FS::cust_bill_pkg { + 'pkgnum' => 0, + 'setup' => $tax, + 'recur' => 0, + 'sdate' => '', + 'edate' => '', + 'itemdesc' => $itemdesc, + 'itemcomment' => $cust_tax_adjustment->comment, + 'cust_tax_adjustment' => $cust_tax_adjustment, + #'cust_bill_pkg_tax_location' => \@cust_bill_pkg_tax_location, + }; + + } + my $charged = sprintf('%.2f', $total_setup + $total_recur ); #create the new invoice @@ -7543,6 +7573,13 @@ sub search_sql { unless $params->{'cancelled_pkgs'}; ## + # parse without census tract checkbox + ## + + push @where, "(censustract = '' or censustract is null)" + if $params->{'no_censustract'}; + + ## # dates ## @@ -8080,12 +8117,12 @@ sub smart_search { } - #eliminate duplicates - my %saw = (); - @cust_main = grep { !$saw{$_->custnum}++ } @cust_main; - } + #eliminate duplicates + my %saw = (); + @cust_main = grep { !$saw{$_->custnum}++ } @cust_main; + @cust_main; }