[freeside-commits] branch master updated. ad3bcb39580173f0ac1b6357cb49515d48af7ddf

Ivan ivan at 420.am
Mon Apr 27 03:00:17 PDT 2015


The branch, master has been updated
       via  ad3bcb39580173f0ac1b6357cb49515d48af7ddf (commit)
       via  6be98dd167d1a77ff9f71c97c385bff65769f30d (commit)
       via  189707c123fab3152d231bdb1d75bf9f65e016ca (commit)
      from  911b5f2429377b0b989e8a10e9971b2463e554a7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ad3bcb39580173f0ac1b6357cb49515d48af7ddf
Merge: 6be98dd 911b5f2
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Apr 27 02:59:21 2015 -0700

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit 6be98dd167d1a77ff9f71c97c385bff65769f30d
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Apr 27 02:59:16 2015 -0700

    order_pkg doc

diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm
index 9d7e7ed..12d56bb 100644
--- a/fs_selfservice/FS-SelfService/SelfService.pm
+++ b/fs_selfservice/FS-SelfService/SelfService.pm
@@ -251,7 +251,30 @@ FS::SelfService - Freeside self-service API
 
   #!!! list_pkgs example
 
-  #!!! order_pkg example
+  #ordering a package with an svc_acct service
+  my $rv = order_pkg( { 'session_id' => $session_id,
+                        'pkgpart'    => $pkgpart,
+                        'svcpart'    => $svcpart,
+                        'username'   => $username,
+                        'domsvc'     => $domsvc, #svcnum of svc_domain
+                        '_password'  => $password,
+                      }
+                    );
+
+  #!!! ordering a package with an svc_domain service example
+
+  #!!! ordering a package with an svc_phone service example
+
+  #!!! ordering a package with an svc_external service example
+
+  #!!! ordering a package with an svc_pbx service
+
+  #ordering a package with no service
+  my $rv = order_pkg( { 'session_id' => $session_id,
+                        'pkgpart'    => $pkgpart,
+                        'svcpart'    => 'none',
+                      }
+                    );
 
   #!!! cancel_pkg example
 

commit 189707c123fab3152d231bdb1d75bf9f65e016ca
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Apr 27 02:56:41 2015 -0700

    multiple payment options (package display: make "No automatic charge" label work correctly), RT#23741

diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index a9d7ac7..f102d97 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -2015,6 +2015,17 @@ sub cust_payby {
   });
 }
 
+sub has_cust_payby_auto {
+  my $self = shift;
+  scalar( qsearch({ 
+    'table'     => 'cust_payby',
+    'hashref'   => { 'custnum' => $self->custnum, },
+    'extra_sql' => " AND payby IN ( 'CARD', 'CHEK' ) ",
+    'order_by'  => 'LIMIT 1',
+  }) );
+
+}
+
 =item unsuspend
 
 Unsuspends all unflagged suspended packages (see L</unflagged_suspended_pkgs>
diff --git a/httemplate/view/cust_main/packages/section.html b/httemplate/view/cust_main/packages/section.html
index e888c94..e38c34f 100755
--- a/httemplate/view/cust_main/packages/section.html
+++ b/httemplate/view/cust_main/packages/section.html
@@ -20,6 +20,8 @@
             cust_pkg-group_by_location
             no_services
         )),
+        #for status.html
+        'has_cust_payby_auto' => $cust_main->has_cust_payby_auto,
     &>
 %   }
 % } else { # there are no packages
diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html
index 2bb4bef..3515b38 100644
--- a/httemplate/view/cust_main/packages/status.html
+++ b/httemplate/view/cust_main/packages/status.html
@@ -494,16 +494,11 @@ sub pkg_status_row_detached {
 
 sub pkg_status_row_noauto {
   my( $cust_pkg, %opt ) = @_;
-  my $part_pkg = $opt{'part_pkg'};
-  return '' unless $cust_pkg->no_auto || $part_pkg->no_auto;
 
-  #inefficient, should be passed in
-  my $cust_main = $cust_pkg->cust_main;
+  return '' unless ( $cust_pkg->no_auto || $opt{'part_pkg'}->no_auto );
+                && $opt{'has_cust_payby_auto'};
 
-  return '' unless $cust_main->payby =~ /^(CARD|CHEK)$/;
-  my $what = lc(FS::payby->shortname($cust_main->payby));
-
-  pkg_status_row_colspan( $cust_pkg, emt("No automatic $what charge"), '');
+  pkg_status_row_colspan( $cust_pkg, emt("No automatic charge"), '');
 }
 
 sub pkg_status_row_separate_bill {

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_main.pm                              |   11 ++++++++++
 fs_selfservice/FS-SelfService/SelfService.pm    |   25 ++++++++++++++++++++++-
 httemplate/view/cust_main/packages/section.html |    2 ++
 httemplate/view/cust_main/packages/status.html  |   11 +++-------
 4 files changed, 40 insertions(+), 9 deletions(-)




More information about the freeside-commits mailing list