[freeside-commits] freeside/httemplate/misc order_pkg.html, 1.10, 1.11 cust-part_pkg.cgi, 1.2, 1.3

Ivan,,, ivan at wavetail.420.am
Sat Jan 30 12:05:17 PST 2010


Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory wavetail.420.am:/tmp/cvs-serv5401/httemplate/misc

Modified Files:
	order_pkg.html cust-part_pkg.cgi 
Log Message:
discounts, RT#6679

Index: cust-part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/cust-part_pkg.cgi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cust-part_pkg.cgi	19 Dec 2009 19:09:30 -0000	1.2
+++ cust-part_pkg.cgi	30 Jan 2010 20:05:15 -0000	1.3
@@ -23,7 +23,7 @@
   'order_by'  => 'ORDER BY pkg',
 });
 
-my @return = map  { $_->pkgpart => $_->pkg_comment }
+my @return = map  { ( $_->pkgpart, $_->pkg_comment, $_->can_discount ); }
              #sort { $a->pkg_comment cmp $b->pkg_comment }
              @part_pkg;
 

Index: order_pkg.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/order_pkg.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- order_pkg.html	30 Jan 2010 08:55:11 -0000	1.10
+++ order_pkg.html	30 Jan 2010 20:05:15 -0000	1.11
@@ -10,8 +10,14 @@
   function enable_order_pkg () {
     if ( document.OrderPkgForm.pkgpart.selectedIndex > 0 ) {
       document.OrderPkgForm.submit.disabled = false;
+      if ( document.OrderPkgForm.pkgpart.options[document.OrderPkgForm.pkgpart.selectedIndex].getAttribute('data-can_discount') == 1 ) {
+        document.OrderPkgForm.discountnum.disabled = false;
+      } else {
+        document.OrderPkgForm.discountnum.disabled = true;
+      }
     } else {
       document.OrderPkgForm.submit.disabled = true;
+      document.OrderPkgForm.discountnum.disabled = true;
     }
   }
 
@@ -61,7 +67,10 @@
 </SCRIPT>
 
 % if ( $curuser->access_right('Discount customer package') ) {
-  <% include('/elements/tr-select-discount.html') %>
+  <% include('/elements/tr-select-discount.html',
+               'element_etc' => 'DISABLED',
+            )
+  %>
 % }
 
 % if ( $conf->exists('pkg_referral') ) {



More information about the freeside-commits mailing list