X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2FREAL_cust_pkg.cgi;h=c31213805362315a271bc802ac84e1867581c488;hb=5fa9ce1b7c8b934e96a6a2f850a4e788eb76f495;hp=d9b7579f68200941a4ebe86ca936d08adf017fa8;hpb=f7fd2a3e34da751cbc02bbf215e99c6dc89adc15;p=freeside.git diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi index d9b7579f6..c31213805 100755 --- a/httemplate/edit/REAL_cust_pkg.cgi +++ b/httemplate/edit/REAL_cust_pkg.cgi @@ -1,131 +1,221 @@ - -<% -# +<% 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 ); -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('