X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fquick-cust_pkg.cgi;h=fab85252bbcb8494458e24851f8e1e8f1d6bcf21;hb=b5dbd9e1bcbb701a20ed23e723b1e0105fd7c1a1;hp=2fde17f5ea1a32868e5aedafb5a3edf18197b5d4;hpb=2ab068f449eb97a10e18d20e9dab5ab9faa017e7;p=freeside.git diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index 2fde17f5e..fab85252b 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -6,12 +6,21 @@ % my $show = $curuser->default_customer_view =~ /^(jumbo|packages)$/ % ? '' % : ';show=packages'; +% my $redir_url = popurl(3) +% ."view/cust_main.cgi?custnum=$custnum$show;fragment=$frag#$frag"; +% +% # for going right to a provision service after ordering a package +% if ( $svcpart ) { +% $redir_url = popurl(3)."edit/".$part_svc->svcdb.".cgi?". +% "pkgnum=".$cust_pkg->pkgnum. ";svcpart=$svcpart"; +% $redir_url .= ";qualnum=$qualnum" if $qualnum; +% } <% header('Package ordered') %> @@ -49,6 +58,22 @@ $cgi->param('discountnum') =~ /^(\-?\d*)$/ or die 'illegal discountnum '. $cgi->param('discountnum'); my $discountnum = $1; +# for going right to a provision service after ordering a package +my( $svcpart, $part_svc ) = ( '', '' ); +if ( $cgi->param('svcpart') ) { + $cgi->param('svcpart') =~ /^(\-?\d*)$/ + or die 'illegal svcpart '. $cgi->param('svcpart'); + $svcpart = $1; + $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } ) + or die "unknown svcpart $svcpart"; +} + +my $qualnum = ''; +if ( $cgi->param('qualnum') ) { + $cgi->param('qualnum') =~ /^(\d+)$/ or die 'illegal qualnum'; + $qualnum = $1; +} + my $cust_pkg = new FS::cust_pkg { 'custnum' => $custnum, @@ -66,7 +91,12 @@ my $cust_pkg = new FS::cust_pkg { 'discountnum_amount' => scalar($cgi->param('discountnum_amount')), 'discountnum_percent' => scalar($cgi->param('discountnum_percent')), 'discountnum_months' => scalar($cgi->param('discountnum_months')), - #'discountnum_disabled' => scalar($cgi->param('discountnum_disabled')), + 'discountnum_setup' => scalar($cgi->param('discountnum_setup')), + 'contract_end' => ( scalar($cgi->param('contract_end')) + ? parse_datetime($cgi->param('contract_end')) + : '' + ), + 'waive_setup' => ( $cgi->param('waive_setup') eq 'Y' ? 'Y' : '' ), }; my %opt = ( 'cust_pkg' => $cust_pkg ); @@ -74,11 +104,11 @@ my %opt = ( 'cust_pkg' => $cust_pkg ); if ( $locationnum == -1 ) { my $cust_location = new FS::cust_location { map { $_ => scalar($cgi->param($_)) } - qw( custnum address1 address2 city county state zip country ) + qw( custnum address1 address2 city county state zip country geocode ) }; $opt{'cust_location'} = $cust_location; } -my $error = $cust_main->order_pkg( %opt ); +my $error = $cust_main->order_pkg( \%opt );