[freeside-commits] freeside/httemplate/edit/process discount.html, 1.1, 1.2 quick-cust_pkg.cgi, 1.16, 1.17

Ivan,,, ivan at wavetail.420.am
Thu Feb 4 18:39:33 PST 2010


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv16400/httemplate/edit/process

Modified Files:
	discount.html quick-cust_pkg.cgi 
Log Message:
discounts, RT#6679

Index: discount.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/discount.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- discount.html	30 Jan 2010 07:38:32 -0000	1.1
+++ discount.html	5 Feb 2010 02:39:31 -0000	1.2
@@ -1,7 +1,6 @@
 <% include( 'elements/process.html',
                'table'       => 'discount',
                'viewall_dir' => 'browse',
-               'precheck_callback' => $precheck_callback,
            )
 %>
 <%init>
@@ -9,20 +8,4 @@
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
 
-my $precheck_callback = sub {
-  my( $cgi ) = @_;
-
-  if ( $cgi->param('_type') eq 'Select discount type' ) {
-    return 'Please select a discount type';
-  } elsif ( $cgi->param('_type') eq 'Amount' ) {
-    $cgi->param('percent', '0');
-    return 'Amount must be greater than 0' unless $cgi->param('amount') > 0;
-  } elsif ( $cgi->param('_type') eq 'Percentage' ) {
-    $cgi->param('amount', '0.00');
-    return 'Percentage must be greater than 0' unless $cgi->param('percent') > 0;
-  }
-
-  '';
-};
-
 </%init>

Index: quick-cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/quick-cust_pkg.cgi,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- quick-cust_pkg.cgi	30 Jan 2010 08:55:11 -0000	1.16
+++ quick-cust_pkg.cgi	5 Feb 2010 02:39:31 -0000	1.17
@@ -45,17 +45,27 @@
 $cgi->param('locationnum') =~ /^(\-?\d*)$/
   or die 'illegal locationnum '. $cgi->param('locationnum');
 my $locationnum = $1;
+$cgi->param('discountnum') =~ /^(\-?\d*)$/
+  or die 'illegal discountnum '. $cgi->param('discountnum');
+my $discountnum = $1;
+
 
 my $cust_pkg = new FS::cust_pkg {
-  'custnum'     => $custnum,
-  'pkgpart'     => $pkgpart,
-  'start_date'  => ( scalar($cgi->param('start_date'))
-                       ? str2time($cgi->param('start_date'))
-                       : ''
-                   ),
-  'discountnum' => scalar($cgi->param('discountnum')),
-  'refnum'      => $refnum,
-  'locationnum' => $locationnum,
+  'custnum'              => $custnum,
+  'pkgpart'              => $pkgpart,
+  'start_date'           => ( scalar($cgi->param('start_date'))
+                                ? str2time($cgi->param('start_date'))
+                                : ''
+                            ),
+  'refnum'               => $refnum,
+  'locationnum'          => $locationnum,
+  'discountnum'          => $discountnum,
+  #for the create a new discount case
+  'discountnum__type'    => scalar($cgi->param('discountnum__type')),
+  'discountnum_amount'   => scalar($cgi->param('discountnum_amount')),
+  'discountnum_percent'  => scalar($cgi->param('discountnum_percent')),
+  'discountnum_months'   => scalar($cgi->param('discountnum_months')),
+  #'discountnum_disabled' => scalar($cgi->param('discountnum_disabled')),
 };
 
 my %opt = ( 'cust_pkg' => $cust_pkg );



More information about the freeside-commits mailing list