diff options
author | jeff <jeff> | 2007-04-05 14:15:46 +0000 |
---|---|---|
committer | jeff <jeff> | 2007-04-05 14:15:46 +0000 |
commit | c4c93c5d5f7f048cdfdd02205d0f6f7beadcc25c (patch) | |
tree | 458aaf3e90d3ff1b201cd0faa1a3b455dfe646df /httemplate/misc/process/cust_main_note-import.cgi | |
parent | f3c4bc88460be7576d81b9ca234b421950f48c01 (diff) |
use comments and not notes
Diffstat (limited to 'httemplate/misc/process/cust_main_note-import.cgi')
-rw-r--r-- | httemplate/misc/process/cust_main_note-import.cgi | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/httemplate/misc/process/cust_main_note-import.cgi b/httemplate/misc/process/cust_main_note-import.cgi index efc6224d0..6aa8b1d37 100644 --- a/httemplate/misc/process/cust_main_note-import.cgi +++ b/httemplate/misc/process/cust_main_note-import.cgi @@ -38,14 +38,26 @@ my @inserted = (); my @uninserted = (); for ( my $row = 0; exists($param->{"custnum$row"}); $row++ ) { if ( $param->{"custnum$row"} ) { - my $cust_main_note = new FS::cust_main_note { - 'custnum' => $param->{"custnum$row"}, - '_date' => $date, - 'otaker' => $otaker, - 'comments' => $param->{"note$row"}, - }; - my $error = ''; - $error = $cust_main_note->insert unless ($op eq "Preview"); +# my $cust_main_note = new FS::cust_main_note { +# 'custnum' => $param->{"custnum$row"}, +# '_date' => $date, +# 'otaker' => $otaker, +# 'comments' => $param->{"note$row"}, +# }; +# my $error = ''; +# $error = $cust_main_note->insert unless ($op eq "Preview"); + my $cust_main = qsearchs('cust_main', + { 'custnum' => $param->{"custnum$row"} } + ); + my $error; + if ($cust_main) { + $cust_main->comments + ? $cust_main->comments($cust_main->comments. " ". $param->{"note$row"}) + : $cust_main->comments($param->{"note$row"}); + $error = $cust_main->replace; + }else{ + $error = "Can't find customer " . $param->{"custnum$row"}; + } my $result = { 'custnum' => $param->{"custnum$row"}, 'last' => $param->{"last$row"}, 'first' => $param->{"first$row"}, |