X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2FREAL_cust_pkg.cgi;h=170281ba0e5b98bdbff10e94128aa39fab0f31a9;hb=8688a1fe1b157c1061e928823d81ba1b7f34cde8;hp=9cbab2a162597c248ad9546091b1327491e0e49f;hpb=0715590a107d7e17a37b2f4235b6c8a540783d1e;p=freeside.git diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi index 9cbab2a16..170281ba0 100755 --- a/httemplate/edit/REAL_cust_pkg.cgi +++ b/httemplate/edit/REAL_cust_pkg.cgi @@ -1,138 +1,225 @@ - -<% -# +<% include("/elements/header.html",'Customer package - Edit dates') %> + +%#, menubar( +%# "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", +%#)); + + + + + + +
+ +<% include('/elements/footer.html') %> +<%shared> + +my $conf = new FS::Conf; +my $date_format = $conf->config('date_format') || '%m/%d/%Y'; + +my $format = $date_format. ' %T'; # %z (%Z)'; + +%shared> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Edit customer package dates'); + + +my $error = ''; +my( $pkgnum, $cust_pkg ); -my $error =''; -my $pkgnum = ''; if ( $cgi->param('error') ) { - $error = $cgi->param('error'); + $pkgnum = $cgi->param('pkgnum'); - if ( $error eq '_bill_areyousure' ) { - my $bill = $cgi->param('bill'); - $error = "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 ( $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('