summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-05-05 16:44:26 -0700
committerMark Wells <mark@freeside.biz>2013-05-05 16:44:45 -0700
commit786d21e09d1f11c8976a8d45ef734d2d0a100ee7 (patch)
tree1fea237df00454bceada22b02e703492f1b2459d /httemplate/edit
parent1daf1a670d3cdfb307271fb7c7c98c83fb1fb464 (diff)
allow certain minor location edits without moving packages, #940
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/process/change-cust_pkg.html2
-rw-r--r--httemplate/edit/process/cust_location.cgi6
-rwxr-xr-xhttemplate/edit/process/cust_main.cgi4
-rw-r--r--httemplate/edit/process/quick-cust_pkg.cgi2
-rw-r--r--httemplate/edit/process/svc_phone.html2
5 files changed, 8 insertions, 8 deletions
diff --git a/httemplate/edit/process/change-cust_pkg.html b/httemplate/edit/process/change-cust_pkg.html
index 77f261d56..c893f13a2 100644
--- a/httemplate/edit/process/change-cust_pkg.html
+++ b/httemplate/edit/process/change-cust_pkg.html
@@ -32,7 +32,7 @@ my %change = map { $_ => scalar($cgi->param($_)) }
$change{'keep_dates'} = 1;
if ( $cgi->param('locationnum') == -1 ) {
- my $cust_location = FS::cust_location->new_or_existing({
+ my $cust_location = FS::cust_location->new({
'custnum' => $cust_pkg->custnum,
map { $_ => scalar($cgi->param($_)) }
qw( address1 address2 city county state zip country )
diff --git a/httemplate/edit/process/cust_location.cgi b/httemplate/edit/process/cust_location.cgi
index 56c3968f6..fd1b8740e 100644
--- a/httemplate/edit/process/cust_location.cgi
+++ b/httemplate/edit/process/cust_location.cgi
@@ -28,12 +28,12 @@ my $cust_location = qsearchs({
});
die "unknown locationnum $locationnum" unless $cust_location;
-my $new = FS::cust_location->new_or_existing({
+my $new = FS::cust_location->new({
custnum => $cust_location->custnum,
prospectnum => $cust_location->prospectnum,
map { $_ => scalar($cgi->param($_)) } FS::cust_main->location_fields
});
-
-my $error = $cust_location->move_to($new);
+my $error = $new->find_or_insert;
+$error ||= $cust_location->move_to($new);
</%init>
diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi
index c1f815550..d295ed317 100755
--- a/httemplate/edit/process/cust_main.cgi
+++ b/httemplate/edit/process/cust_main.cgi
@@ -11,7 +11,7 @@
<%once>
my $me = '[edit/process/cust_main.cgi]';
-my $DEBUG = 0;
+my $DEBUG = 1;
</%once>
<%init>
@@ -83,7 +83,7 @@ for my $pre (qw(bill ship)) {
}
$hash{'custnum'} = $cgi->param('custnum');
warn Dumper \%hash if $DEBUG;
- $locations{$pre} = FS::cust_location->new_or_existing(\%hash);
+ $locations{$pre} = FS::cust_location->new(\%hash);
}
if ( ($cgi->param('same') || '') eq 'Y' ) {
diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi
index 0cc17d36b..14dbda166 100644
--- a/httemplate/edit/process/quick-cust_pkg.cgi
+++ b/httemplate/edit/process/quick-cust_pkg.cgi
@@ -155,7 +155,7 @@ if ( $quotationnum ) {
}
if ( $locationnum == -1 ) {
- my $cust_location = FS::cust_location->new_or_existing({
+ my $cust_location = FS::cust_location->new({
map { $_ => scalar($cgi->param($_)) }
('custnum', FS::cust_main->location_fields)
});
diff --git a/httemplate/edit/process/svc_phone.html b/httemplate/edit/process/svc_phone.html
index 9983ea2cb..09398fdfb 100644
--- a/httemplate/edit/process/svc_phone.html
+++ b/httemplate/edit/process/svc_phone.html
@@ -40,7 +40,7 @@ my $args_callback = sub {
my %opt = ();
if ( $cgi->param('locationnum') == -1 ) {
- my $cust_location = FS::cust_location->new_or_existing({
+ my $cust_location = FS::cust_location->new({
map { $_ => scalar($cgi->param($_)) }
qw( custnum address1 address2 city county state zip country )
});