projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
communigate, RT#7083
[freeside.git]
/
FS
/
FS
/
cust_main_county.pm
diff --git
a/FS/FS/cust_main_county.pm
b/FS/FS/cust_main_county.pm
index
edf57ab
..
ab1ac1e
100644
(file)
--- a/
FS/FS/cust_main_county.pm
+++ b/
FS/FS/cust_main_county.pm
@@
-2,7
+2,7
@@
package FS::cust_main_county;
use strict;
use vars qw( @ISA @EXPORT_OK $conf
use strict;
use vars qw( @ISA @EXPORT_OK $conf
- @cust_main_county %cust_main_county $countyflag );
+ @cust_main_county %cust_main_county $countyflag );
# $cityflag );
use Exporter;
use FS::Record qw( qsearch dbh );
use FS::cust_bill_pkg;
use Exporter;
use FS::Record qw( qsearch dbh );
use FS::cust_bill_pkg;
@@
-17,6
+17,7
@@
use FS::cust_tax_exempt_pkg;
@cust_main_county = ();
$countyflag = '';
@cust_main_county = ();
$countyflag = '';
+#$cityflag = '';
#ask FS::UID to run this stuff for us later
$FS::UID::callback{'FS::cust_main_county'} = sub {
#ask FS::UID to run this stuff for us later
$FS::UID::callback{'FS::cust_main_county'} = sub {
@@
-55,10
+56,12
@@
currently supported:
=item taxnum - primary key (assigned automatically for new tax rates)
=item taxnum - primary key (assigned automatically for new tax rates)
-=item
state
+=item
city
=item county
=item county
+=item state
+
=item country
=item tax - percentage
=item country
=item tax - percentage
@@
-116,8
+119,9
@@
sub check {
$self->exempt_amount(0) unless $self->exempt_amount;
$self->ut_numbern('taxnum')
$self->exempt_amount(0) unless $self->exempt_amount;
$self->ut_numbern('taxnum')
- || $self->ut_
anything('state
')
+ || $self->ut_
textn('city
')
|| $self->ut_textn('county')
|| $self->ut_textn('county')
+ || $self->ut_anything('state')
|| $self->ut_text('country')
|| $self->ut_float('tax')
|| $self->ut_textn('taxclass') # ...
|| $self->ut_text('country')
|| $self->ut_float('tax')
|| $self->ut_textn('taxclass') # ...
@@
-198,29
+202,18
@@
sub _list_sql {
map $_->[0], @{ $sth->fetchall_arrayref };
}
map $_->[0], @{ $sth->fetchall_arrayref };
}
-=item taxline TAXABLES
, [ OPTIONSHASH
]
+=item taxline TAXABLES
_ARRAYREF, [ OPTION => VALUE ...
]
Returns a listref of a name and an amount of tax calculated for the list of
Returns a listref of a name and an amount of tax calculated for the list of
-packages or amounts referenced by TAXABLES
. Returns a scalar error message
-on error.
+packages or amounts referenced by TAXABLES
_ARRAYREF. Returns a scalar error
+
message
on error.
-O
PTIONSHASH includes
custnum and invoice_date and are hints to this method
+O
ptions include
custnum and invoice_date and are hints to this method
=cut
sub taxline {
=cut
sub taxline {
- my $self = shift;
-
- my $taxables;
- my %opt = ();
-
- if (ref($_[0]) eq 'ARRAY') {
- $taxables = shift;
- %opt = @_;
- }else{
- $taxables = [ @_ ];
- # exemptions broken in this case
- }
+ my( $self, $taxables, %opt ) = @_;
my @exemptions = ();
push @exemptions, @{ $_->_cust_tax_exempt_pkg }
my @exemptions = ();
push @exemptions, @{ $_->_cust_tax_exempt_pkg }
@@
-362,7
+355,12
@@
sub taxline {
}
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
}
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
- return [ $name, $amount ]
+
+ return {
+ 'name' => $name,
+ 'amount' => $amount,
+ };
+
}
=back
}
=back