-if ( $cust_refund->closed !~ /^Y/i
- && $conf->exists('deleterefunds')
- && $curuser->access_right('Delete refund')
- )
-{
- $delete = qq! (<A HREF="javascript:areyousure('!.
- qq!${p}misc/delete-cust_refund.cgi?!. $cust_refund->refundnum.
- qq!', 'Are you sure you want to delete this refund?')"!.
- qq! TITLE="Delete this refund from the database completely - not recommended"!.
- qq!>delete</A>)!;
-}
+$delete = areyousure_link("${p}misc/delete-cust_refund.cgi?".$cust_refund->refundnum,
+ emt('Are you sure you want to delete this refund?'),
+ emt('Delete this refund from the database completely - not recommended'),
+ emt('delete')
+ )
+ if $cust_refund->closed !~ /^Y/i
+ && $opt{'deleterefunds'}
+ && $opt{'Delete refund'};