projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
quiet warnings about CGI::param in list context
[freeside.git]
/
httemplate
/
edit
/
process
/
cust_main.cgi
diff --git
a/httemplate/edit/process/cust_main.cgi
b/httemplate/edit/process/cust_main.cgi
index
2cb1648
..
18017fd
100755
(executable)
--- a/
httemplate/edit/process/cust_main.cgi
+++ b/
httemplate/edit/process/cust_main.cgi
@@
-15,7
+15,14
@@
%
% } else {
%
%
% } else {
%
-<% $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new->custnum) %>
+<% $cgi->redirect( -uri => popurl(3). "view/cust_main.cgi?". $new->custnum,
+ -cookie => CGI::Cookie->new(
+ -name => 'freeside_status',
+ -value => mt($freeside_status),
+ -expires => '+5m',
+ ),
+ )
+%>
%
% }
<%once>
%
% }
<%once>
@@
-37,7
+44,7
@@
my $error = '';
$cgi->param('tax','') unless defined $cgi->param('tax');
$cgi->param('tax','') unless defined $cgi->param('tax');
-$cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] );
+$cgi->param('refnum', (split(/:/, ($cgi->
multi_
param('refnum'))[0] ))[0] );
#my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') );
#push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST');
#my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') );
#push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST');
@@
-90,6
+97,11
@@
my $new = new FS::cust_main ( {
(map { ( "ship_$_", '' ) } (FS::cust_main->location_fields))
} );
(map { ( "ship_$_", '' ) } (FS::cust_main->location_fields))
} );
+# add any virtual fields to the new cust_main record
+foreach ($new->virtual_fields) {
+ $new->setfield($_, scalar($cgi->param($_)));
+}
+
warn Dumper( $new ) if $DEBUG > 1;
if ( $duplicate_of ) {
warn Dumper( $new ) if $DEBUG > 1;
if ( $duplicate_of ) {
@@
-180,7
+192,7
@@
if ( $cgi->param('residential_commercial') eq 'Residential' ) {
$error = 'Email address required';
}
$error = 'Email address required';
}
- $options{'invoicing_list'} = [ split(/
\s*,\s*
/, $email) ];
+ $options{'invoicing_list'} = [ split(/
[,\s]+
/, $email) ];
# XXX really should include the phone numbers in here also
} else {
# XXX really should include the phone numbers in here also
} else {
@@
-213,8
+225,11
@@
if ( $vendor eq 'avalara' or $vendor eq 'suretax' ) {
}
#perhaps this stuff should go to cust_main.pm
}
#perhaps this stuff should go to cust_main.pm
+my $freeside_status = '';
if ( $new->custnum eq '' or $duplicate_of ) {
if ( $new->custnum eq '' or $duplicate_of ) {
+ $freeside_status = 'Customer added';
+
my $cust_pkg = '';
my $svc;
my $cust_pkg = '';
my $svc;
@@
-336,6
+351,8
@@
if ( $new->custnum eq '' or $duplicate_of ) {
} else { #create old record object
} else { #create old record object
+ $freeside_status = 'Customer edited';
+
my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } );
$error ||= "Old record not found!" unless $old;
my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } );
$error ||= "Old record not found!" unless $old;