From 6a38629bcb54a2ad9b8a5de6cac9f478bc4a7e66 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 6 Feb 2014 00:05:07 -0800 Subject: [PATCH] add "Ordered" status to customer number/link on agent browse, RT#27442 --- FS/FS/agent.pm | 22 ++++++++++++++++++++++ httemplate/browse/agent.cgi | 25 +++++++++++++++++++++++++ httemplate/search/cust_main.cgi | 1 + 3 files changed, 48 insertions(+) diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm index b476847c5..0fdc5f542 100644 --- a/FS/FS/agent.pm +++ b/FS/FS/agent.pm @@ -419,6 +419,28 @@ sub cust_main_sql { ); } +=item num_ordered_cust_main + +Returns the number of ordered customers for this agent (customers with packages +ordered, but not yet billed). + +=cut + +sub num_ordered_cust_main { + shift->num_sql(FS::cust_main->ordered_sql); +} + +=item active_cust_main + +Returns the active customers for this agent, as cust_main objects. + +=cut + +sub active_cust_main { + shift->cust_main_sql(FS::cust_main->active_sql); +} + + =item num_active_cust_main Returns the number of active customers for this agent (customers with active diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi index 6f2864106..25524323d 100755 --- a/httemplate/browse/agent.cgi +++ b/httemplate/browse/agent.cgi @@ -182,6 +182,26 @@ inactive + + <% my $num_ordered = $agent->num_ordered_cust_main %>  + + + + +% if ( $num_ordered ) { + + +% } +ordered +% if ($num_ordered ) { + +% } + + + + + + <% my $num_active = $agent->num_active_cust_main %>  @@ -266,6 +286,11 @@ inactive + + +   + + diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index ee1dd8597..0b0dd4ffe 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -393,6 +393,7 @@ if ( $cgi->param('browse') push @qual, FS::cust_main->cancel_sql if $cgi->param('cancelled'); push @qual, FS::cust_main->prospect_sql if $cgi->param('prospect'); + push @qual, FS::cust_main->ordered_sql if $cgi->param('ordered'); push @qual, FS::cust_main->active_sql if $cgi->param('active'); push @qual, FS::cust_main->inactive_sql if $cgi->param('inactive'); push @qual, FS::cust_main->susp_sql if $cgi->param('suspended'); -- 2.11.0