cancel one-time packages that have not yet billed with v4 package actions menu, RT...
authorIvan Kohler <ivan@freeside.biz>
Mon, 22 May 2017 15:53:28 +0000 (08:53 -0700)
committerIvan Kohler <ivan@freeside.biz>
Mon, 22 May 2017 15:53:28 +0000 (08:53 -0700)
httemplate/view/cust_main/packages/package.html

index 3b39c86..6114341 100644 (file)
                  },
 
                  { label       => '-',
-                   condition   => sub { $part_pkg->freq ne '0' },
+                   #condition   => sub { $part_pkg->freq ne '0' },
                    content     => '-',
                  },
 
 
                  { label       => 'Cancel now',
                    acl         => 'Cancel customer package immediately',
-                   condition   => sub { $part_pkg->freq ne '0'
-                                          && ! $change_from
-                                          && ! $supplemental
-                                          && ! $cust_pkg->change_to_pkgnum
-                                          && ! $cust_pkg->get('cancel')
-                                      },
+                   condition   => sub {
+                     ( $part_pkg->freq ne '0' || ! $cust_pkg->get('setup') )
+                       && ! $change_from
+                       && ! $supplemental
+                       && ! $cust_pkg->change_to_pkgnum
+                       && ! $cust_pkg->get('cancel')
+                   },
                    popup       => "misc/cancel_pkg.html?method=cancel;$plink",
                    actionlabel => emt('Cancel now'),
                    color       => '#FF0000',
                  },
 
                  { label       => '-',
-                   condition   => sub { $part_pkg->freq ne '0'
-                                          && ! $change_from
-                                          && ! $cust_pkg->get('cancel')
-                                      },
+                   condition   => sub {
+                     ( $part_pkg->freq ne '0' || ! $cust_pkg->get('setup') )
+                       && ! $change_from
+                       && ! $cust_pkg->get('cancel')
+                   },
                    content     => '-',
                  },