From: ivan Date: Mon, 21 Feb 2011 01:21:44 +0000 (+0000) Subject: add agent_pkgid X-Git-Tag: freeside_2_1_2~38 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=6178a15b24780f425a6bcad8a5e7679956558207 add agent_pkgid --- diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 42153bff6..bae2ab7f8 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1326,11 +1326,12 @@ sub tables_hashref { 'manual_flag', 'char', 'NULL', 1, '', '', 'no_auto', 'char', 'NULL', 1, '', '', 'quantity', 'int', 'NULL', '', '', '', + 'agent_pkgid', 'int', 'NULL', '', '', '', ], 'primary_key' => 'pkgnum', 'unique' => [], 'index' => [ ['custnum'], ['pkgpart'], [ 'pkgbatch' ], [ 'locationnum' ], - [ 'usernum' ], + [ 'usernum' ], [ 'agent_pkgid' ], [ 'start_date' ], ['setup'], ['last_bill'], ['bill'], ['susp'], ['adjourn'], ['expire'], ['cancel'], ['change_date'], ['order_date'], diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index fcfd7e956..968441d03 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -594,6 +594,7 @@ sub check { || $self->ut_numbern('adjourn') || $self->ut_numbern('expire') || $self->ut_enum('no_auto', [ '', 'Y' ]) + || $self->ut_numbern('agent_pkgid') ; return $error if $error; diff --git a/FS/FS/cust_pkg/Import.pm b/FS/FS/cust_pkg/Import.pm index 9c93677a7..fe69f82fd 100644 --- a/FS/FS/cust_pkg/Import.pm +++ b/FS/FS/cust_pkg/Import.pm @@ -170,8 +170,9 @@ sub batch_import { my $format = delete $opt->{'format'}; my @fields = (); - if ( $format =~ /^(.*)-agent_custid$/ ) { + if ( $format =~ /^(.*)-agent_custid(-agent_pkgid)?$/ ) { $format = $1; + my $agent_pkgid = $2; @fields = ( sub { my( $self, $value ) = @_; # $conf, $param @@ -182,6 +183,7 @@ sub batch_import { $self->custnum($cust_main->custnum) if $cust_main; }, ); + push @fields, 'agent_pkgid' if $agent_pkgid; } else { @fields = ( 'custnum' ); }