summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/cust_svc.cgi
blob: e9d5f62385fcd82b728e318d1a77a89c3161576f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 );
%  errorpage($error);
%} else { 
%  my $svcdb = $new->part_svc->svcdb;
%  print $cgi->redirect(popurl(3). "view/$svcdb.cgi?$svcnum");
%}
%
%