sub cust_bill_pay {
my $self = shift;
- sort { $a->_date <=> $b->date }
+ sort { $a->_date <=> $b->_date }
qsearch( 'cust_bill_pay', { 'invnum' => $self->invnum } );
}
$balance -= $_->amount foreach ( $self->cust_bill_pay );
$balance -= $_->amount foreach ( $self->cust_credited );
$balance = sprintf( "%.2f", $balance);
+ $balance =~ s/^\-0\.00$/0.00/; #yay ieee fp
+ $balance;
}
=item print_text [TIME];
#something more elaborate if $_->amount ne $_->cust_credit->credited ?
+ my $reason = substr($_->cust_credit->reason,0,32);
+ $reason .= '...' if length($reason) < length($_->cust_credit->reason);
+ $reason = " ($reason) " if $reason;
push @buf,[
- "Credit #". $_->crednum. " (". time2str("%x",$_->cust_credit->_date) .")",
+ "Credit #". $_->crednum. " (". time2str("%x",$_->cust_credit->_date) .")".
+ $reason,
$money_char. sprintf("%10.2f",$_->amount)
];
}
=head1 VERSION
-$Id: cust_bill.pm,v 1.11 2001-09-03 22:07:38 ivan Exp $
+$Id: cust_bill.pm,v 1.14 2001-12-21 21:40:24 ivan Exp $
=head1 BUGS