diff options
Diffstat (limited to 'httemplate/edit/process/part_svc.cgi')
-rwxr-xr-x | httemplate/edit/process/part_svc.cgi | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi index 31ab13438..859670b17 100755 --- a/httemplate/edit/process/part_svc.cgi +++ b/httemplate/edit/process/part_svc.cgi @@ -33,6 +33,29 @@ if ( $error ) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). "part_svc.cgi?". $cgi->query_string ); } else { + + #false laziness w/ edit/process/agent_type.cgi + foreach my $part_export (qsearch('part_export',{})) { + my $exportnum = $part_export->exportnum; + my $export_svc = qsearchs('export_svc', { + 'exportnum' => $part_export->exportnum, + 'svcpart' => $new->svcpart, + } ); + if ( $export_svc && ! $cgi->param("exportnum". $part_export->exportnum) ) { + $error = $export_svc->delete; + die $error if $error; + } elsif ( $cgi->param("exportnum". $part_export->exportnum) + && ! $export_svc ) { + $export_svc = new FS::export_svc ( { + 'exportnum' => $part_export->exportnum, + 'svcpart' => $new->svcpart, + } ); + $error = $export_svc->insert; + die $error if $error; + } + + } + print $cgi->redirect(popurl(3)."browse/part_svc.cgi"); } |