From: ivan Date: Tue, 17 Mar 2009 12:01:25 +0000 (+0000) Subject: agent-virt invoice_*{notes,footer,smallfooter,coupon}, RT#5025 X-Git-Tag: root_of_svc_elec_features~1368 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=4445165860112be241b1a51c50436ad0828a297a agent-virt invoice_*{notes,footer,smallfooter,coupon}, RT#5025 --- diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 8ea57304c..67ce56c6d 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -818,6 +818,7 @@ worry that config_items is freeside-specific and icky. 'section' => 'billing', 'description' => 'Notes section for HTML invoices. Defaults to the same data in invoice_latexnotes if not specified.', 'type' => 'textarea', + 'per_agent' => 1, }, { @@ -825,6 +826,7 @@ worry that config_items is freeside-specific and icky. 'section' => 'billing', 'description' => 'Footer for HTML invoices. Defaults to the same data in invoice_latexfooter if not specified.', 'type' => 'textarea', + 'per_agent' => 1, }, { @@ -846,6 +848,7 @@ worry that config_items is freeside-specific and icky. 'section' => 'billing', 'description' => 'Notes section for LaTeX typeset PostScript invoices.', 'type' => 'textarea', + 'per_agent' => 1, }, { @@ -853,6 +856,7 @@ worry that config_items is freeside-specific and icky. 'section' => 'billing', 'description' => 'Footer for LaTeX typeset PostScript invoices.', 'type' => 'textarea', + 'per_agent' => 1, }, { @@ -860,6 +864,7 @@ worry that config_items is freeside-specific and icky. 'section' => 'billing', 'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.', 'type' => 'textarea', + 'per_agent' => 1, }, { @@ -874,6 +879,7 @@ worry that config_items is freeside-specific and icky. 'section' => 'billing', 'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.', 'type' => 'textarea', + 'per_agent' => 1, }, { diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index c8384c009..6fac0a946 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -1990,15 +1990,18 @@ sub print_generic { $invoice_data{'previous_balance'} = sprintf("%.2f", $pr_total); $invoice_data{'balance'} = sprintf("%.2f", $balance_due); + my $agentnum = $self->cust_main->agentnum; + #do variable substitution in notes, footer, smallfooter foreach my $include (qw( notes footer smallfooter coupon )) { my $inc_file = $conf->key_orbase("invoice_${format}$include", $template); my @inc_src; - if ( $conf->exists($inc_file) && length( $conf->config($inc_file) ) ) { + if ( $conf->exists($inc_file, $agentnum) + && length( $conf->config($inc_file, $agentnum) ) ) { - @inc_src = $conf->config($inc_file); + @inc_src = $conf->config($inc_file, $agentnum); } else { @@ -2010,7 +2013,7 @@ sub print_generic { s/--\@\]/$delimiters{$format}[1]/g; $_; } - &$convert_map( $conf->config($inc_file) ); + &$convert_map( $conf->config($inc_file, $agentnum) ); }