[freeside-commits] freeside/FS/FS cust_bill.pm, 1.287, 1.288 usage_class.pm, 1.5, 1.6
Jeff Finucane,420,,
jeff at wavetail.420.am
Sun Jun 27 21:11:49 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv3849/FS/FS
Modified Files:
cust_bill.pm usage_class.pm
Log Message:
add some dollar signs RT8704
Index: usage_class.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/usage_class.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -d -r1.5 -r1.6
--- usage_class.pm 27 Jun 2010 09:25:26 -0000 1.5
+++ usage_class.pm 28 Jun 2010 04:11:47 -0000 1.6
@@ -3,6 +3,9 @@
use strict;
use vars qw( @ISA );
use FS::Record qw( qsearch qsearchs );
+use FS::Conf;
+
+my $conf = new FS::Conf;
@ISA = qw(FS::Record);
@@ -122,7 +125,9 @@
sub { shift->{description} },
sub { shift->{calls} },
sub { sprintf( '%.1f', shift->{duration}/60 ) },
- sub { shift->{amount} },
+ sub { my($href, %opt) = @_;
+ ($opt{dollar} || ''). $href->{amount};
+ },
],
'align' => [ qw( l r r r ) ],
'span' => [ qw( 4 1 1 1 ) ], # unitprices?
@@ -134,7 +139,9 @@
'fields' => [
sub { shift->{description} },
sub { shift->{calls} },
- sub { shift->{amount} },
+ sub { my($href, %opt) = @_;
+ ($opt{dollar} || ''). $href->{amount};
+ },
],
'align' => [ qw( l r r ) ],
'span' => [ qw( 5 1 1 ) ],
@@ -271,6 +278,7 @@
my ( $f, $prefix, $suffix, $separator, $column ) =
$self->_generator_defaults($format, %opt);
+ my $money_char = '$';
if ($format eq 'latex') {
$prefix = "\\hline\n\\multicolumn{1}{c}{\\rule{0pt}{2.5ex}~} &\n";
$suffix = '\\\\';
@@ -279,6 +287,7 @@
sub { my ($d,$a,$s,$w) = @_;
return "\\multicolumn{$s}{$a}{\\makebox[$w][$a]{\\textbf{$d}}}";
};
+ $money_char = '\\dollar';
}elsif ( $format eq 'html' ) {
$prefix = '"><td align="center"></td>';
$suffix = '';
@@ -287,14 +296,19 @@
sub { my ($d,$a,$s,$w) = @_;
return qq!<td align="$html_align{$a}">$d</td>!;
};
+ $money_char = $conf->config('money_char') || '$';
}
sub {
- my @args = @_;
+ #my @args = @_;
+ my ($href) = shift;
my @result = ();
foreach (my $i = 0; $f->{label}->[$i]; $i++) {
- push @result, &{$column}( &{$f->{fields}->[$i]}(@args),
+ my $dollar = '';
+ $dollar = $money_char if $i == scalar(@{$f->{label}})-1;
+ push @result,
+ &{$column}( &{$f->{fields}->[$i]}($href, 'dollar' => $dollar),
map { $f->{$_}->[$i] } qw(align span width)
);
}
Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.287
retrieving revision 1.288
diff -u -w -d -r1.287 -r1.288
--- cust_bill.pm 27 Jun 2010 09:25:26 -0000 1.287
+++ cust_bill.pm 28 Jun 2010 04:11:47 -0000 1.288
@@ -3397,7 +3397,9 @@
'fields' => [
sub { shift->{description} },
sub { shift->{quantity} },
- sub { shift->{amount} },
+ sub { my($href, %opt) = @_;
+ ($opt{dollar} || ''). $href->{amount};
+ },
],
'align' => [ qw( l r r ) ],
'span' => [ qw( 5 1 1 ) ], # unitprices?
@@ -3471,6 +3473,7 @@
my ( $f, $prefix, $suffix, $separator, $column ) =
_condensed_generator_defaults($format);
+ my $money_char = '$';
if ($format eq 'latex') {
$prefix = "\\hline\n\\multicolumn{1}{c}{\\rule{0pt}{2.5ex}~} &\n";
$suffix = '\\\\';
@@ -3479,6 +3482,7 @@
sub { my ($d,$a,$s,$w) = @_;
return "\\multicolumn{$s}{$a}{\\makebox[$w][$a]{\\textbf{$d}}}";
};
+ $money_char = '\\dollar';
}elsif ( $format eq 'html' ) {
$prefix = '"><td align="center"></td>';
$suffix = '';
@@ -3487,14 +3491,20 @@
sub { my ($d,$a,$s,$w) = @_;
return qq!<td align="$html_align{$a}">$d</td>!;
};
+ #$money_char = $conf->config('money_char') || '$';
+ $money_char = ''; # this is madness
}
sub {
- my @args = @_;
+ #my @args = @_;
+ my $href = shift;
my @result = ();
foreach (my $i = 0; $f->{label}->[$i]; $i++) {
- push @result, &{$column}( &{$f->{fields}->[$i]}(@args),
+ my $dollar = '';
+ $dollar = $money_char if $i == scalar(@{$f->{label}})-1;
+ push @result,
+ &{$column}( &{$f->{fields}->[$i]}($href, 'dollar' => $dollar),
map { $f->{$_}->[$i] } qw(align span width)
);
}
More information about the freeside-commits
mailing list