sub check {
my $self = shift;
+ #warn "BEFORE: \n". $self->_dump;
+
my $error =
$self->ut_numbern('custnum')
|| $self->ut_number('agentnum')
$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' => '',
'country' => $self->country,
} );
}
- }
+# }
$error =
$self->ut_phonen('daytime', $self->country)
);
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
+ if ( scalar ( grep { $self->getfield($_) ne $self->getfield("ship_$_") }
+ @addfields )
+ && scalar ( grep { $self->getfield("ship_$_") ne '' } @addfields )
)
{
my $error =
$self->otaker(getotaker);
+ #warn "AFTER: \n". $self->_dump;
+
''; #no error
}
$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;
}
}
'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 )
);
my $part_pkg = new FS::part_pkg ( {
'pkg' => $pkg || 'One-time charge',
- 'comment' => $comment,
+ 'comment' => $comment || '$'. sprintf("%.2f".$amount),
'setup' => $amount,
'freq' => 0,
'recur' => '0',