X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fpart_svc.cgi;h=9633fabdfe2726474b2dee043cf7d1a17a898bc5;hp=31ab13438362f2472afc2ee789bbc045d66cb4ec;hb=3595c874f8e476e58b98b7ab6d86918d4dbb1d5c;hpb=74e64d70361848f089aad9a7881c2af9caf6e479 diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi index 31ab13438..9633fabdf 100755 --- a/httemplate/edit/process/part_svc.cgi +++ b/httemplate/edit/process/part_svc.cgi @@ -17,7 +17,7 @@ my $new = new FS::part_svc ( { push @fields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge map { ( $svcdb.'__'.$_, $svcdb.'__'.$_.'_flag' ) } @fields; } grep defined( $FS::Record::dbdef->table($_) ), - qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www ) + qw( svc_acct svc_domain svc_forward svc_www svc_broadband ) ) } ); @@ -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"); }