X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fsvc_alarm.pm;h=1714109e5dde471236a939a890d112d86a035229;hp=afb4c1db3b2fa136778f341401f67c85c13d4e59;hb=389b6f1116c3309c2ee57a6c295ed1a793503095;hpb=8a3252f9dd5f851d088142e9753289a4e7ab7934 diff --git a/FS/FS/svc_alarm.pm b/FS/FS/svc_alarm.pm index afb4c1db3..1714109e5 100644 --- a/FS/FS/svc_alarm.pm +++ b/FS/FS/svc_alarm.pm @@ -74,7 +74,7 @@ sub table_info { 'acctnum' => { label => 'Account #', %opts }, '_password' => { label => 'Password' , %opts }, 'location' => { label => 'Location', %opts }, - 'cs_receiver' => { label => 'CS Reciever #'}, + 'cs_receiver' => { label => 'CS Receiver #'}, 'cs_phonenum' => { label => 'CS Phone #' }, 'serialnum' => { label => 'Alarm Serial #' }, 'alarmsystemnum' => { label => 'Alarm System Vendor', @@ -197,13 +197,15 @@ sub check { my $x = $self->setfixed; return $x unless ref $x; + my $iso3166 = $self->cust_main->ship_location->country(); + my $error = $self->ut_numbern('svcnum') || $self->ut_text('acctnum') || $self->ut_alphan('_password') || $self->ut_textn('location') || $self->ut_numbern('cs_receiver') - || $self->ut_phonen('cs_phonenum') + || $self->ut_phonen('cs_phonenum', $iso3166) || $self->ut_alphan('serialnum') || $self->ut_foreign_key('alarmsystemnum', 'alarm_system', 'systemnum') || $self->ut_foreign_key('alarmtypenum', 'alarm_type', 'typenum') @@ -211,6 +213,10 @@ sub check { ; return $error if $error; + #really just an signed int, but to discourage storing other data (e.g. phone) + return 'CS Receiver must be 9 digits or less' + if $self->cs_receiver =~ /\d{10}/; + $self->SUPER::check; }