accountcode billing, RT12181
[freeside.git] / FS / FS / cust_bill_pkg.pm
index 2c79209..29663c5 100644 (file)
@@ -154,8 +154,9 @@ sub insert {
         'classnum'   => (ref($detail) ? $detail->[3] : '' ),
         'phonenum'   => (ref($detail) ? $detail->[4] : '' ),
         'accountcode' => (ref($detail) ? $detail->[5] : '' ),
-        'duration'   => (ref($detail) ? $detail->[6] : '' ),
-        'regionname' => (ref($detail) ? $detail->[7] : '' ),
+        'startdate'  => (ref($detail) ? $detail->[6] : '' ),
+        'duration'   => (ref($detail) ? $detail->[7] : '' ),
+        'regionname' => (ref($detail) ? $detail->[8] : '' ),
       };
       $error = $cust_bill_pkg_detail->insert;
       if ( $error ) {
@@ -899,12 +900,25 @@ sub cust_bill_pkg_discount {
 =cut
 
 sub recur_show_zero {
-  my $self = shift;
+  #my $self = shift;
+  #   $self->recur == 0
+  #&& $self->pkgnum
+  #&& $self->cust_pkg->part_pkg->recur_show_zero;
+
+  shift->_X_show_zero('recur');
+
+}
+
+sub setup_show_zero {
+  shift->_X_show_zero('setup');
+}
+
+sub _X_show_zero {
+  my( $self, $what ) = @_;
 
-     $self->recur == 0
-  && $self->pkgnum
-  && $self->cust_pkg->part_pkg->recur_show_zero;
+  return 0 unless $self->$what() == 0 && $self->pkgnum;
 
+  $self->cust_pkg->_X_show_zero($what);
 }
 
 =back