[freeside-commits] branch master updated. c56b3fce5486b08d986743d1c2a9cc2e6aafa5bc

Justin DeVuyst justin at 420.am
Fri Mar 3 16:25:24 PST 2017


The branch, master has been updated
       via  c56b3fce5486b08d986743d1c2a9cc2e6aafa5bc (commit)
       via  70723170e55a4dbdcf69a227da79ec51e4f4c285 (commit)
       via  62157b20f819936d8287f12689c3b5cb34efe7ae (commit)
      from  51e2a2439d923d63a5a2321864c69f82272cd362 (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 c56b3fce5486b08d986743d1c2a9cc2e6aafa5bc
Author: Justin DeVuyst <justin at devuyst.com>
Date:   Fri Mar 3 19:24:14 2017 -0500

    Add warning of svc unprovisioning on pkg cancel.  See RT#29087.

diff --git a/httemplate/misc/cancel_pkg.html b/httemplate/misc/cancel_pkg.html
index d3ca996..7af106d 100755
--- a/httemplate/misc/cancel_pkg.html
+++ b/httemplate/misc/cancel_pkg.html
@@ -8,6 +8,8 @@
 
 <BR>
 <% emt(ucfirst($method)." [_1]", $part_pkg->pkg_comment(cust_pkg=>$cust_pkg) ) %>
+<BR>
+<font color="red"><% $unprovision_warning |h %></font>
 <table style="background-color: #cccccc; border-spacing: 2; width: 100%">
 
 % my $date_init = 0;
@@ -191,6 +193,23 @@ my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum})
 
 my $part_pkg = $cust_pkg->part_pkg;
 
+my $unprovision_warning = '';
+{
+    my @services_w_export;
+    for ( $cust_pkg->cust_svc ) {
+        push( @services_w_export, ($_->label)[0] . ': ' . ($_->label)[1], )
+          if $_->part_svc->export_svc;
+    }
+    if ( @services_w_export ) {
+        $unprovision_warning = 'NOTE: This package has ' . @services_w_export
+          . ' ' . PL( "service", @services_w_export )
+          . ' that will be unprovisioned';
+        $unprovision_warning .= ' (' . join( ', ', @services_w_export, ) . ')'
+          if @services_w_export < 10;
+        $unprovision_warning .= '.';
+    }
+}
+
 $date ||= $cust_pkg->get($method);
 $date ||= time;
 

commit 70723170e55a4dbdcf69a227da79ec51e4f4c285
Author: Justin DeVuyst <justin at devuyst.com>
Date:   Fri Mar 3 19:23:15 2017 -0500

    Agent virtualize the attachment report.  See RT#24899.

diff --git a/httemplate/browse/cust_attachment.html b/httemplate/browse/cust_attachment.html
index f81ec1b..bc9597f 100755
--- a/httemplate/browse/cust_attachment.html
+++ b/httemplate/browse/cust_attachment.html
@@ -11,10 +11,7 @@
                     <INPUT TYPE="hidden" NAME="orderby" VALUE="$orderby">
                     <INPUT TYPE="hidden" NAME="show_deleted" VALUE="$disabled">!
                     , 
-                 'query'       => { 'table'     => 'cust_attachment',
-                                    'hashref'   => $hashref,
-                                    'order_by' => 'ORDER BY '.$orderby,
-                                  },
+                 'query'       => $query,
                  'count_query' => $count_query,
                  'header' => [ selflink('#',orderby => 'attachnum'),
                                selflink('Customer',orderby => 'custnum'),
@@ -90,14 +87,20 @@ else {
   }
 }
 
-my $hashref = $disabled ? 
-  { disabled => { op => '>', value => 0 } } :
-  { disabled => '' };
+my $orderby = $cgi->param('orderby') || 'custnum';
 
-my $count_query = 'SELECT COUNT(*) FROM cust_attachment WHERE '. ($disabled ?
-  'disabled > 0' : 'disabled IS NULL');
+my $query = {
+    table     => 'cust_attachment',
+    hashref   => { disabled => $disabled ? { op => '>', value => 0 } : undef, },
+    order_by  => "ORDER BY $orderby",
+    addl_from => 'JOIN cust_main USING (custnum)',
+    extra_sql => ' AND ' . $curuser->agentnums_sql,
+};
 
-my $orderby = $cgi->param('orderby') || 'custnum';
+my $count_query = 'SELECT COUNT(*) FROM cust_attachment'
+  . ' JOIN cust_main USING (custnum)'
+  . ' WHERE ' . $curuser->agentnums_sql
+  . ' AND disabled ' . ( $disabled ? '> 0' : 'IS NULL' );
 
 my $sub_cust = sub {
   my $c = qsearchs('cust_main', { custnum => shift->custnum } );

commit 62157b20f819936d8287f12689c3b5cb34efe7ae
Author: Justin DeVuyst <justin at devuyst.com>
Date:   Fri Mar 3 19:20:40 2017 -0500

    Add quantity validation for one-time charge.  See RT#37675.

diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html
index af6fd41..2d38203 100644
--- a/httemplate/edit/quick-charge.html
+++ b/httemplate/edit/quick-charge.html
@@ -449,10 +449,19 @@ function bill_now_changed (what) {
 
 </SCRIPT>
 
+%my %footer_args = (
+%    formvalidation => {
+%        QuickChargeForm => {
+%            validate_fields => {
+%                quantity => 'digits: true, min: 1, required: true',
+%            },
+%        },
+%    },
+%);
 % if ( $quotationnum ) {
-  <& /elements/footer.html &>
+  <& /elements/footer.html, %footer_args &>
 % } else {
-  <& /elements/footer-cust_main.html &>
+  <& /elements/footer-cust_main.html, %footer_args &>
 % }
 <%init>
 
diff --git a/httemplate/elements/footer-cust_main.html b/httemplate/elements/footer-cust_main.html
index c9a9cc2..9349c1d 100644
--- a/httemplate/elements/footer-cust_main.html
+++ b/httemplate/elements/footer-cust_main.html
@@ -1,2 +1,2 @@
 </DIV>
-<& /elements/footer.html &>
+<& /elements/footer.html, %ARGS &>

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

Summary of changes:
 httemplate/browse/cust_attachment.html    |   23 +++++++++++++----------
 httemplate/edit/quick-charge.html         |   13 +++++++++++--
 httemplate/elements/footer-cust_main.html |    2 +-
 httemplate/misc/cancel_pkg.html           |   19 +++++++++++++++++++
 4 files changed, 44 insertions(+), 13 deletions(-)




More information about the freeside-commits mailing list