diff options
Diffstat (limited to 'httemplate/edit/process/part_referral.cgi')
-rwxr-xr-x | httemplate/edit/process/part_referral.cgi | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/httemplate/edit/process/part_referral.cgi b/httemplate/edit/process/part_referral.cgi new file mode 100755 index 000000000..fd2c01506 --- /dev/null +++ b/httemplate/edit/process/part_referral.cgi @@ -0,0 +1,28 @@ +<% + +my $refnum = $cgi->param('refnum'); + +my $new = new FS::part_referral ( { + map { + $_, scalar($cgi->param($_)); + } fields('part_referral') +} ); + +my $error; +if ( $refnum ) { + my $old = qsearchs( 'part_referral', { 'refnum' =>$ refnum } ); + die "(Old) Record not found!" unless $old; + $error = $new->replace($old); +} else { + $error = $new->insert; +} +$refnum=$new->refnum; + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "part_referral.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "browse/part_referral.cgi"); +} + +%> |