separate ACL for editing customer invoice terms, RT#75759
authorIvan Kohler <ivan@freeside.biz>
Fri, 2 Jun 2017 21:22:07 +0000 (14:22 -0700)
committerIvan Kohler <ivan@freeside.biz>
Fri, 2 Jun 2017 21:22:07 +0000 (14:22 -0700)
httemplate/edit/cust_main/billing.html

index 9836810..135f636 100644 (file)
     <TR>
       <TD ALIGN="right" WIDTH="200"><% mt('Invoice terms') |h %> </TD>
       <TD WIDTH="408">
-        <& /elements/select-terms.html,
-             'curr_value' => $cust_main->invoice_terms,
-             'agentnum'   => $cust_main->agentnum,
-        &>
+%       if ( $curuser->access_right('Edit customer invoice terms') ) {
+          <& /elements/select-terms.html,
+               'curr_value' => $cust_main->invoice_terms,
+               'agentnum'   => $cust_main->agentnum,
+          &>
+%       } else {
+%
+%         my $terms =
+%           $cust_main->invoice_terms
+%             || emt('Default').' ('.
+%                ( $conf->config('invoice_default_terms', $cust_main->agentnum)
+%                    || emt('Payable upon receipt')
+%                ).
+%                ')';
+          <% $terms |h %>
+
+          <& /elements/hidden.html, 
+               'field'      => 'invoice_terms',
+               'curr_value' => $cust_main->invoice_terms,
+          &>
+%       }
       </TD>
     </TR>