X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=2a8f47b605e69e1b016237436d7f97fbc3af145e;hb=b79a8cb932946c849328a3c117c35821d9d21e66;hp=97b117285535e5aa95d181a47e16162e2456c118;hpb=5fdd19665fb7c0ad425a99d3dbf9ad7e27fbf44a;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 97b117285..2a8f47b60 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -68,6 +68,7 @@ use FS::banned_pay; use FS::cust_main_note; use FS::cust_attachment; use FS::contact; +use FS::Locales; # 1 is mostly method/subroutine entry and options # 2 traces progress of some operations @@ -210,6 +211,10 @@ phone (optional) phone (optional) +=item mobile + +phone (optional) + =item ship_first Shipping first name @@ -256,6 +261,10 @@ phone (optional) phone (optional) +=item ship_mobile + +phone (optional) + =item payby Payment Type (See L for valid payby values) @@ -328,6 +337,10 @@ Discourage individual CDR printing, empty or `Y' Allow self-service editing of ticket subjects, empty or 'Y' +=item calling_list_exempt + +Do not call, empty or 'Y' + =back =head1 METHODS @@ -1692,6 +1705,8 @@ sub check { || $self->ut_floatn('credit_limit') || $self->ut_numbern('billday') || $self->ut_enum('edit_subject', [ '', 'Y' ] ) + || $self->ut_enum('calling_list_exempt', [ '', 'Y' ] ) + || $self->ut_enum('locale', [ '', FS::Locales->locales ]) ; #barf. need message catalogs. i18n. etc. @@ -1745,9 +1760,10 @@ sub check { } $error = - $self->ut_phonen('daytime', $self->country) - || $self->ut_phonen('night', $self->country) - || $self->ut_phonen('fax', $self->country) + $self->ut_phonen('daytime', $self->country) + || $self->ut_phonen('night', $self->country) + || $self->ut_phonen('fax', $self->country) + || $self->ut_phonen('mobile', $self->country) ; return $error if $error; @@ -1757,7 +1773,7 @@ sub check { } if ( $conf->exists('cust_main-require_phone') - && ! length($self->daytime) && ! length($self->night) + && ! length($self->daytime) && ! length($self->night) && ! length($self->mobile) ) { my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/ @@ -1766,8 +1782,12 @@ sub check { my $night_label = FS::Msgcat::_gettext('night') =~ /^(night)?$/ ? 'Night Phone' : FS::Msgcat::_gettext('night'); - - return "$daytime_label or $night_label is required" + + my $mobile_label = FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/ + ? 'Mobile Phone' + : FS::Msgcat::_gettext('mobile'); + + return "$daytime_label, $night_label or $mobile_label is required" } @@ -1805,9 +1825,10 @@ sub check { #eofalse $error = - $self->ut_phonen('ship_daytime', $self->ship_country) - || $self->ut_phonen('ship_night', $self->ship_country) - || $self->ut_phonen('ship_fax', $self->ship_country) + $self->ut_phonen('ship_daytime', $self->ship_country) + || $self->ut_phonen('ship_night', $self->ship_country) + || $self->ut_phonen('ship_fax', $self->ship_country) + || $self->ut_phonen('ship_mobile', $self->ship_country) ; return $error if $error; @@ -1933,8 +1954,7 @@ sub check { if ( $conf->exists('cust_main-require-bank-branch') ) { $payinfo =~ /^(\d+)\@(\d+)\.(\d+)$/ or return 'invalid echeck account@branch.bank'; $payinfo = "$1\@$2.$3"; - } - elsif ( $conf->exists('echeck-nonus') ) { + } elsif ( $conf->exists('echeck-nonus') ) { $payinfo =~ /^(\d+)\@(\d+)$/ or return 'invalid echeck account@aba'; $payinfo = "$1\@$2"; } else { @@ -2058,7 +2078,7 @@ Returns a list of fields which have ship_ duplicates. sub addr_fields { qw( last first company address1 address2 city county state zip country - daytime night fax + daytime night fax mobile ); } @@ -2461,6 +2481,7 @@ sub batch_card { 'status' => 'O', 'payby' => FS::payby->payby2payment($payby), ); + $pay_batch{agentnum} = $self->agentnum if $conf->exists('batch-spoolagent'); my $pay_batch = qsearchs( 'pay_batch', \%pay_batch );