X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fquick-cust_pkg.cgi;h=67cdb87e868d2d267fa7af4c315694da2b65ed2e;hb=d46254f9b36873e457424eefdcf3610b71ef889d;hp=fe5ee5e9e4e3723d0b1396c9290027c49e91fafa;hpb=b8144cab2a804b964d1a97164780e2ddc6ae60ec;p=freeside.git diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index fe5ee5e9e..67cdb87e8 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -70,6 +70,9 @@ my $quantity = $1 || 1; $cgi->param('refnum') =~ /^(\d*)$/ or die 'illegal refnum '. $cgi->param('refnum'); my $refnum = $1; +$cgi->param('salesnum') =~ /^(\d*)$/ + or die 'illegal salesnum '. $cgi->param('salesnum'); +my $salesnum = $1; $cgi->param('contactnum') =~ /^(\-?\d*)$/ or die 'illegal contactnum '. $cgi->param('contactnum'); my $contactnum = $1; @@ -107,10 +110,7 @@ my $error = ''; my %hash = ( 'pkgpart' => $pkgpart, 'quantity' => $quantity, - 'start_date' => ( scalar($cgi->param('start_date')) - ? parse_datetime($cgi->param('start_date')) - : '' - ), + 'salesnum' => $salesnum, 'refnum' => $refnum, 'contactnum' => $contactnum, 'locationnum' => $locationnum, @@ -129,6 +129,14 @@ my %hash = ( ); $hash{'custnum'} = $cust_main->custnum if $cust_main; +if ( $cgi->param('start') eq 'on_hold' ) { + $hash{'susp'} = 'now'; +} elsif ( $cgi->param('start') eq 'on_date' ) { + $hash{'start_date'} = scalar($cgi->param('start_date')) + ? parse_datetime($cgi->param('start_date')) + : ''; +} + if ( $quotationnum ) { $quotation_pkg = new FS::quotation_pkg \%hash; @@ -136,7 +144,7 @@ if ( $quotationnum ) { $quotation_pkg->prospectnum($prospect_main->prospectnum) if $prospect_main; #XXX handle new location - $error = $quotation_pkg->insert; + $error = $quotation_pkg->insert || $quotation_pkg->estimate; } else {