1 <% include('/elements/header-popup.html', 'Service Qualification' ) %>
3 <% include('/elements/error.html') %>
5 <FORM NAME = "QualForm"
6 ACTION = "<% $p %>edit/process/qual.cgi"
8 onSubmit = "document.QualForm.submitButton.disabled=true;"
11 <INPUT TYPE="hidden" NAME="<%$cust_or_prospect%>num" VALUE="<% $custnum_or_prospectnum %>">
13 <% ntable("#cccccc", 2) %>
15 <% include('/elements/tr-td-label.html',
17 'label' => 'Qualify using',
18 #'cell_style' => 'font-weight: bold',
23 <% include('/elements/select.html',
25 'field' => 'exportnum',
26 'options' => \@export_options,
27 'labels' => $export_labels,
28 'curr_value' => $exportnum,
34 <% include('/elements/tr-input-text.html',
36 'label' => 'Service phone number',
37 'field' => 'phonenum',
39 'value' => scalar($cgi->param('phonenum')),
43 'prefix' => '<TABLE><TR><TD>',
44 'postfix' => '</TD><TD><FONT SIZE="-2">'. join('<BR>',
45 'Line-share (non dry loops) - always fill in',
46 'Dry loops - always leave empty',
47 ). '</FONT></TD></TR></TABLE>',
51 <% include('/elements/tr-select-cust_location.html',
53 $table => $cust_main_or_prospect_main,
54 'alt_format' => $conf->exists('qual-alt_address_format'),
55 'disable_empty' => $conf->exists('qual-alt_address_format'),
57 #required for ikano.. config? 'is_optional' => 1,
63 <INPUT TYPE = "submit"
74 my $curuser = $FS::CurrentUser::CurrentUser;
77 unless $curuser->access_right('Qualify service');
79 my $conf = new FS::Conf;
80 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
82 $cgi->param('custnum') =~ /^(\d+)$/;
84 $cgi->param('prospectnum') =~ /^(\d+)$/;
86 my $cust_or_prospect = $custnum ? "cust" : "prospect";
87 my $table = $cust_or_prospect . "_main";
88 my $custnum_or_prospectnum = $custnum ? $custnum : $prospectnum;
89 my $cust_main_or_prospect_main = qsearchs({
91 'hashref' => { $cust_or_prospect."num" => $custnum_or_prospectnum },
92 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
94 die "neither prospect nor customer specified or found"
95 unless $cust_main_or_prospect_main;
97 my @exports = grep { $_->can('qual') } qsearch( 'part_export', {} );
98 my @export_options = ( 0 );
99 my $export_labels = { '0' => '(manual)' };
100 foreach my $export ( @exports ) {
101 push @export_options, $export->exportnum;
102 $export_labels->{$export->exportnum} = $export->exportname;
104 my $exportnum = $cgi->param('error')
105 ? scalar($cgi->param('exportnum'))
106 : scalar(@exports) == 1
107 ? $exports[0]->exportnum