[freeside-commits] branch master updated. c70ef4f4ec2a61b32c7e6aee40b3130cfd4381e5
Mark Wells
mark at 420.am
Tue Mar 10 13:10:13 PDT 2015
The branch, master has been updated
via c70ef4f4ec2a61b32c7e6aee40b3130cfd4381e5 (commit)
from c2e5e744cf218f9a388bc3073bfe5d9cc86b5ff3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c70ef4f4ec2a61b32c7e6aee40b3130cfd4381e5
Author: Mark Wells <mark at freeside.biz>
Date: Tue Mar 10 13:10:07 2015 -0700
correctly choose a default locationnum for prospects, #32489, #25343
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index fce1a3f..a5fb557 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -3026,7 +3026,10 @@ sub _items_cust_bill_pkg {
}) || $cust_main;
$default_locationnum = $h_cust_main->ship_locationnum;
} elsif ( $self->prospectnum ) {
- $default_locationnum = $self->prospect_main->cust_location->locationnum;
+ my $cust_location = qsearchs('cust_location',
+ { prospectnum => $self->prospectnum,
+ disabled => '' });
+ $default_locationnum = $cust_location->locationnum if $cust_location;
}
my @b = (); # accumulator for the line item hashes that we'll return
diff --git a/FS/FS/quotation_pkg.pm b/FS/FS/quotation_pkg.pm
index dae459e..dcd68c9 100644
--- a/FS/FS/quotation_pkg.pm
+++ b/FS/FS/quotation_pkg.pm
@@ -199,7 +199,11 @@ sub check {
if ($quotation->custnum) {
$self->set('locationnum', $quotation->cust_main->ship_locationnum);
} elsif ($quotation->prospectnum) {
- $self->set('locationnum', $quotation->prospect_main->locationnum);
+ # use the first non-disabled location for that prospect
+ my $cust_location = qsearchs('cust_location',
+ { prospectnum => $quotation->prospectnum,
+ disabled => '' });
+ $self->set('locationnum', $cust_location->locationnum) if $cust_location;
} # else the quotation is invalid
}
-----------------------------------------------------------------------
Summary of changes:
FS/FS/Template_Mixin.pm | 5 ++++-
FS/FS/quotation_pkg.pm | 6 +++++-
2 files changed, 9 insertions(+), 2 deletions(-)
More information about the freeside-commits
mailing list