X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_cust_pkg.html;h=27aececc944e8d6d904dd6ffb5a50c19c1d8b123;hp=d210446b476a1bb4abd43ab7c5c637be7a55ebc2;hb=f822e27a1e00594332ffa487a1c284234c5580a6;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195 diff --git a/httemplate/search/report_cust_pkg.html b/httemplate/search/report_cust_pkg.html index d210446b4..27aececc9 100755 --- a/httemplate/search/report_cust_pkg.html +++ b/httemplate/search/report_cust_pkg.html @@ -1,25 +1,71 @@ -<% include('/elements/header.html', 'Package Report' ) %> +<& /elements/header.html, mt($title, @title_arg) &>
+ + +% unless ( $custnum ) { - - - + <& /elements/tr-title.html, value => mt('Customer search options') &> + + <& /elements/tr-select-agent.html, + 'curr_value' => scalar( $cgi->param('agentnum') ), + 'disable_empty' => 0, + 'onchange' => 'agent_changed(this)', + &> + + <& /elements/tr-select-cust_main-status.html, + 'label' => 'Customer status', + 'field' => 'cust_status', + &> + + - <% include( '/elements/tr-select-agent.html', - 'curr_value' => scalar( $cgi->param('agentnum') ), - ) - %> + <& /elements/tr-select-sales.html, + 'label' => 'Customer sales person', + 'element_name' => 'cust_main_salesnum', + 'id' => 'cust_main_salesnum', + 'curr_value' => scalar($cgi->param('cust_main_salesnum')), + 'pre_options' => [ '' => 'all', + 0 => '(none)', ], + 'disable_empty' => 1, + &> - <% include( '/elements/tr-select-cust_pkg-status.html', +
- Search options -
+
+ +% } + + + + <& /elements/tr-title.html, value => mt('Package search options') &> + + <& /elements/tr-select-sales.html, + 'label' => 'Package sales person', + 'curr_value' => scalar($cgi->param('salesnum')), + 'pre_options' => [ '' => 'all', + 0 => '(none)', ], + 'disable_empty' => 1, + &> + + <& /elements/tr-select-cust_pkg-status.html, + 'label' => 'Package status', 'onchange' => 'status_changed(this);', - ) - %> + &> - <% include( '/elements/tr-select-pkg_class.html', + <& /elements/tr-select-pkg_class.html, 'pre_options' => [ '0' => 'all' ], 'empty_label' => '(empty class)', - ) - %> - -% foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) { - - - - - + &> -% } - - <% include( '/elements/tr-selectmultiple-part_pkg.html' ) %> +% if ( scalar( qsearch( 'part_pkg_report_option', { 'disabled' => '' } ) ) ) { - - - + <& /elements/tr-select-table.html, + 'label' => 'Report classes', + 'table' => 'part_pkg_report_option', + 'name_col' => 'name', + 'hashref' => { 'disabled' => '' }, + 'element_name' => 'report_option', + 'multiple' => 'multiple', + &> +% } - + - <% include( '/elements/tr-select-cust-fields.html' ) %> + + + + <& /elements/tr-checkbox.html, + 'label' => 'Custom packages', + 'field' => 'custom', + 'value' => 1, + 'onchange' => 'custom_changed(this);', + &> + + <& /elements/tr-selectmultiple-part_pkg.html &> + + <& /elements/tr-title.html, value => mt('Location search options') &> + +% my @location_options = qw(cust nocust census nocensus); +% if ( $conf->config('tax_data_vendor') eq 'cch' ) { +% push @location_options, 'geocode', 'nogeocode'; +% } + <& /elements/tr-checkbox-multiple.html, + 'label' => 'Where package location:', + 'field' => 'loc', + 'options' => \@location_options, + 'labels' => { 'cust' => "is the customer's default location", + 'nocust' => "is not the customer's default location", + 'census' => "has a census tract", + 'nocensus' => "does not have a census tract", + 'nogeocode'=> 'has an implicit tax location', + 'geocode' => 'has a hardcoded tax location', + }, + 'value' => { map { $_ => 0 } @location_options }, + &> + + <& /elements/tr-title.html, value => mt('Display options') &> + + <& /elements/tr-select-cust-fields.html &>
<% $label{$field} %> - - <% include( '/elements/tr-input-beginning_ending.html', - prefix => $field, - layout => 'horiz', - ) - %> -
-
 
Display options + + + + + + +% my $noinit = 0; +% foreach my $field (@date_fields) { + + + +% foreach (qw(beginning ending)) { + +% $noinit = 1; +% } + +% } #foreach $field +
From date (m/d/y)To date (m/d/y)
<% $label{$field} %> + <& /elements/input-date-field.html, { + 'name' => $field.'_'.$_, + 'value' => '', + 'noinit' => $noinit, + 'format' => '%m/%d/%Y', + } &> +
+
@@ -112,25 +224,47 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('List packages'); +my $title = 'Package Report'; +#false laziness w/report_cust_bill.html +my @title_arg = (); + +my $custnum = ''; +if ( $cgi->param('custnum') =~ /^(\d+)$/ ) { + $custnum = $1; + my $cust_main = qsearchs({ + 'table' => 'cust_main', + 'hashref' => { 'custnum' => $custnum }, + 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, + }) or die "unknown custnum $custnum"; + $title .= ': [_1]'; + push @title_arg, $cust_main->name; +} + <%once> -my %label = ( - 'setup' => 'Setup', - 'last_bill' => 'Last bill', - 'bill' => 'Next bill', - 'adjourn' => 'Adjourns', - 'susp' => 'Suspended', - 'expire' => 'Expires', - 'cancel' => 'Cancelled', -); +tie my %label, 'Tie::IxHash', + 'setup' => 'Setup', + 'last_bill' => 'Last bill', + 'bill' => 'Next bill', + 'adjourn' => 'Adjourns', + 'susp' => 'Suspended', + 'dundate' => 'Suspension delayed until', + 'expire' => 'Expires', + 'contract_end' => 'Contract ends', + 'change_date' => 'Changed from other package', + 'cancel' => 'Cancelled', +; +my @date_fields = keys %label; #false laziness w/cust_pkg.cgi my %disable = ( 'all' => {}, - 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, }, + 'on hold' => { 'setup'=>1, 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'expire'=>1, 'cancel'=>1, 'dundate'=> 1, }, + 'not yet billed' => { 'setup'=>1, 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, 'dundate'=>1, }, + 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, 'contract_end'=>1, 'dundate'=>1, }, 'active' => { 'susp'=>1, 'cancel'=>1 }, - 'suspended' => { 'cancel' => 1 }, + 'suspended' => { 'cancel'=>1, 'dundate'=>1, }, 'cancelled' => {}, '' => {}, ); @@ -141,8 +275,10 @@ my %checkbox = ( 'last_bill' => 0, 'bill' => 0, 'susp' => 1, + 'dundate' => 1, 'expire' => 1, 'cancel' => 1, ); +my $conf = FS::Conf->new;