[freeside-commits] branch FREESIDE_3_BRANCH updated. edae5c0f10d80ecd8d45c04c51e3ca698e4a7a99
Mark Wells
mark at 420.am
Tue Mar 10 13:10:12 PDT 2015
The branch, FREESIDE_3_BRANCH has been updated
via edae5c0f10d80ecd8d45c04c51e3ca698e4a7a99 (commit)
from 93b55cfdc07c1c29e9b42e801713f6595eaf071f (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 edae5c0f10d80ecd8d45c04c51e3ca698e4a7a99
Author: Mark Wells <mark at freeside.biz>
Date: Tue Mar 10 13:09:51 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 4a0834e..6557367 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -3027,7 +3027,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 342e9bb..d5c02e1 100644
--- a/FS/FS/quotation_pkg.pm
+++ b/FS/FS/quotation_pkg.pm
@@ -201,7 +201,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