X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpayment_history%2Fcredit.html;h=f2b29b0796a2cb9f746cfb2f84b25c030f8413ed;hb=93519f9371b41ded713a93fba031ed7a361be04c;hp=ae388eb54f71129c9939d900743991b12b6b1ffd;hpb=170aa1e8078280e7c03a6ebfc67280de66fa1b9d;p=freeside.git diff --git a/httemplate/view/cust_main/payment_history/credit.html b/httemplate/view/cust_main/payment_history/credit.html index ae388eb54..f2b29b079 100644 --- a/httemplate/view/cust_main/payment_history/credit.html +++ b/httemplate/view/cust_main/payment_history/credit.html @@ -7,6 +7,7 @@ my( $cust_credit, %opt ) = @_; my $date_format = $opt{'date_format'} || '%m/%d/%Y'; my $conf = new FS::Conf; +my $money_char = $conf->config('money_char') || '$'; my $curuser = $FS::CurrentUser::CurrentUser; my @cust_credit_bill = $cust_credit->cust_credit_bill; @@ -74,23 +75,20 @@ if ( scalar(@cust_credit_bill) == 0 foreach my $app ( sort { $a->_date <=> $b->_date } ( @cust_credit_bill, @cust_credit_refund ) ) { if ( $app->isa('FS::cust_credit_bill') ) { - $desc .= '  '. - '$'. $app->amount. - ' '. $app->applied_to_invoice. - '
'; - #' on '. time2str($date_format, $app->_date). + $desc .= '  ' . $money_char . $app->amount . ' ' + . $app->applied_to_invoice . '
'; } elsif ( $app->isa('FS::cust_credit_refund') ) { - $desc .= '  '. - '$'. $app->amount. - mt(" refunded on [_1]", time2str($date_format, $app->_date) ). - '
'; + $desc .= '  ' . + mt("[_1][_2] refunded on [_3]", $money_char, $app->amount, + time2str($date_format, $app->_date) ) . '
'; } else { die "$app is not a FS::cust_credit_bill or a FS::cust_credit_refund"; } } if ( $cust_credit->credited > 0 ) { - $desc .= '  $'. - $cust_credit->credited. ' unapplied'; + $desc .= '  ' . + mt("[_1][_2] unapplied", $money_char, $cust_credit->credited) . + ''; if ( $curuser->access_right('Apply credit') ) { if ( $cust_credit->cust_main->total_owed > 0 ) { $apply = ' ('. @@ -121,32 +119,21 @@ if ( scalar(@cust_credit_bill) == 0 } # my $delete = ''; -if ( $cust_credit->closed !~ /^Y/i - - #s'pose deleting a credit isn't bad like deleting a payment - # and this needs to be generally available until we have credit voiding.. - #&& $conf->exists('deletecredits') - - && $curuser->access_right('Delete credit') - ) -{ - $delete = qq! (!. - qq!delete)!; -} +$delete = areyousure_link("${p}misc/delete-cust_credit.cgi?".$cust_credit->crednum, + mt('Are you sure you want to delete this credit?'), + '', + mt('delete') + ) +if ( $cust_credit->closed !~ /^Y/i && $curuser->access_right('Delete credit') ); my $unapply = ''; -if ( $cust_credit->closed !~ /^Y/i - && scalar(@cust_credit_bill) - && $curuser->access_right('Unapply credit') - ) -{ - $unapply = qq! (!. - qq!unapply)!; -} +$unapply = areyousure_link("${p}misc/unapply-cust_credit.cgi?".$cust_credit->crednum, + mt('Are you sure you want to unapply this credit?'), + '', + mt('unapply') + ) +if ( $cust_credit->closed !~ /^Y/i && scalar(@cust_credit_bill) + && $curuser->access_right('Unapply credit') ); my $reason = $cust_credit->reason ? ' ('. $cust_credit->reason. ')'