[freeside-commits] freeside/httemplate/misc/process cust_main_note-import.cgi, 1.4, 1.5

Jeff Finucane,420,, jeff at wavetail.420.am
Fri Sep 24 15:07:13 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/misc/process
In directory wavetail.420.am:/tmp/cvs-serv22152/httemplate/misc/process

Modified Files:
	cust_main_note-import.cgi 
Log Message:
import to notes

Index: cust_main_note-import.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/process/cust_main_note-import.cgi,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -d -r1.4 -r1.5
--- cust_main_note-import.cgi	23 Aug 2010 20:05:39 -0000	1.4
+++ cust_main_note-import.cgi	24 Sep 2010 22:07:11 -0000	1.5
@@ -39,18 +39,11 @@
 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 $error = '';
+    if ( $param->{use_comments} ) { # why? notes are sexier
     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"})
@@ -59,6 +52,15 @@
     }else{
       $error = "Can't find customer " . $param->{"custnum$row"};
     }
+    } else {
+      my $cust_main_note = new FS::cust_main_note {
+                                            'custnum'  => $param->{"custnum$row"},
+                                            '_date'    => $date,
+                                            'otaker'   => $otaker,
+                                            'comments' => $param->{"note$row"},
+                                                  };
+      $error = $cust_main_note->insert unless ($op eq "Preview");
+    }
     my $result = { 'custnum' => $param->{"custnum$row"},
                    'last'    => $param->{"last$row"},
                    'first'   => $param->{"first$row"},



More information about the freeside-commits mailing list