$msg;
}
+=item invnum_date_pretty
+
+Returns a string with the invoice number and date, for example:
+"Invoice #54 (3/20/2008)"
+
+=cut
+
+sub invnum_date_pretty {
+ my $self = shift;
+ 'Invoice #'. $self->invnum. ' ('. time2str('%x', $self->_date). ')';
+}
+
sub _items_sections {
my $self = shift;
qsearchs( 'cust_bill', { 'invnum' => $self->invnum } );
}
+=item applied_to_invoice
+
+Returns a string representing the invoice (see L<FS::cust_bill), for example:
+"applied to Invoice #54 (3/20/2008)"
+
+=cut
+
+sub applied_to_invoice {
+ my $self = shift;
+ 'applied to '. $self->cust_bill->invnum_date_pretty;
+}
+
=item lineitem_breakdown_table
=cut
% && scalar(@cust_pay_refund) == 0
% && $cust_pay->unapplied == 0 ) {
% #applied to one invoice, the usual situation
-% $desc = ' applied to Invoice #'. $cust_bill_pay[0]->invnum;
+% $desc = ' '. $cust_bill_pay[0]->applied_to_invoice;
% } elsif ( scalar(@cust_bill_pay) == 0
% && scalar(@cust_pay_refund) == 1
% && $cust_pay->unapplied == 0 ) {
% if ( $app->isa('FS::cust_bill_pay') ) {
% $desc .= ' '.
% '$'. $app->amount.
-% ' applied to Invoice #'. $app->invnum.
+% ' '. $app->applied_to_invoice.
% '<BR>';
% #' on '. time2str("%D", $cust_bill_pay->_date).
% } elsif ( $app->isa('FS::cust_pay_refund') ) {
% && scalar(@cust_credit_refund) == 0
% && $cust_credit->credited == 0 ) {
% #applied to one invoice, the usual situation
-% $desc = ' applied to Invoice #'. $cust_credit_bill[0]->invnum;
+% $desc = ' '. $cust_credit_bill[0]->applied_to_invoice;
% } elsif ( scalar(@cust_credit_bill) == 0
% && scalar(@cust_credit_refund) == 1
% && $cust_credit->credited == 0 ) {
% if ( $app->isa('FS::cust_credit_bill') ) {
% $desc .= ' '.
% '$'. $app->amount.
-% ' applied to Invoice #'. $app->invnum.
+% ' '. $app->applied_to_invoice.
% '<BR>';
% #' on '. time2str("%D", $app->_date).
% } elsif ( $app->isa('FS::cust_credit_refund') ) {