<rjbs> More of the same: these patches make it safer to subclass FS::part_pkg's pkg_s...
[freeside.git] / httemplate / view / cust_pkg.cgi
index c388011..a20149a 100755 (executable)
@@ -71,7 +71,7 @@ print &ntable("#cccccc"), '<TR><TD>', &ntable("#cccccc",2),
       ( $setup ? time2str("%D",$setup) : "(Not setup)" ), '</TD></TR>';
 
 print '<TR><TD ALIGN="right">Last bill date</TD><TD BGCOLOR="#ffffff">',
-      ( $cust_pkg->last_bill ? time2str("%D",$cust_pkg->last_bill) : "&nbsp;" ),
+      ( $cust_pkg->get('last_bill') ? time2str("%D",$cust_pkg->get('last_bill')) : "&nbsp;" ),
       '</TD></TR>'
   if $cust_pkg->dbdef_table->column('last_bill');
 
@@ -104,8 +104,9 @@ unless ($cancel) {
 
   #list of services this pkgpart includes
   my $pkg_svc;
-  my %pkg_svc = ();
-  foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) {
+  my %pkg_svc;
+  #foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) {
+  foreach $pkg_svc ( $cust_pkg->part_pkg->pkg_svc ) {
     $pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity if $pkg_svc->quantity;
   }