summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-10-10 22:51:42 -0700
committerIvan Kohler <ivan@freeside.biz>2013-10-10 22:51:42 -0700
commit044e3bcb6bbe6d011116b4a0cfa49023e6c391f0 (patch)
tree9a711ee8d5b67376c65dd3c6dd3373ed3a6e57ac
parent49d620491ee0004274c066156748d41bae7e2b3d (diff)
add billco-account_num option, RT#22934
-rw-r--r--FS/FS/Conf.pm14
-rw-r--r--FS/FS/cust_bill.pm9
2 files changed, 21 insertions, 2 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 39a19ad49..0d8d3bef1 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -934,7 +934,19 @@ sub reason_type_options {
'type' => 'text',
'per_agent' => 1,
},
-
+
+ {
+ 'key' => 'billco-account_num',
+ 'section' => 'billing',
+ 'description' => 'The data to place in the "Transaction Account No" / "TRACCTNUM" field.',
+ 'type' => 'select',
+ 'select_hash' => [
+ 'invnum-date' => 'Invoice number - Date (default)',
+ 'display_custnum' => 'Customer number',
+ ],
+ 'per_agent' => 1,
+ },
+
{
'key' => 'next-bill-ignore-time',
'section' => 'billing',
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index a747a782d..a61adde45 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -1972,6 +1972,13 @@ sub print_csv {
if ( $format eq 'billco' ) {
+ my $account_num =
+ $self->conf->config('billco-account_num', $cust_main->agentnum);
+
+ my $tracctnum = $account_num eq 'display_custnum'
+ ? $cust_main->display_custnum
+ : $opt{'tracctnum'};
+
my $taxtotal = 0;
$taxtotal += $_->{'amount'} foreach $self->_items_tax;
@@ -1988,7 +1995,7 @@ sub print_csv {
$csv->combine(
'', # 1 | N/A-Leave Empty CHAR 2
'', # 2 | N/A-Leave Empty CHAR 15
- $opt{'tracctnum'}, # 3 | Transaction Account No CHAR 15
+ $tracctnum, # 3 | Transaction Account No CHAR 15
$self->invnum, # 4 | Transaction Invoice No CHAR 15
$cust_main->zip, # 5 | Transaction Zip Code CHAR 5
$cust_main->company, # 6 | Transaction Company Bill To CHAR 30