% 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 ) {
+% my $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } );
+% if ( $part_svc ) {
+% $redir_url = popurl(3)."edit/".$part_svc->svcdb.".cgi?"
+% ."pkgnum=".$cust_pkg->pkgnum.";svcpart=$svcpart";
+% }
+% }
<% header('Package ordered') %>
<SCRIPT TYPE="text/javascript">
// XXX fancy ajax rebuild table at some point, but a page reload will do for now
// XXX chop off trailing #target and replace... ?
- window.top.location = '<% popurl(3). "view/cust_main.cgi?custnum=$custnum$show;fragment=$frag#$frag" %>';
+ window.top.location = '<% $redir_url %>';
</SCRIPT>
or die 'illegal discountnum '. $cgi->param('discountnum');
my $discountnum = $1;
+# for going right to a provision service after ordering a package
+my $svcpart;
+if ( $cgi->param('svcpart') ) {
+ $cgi->param('svcpart') =~ /^(\-?\d*)$/
+ or die 'illegal svcpart '. $cgi->param('svcpart');
+ $svcpart = $1;
+}
my $cust_pkg = new FS::cust_pkg {
'custnum' => $custnum,
'discountnum_amount' => scalar($cgi->param('discountnum_amount')),
'discountnum_percent' => scalar($cgi->param('discountnum_percent')),
'discountnum_months' => scalar($cgi->param('discountnum_months')),
+ 'contract_end' => ( scalar($cgi->param('contract_end'))
+ ? parse_datetime($cgi->param('contract_end'))
+ : ''
+ ),
#'discountnum_disabled' => scalar($cgi->param('discountnum_disabled')),
};
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 );
</%init>