diff options
| author | ivan <ivan> | 2011-10-21 23:09:03 +0000 |
|---|---|---|
| committer | ivan <ivan> | 2011-10-21 23:09:03 +0000 |
| commit | 5d20de9563b173877e6419934f2b63332da2dc49 (patch) | |
| tree | 83a163a99da8327ea8352bc98365ef7caabc0c96 /FS/FS | |
| parent | 2676cd11f3793fe5efe8b431c21eb952b3cb7a77 (diff) | |
agent-virt batches and batchconfig-eftcanada config (argh!), RT#14859
Diffstat (limited to 'FS/FS')
| -rw-r--r-- | FS/FS/Conf.pm | 8 | ||||
| -rw-r--r-- | FS/FS/Schema.pm | 14 | ||||
| -rw-r--r-- | FS/FS/cust_main.pm | 1 | ||||
| -rw-r--r-- | FS/FS/pay_batch.pm | 6 |
4 files changed, 21 insertions, 8 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index bee177052..590a5c3ec 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -3253,6 +3253,14 @@ and customer address. Include units.', 'section' => 'billing', 'description' => 'Configuration for EFT Canada batching, four lines: 1. SFTP username, 2. SFTP password, 3. Transaction code, 4. Number of days to delay process date.', 'type' => 'textarea', + 'per_agent' => 1, + }, + + { + 'key' => 'batch-spoolagent', + 'section' => 'billing', + 'description' => 'Store payment batches per-agent.', + 'type' => 'checkbox', }, { diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index f76fa61ea..316db6fb2 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1382,19 +1382,19 @@ sub tables_hashref { 'pay_batch' => { #batches of payments to an external processor 'columns' => [ - 'batchnum', 'serial', '', '', '', '', - 'payby', 'char', '', 4, '', '', # CARD/CHEK - 'status', 'char', 'NULL', 1, '', '', - 'download', @date_type, '', '', - 'upload', @date_type, '', '', + 'batchnum', 'serial', '', '', '', '', + 'agentnum', 'int', 'NULL', '', '', '', + 'payby', 'char', '', 4, '', '', # CARD/CHEK + 'status', 'char', 'NULL', 1, '', '', + 'download', @date_type, '', '', + 'upload', @date_type, '', '', ], 'primary_key' => 'batchnum', 'unique' => [], 'index' => [], }, - 'cust_pay_batch' => { #what's this used for again? list of customers - #in current CARD batch? (necessarily CARD?) + 'cust_pay_batch' => { #list of customers in current CARD/CHEK batch 'columns' => [ 'paybatchnum', 'serial', '', '', '', '', 'batchnum', 'int', '', '', '', '', diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 49702f6f5..2a8f47b60 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2481,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 ); diff --git a/FS/FS/pay_batch.pm b/FS/FS/pay_batch.pm index 90b4eb8eb..bde8fdbf7 100644 --- a/FS/FS/pay_batch.pm +++ b/FS/FS/pay_batch.pm @@ -5,8 +5,9 @@ use vars qw( @ISA $DEBUG %import_info %export_info $conf ); use Time::Local; use Text::CSV_XS; use FS::Record qw( dbh qsearch qsearchs ); -use FS::cust_pay; use FS::Conf; +use FS::cust_pay; +use FS::agent; use Date::Parse qw(str2time); use Business::CreditCard qw(cardtype); @@ -40,6 +41,8 @@ from FS::Record. The following fields are currently supported: =item batchnum - primary key +=item agentnum - optional agent number for agent batches + =item payby - CARD or CHEK =item status - O (Open), I (In-transit), or R (Resolved) @@ -112,6 +115,7 @@ sub check { $self->ut_numbern('batchnum') || $self->ut_enum('payby', [ 'CARD', 'CHEK' ]) || $self->ut_enum('status', [ 'O', 'I', 'R' ]) + || $self->ut_foreign_keyn('agentnum', 'agent', 'agentnum') ; return $error if $error; |
