[freeside-commits] freeside/httemplate/elements menu.html, 1.31, 1.32 tr-select-reason.html, 1.4, 1.5

Jeff Finucane,420,, jeff at wavetail.420.am
Tue Dec 4 10:21:00 PST 2007


Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail:/tmp/cvs-serv23022/httemplate/elements

Modified Files:
	menu.html tr-select-reason.html 
Log Message:
change credit reasons from freetext to new reason/reason type system (#2777)

Index: menu.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/menu.html,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- menu.html	3 Nov 2007 17:38:11 -0000	1.31
+++ menu.html	4 Dec 2007 18:20:58 -0000	1.32
@@ -267,6 +267,7 @@
   $config_billing{'View/Edit prepaid cards'}          = [ $fsurl.'search/prepay_credit.html', 'View outstanding cards, generate new cards' ];
   $config_billing{'View/Edit call rates and regions'} = [ $fsurl.'browse/rate.cgi', 'Manage rate plans, regions and prefixes for VoIP and call billing' ];
   $config_billing{'View/Edit locales and tax rates'}  = [ $fsurl.'browse/cust_main_county.cgi', 'Change tax rates, or break down a country into states, or a state into counties and assign different tax rates to each' ];
+  $config_billing{'View/Edit credit reason types'}  = [ $fsurl.'browse/reason_type.html?class=R', 'Credit reason types define groups of reasons, for reporting and convenience purposes.' ];
 }
 
 tie my %config_dialup, 'Tie::IxHash',

Index: tr-select-reason.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/tr-select-reason.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- tr-select-reason.html	1 Aug 2007 22:25:10 -0000	1.4
+++ tr-select-reason.html	4 Dec 2007 18:20:58 -0000	1.5
@@ -53,18 +53,39 @@
   </TD>
 </TR>
 
+%     my @types = qsearch( 'reason_type', { 'class' => $class } );
+%   if (scalar(@types) < 1) {  # we should never reach this
+<TR>
+  <TD ALIGN="right">
+    <P>No reason types.  Go add some. </P>
+  </TD>
+</TR>
+%   }elsif (scalar(@types) == 1) {
+<TR>
+  <TD ALIGN="right">
+    <P id="new<% $name %>TLabel" style="display:<% $display %>">Reason Type</P>
+  </TD>
+  <TD>
+    <P id="new<% $name %>T" disabled="<% $disabled %>" style="display:<% $display %>"><% $types[0]->type %>
+    <INPUT type="hidden" name="new<% $name %>T" value="<% $types[0]->typenum %>">
+  </TD>
+</TR>
+
+%   }else{
+
 <TR>
   <TD ALIGN="right">
     <P id="new<% $id %>TLabel" style="display:<% $display %>">Reason Type</P>
   </TD>
   <TD>
     <SELECT id="new<% $id %>T" name="new<% $name %>T" "<% $disabled %>" style="display:<% $display %>">
-%     for my $type (qsearch( 'reason_type', { 'class' => $class } )){
+%     for my $type (@types)){
         <OPTION VALUE="<% $type->typenum %>" <% ($init_type == $type->typenum) ? 'SELECTED' : '' %>><% $type->type %></OPTION>
 %     }
     </SELECT>
   </TD>
 </TR>
+%   }
 
 <TR>
   <TD ALIGN="right">
@@ -94,6 +115,9 @@
 } elsif ($class eq 'S') {
   $access_right = 'Suspend customer package';
   $add_access_right = 'Add on-the-fly suspend reason';
+} elsif ($class eq 'S') {
+  $access_right = 'Post credit';
+  $add_access_right = 'Add on-the-fly credit reason';
 } else {
   die "illegal class: $class";
 }
@@ -113,7 +137,8 @@
 
 }
 
-my $extra_sql = "WHERE class = '$class' ORDER BY reason_type";
+my $extra_sql = "WHERE class = '$class' and (disabled = '' OR disabled is NULL) ".
+                "ORDER BY reason_type";
 my $curuser = $FS::CurrentUser::CurrentUser;
 
 </%init>



More information about the freeside-commits mailing list