Presto! Now you can consider all numbers to be shillings.
If you need to change the currency symbol, you can hunt down the
instances of literal '$' in FS::cust_bill::print_text and replace them
with your currency symbol. I guess this should turn into a
configuration value.
package FS::cust_bill;
use strict;
package FS::cust_bill;
use strict;
-use vars qw( @ISA $conf $invoice_template );
+use vars qw( @ISA $conf $invoice_template $money_char );
use vars qw( $invoice_lines @buf ); #yuck
use Date::Format;
use Text::Template;
use vars qw( $invoice_lines @buf ); #yuck
use Date::Format;
use Text::Template;
#ask FS::UID to run this stuff for us later
$FS::UID::callback{'FS::cust_bill'} = sub {
#ask FS::UID to run this stuff for us later
$FS::UID::callback{'FS::cust_bill'} = sub {
+
+ $money_char = $conf->config('money_char') || '$';
+
my @invoice_template = $conf->config('invoice_template')
or die "cannot load config file invoice_template";
$invoice_lines = 0;
my @invoice_template = $conf->config('invoice_template')
or die "cannot load config file invoice_template";
$invoice_lines = 0;
push @buf, [
"Previous Balance, Invoice #". $_->invnum.
" (". time2str("%x",$_->_date). ")",
push @buf, [
"Previous Balance, Invoice #". $_->invnum.
" (". time2str("%x",$_->_date). ")",
- '$'. sprintf("%10.2f",$_->owed)
+ $money_char. sprintf("%10.2f",$_->owed)
];
}
if (@pr_cust_bill) {
push @buf,['','-----------'];
];
}
if (@pr_cust_bill) {
push @buf,['','-----------'];
- push @buf,['Total Previous Balance','$' . sprintf("%10.2f",$pr_total ) ];
+ push @buf,[ 'Total Previous Balance',
+ $money_char. sprintf("%10.2f",$pr_total ) ];
my($pkg)=$part_pkg->pkg;
if ( $_->setup != 0 ) {
my($pkg)=$part_pkg->pkg;
if ( $_->setup != 0 ) {
- push @buf, [ "$pkg Setup",'$' . sprintf("%10.2f",$_->setup) ];
+ push @buf, [ "$pkg Setup", $money_char. sprintf("%10.2f",$_->setup) ];
push @buf,
map { [ " ". $_->[0]. ": ". $_->[1], '' ] } $cust_pkg->labels;
}
push @buf,
map { [ " ". $_->[0]. ": ". $_->[1], '' ] } $cust_pkg->labels;
}
push @buf, [
"$pkg (" . time2str("%x",$_->sdate) . " - " .
time2str("%x",$_->edate) . ")",
push @buf, [
"$pkg (" . time2str("%x",$_->sdate) . " - " .
time2str("%x",$_->edate) . ")",
- '$' . sprintf("%10.2f",$_->recur)
+ $money_char. sprintf("%10.2f",$_->recur)
];
push @buf,
map { [ " ". $_->[0]. ": ". $_->[1], '' ] } $cust_pkg->labels;
}
} else { #pkgnum Tax
];
push @buf,
map { [ " ". $_->[0]. ": ". $_->[1], '' ] } $cust_pkg->labels;
}
} else { #pkgnum Tax
- push @buf,["Tax",'$' . sprintf("%10.2f",$_->setup) ]
+ push @buf,["Tax", $money_char. sprintf("%10.2f",$_->setup) ]
if $_->setup != 0;
}
}
push @buf,['','-----------'];
push @buf,['Total New Charges',
if $_->setup != 0;
}
}
push @buf,['','-----------'];
push @buf,['Total New Charges',
- '$' . sprintf("%10.2f",$self->charged) ];
+ $money_char. sprintf("%10.2f",$self->charged) ];
push @buf,['',''];
push @buf,['','-----------'];
push @buf,['Total Charges',
push @buf,['',''];
push @buf,['','-----------'];
push @buf,['Total Charges',
- '$' . sprintf("%10.2f",$self->charged + $pr_total) ];
+ $money_char. sprintf("%10.2f",$self->charged + $pr_total) ];
push @buf,['',''];
#credits
foreach ( @cr_cust_credit ) {
push @buf,[
"Credit #". $_->crednum. " (" . time2str("%x",$_->_date) .")",
push @buf,['',''];
#credits
foreach ( @cr_cust_credit ) {
push @buf,[
"Credit #". $_->crednum. " (" . time2str("%x",$_->_date) .")",
- '$' . sprintf("%10.2f",$_->credited)
+ $money_char. sprintf("%10.2f",$_->credited)
foreach ( $self->cust_pay ) {
push @buf,[
"Payment received ". time2str("%x",$_->_date ),
foreach ( $self->cust_pay ) {
push @buf,[
"Payment received ". time2str("%x",$_->_date ),
- '$' . sprintf("%10.2f",$_->paid )
+ $money_char. sprintf("%10.2f",$_->paid )
];
}
#balance due
push @buf,['','-----------'];
];
}
#balance due
push @buf,['','-----------'];
- push @buf,['Balance Due','$' .
+ push @buf,['Balance Due', $money_char.
sprintf("%10.2f",$self->owed + $pr_total - $cr_total ) ];
#setup template variables
sprintf("%10.2f",$self->owed + $pr_total - $cr_total ) ];
#setup template variables
-$Id: cust_bill.pm,v 1.5 2001-02-11 17:17:39 ivan Exp $
+$Id: cust_bill.pm,v 1.6 2001-03-30 17:33:52 ivan Exp $
<li><a name="invoice_template">invoice_template</a> - Required template file for invoices. See the <a href="billing.html">section on billing</a> for details.
<li><a name="lpr">lpr</a> - Print command for paper invoices, for example `lpr -h'.
<li><a name="maildisablecatchall">maildisablecatchall</a> - The existance of this file will disable the requirement that each virtual domain have a catch-all mailbox.
<li><a name="invoice_template">invoice_template</a> - Required template file for invoices. See the <a href="billing.html">section on billing</a> for details.
<li><a name="lpr">lpr</a> - Print command for paper invoices, for example `lpr -h'.
<li><a name="maildisablecatchall">maildisablecatchall</a> - The existance of this file will disable the requirement that each virtual domain have a catch-all mailbox.
+ <li><a name="money_char">money_char</a> - Currency symbol - defaults to `$'.
<li><a name="mxmachines">mxmachines</a> - MX entries for new domains, weight and machine, one per line, with trailing `.'
<li><a name="nsmachines">nsmachines</a> - NS nameservers for new domains, one per line, with trailing `.'
<li><a name="nismachines">nismachines</a> - Your NIS master (not slave master) machines, one per line. This enables export of `/etc/global/passwd' and `/etc/global/shadow'.
<li><a name="mxmachines">mxmachines</a> - MX entries for new domains, weight and machine, one per line, with trailing `.'
<li><a name="nsmachines">nsmachines</a> - NS nameservers for new domains, one per line, with trailing `.'
<li><a name="nismachines">nismachines</a> - Your NIS master (not slave master) machines, one per line. This enables export of `/etc/global/passwd' and `/etc/global/shadow'.