X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fedit%2FREAL_cust_pkg.cgi;h=859baa1b1dec35750f6a50244ddc9b34d5e0bbc0;hb=41d0660124cf3965a4a2b4706d02e382ac4cbf01;hp=d9b7579f68200941a4ebe86ca936d08adf017fa8;hpb=2041a9143fac20b79ead4a1ae01224dedf5b27c2;p=freeside.git diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi index d9b7579f6..859baa1b1 100755 --- a/httemplate/edit/REAL_cust_pkg.cgi +++ b/httemplate/edit/REAL_cust_pkg.cgi @@ -1,131 +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 ( $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('