projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
080406e
)
better error message for no location_kind
author
ivan
<ivan>
Sun, 13 Mar 2011 03:49:25 +0000
(
03:49
+0000)
committer
ivan
<ivan>
Sun, 13 Mar 2011 03:49:25 +0000
(
03:49
+0000)
FS/FS/cust_location.pm
patch
|
blob
|
history
FS/FS/part_export/ikano.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_location.pm
b/FS/FS/cust_location.pm
index
60c0181
..
7d0ce1c
100644
(file)
--- a/
FS/FS/cust_location.pm
+++ b/
FS/FS/cust_location.pm
@@
-5,6
+5,7
@@
use base qw( FS::geocode_Mixin FS::Record );
use Locale::Country;
use FS::UID qw( dbh );
use FS::Record qw( qsearch ); #qsearchs );
use Locale::Country;
use FS::UID qw( dbh );
use FS::Record qw( qsearch ); #qsearchs );
+use FS::Conf;
use FS::prospect_main;
use FS::cust_main;
use FS::cust_main_county;
use FS::prospect_main;
use FS::cust_main;
use FS::cust_main_county;
@@
-134,6
+135,9
@@
sub check {
|| $self->ut_textn('state')
|| $self->ut_country('country')
|| $self->ut_zip('zip', $self->country)
|| $self->ut_textn('state')
|| $self->ut_country('country')
|| $self->ut_zip('zip', $self->country)
+ || $self->ut_alphan('location_type')
+ || $self->ut_textn('location_number')
+ || $self->ut_enum('location_kind', [ '', 'R', 'B' ] )
|| $self->ut_alphan('geocode')
;
return $error if $error;
|| $self->ut_alphan('geocode')
;
return $error if $error;
@@
-141,6
+145,12
@@
sub check {
return "No prospect or customer!" unless $self->prospectnum || $self->custnum;
return "Prospect and customer!" if $self->prospectnum && $self->custnum;
return "No prospect or customer!" unless $self->prospectnum || $self->custnum;
return "Prospect and customer!" if $self->prospectnum && $self->custnum;
+ my $conf = new FS::Conf;
+ return 'Location kind is required'
+ if $self->prospectnum
+ && $conf->exists('prospect_main-alt_address_format')
+ && ! $self->location_kind;
+
unless ( qsearch('cust_main_county', {
'country' => $self->country,
'state' => '',
unless ( qsearch('cust_main_county', {
'country' => $self->country,
'state' => '',
diff --git
a/FS/FS/part_export/ikano.pm
b/FS/FS/part_export/ikano.pm
index
63b0ed3
..
153b4a6
100644
(file)
--- a/
FS/FS/part_export/ikano.pm
+++ b/
FS/FS/part_export/ikano.pm
@@
-280,6
+280,8
@@
sub qual {
my %location_hash = $qual->location_hash;
return 'No address provided' unless keys %location_hash;
my %location_hash = $qual->location_hash;
return 'No address provided' unless keys %location_hash;
+ return 'Location kind is required' unless $location_hash{location_kind};
+
my $svctn = $qual->phonenum;
my $result = $self->ikano_command('PREQUAL',
my $svctn = $qual->phonenum;
my $result = $self->ikano_command('PREQUAL',