[freeside-commits] freeside/FS/FS Schema.pm, 1.313, 1.314 cust_bill.pm, 1.346, 1.347

Ivan,,, ivan at wavetail.420.am
Tue Jul 12 15:57:06 PDT 2011


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv31465/FS/FS

Modified Files:
	Schema.pm cust_bill.pm 
Log Message:
fix UI for package editing w/recur_show_zero, add setup_show_zero, RT#9777

Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.313
retrieving revision 1.314
diff -u -w -d -r1.313 -r1.314
--- Schema.pm	9 Jul 2011 02:59:48 -0000	1.313
+++ Schema.pm	12 Jul 2011 22:57:03 -0000	1.314
@@ -1455,6 +1455,8 @@
         'quantity',            'int', 'NULL', '', '', '',
         'agent_pkgid',         'int', 'NULL', '', '', '',
         'waive_setup',        'char', 'NULL',  1, '', '', 
+        'recur_show_zero',    'char', 'NULL',  1, '', '',
+        'setup_show_zero',    'char', 'NULL',  1, '', '',
       ],
       'primary_key' => 'pkgnum',
       'unique' => [],
@@ -1638,6 +1640,7 @@
         'fcc_ds0s',      'int',     'NULL', '', '', '', 
         'no_auto',          'char', 'NULL',  1, '', '', 
         'recur_show_zero',  'char', 'NULL',  1, '', '',
+        'setup_show_zero',  'char', 'NULL',  1, '', '',
       ],
       'primary_key' => 'pkgpart',
       'unique' => [],

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.346
retrieving revision 1.347
diff -u -w -d -r1.346 -r1.347
--- cust_bill.pm	7 Jul 2011 17:00:56 -0000	1.346
+++ cust_bill.pm	12 Jul 2011 22:57:03 -0000	1.347
@@ -4612,13 +4612,21 @@
  
         my $cust_pkg = $cust_bill_pkg->cust_pkg;
 
-        if ( $cust_bill_pkg->setup != 0 && (!$type || $type eq 'S') ) {
+        if (    (!$type || $type eq 'S')
+             && (    $cust_bill_pkg->setup != 0
+                  || $cust_bill_pkg->setup_show_zero
+                )
+           )
+         {
 
           warn "$me _items_cust_bill_pkg adding setup\n"
             if $DEBUG > 1;
 
           my $description = $desc;
-          $description .= ' Setup' if $cust_bill_pkg->recur != 0;
+          $description .= ' Setup'
+            if $cust_bill_pkg->recur != 0
+            || $discount_show_always
+            || $cust_bill_pkg->recur_show_zero;
 
           my @d = ();
           unless ( $cust_pkg->part_pkg->hide_svc_detail
@@ -4647,6 +4655,7 @@
             push @{ $s->{ext_description} }, @d;
           } else {
             $s = {
+              _is_setup       => 1,
               description     => $description,
               #pkgpart         => $part_pkg->pkgpart,
               pkgnum          => $cust_bill_pkg->pkgnum,
@@ -4822,7 +4831,9 @@
         push @b, { %$_ }
           if $_->{amount} != 0
           || $discount_show_always
-          || $cust_bill_pkg->recur_show_zero;
+          || ( ! $_->{_is_setup} && $cust_bill_pkg->recur_show_zero )
+          || (   $_->{_is_setup} && $cust_bill_pkg->setup_show_zero )
+        ;
         $_ = undef;
       }
     }



More information about the freeside-commits mailing list