oops, last bit for reg codes
authorivan <ivan>
Sat, 29 Jan 2005 12:50:05 +0000 (12:50 +0000)
committerivan <ivan>
Sat, 29 Jan 2005 12:50:05 +0000 (12:50 +0000)
FS/FS/part_pkg/flat.pm
httemplate/browse/agent.cgi

index 131f850..ee0f756 100644 (file)
@@ -48,7 +48,7 @@ sub calc_remain {
   my $next_bill = $cust_pkg->getfield('bill') || 0;
   my $last_bill = $cust_pkg->last_bill || 0;
   return 0 if    ! $self->base_recur
-              || ! $self->option('unused_credit')
+              || ! $self->option('unused_credit', 1)
               || ! $last_bill
               || ! $next_bill;
 
index f389342..f24266f 100755 (executable)
@@ -35,6 +35,7 @@ full offerings (via their type).<BR><BR>
   <TH COLSPAN=<%= ( $cgi->param('showdisabled') || !dbdef->table('agent')->column('disabled') ) ? 2 : 3 %>>Agent</TH>
   <TH>Type</TH>
   <TH>Customers</TH>
+  <TH>Registration Codes</TH>
   <TH><FONT SIZE=-1>Freq.</FONT></TH>
   <TH><FONT SIZE=-1>Prog.</FONT></TH>
 </TR>
@@ -89,6 +90,12 @@ foreach my $agent ( sort {
           <% if ( $num_cancel ) { %>
             <A HREF="<%= $cust_main_link %>&showcancelledcustomers=1&cancelled=1"><% } %>cancelled<% if ( $num_cancel ) { %></A><% } %>
         </TD>
+        <TD>
+          <%= my $num_reg_code = $agent->num_reg_code %>
+          <% if ( $num_reg_code ) { %>
+            <A HREF="<%=$p%>search/reg_code.html?agentnum=<%= $agent->agentnum %>"><% } %>Unused<% if ( $num_reg_code ) { %></A><% } %>
+          <BR><A HREF="<%=$p%>edit/reg_code.cgi?agentnum=<%= $agent->agentnum %>">Generate codes</A>
+        </TD>
         <TD><%= $agent->freq %></TD>
         <TD><%= $agent->prog %></TD>
       </TR>