[freeside-commits] freeside/httemplate/misc/process cust_main_note-import.cgi, 1.2.2.1, 1.2.2.2

Jeff Finucane,420,, jeff at wavetail.420.am
Thu Apr 5 07:18:45 PDT 2007


Update of /home/cvs/cvsroot/freeside/httemplate/misc/process
In directory wavetail:/tmp/cvs-serv7128

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	cust_main_note-import.cgi 
Log Message:
use comments and not notes (backport)

Index: cust_main_note-import.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/process/cust_main_note-import.cgi,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -d -r1.2.2.1 -r1.2.2.2
--- cust_main_note-import.cgi	20 Mar 2007 20:21:59 -0000	1.2.2.1
+++ cust_main_note-import.cgi	5 Apr 2007 14:18:43 -0000	1.2.2.2
@@ -38,14 +38,26 @@
 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"},



More information about the freeside-commits mailing list