diff options
| author | ivan <ivan> | 2009-04-15 02:29:36 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2009-04-15 02:29:36 +0000 | 
| commit | 4cd4bc31a0ceb17ac9e8b0162450dd26f315a4fd (patch) | |
| tree | f4d85484b951e564e37399fb1fab64712ecf7b24 /FS | |
| parent | dae1709465dafbd941ffd326117bc59b898352df (diff) | |
show 60 chars on typeset invoices but only 32 on plaintext, RT#3905
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/cust_bill.pm | 14 | 
1 files changed, 9 insertions, 5 deletions
| diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 408da9930..071b89cd0 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -2280,7 +2280,7 @@ sub print_generic {      # credits      my $credittotal = 0; -    foreach my $credit ( $self->_items_credits ) { +    foreach my $credit ( $self->_items_credits('trim_len'=>60) ) {        my $total;        $total->{'total_item'} = &$escape_function($credit->{'description'}); @@ -2302,10 +2302,13 @@ sub print_generic {          push @total_items, $total;        } -      push @buf, [ $credit->{'description'}, $money_char.$credit->{'amount'} ]; -      }      $invoice_data{'credittotal'} = sprintf('%.2f', $credittotal); + +    #credits (again) +    foreach my $credit ( $self->_items_credits('trim_len'=>32) ) { +      push @buf, [ $credit->{'description'}, $money_char.$credit->{'amount'} ]; +    }      # payments      my $paymenttotal = 0; @@ -2918,7 +2921,8 @@ sub _items_cust_bill_pkg {  }  sub _items_credits { -  my $self = shift; +  my( $self, %opt ) = @_; +  my $trim_len = $opt{'trim_len'} || 60;    my @b;    #credits @@ -2926,7 +2930,7 @@ sub _items_credits {      #something more elaborate if $_->amount ne $_->cust_credit->credited ? -    my $reason = substr($_->cust_credit->reason,0,32); +    my $reason = substr($_->cust_credit->reason, 0, $trim_len);      $reason .= '...' if length($reason) < length($_->cust_credit->reason);      $reason = " ($reason) " if $reason; | 
