projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4289a88
)
support importing customer notes by agent_custid
author
jeff
<jeff>
Mon, 23 Aug 2010 20:05:39 +0000
(20:05 +0000)
committer
jeff
<jeff>
Mon, 23 Aug 2010 20:05:39 +0000
(20:05 +0000)
httemplate/misc/cust_main_note-import.cgi
patch
|
blob
|
history
httemplate/misc/cust_main_note-import.html
patch
|
blob
|
history
httemplate/misc/process/cust_main_note-import.cgi
patch
|
blob
|
history
diff --git
a/httemplate/misc/cust_main_note-import.cgi
b/httemplate/misc/cust_main_note-import.cgi
index
b93c5c1
..
8a94ae4
100644
(file)
--- a/
httemplate/misc/cust_main_note-import.cgi
+++ b/
httemplate/misc/cust_main_note-import.cgi
@@
-108,6
+108,7
@@
% my $fh = $cgi->upload('csvfile');
% my $csv = new Text::CSV_XS;
% my $skip_fuzzies = $cgi->param('fuzzies') ? 0 : 1;
% my $fh = $cgi->upload('csvfile');
% my $csv = new Text::CSV_XS;
% my $skip_fuzzies = $cgi->param('fuzzies') ? 0 : 1;
+% my $use_agent_custid = $cgi->param('use_agent_custid') ? 1 : 0;
%
% if ( defined($fh) ) {
<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
%
% if ( defined($fh) ) {
<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
@@
-118,7
+119,7
@@
<TH>First</TH>
<TH>Note to be added</TH>
</TR>
<TH>First</TH>
<TH>Note to be added</TH>
</TR>
-% my $agentnum
=> scalar($cgi->param('agentnum')),
+% my $agentnum
= scalar($cgi->param('agentnum'));
% my $line;
% my $row = 0;
% while ( defined($line=<$fh>) ) {
% my $line;
% my $row = 0;
% while ( defined($line=<$fh>) ) {
@@
-138,7
+139,10
@@
% next unless ( $last || $first || $note );
% my @cust_main = ();
% warn "searching for: $last, $first" if ($first || $last);
% next unless ( $last || $first || $note );
% my @cust_main = ();
% warn "searching for: $last, $first" if ($first || $last);
-% if ($custnum) {
+% if ($agentnum && $custnum && $use_agent_custid) {
+% @cust_main = qsearch('cust_main', { 'agent' => $agentnum,
+% 'agent_custid' => $custnum } );
+% } elsif ($custnum) { # && !use_agent_custid
% @cust_main = qsearch('cust_main', { 'custnum' => $custnum });
% } else {
% @cust_main = FS::cust_main::smart_search(
% @cust_main = qsearch('cust_main', { 'custnum' => $custnum });
% } else {
% @cust_main = FS::cust_main::smart_search(
diff --git
a/httemplate/misc/cust_main_note-import.html
b/httemplate/misc/cust_main_note-import.html
index
d8fefa7
..
cc1645d
100644
(file)
--- a/
httemplate/misc/cust_main_note-import.html
+++ b/
httemplate/misc/cust_main_note-import.html
@@
-13,6
+13,13
@@
Anything after the character sequence #! is ignored.
<% &ntable("#cccccc") %>
<% &ntable("#cccccc") %>
+<% include('/elements/tr-select-agent.html',
+ #'curr_value' => '', #$agentnum,
+ 'label' => "<B>Agent</B>",
+ 'empty_label' => 'Select agent',
+ )
+%>
+
<TR>
<TH ALIGN="right">CSV filename</TH>
<TD><INPUT TYPE="file" NAME="csvfile"></TD>
<TR>
<TH ALIGN="right">CSV filename</TH>
<TD><INPUT TYPE="file" NAME="csvfile"></TD>
@@
-22,6
+29,11
@@
Anything after the character sequence #! is ignored.
<TD><INPUT TYPE="checkbox" NAME="fuzzies"></TD>
</TR>
<TD><INPUT TYPE="checkbox" NAME="fuzzies"></TD>
</TR>
+<TR>
+ <TH ALIGN="right">custnum is reseller's customer number</TH>
+ <TD><INPUT TYPE="checkbox" NAME="use_agent_custid"></TD>
+</TR>
+
</TABLE>
<BR><BR>
</TABLE>
<BR><BR>
diff --git
a/httemplate/misc/process/cust_main_note-import.cgi
b/httemplate/misc/process/cust_main_note-import.cgi
index
6aa8b1d
..
ec96f23
100644
(file)
--- a/
httemplate/misc/process/cust_main_note-import.cgi
+++ b/
httemplate/misc/process/cust_main_note-import.cgi
@@
-26,6
+26,7
@@
The following items <% $op eq 'Preview' ? 'would be' : 'were' %> imported. (See
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Import');
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Import');
+$FS::cust_main::import=1; # the customer records are already in the database
my $date = time;
my $otaker = $FS::CurrentUser::CurrentUser->username;
my $csv = new Text::CSV_XS;
my $date = time;
my $otaker = $FS::CurrentUser::CurrentUser->username;
my $csv = new Text::CSV_XS;