X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=e7622d7126401faadf464f3c0f65397cdd11105a;hb=27ed323fad9fca12f507a524e1788fb37e36501e;hp=4fd9b6e375ada23ce3539dcec941ba50fdc2eb12;hpb=2b2aa5664742a134da11862a7cedb37d25524423;p=freeside.git diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 4fd9b6e37..e7622d712 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -2029,7 +2029,7 @@ header line only, with the fields: Agent number, agent name, customer number, first name, last name, address line 1, address line 2, city, state, zip, invoice date, invoice number, -amount charged, amount due, +amount charged, amount due, previous balance, due date. and then, for each line item, three columns containing the package number, description, and amount. @@ -2115,6 +2115,7 @@ sub print_csv { } elsif ( $format eq 'oneline' ) { #name my ($previous_balance) = $self->previous; + $previous_balance = sprintf('%.2f', $previous_balance); my $totaldue = sprintf('%.2f', $self->owed + $previous_balance); my @items = map { ($_->{pkgnum} || ''), @@ -2139,6 +2140,8 @@ sub print_csv { $self->invnum, $self->charged, $totaldue, + $previous_balance, + $self->due_date2str("%x"), @items, ); @@ -3426,6 +3429,15 @@ sub search_sql_where { push @search, "cust_bill.custnum = $1"; } + #customer classnum + if ( $param->{'cust_classnum'} ) { + my $classnums = $param->{'cust_classnum'}; + $classnums = [ $classnums ] if !ref($classnums); + $classnums = [ grep /^\d+$/, @$classnums ]; + push @search, 'cust_main.classnum in ('.join(',',@$classnums).')' + if @$classnums; + } + #_date if ( $param->{_date} ) { my($beginning, $ending) = @{$param->{_date}};