svc_broadband merge
[freeside.git] / httemplate / edit / process / part_referral.cgi
1 <%
2
3 my $refnum = $cgi->param('refnum');
4
5 my $new = new FS::part_referral ( {
6   map {
7     $_, scalar($cgi->param($_));
8   } fields('part_referral')
9 } );
10
11 my $error;
12 if ( $refnum ) {
13   my $old = qsearchs( 'part_referral', { 'refnum' =>$ refnum } );
14   die "(Old) Record not found!" unless $old;
15   $error = $new->replace($old);
16 } else {
17   $error = $new->insert;
18 }
19 $refnum=$new->refnum;
20
21 if ( $error ) {
22   $cgi->param('error', $error);
23   print $cgi->redirect(popurl(2). "part_referral.cgi?". $cgi->query_string );
24 } else {
25   print $cgi->redirect(popurl(3). "browse/part_referral.cgi");
26 }
27
28 %>