[freeside-commits] freeside/FS/FS cust_bill.pm, 1.263.2.22, 1.263.2.23 usage_class.pm, 1.2.4.3, 1.2.4.4
Jeff Finucane,420,,
jeff at wavetail.420.am
Sun Jun 27 21:11:27 PDT 2010
- Previous message: [freeside-commits] freeside/FS/FS cust_bill.pm, 1.286, 1.287 cust_bill_pkg.pm, 1.50, 1.51 usage_class.pm, 1.4, 1.5
- Next message: [freeside-commits] freeside/FS/FS cust_bill.pm, 1.287, 1.288 usage_class.pm, 1.5, 1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv3788/FS/FS
Modified Files:
Tag: FREESIDE_1_9_BRANCH
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.2.4.3
retrieving revision 1.2.4.4
diff -u -w -d -r1.2.4.3 -r1.2.4.4
--- usage_class.pm 27 Jun 2010 09:22:08 -0000 1.2.4.3
+++ usage_class.pm 28 Jun 2010 04:11:25 -0000 1.2.4.4
@@ -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.263.2.22
retrieving revision 1.263.2.23
diff -u -w -d -r1.263.2.22 -r1.263.2.23
--- cust_bill.pm 27 Jun 2010 09:22:08 -0000 1.263.2.22
+++ cust_bill.pm 28 Jun 2010 04:11:25 -0000 1.263.2.23
@@ -3351,7 +3351,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?
@@ -3425,6 +3427,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 = '\\\\';
@@ -3433,6 +3436,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 = '';
@@ -3441,14 +3445,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)
);
}
- Previous message: [freeside-commits] freeside/FS/FS cust_bill.pm, 1.286, 1.287 cust_bill_pkg.pm, 1.50, 1.51 usage_class.pm, 1.4, 1.5
- Next message: [freeside-commits] freeside/FS/FS cust_bill.pm, 1.287, 1.288 usage_class.pm, 1.5, 1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list