projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This commit was manufactured by cvs2svn to create tag 'freeside_2_1_1'.
[freeside.git]
/
FS
/
FS
/
cust_main
/
Billing.pm
diff --git
a/FS/FS/cust_main/Billing.pm
b/FS/FS/cust_main/Billing.pm
index
639d594
..
0cd304b
100644
(file)
--- a/
FS/FS/cust_main/Billing.pm
+++ b/
FS/FS/cust_main/Billing.pm
@@
-306,7
+306,11
@@
terms or the default terms are used.
sub bill {
my( $self, %options ) = @_;
sub bill {
my( $self, %options ) = @_;
+
return '' if $self->payby eq 'COMP';
return '' if $self->payby eq 'COMP';
+
+ local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
+
warn "$me bill customer ". $self->custnum. "\n"
if $DEBUG;
warn "$me bill customer ". $self->custnum. "\n"
if $DEBUG;
@@
-431,6
+435,10
@@
sub bill {
next unless @cust_bill_pkg; #don't create an invoice w/o line items
next unless @cust_bill_pkg; #don't create an invoice w/o line items
+ warn "$me billing pass $pass\n"
+ #.Dumper(\@cust_bill_pkg)."\n"
+ if $DEBUG > 2;
+
if ( scalar( grep { $_->recur && $_->recur > 0 } @cust_bill_pkg) ||
!$conf->exists('postal_invoice-recurring_only')
)
if ( scalar( grep { $_->recur && $_->recur > 0 } @cust_bill_pkg) ||
!$conf->exists('postal_invoice-recurring_only')
)
@@
-633,9
+641,13
@@
jurisdictions (i.e. Texas) have tax exemptions which are date sensitive.
sub calculate_taxes {
my ($self, $cust_bill_pkg, $taxlisthash, $invoice_time) = @_;
sub calculate_taxes {
my ($self, $cust_bill_pkg, $taxlisthash, $invoice_time) = @_;
-
my @tax_line_items = ()
;
+
local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG
;
- warn "having a look at the taxes we found...\n" if $DEBUG > 2;
+ warn "$me calculate_taxes\n"
+ #.Dumper($self, $cust_bill_pkg, $taxlisthash, $invoice_time). "\n"
+ if $DEBUG > 2;
+
+ my @tax_line_items = ();
# keys are tax names (as printed on invoices / itemdesc )
# values are listrefs of taxlisthash keys (internal identifiers)
# keys are tax names (as printed on invoices / itemdesc )
# values are listrefs of taxlisthash keys (internal identifiers)
@@
-708,7
+720,6
@@
sub calculate_taxes {
foreach my $tax ( keys %$taxlisthash ) {
foreach ( @{ $taxlisthash->{$tax} }[1 ... scalar(@{ $taxlisthash->{$tax} })] ) {
next unless ref($_) eq 'FS::cust_bill_pkg';
foreach my $tax ( keys %$taxlisthash ) {
foreach ( @{ $taxlisthash->{$tax} }[1 ... scalar(@{ $taxlisthash->{$tax} })] ) {
next unless ref($_) eq 'FS::cust_bill_pkg';
-
push @{ $packagemap{$_->pkgnum}->_cust_tax_exempt_pkg },
splice( @{ $_->_cust_tax_exempt_pkg } );
}
push @{ $packagemap{$_->pkgnum}->_cust_tax_exempt_pkg },
splice( @{ $_->_cust_tax_exempt_pkg } );
}
@@
-774,6
+785,8
@@
sub calculate_taxes {
sub _make_lines {
my ($self, %params) = @_;
sub _make_lines {
my ($self, %params) = @_;
+ local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
+
my $part_pkg = $params{part_pkg} or die "no part_pkg specified";
my $cust_pkg = $params{cust_pkg} or die "no cust_pkg specified";
my $precommit_hooks = $params{precommit_hooks} or die "no package specified";
my $part_pkg = $params{part_pkg} or die "no part_pkg specified";
my $cust_pkg = $params{cust_pkg} or die "no cust_pkg specified";
my $precommit_hooks = $params{precommit_hooks} or die "no package specified";
@@
-918,7
+931,7
@@
sub _make_lines {
# If $cust_pkg has been modified, update it (if we're a real pkgpart)
###
# If $cust_pkg has been modified, update it (if we're a real pkgpart)
###
- if ( $lineitems
|| $options{has_hidden}
) {
+ if ( $lineitems ) {
if ( $cust_pkg->modified && $cust_pkg->pkgpart == $real_pkgpart ) {
# hmm.. and if just the options are modified in some weird price plan?
if ( $cust_pkg->modified && $cust_pkg->pkgpart == $real_pkgpart ) {
# hmm.. and if just the options are modified in some weird price plan?
@@
-1015,6
+1028,8
@@
sub _handle_taxes {
my $real_pkgpart = shift;
my $options = shift;
my $real_pkgpart = shift;
my $options = shift;
+ local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
+
my %cust_bill_pkg = ();
my %taxes = ();
my %cust_bill_pkg = ();
my %taxes = ();
@@
-1212,6
+1227,8
@@
sub _gather_taxes {
my $part_pkg = shift;
my $class = shift;
my $part_pkg = shift;
my $class = shift;
+ local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
+
my @taxes = ();
my $geocode = $self->geocode('cch');
my @taxes = ();
my $geocode = $self->geocode('cch');
@@
-1291,6
+1308,9
@@
Debugging level. Default is 0 (no debugging), or can be set to 1 (passed-in opt
sub collect {
my( $self, %options ) = @_;
sub collect {
my( $self, %options ) = @_;
+
+ local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
+
my $invoice_time = $options{'invoice_time'} || time;
#put below somehow?
my $invoice_time = $options{'invoice_time'} || time;
#put below somehow?
@@
-1474,6
+1494,9
@@
Debugging level. Default is 0 (no debugging), or can be set to 1 (passed-in opt
sub do_cust_event {
my( $self, %options ) = @_;
sub do_cust_event {
my( $self, %options ) = @_;
+
+ local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
+
my $time = $options{'time'} || time;
#put below somehow?
my $time = $options{'time'} || time;
#put below somehow?
@@
-1686,6
+1709,9
@@
by prepaying the most recent invoice for MONTHS.
sub discount_term_values {
my $self = shift;
my $term = shift;
sub discount_term_values {
my $self = shift;
my $term = shift;
+
+ local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
+
warn "$me discount_term_values called with $term\n" if $DEBUG;
my %result = ();
warn "$me discount_term_values called with $term\n" if $DEBUG;
my %result = ();
@@
-1778,6
+1804,7
@@
sub due_cust_event {
#my $DEBUG = $opt{'debug'}
local($DEBUG) = $opt{'debug'}
if defined($opt{'debug'}) && $opt{'debug'} > $DEBUG;
#my $DEBUG = $opt{'debug'}
local($DEBUG) = $opt{'debug'}
if defined($opt{'debug'}) && $opt{'debug'} > $DEBUG;
+ $DEBUG = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
warn "$me due_cust_event called with options ".
join(', ', map { "$_: $opt{$_}" } keys %opt). "\n"
warn "$me due_cust_event called with options ".
join(', ', map { "$_: $opt{$_}" } keys %opt). "\n"