X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fagent.cgi;h=64288b830cad78733a7d9766822fc1358ad295d8;hb=38dd3ed3eeda0a467e1b4d8cedd741fc62aedc9c;hp=adeb78dbd552c63a55cb72901d025c4a2f7721be;hpb=a68758a95e760e50ad99a2a2e0885d2aa9cf907a;p=freeside.git
diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi
index adeb78dbd..64288b830 100755
--- a/httemplate/browse/agent.cgi
+++ b/httemplate/browse/agent.cgi
@@ -1,86 +1,425 @@
-
-
-<%
-
- #bad false laziness with search/cust_main.cgi (also needs fixing up for
- #old mysql)
- my $ncancelled = "
- 0 < ( SELECT COUNT(*) FROM cust_pkg
- WHERE cust_pkg.custnum = cust_main.custnum
- AND ( cust_pkg.cancel IS NULL
- OR cust_pkg.cancel = 0
- )
- )
- OR 0 = ( SELECT COUNT(*) FROM cust_pkg
- WHERE cust_pkg.custnum = cust_main.custnum
- )
- ";
-
- my $ncancelled_sth = dbh->prepare("SELECT COUNT(*) FROM cust_main
- WHERE agentnum = ?
- AND $ncancelled ")
- or die dbh->errstr;
-
- my $total_sth = dbh->prepare("SELECT COUNT(*) FROM cust_main
- WHERE agentnum = ? ")
- or die dbh->errstr;
-
-%>
-
-<%= header('Agent Listing', menubar(
- 'Main Menu' => $p,
+<% include("/elements/header.html",'Agent Listing', menubar(
'Agent Types' => $p. 'browse/agent_type.cgi',
# 'Add new agent' => '../edit/agent.cgi'
)) %>
Agents are resellers of your service. Agents may be limited to a subset of your
full offerings (via their type).
-Add a new agent
+Add a new agent
+% if ( dbdef->table('agent')->column('disabled') ) {
+
+ <% $cgi->param('showdisabled')
+ ? do { $cgi->param('showdisabled', 0);
+ '( hide disabled agents )'; }
+ : do { $cgi->param('showdisabled', 1);
+ '( show disabled agents )'; }
+ %>
+% }
+
+
+<% include('/elements/table-grid.html') %>
+% my $bgcolor1 = '#eeeeee';
+% my $bgcolor2 = '#ffffff';
+% my $bgcolor = '';
-<%= table() %>
-
- <%= $agent->agentnum %> |
-
- <%= $agent->agent %> |
- <%= $agent->agent_type->atype %> |
-
- <%= $num_ncancelled %>
- active
- <%= $num_cancelled %>
- cancelled
+ |
+ <% $agent->agent_type->atype %>
+ |
+
+
+% if ( $agent->agent_custnum ) {
+ <% include('/elements/small_custview.html',
+ $agent->agent_custnum,
+ scalar($conf->config('countrydefault')),
+ 1, #show balance
+ )
+ %>
+% }
+ |
+
+
+% foreach my $access_group (
+% map $_->access_group,
+% qsearch('access_groupagent', { 'agentnum' => $agent->agentnum })
+% ) {
+ <% $access_group->groupname |h %>
+% }
+ |
+
+
+ <% $agent->invoice_template || '(Default)' %>
+ |
+
+
+
|
- $hashref->{freq} |
- $hashref->{prog} |
+
+
+
+ |
+
+
+ Package Churn
+ Payments
+ Credits
+ A/R Aging
+
+
+ |
+
+
+ <% my $num_reg_code = $agent->num_reg_code %>
+% if ( $num_reg_code ) {
+
+
+% }
+Unused
+% if ( $num_reg_code ) {
+
+% }
+
+ Generate codes
+ |
+
+
+ <% my $num_prepay_credit = $agent->num_prepay_credit %>
+% if ( $num_prepay_credit ) {
+
+
+% }
+Unused
+% if ( $num_prepay_credit ) {
+
+% }
+
+ Generate cards
+ |
+% if ( $conf->config('ticket_system') ) {
+
+
+
+% if ( $agent->ticketing_queueid ) {
+
+ Queue: <% $agent->ticketing_queueid %>: <% $agent->ticketing_queue %>
+% }
+
+ |
+% }
+
+
+
+
+% foreach my $override (
+% # sort { } want taxclass-full stuff first? and default cards (empty cardtype)
+% qsearch('agent_payment_gateway', { 'agentnum' => $agent->agentnum } )
+% ) {
+%
+
+
+
+ <% $override->cardtype || 'Default' %> to <% $override->payment_gateway->gateway_module %> (<% $override->payment_gateway->gateway_username %>)
+ <% $override->taxclass
+ ? ' for '. $override->taxclass. ' only'
+ : ''
+ %>
+ (delete)
+ |
+
+% }
+
+
+ (add override) |
+
+
+ |
+
+
+
+% foreach my $override (
+% qsearch('conf', { 'agentnum' => $agent->agentnum } )
+% ) {
+%
+
+
+
+ <% $override->name %> (delete)
+ |
+
+% }
+
+
+ (view/add/edit overrides) |
+
+
+ |
+
+% }
-<% } %>
+
+
+