X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fprocess%2Fcust_main_note-import.cgi;h=945689f89f384468f7ecfdbda274e319b0e48c6c;hp=6625e00296f1a7901a1518ffdc4079994d103bad;hb=8afd2939872ed96d7e205e85c183a5cf20c36ef6;hpb=53c235fd67a9ab0022bc8ea0cc35b5a4d02d2e11 diff --git a/httemplate/misc/process/cust_main_note-import.cgi b/httemplate/misc/process/cust_main_note-import.cgi index 6625e0029..945689f89 100644 --- a/httemplate/misc/process/cust_main_note-import.cgi +++ b/httemplate/misc/process/cust_main_note-import.cgi @@ -40,7 +40,8 @@ my @uninserted = (); for ( my $row = 0; exists($param->{"custnum$row"}); $row++ ) { if ( $param->{"custnum$row"} ) { my $error = ''; - if ( $param->{use_comments} ) { # why? notes are sexier + if ( $param->{use_comments} ) { # why? notes are sexier (i think this can + # come out now? UI doesn't let you set it my $cust_main = qsearchs('cust_main', { 'custnum' => $param->{"custnum$row"} } ); @@ -53,12 +54,21 @@ for ( my $row = 0; exists($param->{"custnum$row"}); $row++ ) { $error = "Can't find customer " . $param->{"custnum$row"}; } } else { + + my $comments = $param->{"note$row"}; + my $classnum = ''; + if ( $comments =~ /^\s*(\d+)\s*\|\s*(.+)$/ ) { + $classnum = $1; + $comments = $2; + } + my $cust_main_note = new FS::cust_main_note { - 'custnum' => $param->{"custnum$row"}, - '_date' => $date, - 'otaker' => $otaker, - 'comments' => $param->{"note$row"}, - }; + 'custnum' => $param->{"custnum$row"}, + '_date' => $date, + 'otaker' => $otaker, + 'comments' => $comments, + 'classnum' => $classnum, + }; $error = $cust_main_note->insert unless ($op eq "Preview"); } my $result = { 'custnum' => $param->{"custnum$row"},