- $desc .= ' <B><FONT COLOR="#FF0000">$'.
- $cust_credit->credited. ' unapplied</FONT></B>';
- if ( $curuser->access_right('Apply credit') ) {
- $apply = ' ('. include( '/elements/popup_link.html',
- 'label' => 'apply',
- 'action' => "${p}edit/cust_credit_bill.cgi?".
- $cust_credit->crednum,
- 'actionlabel' => 'Apply credit',
- 'width' => 392,
- #default# 'height' => 336,
- ).
- ')';
- #XXX if there are any open refunds
- $apply.= ' ('. include( '/elements/popup_link.html',
- 'label' => 'apply to refund',
- 'action' => "${p}edit/cust_credit_refund.cgi?".
- $cust_credit->crednum,
- 'actionlabel' => 'Apply credit to refund',
- 'width' => 392,
- #default# 'height' => 336,
- ).
- ')';
+ $desc .= ' <B><FONT COLOR="#FF0000">'.
+ emt("[_1][_2] unapplied",$opt{money_char},$cust_credit->credited).
+ '</FONT></B>';
+ if ( $opt{'Apply credit'} ) {
+ if ( $opt{total_owed} > 0 ) {
+ $apply = ' ('.
+ include( '/elements/popup_link.html',
+ 'label' => emt('apply'),
+ 'action' => "${p}edit/cust_credit_bill.cgi?".
+ $cust_credit->crednum,
+ 'actionlabel' => emt('Apply credit'),
+ %cust_credit_bill_width,
+ %cust_credit_bill_height,
+ ).
+ ')';
+ }
+ if ( $opt{total_unapplied_refunds} > 0 ) {
+ $apply.= ' ('.
+ include( '/elements/popup_link.html',
+ 'label' => emt('apply to refund'),
+ 'action' => "${p}edit/cust_credit_refund.cgi?".
+ $cust_credit->crednum,
+ 'actionlabel' => emt('Apply credit to refund'),
+ 'width' => 392,
+ ).
+ ')';
+ }