% include("/elements/header.html",'Customer package - Edit dates') %> %#, menubar( %# "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", %#));
<% include('/elements/footer.html') %> <%once> #my $format = "%c %z (%Z)"; my $format = "%m/%d/%Y %T %z (%Z)"; #false laziness w/view/cust_main/packages.html #my( $billed_or_prepaid, %once> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Edit customer package dates'); my $error = ''; my( $pkgnum, $cust_pkg ); if ( $cgi->param('error') ) { $pkgnum = $cgi->param('pkgnum'); if ( $cgi->param('error') =~ /^_/ ) { my @errors = (); my %errors = map { $_=>1 } split(',', $cgi->param('error')); $cgi->param('error', ''); if ( $errors{'_bill_areyousure'} ) { if ( $cgi->param('bill') =~ /^([\s\d\/\:\-\(\w\)]*)$/ ) { my $bill = $1; push @errors, "You are attempting to set the next bill date to $bill, which is in the past. This will charge the customer for the interval from $bill until now. Are you sure you want to do this? ". ''; } } if ( $errors{'_setup_areyousure'} ) { push @errors, "You are attempting to remove the setup date. This will re-charge the customer for the setup fee. Are you sure you want to do this? ". ''; } if ( $errors{'_start'} ) { push @errors, "You are attempting to add a start date to a package that has already started billing."; } $error = join('