X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=b3ae29011d0c822ad0bbceb5ef5573559657ff0c;hb=c3a7e8855edbe4f836543184d5a7543e04255a43;hp=4fd9b6e375ada23ce3539dcec941ba50fdc2eb12;hpb=2b2aa5664742a134da11862a7cedb37d25524423;p=freeside.git diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 4fd9b6e37..b3ae29011 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -1584,7 +1584,10 @@ sub print { $self->batch_invoice(\%opt); } else { - do_print $self->lpr_data(\%opt); + do_print( + $self->lpr_data(\%opt), + 'agentnum' => $self->cust_main->agentnum, + ); } } @@ -2029,7 +2032,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 +2118,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 +2143,8 @@ sub print_csv { $self->invnum, $self->charged, $totaldue, + $previous_balance, + $self->due_date2str("%x"), @items, ); @@ -3426,6 +3432,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}};