[freeside-commits] freeside/FS/FS cust_bill.pm, 1.299.2.1, 1.299.2.2 cust_pkg.pm, 1.179.2.1, 1.179.2.2
Mark Wells
mark at wavetail.420.am
Sun Nov 14 01:10:37 PST 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv18464/FS/FS
Modified Files:
Tag: FREESIDE_2_1_BRANCH
cust_bill.pm cust_pkg.pm
Log Message:
better hidden pkg_svc flag, RT#9871
Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.299.2.1
retrieving revision 1.299.2.2
diff -u -w -d -r1.299.2.1 -r1.299.2.2
--- cust_bill.pm 13 Nov 2010 23:24:03 -0000 1.299.2.1
+++ cust_bill.pm 14 Nov 2010 09:10:35 -0000 1.299.2.2
@@ -4156,6 +4156,7 @@
my @dates = ( $self->_date );
my $prev = $cust_bill_pkg->previous_cust_bill_pkg;
push @dates, $prev->sdate if $prev;
+ push @dates, undef if !$prev;
unless ( $cust_pkg->part_pkg->hide_svc_detail
|| $cust_bill_pkg->itemdesc
Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.179.2.1
retrieving revision 1.179.2.2
diff -u -w -d -r1.179.2.1 -r1.179.2.2
--- cust_pkg.pm 13 Nov 2010 23:24:03 -0000 1.179.2.1
+++ cust_pkg.pm 14 Nov 2010 09:10:35 -0000 1.179.2.2
@@ -1650,21 +1650,19 @@
sub h_cust_svc {
my $self = shift;
my ($end, $start, $mode) = @_;
- my %search = (
- 'table' => 'h_cust_svc',
- 'hashref' => { 'pkgnum' => $self->pkgnum }
+ my @cust_svc = $self->_sort_cust_svc(
+ [ qsearch( 'h_cust_svc',
+ { 'pkgnum' => $self->pkgnum, },
+ FS::h_cust_svc->sql_h_search(@_),
+ ) ]
);
- @search{'select', 'extra_sql', 'cache_obj', 'addl_from'} =
- FS::h_cust_svc->sql_h_search($end, $start);
if ( $mode eq 'I' ) {
- $search{'addl_from'} .= ' JOIN cust_pkg USING (pkgnum)
- JOIN pkg_svc USING (pkgpart, svcpart)';
- $search{'extra_sql'} = ' AND pkg_svc.hidden IS NULL '.$search{'extra_sql'};
+ my %hidden_svcpart = map { $_->svcpart => $_->hidden } $self->part_svc;
+ return grep { !$hidden_svcpart{$_->svcpart} } @cust_svc;
+ }
+ else {
+ return @cust_svc;
}
-
- $self->_sort_cust_svc(
- [ qsearch(\%search) ]
- );
}
sub _sort_cust_svc {
@@ -1767,6 +1765,7 @@
max( 0, $pkg_svc->quantity - $num_cust_svc );
$part_svc->{'Hash'}{'cust_pkg_svc'} =
$num_cust_svc ? [ $self->cust_svc($part_svc->svcpart) ] : [];
+ $part_svc->{'Hash'}{'hidden'} = $pkg_svc->hidden;
$part_svc;
} $self->part_pkg->pkg_svc;
More information about the freeside-commits
mailing list