X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=125332c9d70213c9b6ef6858fa703c149916a897;hb=1fdd857c556d4e6ee7e2b577085ede891dd41506;hp=b732218e7a7a50c6e9fb060f0b73ebf836f9cdc7;hpb=c493d99b65cf3b1cc05ea5d7a61214dba563569f;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index b732218e7..125332c9d 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -512,6 +512,8 @@ and repalce methods. sub check { my $self = shift; + warn "BEFORE: \n". $self->_dump; + my $error = $self->ut_numbern('custnum') || $self->ut_number('agentnum') @@ -553,7 +555,9 @@ sub check { $self->ss("$1-$2-$3"); } - unless ( $import ) { + +# bad idea to disable, causes billing to fail because of no tax rates later +# unless ( $import ) { unless ( qsearchs('cust_main_county', { 'country' => $self->country, 'state' => '', @@ -566,7 +570,7 @@ sub check { 'country' => $self->country, } ); } - } +# } $error = $self->ut_phonen('daytime', $self->country) @@ -583,7 +587,7 @@ sub check { if ( defined $self->dbdef_table->column('ship_last') ) { if ( grep { $self->getfield($_) ne $self->getfield("ship_$_") } @addfields - && grep $self->getfield("ship_$_"), grep $_ ne 'state', @addfields + && grep { $self->getfield("ship_$_") ne '' } @addfields ) { my $error = @@ -694,6 +698,8 @@ sub check { $self->otaker(getotaker); + warn "AFTER: \n". $self->_dump; + ''; #no error } @@ -976,10 +982,10 @@ sub bill { $total_recur += $recur; $taxable_setup += $setup unless $part_pkg->dbdef_table->column('setuptax') - || $part_pkg->setuptax =~ /^Y$/i; + && $part_pkg->setuptax =~ /^Y$/i; $taxable_recur += $recur unless $part_pkg->dbdef_table->column('recurtax') - || $part_pkg->recurtax =~ /^Y$/i; + && $part_pkg->recurtax =~ /^Y$/i; } } @@ -1000,7 +1006,8 @@ sub bill { 'state' => $self->state, 'county' => $self->county, 'country' => $self->country, - } ); + } ) or die "fatal: can't find tax rate for state/county/country ". + $self->state. "/". $self->county. "/". $self->country. "\n"; my $tax = sprintf( "%.2f", $taxable_charged * ( $cust_main_county->getfield('tax') / 100 ) );