-<% include('/elements/header.html', mt($title, @title_arg) %>
+<& /elements/header.html, mt($title, @title_arg) &>
<FORM ACTION="cust_pkg.cgi" METHOD="GET">
<INPUT TYPE="hidden" NAME="magic" VALUE="bill">
<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
- <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+% unless ( $custnum ) {
- <TR>
- <TH CLASS="background" COLSPAN=2 ALIGN="left">
- <FONT SIZE="+1">Search options</FONT>
- </TH>
- </TR>
+ <FONT CLASS="fsinnerbox-title"><% emt('Customer search options') %></FONT>
+ <TABLE CLASS="fsinnerbox">
-% unless ( $custnum ) {
- <% include( '/elements/tr-select-agent.html',
+ <& /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',
+ &>
+
+ <SCRIPT TYPE="text/javascript">
+
+ function agent_changed(what) {
+% # update sales dropdowns
+ salesnum_agentnum_changed(what);
+ cust_main_salesnum_agentnum_changed(what);
+ }
+
+ <&| /elements/onload.js &>
+ agent_changed(document.getElementById('agentnum'))
+ </&>
+
+ </SCRIPT>
+
+ <& /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,
+ &>
+
+ </TABLE>
+ <BR>
+
% }
- <% include( '/elements/tr-select-cust_pkg-status.html',
+<FONT CLASS="fsinnerbox-title"><% emt('Package search options') %></FONT>
+<TABLE CLASS="fsinnerbox">
+
+ <& /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);',
- )
- %>
+ &>
<SCRIPT TYPE="text/javascript">
what.form.<% $field %>_beginning_text.disabled = true;
what.form.<% $field %>_ending_text.disabled = true;
+ what.form.<% $field %>_null.disabled = true;
what.form.<% $field %>_beginning_text.style.backgroundColor = '#dddddd';
what.form.<% $field %>_ending_text.style.backgroundColor = '#dddddd';
% } else {
- what.form.<% $field %>_beginning_text.disabled = false;
- what.form.<% $field %>_ending_text.disabled = false;
- what.form.<% $field %>_beginning_text.style.backgroundColor = '#ffffff';
- what.form.<% $field %>_ending_text.style.backgroundColor = '#ffffff';
+ what.form.<% $field %>_null.disabled = false;
+
+ if ( ! what.form.<% $field %>_null.checked ) {
- what.form.<% $field %>_beginning_button.style.display = '';
- what.form.<% $field %>_ending_button.style.display = '';
- what.form.<% $field %>_beginning_disabled.style.display = 'none';
- what.form.<% $field %>_ending_disabled.style.display = 'none';
+ what.form.<% $field %>_beginning_text.disabled = false;
+ what.form.<% $field %>_ending_text.disabled = false;
+ what.form.<% $field %>_beginning_text.style.backgroundColor = '#ffffff';
+ what.form.<% $field %>_ending_text.style.backgroundColor = '#ffffff';
+
+ what.form.<% $field %>_beginning_button.style.display = '';
+ what.form.<% $field %>_ending_button.style.display = '';
+ what.form.<% $field %>_beginning_disabled.style.display = 'none';
+ what.form.<% $field %>_ending_disabled.style.display = 'none';
+
+ }
% }
% }
}
+% foreach my $field (@date_fields) {
+
+ function <% $field %>_null_changed(what) {
+
+ if ( what.checked ) {
+ what.form.<% $field %>_beginning_text.disabled = true;
+ what.form.<% $field %>_ending_text.disabled = true;
+ what.form.<% $field %>_beginning_text.style.backgroundColor = '#dddddd';
+ what.form.<% $field %>_ending_text.style.backgroundColor = '#dddddd';
+ what.form.<% $field %>_beginning_button.style.display = 'none';
+ what.form.<% $field %>_ending_button.style.display = 'none';
+ what.form.<% $field %>_beginning_disabled.style.display = '';
+ what.form.<% $field %>_ending_disabled.style.display = '';
+
+ } else {
+ what.form.<% $field %>_beginning_text.disabled = false;
+ what.form.<% $field %>_ending_text.disabled = false;
+ what.form.<% $field %>_beginning_text.style.backgroundColor = '#ffffff';
+ what.form.<% $field %>_ending_text.style.backgroundColor = '#ffffff';
+
+ what.form.<% $field %>_beginning_button.style.display = '';
+ what.form.<% $field %>_ending_button.style.display = '';
+ what.form.<% $field %>_beginning_disabled.style.display = 'none';
+ what.form.<% $field %>_ending_disabled.style.display = 'none';
+
+ }
+
+ }
+
+% }
+
</SCRIPT>
- <% include( '/elements/tr-select-pkg_class.html',
+ <& /elements/tr-select-pkg_class.html,
'pre_options' => [ '0' => 'all' ],
'empty_label' => '(empty class)',
- )
- %>
+ &>
% if ( scalar( qsearch( 'part_pkg_report_option', { 'disabled' => '' } ) ) ) {
- <% include( '/elements/tr-select-table.html',
+ <& /elements/tr-select-table.html,
'label' => 'Report classes',
'table' => 'part_pkg_report_option',
'name_col' => 'name',
'hashref' => { 'disabled' => '' },
'element_name' => 'report_option',
'multiple' => 'multiple',
- )
- %>
+ &>
% }
-
+ <TR>
+ <TD COLSPAN=2>
+ <TABLE>
+ <TR>
+ <TD></TD>
+ <TD>From date <i>(m/d/y)</i></TD>
+ <TD>To date <i>(m/d/y)</i></TD>
+ <TD>Empty date</TD>
+ </TR>
+% my $noinit = 0;
% foreach my $field (@date_fields) {
- <TR>
- <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
- <TD>
- <TABLE>
- <% include( '/elements/tr-input-beginning_ending.html',
- prefix => $field,
- layout => 'horiz',
- )
- %>
- </TABLE>
- </TD>
- </TR>
-
-% }
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
+% foreach (qw(beginning ending)) {
+ <TD>
+ <& /elements/input-date-field.html, {
+ 'name' => $field.'_'.$_,
+ 'value' => '',
+ 'noinit' => $noinit,
+ 'format' => '%m/%d/%Y',
+ } &>
+ </TD>
+% $noinit = 1;
+% }
+ <TD ALIGN="center">
+ <& /elements/checkbox.html,
+ 'field' => $field.'_null',
+ 'value' => 'Y',
+ 'onchange' => $field.'_null_changed',
+ &>
+ </TD>
+ </TR>
+% } #foreach $field
+ </TABLE>
+ </TD>
+ </TR>
<SCRIPT TYPE="text/javascript">
</SCRIPT>
- <% include( '/elements/tr-checkbox.html',
+ <& /elements/tr-checkbox.html,
'label' => 'Custom packages',
'field' => 'custom',
'value' => 1,
'onchange' => 'custom_changed(this);',
- )
- %>
+ &>
- <% include( '/elements/tr-selectmultiple-part_pkg.html' ) %>
+ <& /elements/tr-selectmultiple-part_pkg.html &>
- <TR>
- <TH CLASS="background" COLSPAN=2> </TH>
- </TR>
+</TABLE>
+<BR>
- <TR>
- <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Display options</FONT></TH>
- </TR>
- <% include( '/elements/tr-select-cust-fields.html' ) %>
+<FONT CLASS="fsinnerbox-title"><% emt('Location search options') %></FONT>
+<TABLE CLASS="fsinnerbox">
+
+% 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 },
+ &>
+
+</TABLE>
+<BR>
+
+<FONT CLASS="fsinnerbox-title"><% emt('Display options') %></FONT>
+<TABLE CLASS="fsinnerbox">
+
+ <& /elements/tr-select-cust-fields.html &>
</TABLE>
'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' => {},
- 'not yet billed' => { 'setup'=>1, '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, 'dundate'=>1, },
'cancel' => 1,
);
+my $conf = FS::Conf->new;
</%once>