diff options
Diffstat (limited to 'httemplate/edit')
-rw-r--r-- | httemplate/edit/process/cust_svc.cgi | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/httemplate/edit/process/cust_svc.cgi b/httemplate/edit/process/cust_svc.cgi new file mode 100644 index 000000000..187ede5e5 --- /dev/null +++ b/httemplate/edit/process/cust_svc.cgi @@ -0,0 +1,30 @@ +<% + +my $svcnum = $cgi->param('svcnum'); + +my $old = qsearchs('cust_svc',{'svcnum'=>$svcnum}) if $svcnum; + +my $new = new FS::cust_svc ( { + map { + $_, scalar($cgi->param($_)); + } fields('cust_svc') +} ); + +my $error; +if ( $svcnum ) { + $error=$new->replace($old); +} else { + $error=$new->insert; + $svcnum=$new->getfield('svcnum'); +} + +if ( $error ) { + #$cgi->param('error', $error); + #print $cgi->redirect(popurl(2). "cust_svc.cgi?". $cgi->query_string ); + eidiot($error); +} else { + my $svcdb = $new->part_svc->svcdb; + print $cgi->redirect(popurl(3). "view/$svcdb.cgi?$svcnum"); +} + + |