diff options
author | Ivan Kohler <ivan@freeside.biz> | 2016-11-18 14:35:22 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2016-11-18 14:35:22 -0800 |
commit | f1675daf6b326dfedf0cab80d9c9683a0db5c820 (patch) | |
tree | beb44316bfa8f4aa786526747af1316e3ab88bca /httemplate/misc/process | |
parent | 2f8878cdc7df9966574d8e304c0513fc39c35c61 (diff) |
notes import with class, RT#73455
Diffstat (limited to 'httemplate/misc/process')
-rw-r--r-- | httemplate/misc/process/cust_main_note-import.cgi | 22 |
1 files changed, 16 insertions, 6 deletions
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"}, |