[freeside-commits] freeside/FS/FS cust_pkg.pm, 1.205, 1.206 part_pkg.pm, 1.123, 1.124
Ivan,,,
ivan at wavetail.420.am
Fri Aug 5 12:26:55 PDT 2011
- Previous message: [freeside-commits] freeside/bin 21add, 1.2, NONE 21commit, 1.2, NONE cust_main-show_geocoding, 1.1, 1.2 test-event, 1.1, 1.2
- Next message: [freeside-commits] freeside/FS/FS cust_pkg.pm, 1.204.2.1, 1.204.2.2 part_pkg.pm, 1.123, 1.123.2.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv11083
Modified Files:
cust_pkg.pm part_pkg.pm
Log Message:
fix double display of service links in bundled packages (and mis-alignment in customer search?), RT#13966
Index: part_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg.pm,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -w -d -r1.123 -r1.124
--- part_pkg.pm 12 Jul 2011 22:58:41 -0000 1.123
+++ part_pkg.pm 5 Aug 2011 19:26:53 -0000 1.124
@@ -1067,6 +1067,10 @@
shift->_self_and_linked('bill', @_);
}
+sub self_and_svc_linked {
+ shift->_self_and_linked('svc', @_);
+}
+
sub _self_and_linked {
my( $self, $type, $hidden ) = @_;
$hidden ||= '';
Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.205
retrieving revision 1.206
diff -u -w -d -r1.205 -r1.206
--- cust_pkg.pm 22 Jul 2011 17:55:46 -0000 1.205
+++ cust_pkg.pm 5 Aug 2011 19:26:53 -0000 1.206
@@ -1937,7 +1937,7 @@
my $self = shift;
my $pkgnum = $self->pkgnum;
- my $pkgpart = $self->pkgpart;
+ #my $pkgpart = $self->pkgpart;
# qsearch( {
# 'table' => 'part_svc',
@@ -1956,23 +1956,27 @@
# 'extra_param' => [ [$self->pkgpart=>'int'], [$self->pkgnum=>'int'] ],
# } );
-#seems to benchmark slightly faster...
+#seems to benchmark slightly faster... (or did?)
+
+ my @pkgparts = map $_->pkgpart, $self->part_pkg->self_and_svc_linked;
+ my $pkgparts = join(',', @pkgparts);
+
qsearch( {
#'select' => 'DISTINCT ON (svcpart) part_svc.*',
#MySQL doesn't grok DISINCT ON
'select' => 'DISTINCT part_svc.*',
'table' => 'part_svc',
'addl_from' =>
- 'LEFT JOIN pkg_svc ON ( pkg_svc.svcpart = part_svc.svcpart
- AND pkg_svc.pkgpart = ?
+ "LEFT JOIN pkg_svc ON ( pkg_svc.svcpart = part_svc.svcpart
+ AND pkg_svc.pkgpart IN ($pkgparts)
AND quantity > 0
)
LEFT JOIN cust_svc ON ( cust_svc.svcpart = part_svc.svcpart )
LEFT JOIN cust_pkg USING ( pkgnum )
- ',
+ ",
'hashref' => {},
'extra_sql' => "WHERE pkgsvcnum IS NULL AND cust_pkg.pkgnum = ? ",
- 'extra_param' => [ [$self->pkgpart=>'int'], [$self->pkgnum=>'int'] ],
+ 'extra_param' => [ [$self->pkgnum=>'int'] ],
} );
}
- Previous message: [freeside-commits] freeside/bin 21add, 1.2, NONE 21commit, 1.2, NONE cust_main-show_geocoding, 1.1, 1.2 test-event, 1.1, 1.2
- Next message: [freeside-commits] freeside/FS/FS cust_pkg.pm, 1.204.2.1, 1.204.2.2 part_pkg.pm, 1.123, 1.123.2.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list