change one-time charge UI to a full page to avoid conflict with taxproducts, #71394
authorMark Wells <mark@freeside.biz>
Wed, 29 Jun 2016 06:29:37 +0000 (23:29 -0700)
committerMark Wells <mark@freeside.biz>
Wed, 29 Jun 2016 06:29:37 +0000 (23:29 -0700)
httemplate/browse/part_pkg_taxproduct/cch.html
httemplate/edit/process/quick-charge.cgi
httemplate/edit/quick-charge.html
httemplate/view/cust_main/menu.html
httemplate/view/cust_main/packages/package.html
httemplate/view/quotation.html

index b901bad..1f4f53d 100755 (executable)
@@ -97,7 +97,7 @@ $cgi->delete('tax_customer');
 
 
 if ( $tax_group || $tax_item || $tax_provider || $tax_customer ) {
-  push @menubar, 'View all tax products' => $p.'browse/part_pkg_taxproduct.cgi';
+  push @menubar, 'View all tax products' => $p.'browse/part_pkg_taxproduct/cch.html';
 }
 
 $cgi->param('dummy', 1);
index 8ee1821..d1b8e10 100644 (file)
@@ -1,13 +1,4 @@
-% if ( $error ) {
-%   $cgi->param('error', $error );
-<% $cgi->redirect($p.'quick-charge.html?'. $cgi->query_string) %>
-% } else {
-<% header(emt($message)) %>
-  <SCRIPT TYPE="text/javascript">
-    window.top.location.reload();
-  </SCRIPT>
-  </BODY></HTML>
-% }
+<% $cgi->redirect($redirect) %>
 <%init>
 
 my $curuser = $FS::CurrentUser::CurrentUser;
@@ -157,4 +148,14 @@ if ( $param->{'pkgnum'} =~ /^(\d+)$/ ) { #modifying an existing one-time charge
 
 }
 
+my $redirect;
+if ( $error ) {
+  $cgi->param('error', $error );
+  $redirect = $p.'quick-charge.html?'. $cgi->query_string;
+} elsif ( $quotation ) {
+  $redirect = $fsurl.'view/quotation.html?' . $quotation->quotationnum;
+} else {
+  $redirect = $fsurl.'view/cust_main.cgi?custnum=' . $cust_main->custnum . ';show=last';
+}
+
 </%init>
index 14c3f51..2bbbe43 100644 (file)
@@ -1,4 +1,4 @@
-<& /elements/header-popup.html, mt('One-time charge'), '',
+<& /elements/header.html, mt('One-time charge'), '',
             ( ($quotationnum || $cgi->param('error')) ? '' : 'onload="addRow()"' ),
 &>
 
@@ -93,6 +93,18 @@ function bill_now_changed (what) {
 
 </SCRIPT>
 
+<P>
+% if ( $cust_main ) {
+<& /elements/small_custview.html,
+             $cust_main->custnum,
+             scalar($conf->config('countrydefault')),
+             1, #no balance
+&>
+% } else {
+<& /elements/small_prospect_view.html, $prospect_main &>
+% }
+</P>
+
 <FORM ACTION   = "process/quick-charge.cgi"
       NAME     = "QuickChargeForm"
       ID       = "QuickChargeForm"
@@ -183,7 +195,10 @@ function bill_now_changed (what) {
 
       <& /elements/tr-select-taxclass.html, 'curr_value' => $part_pkg->get('taxclass')  &>
 
-      <& /elements/tr-select-taxproduct.html, 'label' => emt('Tax product'), 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $part_pkg->get('taxproductnum')  &>
+      <& /elements/tr-select-taxproduct.html,
+        'label' => emt('Tax product'),
+        'curr_value' => $part_pkg->get('taxproductnum')
+      &>
 % }
 
 % } else { # new one-time charge
@@ -307,9 +322,14 @@ function bill_now_changed (what) {
 
 <& /elements/tr-select-taxclass.html, 'curr_value' => $cgi->param('taxclass')  &>
 
-<& /elements/tr-select-taxproduct.html, 'label' => emt('Tax product'), 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $cgi->param('taxproductnum')  &>
+<& /elements/tr-select-taxproduct.html,
+  'label' => emt('Tax product'),
+  'curr_value' => $cgi->param('taxproductnum')
+&>
 
-<& /elements/tr-select-taxoverride.html, 'onclick' => 'parent.taxoverridemagic(this);', 'curr_value' => $cgi->param('tax_override')  &>
+<& /elements/tr-select-taxoverride.html,
+  'curr_value' => $cgi->param('tax_override')
+&>
 
 % } # if !$cust_pkg
 
index ab2d69d..9e194f4 100644 (file)
 
 </style>
 
-<& /elements/one_time_charge_link.html, form_only=>1 &>
-
 <ul id="customer_menu">
 % foreach my $submenu (@processed_menu) {
   <li>
@@ -358,12 +356,7 @@ my @menu = (
     {
       # it's just a popup, but there's some freaky CCH tax stuff in it
       label       => 'One-time charge',
-      content     => sub {
-                      include( '/elements/one_time_charge_link.html',
-                        custnum => shift->custnum,
-                        no_form => 1,
-                      );
-                     },
+      url         => "edit/quick-charge.html?custnum=$custnum",
       acl         => 'One-time charge',
     },
     {
index e167e26..0a5305e 100644 (file)
@@ -350,14 +350,8 @@ sub pkg_change_link {
 sub onetime_change_link {
   my $cust_pkg = shift;
   my $pkgnum = $cust_pkg->pkgnum;
-  include( '/elements/popup_link-cust_pkg.html',
-    'action'      => $p. "edit/quick-charge.html?change_pkgnum=$pkgnum",
-    'label'       => emt('Modify one-time charge'),
-    'actionlabel' => emt('Modify'),
-    'cust_pkg'    => $cust_pkg,
-    'width'       => 690,
-    'height'      => 440,
-  );
+  '<A HREF="' . $fsurl . "edit/quick-charge.html?change_pkgnum=$pkgnum" .
+  '">' . emt('Modify one-time charge') . '</A>'
 }
 
 sub pkg_change_location_link {
index 5646fb9..7221d53 100755 (executable)
@@ -23,9 +23,13 @@ function areyousure(href, message) {
 
 %   if ( $curuser->access_right('One-time charge') ) {
       <% $inrow ? ' | ' : '' %>
-      <& /elements/one_time_charge_link.html,
-             map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
-        &>
+%     my $query = 'quotationnum=' . $quotation->get('quotationnum');
+%     if ($quotation->custnum) {
+%       $query .= ';custnum=' . $quotation->custnum;
+%     } else {
+%       $query .= ';prospectnum=' . $quotation->prospectnum;
+%     }
+      <A HREF="<% $fsurl . 'edit/quick-charge.html?' . $query %>"><% emt('One-time charge') %></A>
 %     $inrow++;
 %   }