X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fqual.html;fp=httemplate%2Fmisc%2Fqual.html;h=69a5f8b74253dca35e58599f1d843d0cfb95f749;hp=298b10a7a4c01ee08963d53eecc4ec0df5cd91b7;hb=8468ce6abd28b145bfde14a210a166cca46115dc;hpb=c58774a70c3326ad2ba5a7a38b174dfbd76a9f78 diff --git a/httemplate/misc/qual.html b/httemplate/misc/qual.html index 298b10a7a..69a5f8b74 100644 --- a/httemplate/misc/qual.html +++ b/httemplate/misc/qual.html @@ -4,7 +4,7 @@
- + <% ntable("#cccccc", 2) %> @@ -38,7 +38,7 @@ <% include('/elements/tr-select-cust_location.html', 'cgi' => $cgi, - 'cust_main' => $cust_main, + $table => $cust_main_or_prospect_main, 'alt_format' => $conf->exists('qual-alt-address-format') ? 1 : 0, 'is_optional' => 1, 'no_bold' => 1, @@ -62,13 +62,20 @@ die "access denied" my $conf = new FS::Conf; my $date_format = $conf->config('date_format') || '%m/%d/%Y'; -$cgi->param('custnum') =~ /^(\d+)$/ or die "no custnum"; +$cgi->param('custnum') =~ /^(\d+)$/; my $custnum = $1; -my $cust_main = qsearchs({ - 'table' => 'cust_main', - 'hashref' => { 'custnum' => $custnum }, +$cgi->param('prospectnum') =~ /^(\d+)$/; +my $prospectnum = $1; +my $cust_or_prospect = $custnum ? "cust" : "prospect"; +my $table = $cust_or_prospect . "_main"; +my $custnum_or_prospectnum = $custnum ? $custnum : $prospectnum; +my $cust_main_or_prospect_main = qsearchs({ + 'table' => $table, + 'hashref' => { $cust_or_prospect."num" => $custnum_or_prospectnum }, 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, }); +die "neither prospect nor customer specified or found" + unless $cust_main_or_prospect_main; my @exports = grep { $_->can('qual') } qsearch( 'part_export', {} ); my @export_options = ( 0 );