1 <% include( 'elements/process.html',
2 'table' => 'did_order',
3 'viewall_dir' => 'browse',
4 'value_callback' => $value_callback,
6 'table' => 'did_order_item',
7 'fields' => [ qw( msanum npa latanum ratecenternum state
15 unless $FS::CurrentUser::CurrentUser->access_right('Import');
17 unless($cgi->param('submitted')) {
18 $cgi->param('submitted',time);
21 my $value_callback = sub {
22 my ($field, $value) = @_;
23 ($field =~ /ed$/ && $value !~ /^\d+$/) ? parse_datetime($value) : $value;
26 my @params = $cgi->param;
27 foreach my $param ( @params ) {
28 if ( $param =~ /^(orderitemnum[0-9]+)_rc_new$/ ) {
30 my $value = $cgi->param($param);
31 if( $value =~ /^[A-Za-z0-9:\- ]+$/ ) {
32 my $rc = new FS::rate_center({ description => $value });
33 my $error = $rc->insert;
34 die "error inserting new rate center: $error" if $error;
35 $cgi->param("${prefix}_ratecenternum",$rc->ratecenternum);
38 elsif ( $param =~ /^(orderitemnum[0-9]+)_custnum$/ ) {
40 my $value = $cgi->param($param);
41 if ( $value =~ /^\d+$/ ) {
42 $cgi->param("custnum",'');