- <SCRIPT TYPE="text/javascript">
- function areyousure(href, message) {
- if (confirm(message) == true)
- window.location.href = href;
- }
- </SCRIPT>
-
- <A HREF = "javascript:areyousure(
- '<%$p%>misc/delete-cust_bill.html?<% $invnum %>',
- '<% mt('Are you sure you want to delete this invoice?') |h %>'
- )"
- TITLE = "<% mt('Delete this invoice from the database completely') |h %>"
- ><% mt('Delete this invoice') |h %></A>
+% if ( !$cust_bill->closed && $curuser->access_right('Void invoices') ) {
+ <& /elements/popup_link.html,
+ 'label' => emt('Void this invoice'),
+ 'actionlabel' => emt('Void this invoice'),
+ 'action' => $p.'misc/void-cust_bill.html?invnum='.$invnum,
+ &>