diff options
author | ivan <ivan> | 2010-01-30 07:38:32 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-01-30 07:38:32 +0000 |
commit | 0fcdc36642e1430f02ebf5326740e231883bd41f (patch) | |
tree | e5633883c65370134141202c40c616d35481d434 /httemplate/edit/process | |
parent | 11b586f0fad8164514d272cee321e12bde6a49ef (diff) |
discounts, RT#6679
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r-- | httemplate/edit/process/discount.html | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/httemplate/edit/process/discount.html b/httemplate/edit/process/discount.html new file mode 100644 index 000000000..54307b708 --- /dev/null +++ b/httemplate/edit/process/discount.html @@ -0,0 +1,28 @@ +<% include( 'elements/process.html', + 'table' => 'discount', + 'viewall_dir' => 'browse', + 'precheck_callback' => $precheck_callback, + ) +%> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $precheck_callback = sub { + my( $cgi ) = @_; + + if ( $cgi->param('_type') eq 'Select discount type' ) { + return 'Please select a discount type'; + } elsif ( $cgi->param('_type') eq 'Amount' ) { + $cgi->param('percent', '0'); + return 'Amount must be greater than 0' unless $cgi->param('amount') > 0; + } elsif ( $cgi->param('_type') eq 'Percentage' ) { + $cgi->param('amount', '0.00'); + return 'Percentage must be greater than 0' unless $cgi->param('percent') > 0; + } + + ''; +}; + +</%init> |