[freeside-commits] freeside/FS/FS part_pkg.pm, 1.111.2.5, 1.111.2.6 Schema.pm, 1.239.2.44, 1.239.2.45 cust_bill.pm, 1.299.2.35, 1.299.2.36 cust_bill_pkg.pm, 1.51.4.2, 1.51.4.3
Ivan,,,
ivan at wavetail.420.am
Thu Jun 9 20:33:59 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv15876/FS/FS
Modified Files:
Tag: FREESIDE_2_1_BRANCH
part_pkg.pm Schema.pm cust_bill.pm cust_bill_pkg.pm
Log Message:
add package def option to show $0 recurring on invoices, RT#9777
Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.239.2.44
retrieving revision 1.239.2.45
diff -u -w -d -r1.239.2.44 -r1.239.2.45
--- Schema.pm 8 Jun 2011 05:37:39 -0000 1.239.2.44
+++ Schema.pm 10 Jun 2011 03:33:56 -0000 1.239.2.45
@@ -1522,6 +1522,7 @@
'agentnum', 'int', 'NULL', '', '', '',
'fcc_ds0s', 'int', 'NULL', '', '', '',
'no_auto', 'char', 'NULL', 1, '', '',
+ 'recur_show_zero', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'pkgpart',
'unique' => [],
Index: cust_bill_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill_pkg.pm,v
retrieving revision 1.51.4.2
retrieving revision 1.51.4.3
diff -u -w -d -r1.51.4.2 -r1.51.4.3
--- cust_bill_pkg.pm 5 Feb 2011 04:05:12 -0000 1.51.4.2
+++ cust_bill_pkg.pm 10 Jun 2011 03:33:57 -0000 1.51.4.3
@@ -412,7 +412,8 @@
Returns an array of detail information for the invoice line item.
-Currently available options are: I<format> I<escape_function>
+Currently available options are: I<format>, I<escape_function> and
+I<format_function>.
If I<format> is set to html or latex then the array members are improved
for tabular appearance in those environments if possible.
@@ -420,6 +421,12 @@
If I<escape_function> is set then the array members are processed by this
function before being returned.
+I<format_function> overrides the normal HTML or LaTeX function for returning
+formatted CDRs. It can be set to a subroutine which returns an empty list
+to skip usage detail:
+
+ 'format_function' => sub { () },
+
=cut
sub details {
@@ -871,7 +878,7 @@
my %hash = ( 'billpkgnum' => $self->billpkgnum );
$hash{classnum} = $classnum if $classnum;
- qsearch ( 'cust_bill_pkg_detail', { %hash } ),
+ qsearch( 'cust_bill_pkg_detail', \%hash ),
}
@@ -886,6 +893,19 @@
qsearch ( 'cust_bill_pkg_discount', { 'billpkgnum' => $self->billpkgnum } );
}
+=item recur_show_zero
+
+=cut
+
+sub recur_show_zero {
+ my $self = shift;
+
+ $self->recur == 0
+ && $self->pkgnum
+ && $self->cust_pkg->part_pkg->recur_show_zero;
+
+}
+
=back
=head1 BUGS
Index: part_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg.pm,v
retrieving revision 1.111.2.5
retrieving revision 1.111.2.6
diff -u -w -d -r1.111.2.5 -r1.111.2.6
--- part_pkg.pm 12 Feb 2011 05:03:58 -0000 1.111.2.5
+++ part_pkg.pm 10 Jun 2011 03:33:56 -0000 1.111.2.6
@@ -484,6 +484,7 @@
|| $self->ut_enum('disabled', [ '', 'Y' ] )
|| $self->ut_enum('custom', [ '', 'Y' ] )
|| $self->ut_enum('no_auto', [ '', 'Y' ])
+ || $self->ut_enum('recur_show_zero', [ '', 'Y' ])
#|| $self->ut_moneyn('setup_cost')
#|| $self->ut_moneyn('recur_cost')
|| $self->ut_floatn('setup_cost')
Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.299.2.35
retrieving revision 1.299.2.36
diff -u -w -d -r1.299.2.35 -r1.299.2.36
--- cust_bill.pm 27 May 2011 01:11:19 -0000 1.299.2.35
+++ cust_bill.pm 10 Jun 2011 03:33:56 -0000 1.299.2.36
@@ -4460,23 +4460,10 @@
foreach my $cust_bill_pkg ( @$cust_bill_pkgs )
{
- warn "$me _items_cust_bill_pkg considering cust_bill_pkg $cust_bill_pkg\n"
+ warn "$me _items_cust_bill_pkg considering cust_bill_pkg ".
+ $cust_bill_pkg->billpkgnum. ", pkgnum ". $cust_bill_pkg->pkgnum. "\n"
if $DEBUG > 1;
- $discount_show_always = ($cust_bill_pkg->cust_bill_pkg_discount
- && $conf->exists('discount-show-always'));
-
- foreach ( $s, $r, ($opt{skip_usage} ? () : $u ) ) {
- if ( $_ && !$cust_bill_pkg->hidden ) {
- $_->{amount} = sprintf( "%.2f", $_->{amount} ),
- $_->{amount} =~ s/^\-0\.00$/0.00/;
- $_->{unit_amount} = sprintf( "%.2f", $_->{unit_amount} ),
- push @b, { %$_ }
- unless ( $_->{amount} == 0 && !$discount_show_always );
- $_ = undef;
- }
- }
-
foreach my $display ( grep { defined($section)
? $_->section eq $section
: 1
@@ -4555,9 +4542,13 @@
}
- if ( ( $cust_bill_pkg->recur != 0 || $cust_bill_pkg->setup == 0 ||
- ($discount_show_always && $cust_bill_pkg->recur == 0) ) &&
- ( !$type || $type eq 'R' || $type eq 'U' )
+ if ( ( !$type || $type eq 'R' || $type eq 'U' )
+ && (
+ $cust_bill_pkg->recur != 0
+ || $cust_bill_pkg->setup == 0
+ || $discount_show_always
+ || $cust_bill_pkg->recur_show_zero
+ )
)
{
@@ -4703,21 +4694,38 @@
}
- }
-
- warn "$me _items_cust_bill_pkg done considering cust_bill_pkgs\n"
- if $DEBUG > 1;
+ $discount_show_always = ($cust_bill_pkg->cust_bill_pkg_discount
+ && $conf->exists('discount-show-always'));
foreach ( $s, $r, ($opt{skip_usage} ? () : $u ) ) {
- if ( $_ ) {
+ if ( $_ && !$cust_bill_pkg->hidden ) {
$_->{amount} = sprintf( "%.2f", $_->{amount} ),
$_->{amount} =~ s/^\-0\.00$/0.00/;
$_->{unit_amount} = sprintf( "%.2f", $_->{unit_amount} ),
push @b, { %$_ }
- unless ( $_->{amount} == 0 && !$discount_show_always );
+ if $_->{amount} != 0
+ || $discount_show_always
+ || $cust_bill_pkg->recur_show_zero;
+ $_ = undef;
+ }
}
+
}
+ #foreach ( $s, $r, ($opt{skip_usage} ? () : $u ) ) {
+ # if ( $_ ) {
+ # $_->{amount} = sprintf( "%.2f", $_->{amount} ),
+ # $_->{amount} =~ s/^\-0\.00$/0.00/;
+ # $_->{unit_amount} = sprintf( "%.2f", $_->{unit_amount} ),
+ # push @b, { %$_ }
+ # if $_->{amount} != 0
+ # || $discount_show_always
+ # }
+ #}
+
+ warn "$me _items_cust_bill_pkg done considering cust_bill_pkgs\n"
+ if $DEBUG > 1;
+
@b;
}
More information about the freeside-commits
mailing list