freeside/httemplate/edit/process REAL_cust_pkg.cgi,1.5,1.6

ivan ivan at pouncequick.420.am
Wed Dec 22 06:06:48 PST 2004


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory pouncequick:/tmp/cvs-serv7213/process

Modified Files:
	REAL_cust_pkg.cgi 
Log Message:
warn and require confirmation when editing next bill dates to a date in the past, closes; Bug#430

Index: REAL_cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/REAL_cust_pkg.cgi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- REAL_cust_pkg.cgi	22 Mar 2004 11:05:58 -0000	1.5
+++ REAL_cust_pkg.cgi	22 Dec 2004 14:06:45 -0000	1.6
@@ -8,9 +8,19 @@
 $hash{'last_bill'} =
   $cgi->param('last_bill') ? str2time($cgi->param('last_bill')) : '';
 $hash{'expire'} = $cgi->param('expire') ? str2time($cgi->param('expire')) : '';
-my $new = new FS::cust_pkg \%hash;
 
-my $error = $new->replace($old);
+my $new;
+my $error;
+if ( $hash{'bill'} != $old->bill        # if the next bill date was changed
+     && $hash{'bill'} < time            # to a date in the past
+     && ! $cgi->param('bill_areyousure') # and it wasn't confirmed
+   )
+{
+  $error = '_bill_areyousure';
+} else {
+  $new = new FS::cust_pkg \%hash;
+  $error = $new->replace($old);
+}
 
 if ( $error ) {
   $cgi->param('error', $error);




More information about the freeside-commits mailing list