projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into 3.x
[freeside.git]
/
FS
/
FS
/
cust_tax_exempt_pkg_void.pm
diff --git
a/FS/FS/cust_tax_exempt_pkg_void.pm
b/FS/FS/cust_tax_exempt_pkg_void.pm
index
51c85b4
..
ed793d5
100644
(file)
--- a/
FS/FS/cust_tax_exempt_pkg_void.pm
+++ b/
FS/FS/cust_tax_exempt_pkg_void.pm
@@
-110,15
+110,26
@@
and replace methods.
sub check {
my $self = shift;
sub check {
my $self = shift;
- my $error =
+ my $error =
$self->ut_number('exemptpkgnum')
|| $self->ut_foreign_key('billpkgnum', 'cust_bill_pkg_void', 'billpkgnum' )
$self->ut_number('exemptpkgnum')
|| $self->ut_foreign_key('billpkgnum', 'cust_bill_pkg_void', 'billpkgnum' )
- || $self->ut_foreign_key('taxnum', 'cust_main_county', 'taxnum')
- || $self->ut_number('year')
- || $self->ut_number('month')
+ || $self->ut_enum('taxtype', [ 'FS::cust_main_county', 'FS::tax_rate' ])
+ || $self->ut_number('taxnum')
+ || $self->ut_numbern('year')
+ || $self->ut_numbern('month')
|| $self->ut_numbern('creditbillpkgnum') #no FK check, will have been del'ed
|| $self->ut_money('amount')
|| $self->ut_numbern('creditbillpkgnum') #no FK check, will have been del'ed
|| $self->ut_money('amount')
+ || $self->ut_flag('exempt_cust')
+ || $self->ut_flag('exempt_setup')
+ || $self->ut_flag('exempt_recur')
+ || $self->ut_flag('exempt_cust_taxname')
+ || $self->ut_flag('exempt_monthly')
;
;
+
+ $self->get('taxtype') =~ /^FS::(\w+)$/;
+ my $rate_table = $1;
+ $error ||= $self->ut_foreign_key('taxnum', $rate_table, 'taxnum');
+
return $error if $error;
$self->SUPER::check;
return $error if $error;
$self->SUPER::check;