[freeside-commits] freeside/FS/FS Conf.pm, 1.180.2.25, 1.180.2.26 cust_bill.pm, 1.163.2.27, 1.163.2.28
Jeff Finucane,420,,
jeff at wavetail.420.am
Mon Jun 2 04:17:23 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv1178/FS/FS
Modified Files:
Tag: FREESIDE_1_7_BRANCH
Conf.pm cust_bill.pm
Log Message:
typeset tear-off remittance coupon
Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.180.2.25
retrieving revision 1.180.2.26
diff -u -d -r1.180.2.25 -r1.180.2.26
--- Conf.pm 19 May 2008 18:51:01 -0000 1.180.2.25
+++ Conf.pm 2 Jun 2008 11:17:19 -0000 1.180.2.26
@@ -698,6 +698,13 @@
},
{
+ 'key' => 'invoice_latexcoupon',
+ 'section' => 'billing',
+ 'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
+ 'type' => 'textarea',
+ },
+
+ {
'key' => 'invoice_latexreturnaddress',
'section' => 'billing',
'description' => 'Return address for LaTeX typeset PostScript invoices.',
Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.163.2.27
retrieving revision 1.163.2.28
diff -u -d -r1.163.2.27 -r1.163.2.28
--- cust_bill.pm 2 Jun 2008 02:16:20 -0000 1.163.2.27
+++ cust_bill.pm 2 Jun 2008 11:17:20 -0000 1.163.2.28
@@ -1810,6 +1810,7 @@
'terms' => $conf->config('invoice_default_terms') || 'Payable upon receipt',
#'notes' => join("\n", $conf->config('invoice_latexnotes') ),
'conf_dir' => "$FS::UID::conf_dir/conf.$FS::UID::datasrc",
+ 'balance' => $balance_due,
);
my $countrydefault = $conf->config('countrydefault') || 'US';
@@ -1828,6 +1829,28 @@
warn "invoice notes: ". $invoice_data{'notes'}. "\n"
if $DEBUG;
+ #do variable substitution in coupon
+ foreach my $include (qw( coupon )) {
+
+ my @inc_src = $conf->config_orbase("invoice_latex$include", $template);
+
+ my $inc_tt = new Text::Template (
+ TYPE => 'ARRAY',
+ SOURCE => [ map "$_\n", @inc_src ],
+ DELIMITERS => [ '[@--', '--@]' ],
+ ) or die "Can't create new Text::Template object: $Text::Template::ERROR";
+
+ unless ( $inc_tt->compile() ) {
+ my $error = "Can't compile $include template: $Text::Template::ERROR\n";
+ warn $error. "Template:\n". join('', map "$_\n", @inc_src);
+ die $error;
+ }
+
+ $invoice_data{$include} = $inc_tt->fill_in( HASH => \%invoice_data );
+
+ $invoice_data{$include} =~ s/\n+$//
+ }
+
$invoice_data{'footer'} =~ s/\n+$//;
$invoice_data{'smallfooter'} =~ s/\n+$//;
$invoice_data{'notes'} =~ s/\n+$//;
More information about the freeside-commits
mailing list