From a59da6000c99b8fa3f391122900c44735593f544 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Fri, 29 Mar 2013 23:15:21 -0700 Subject: better detection of new locations that are the same as existing locations, #940, #13763, #14717 --- httemplate/edit/process/quick-cust_pkg.cgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'httemplate/edit/process/quick-cust_pkg.cgi') diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index 2dadbccdc..4ea4ace9e 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -143,10 +143,10 @@ if ( $quotationnum ) { my %opt = ( 'cust_pkg' => $cust_pkg ); if ( $locationnum == -1 ) { - my $cust_location = new FS::cust_location { + my $cust_location = FS::cust_location->new_or_existing({ map { $_ => scalar($cgi->param($_)) } - qw( custnum address1 address2 city county state zip country geocode ) - }; + ('custnum', FS::cust_main->location_fields) + }); $opt{'cust_location'} = $cust_location; } -- cgit v1.2.1 From 6f97b139aca5de337dd8bfaa62959eda62a1607a Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 14 Apr 2013 17:09:11 -0700 Subject: package contacts / "name per packages", RT#22185 --- httemplate/edit/process/quick-cust_pkg.cgi | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'httemplate/edit/process/quick-cust_pkg.cgi') diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index 4ea4ace9e..0cc17d36b 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -70,6 +70,9 @@ my $quantity = $1 || 1; $cgi->param('refnum') =~ /^(\d*)$/ or die 'illegal refnum '. $cgi->param('refnum'); my $refnum = $1; +$cgi->param('contactnum') =~ /^(\-?\d*)$/ + or die 'illegal contactnum '. $cgi->param('contactnum'); +my $contactnum = $1; $cgi->param('locationnum') =~ /^(\-?\d*)$/ or die 'illegal locationnum '. $cgi->param('locationnum'); my $locationnum = $1; @@ -109,6 +112,7 @@ my %hash = ( : '' ), 'refnum' => $refnum, + 'contactnum' => $contactnum, 'locationnum' => $locationnum, 'discountnum' => $discountnum, #for the create a new discount case @@ -142,6 +146,14 @@ if ( $quotationnum ) { my %opt = ( 'cust_pkg' => $cust_pkg ); + if ( $contactnum == -1 ) { + my $contact = FS::contact->new({ + 'custnum' => scalar($cgi->param('custnum')), + map { $_ => scalar($cgi->param("contactnum_$_")) } qw( first last ) + }); + $opt{'contact'} = $contact; + } + if ( $locationnum == -1 ) { my $cust_location = FS::cust_location->new_or_existing({ map { $_ => scalar($cgi->param($_)) } -- cgit v1.2.1 From 786d21e09d1f11c8976a8d45ef734d2d0a100ee7 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Sun, 5 May 2013 16:44:26 -0700 Subject: allow certain minor location edits without moving packages, #940 --- httemplate/edit/process/quick-cust_pkg.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/process/quick-cust_pkg.cgi') 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) }); -- cgit v1.2.1 From 8f8283f365995ff83040ee6b62920dd0149c1eac Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Tue, 28 May 2013 17:18:46 -0700 Subject: fix some problems with ordering packages on alt. locations, #23189, #940 --- httemplate/edit/process/quick-cust_pkg.cgi | 2 ++ 1 file changed, 2 insertions(+) (limited to 'httemplate/edit/process/quick-cust_pkg.cgi') diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index 14dbda166..fe5ee5e9e 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -160,6 +160,8 @@ if ( $quotationnum ) { ('custnum', FS::cust_main->location_fields) }); $opt{'cust_location'} = $cust_location; + } else { + $opt{'locationnum'} = $locationnum; } $error = $cust_main->order_pkg( \%opt ); -- cgit v1.2.1