summaryrefslogtreecommitdiff
path: root/FS/FS/qual.pm
diff options
context:
space:
mode:
authorlevinse <levinse>2010-12-01 05:56:10 +0000
committerlevinse <levinse>2010-12-01 05:56:10 +0000
commitad17d8651adb39fdef45f509490a6b2c6eac8301 (patch)
tree870832dd91871a0356b044f840d364df416150a6 /FS/FS/qual.pm
parentb638e75f063e231edaf3f3859d27f3981c12c999 (diff)
-ikano, svc_dsl, dsl_note, and qual on-going implementation, RT7111
-add predelete_hook_first and predelete_hook into svc_Common (don't use yet, might change or be removed soon) -add new cust_location fields into geocode_Mixin location_hash
Diffstat (limited to 'FS/FS/qual.pm')
-rw-r--r--FS/FS/qual.pm37
1 files changed, 24 insertions, 13 deletions
diff --git a/FS/FS/qual.pm b/FS/FS/qual.pm
index de06334..553de13 100644
--- a/FS/FS/qual.pm
+++ b/FS/FS/qual.pm
@@ -38,10 +38,6 @@ FS::Record. The following fields are currently supported:
=item locationnum
-Either one of these cases must be true:
--locationnum is non-null and prospectnum is null and custnum is null
--locationnum is null and (prospectnum is non-null or custnum is non-null, but not both non-null)
-
=item phonenum - Service Telephone Number
=item exportnum - export instance providing service-qualification capabilities,
@@ -117,25 +113,40 @@ sub check {
|| $self->ut_foreign_keyn('prospectnum', 'prospect_main', 'prospectnum')
|| $self->ut_foreign_keyn('locationnum', 'cust_location', 'locationnum')
|| $self->ut_numbern('phonenum')
- || $self->ut_foreign_key('exportnum', 'part_export', 'exportnum')
+ || $self->ut_foreign_keyn('exportnum', 'part_export', 'exportnum')
|| $self->ut_textn('vendor_qual_id')
|| $self->ut_alpha('status')
;
return $error if $error;
-#Either one of these cases must be true:
-#1. locationnum is non-null and prospectnum is null and custnum is null
-#2. locationnum is null and (prospectnum is non-null or custnum is non-null, but not both non-null)
- return "Invalid prospect/customer/location combination" unless (
- ( $self->locationnum && !$self->prospectcnum && !$self->custnum ) #1
- ||
- ( !$self->locationnum && ( $self->prospectnum || $self->custnum )
- && !( $self->custnum && $self->prospectnum ) ) #2
+ return "Invalid prospect/customer/location combination" if (
+ ( $self->locationnum && $self->prospectnum && $self->custnum ) ||
+ ( !$self->locationnum && !$self->prospectnum && !$self->custnum )
);
$self->SUPER::check;
}
+sub location {
+ my $self = shift;
+ if ( $self->locationnum ) {
+ my $l = qsearchs( 'cust_location',
+ { 'locationnum' => $self->locationnum });
+ return $l->location_hash if $l;
+ }
+ if ( $self->custnum ) {
+ my $c = qsearchs( 'cust_main', { 'custnum' => $self->custnum });
+ return $c->location_hash if $c;
+ }
+ # prospectnum does not imply any particular address! must specify locationnum
+
+ '';
+}
+
+sub status_long {
+
+}
+
=back
=head1 SEE ALSO