From 569c8e243c450b46cc4d28d513a4e83d6128d03c Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 1 Nov 2016 16:21:00 -0700 Subject: fix adding a new location on a quotation, RT#73236 --- httemplate/edit/process/quick-cust_pkg.cgi | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'httemplate') diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index da5afe440..6a346e0be 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -189,7 +189,18 @@ if ( $quotationnum ) { ) : (); - #XXX handle new location + if ( $locationnum == -1 ) { + my $cust_location = FS::cust_location->new({ + 'custnum' => $custnum, + 'prospectnum' => $prospectnum, + map { $_ => scalar($cgi->param($_)) } + FS::cust_main->location_fields + }); + $opt{'cust_location'} = $cust_location; + } else { + $opt{'locationnum'} = $locationnum; + } + $error = $quotation_pkg->insert(%opt); } else { -- cgit v1.2.1