From 54db570dc261f7cde343fa78ef92855f6d576570 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 10 Oct 2013 22:51:41 -0700 Subject: [PATCH] add billco-account_num option, RT#22934 --- FS/FS/Conf.pm | 14 +++++++++++++- FS/FS/cust_bill.pm | 9 ++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 16bbaad60..dd4cd6869 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -935,7 +935,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 -- 2.11.0