blob: 187ede5e509dcb0795822fcc20f81b144098c657 (
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 );
eidiot($error);
} else {
my $svcdb = $new->part_svc->svcdb;
print $cgi->redirect(popurl(3). "view/$svcdb.cgi?$svcnum");
}
|