X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fdiscount.html;h=eb4e92e9f6984e1c36549047873de4daff28c7b6;hb=1fc8addc56f8daf12397da568eb1ac1b27fd3984;hp=54307b708e931970eac3f68532d0d90461407181;hpb=0fcdc36642e1430f02ebf5326740e231883bd41f;p=freeside.git diff --git a/httemplate/edit/process/discount.html b/httemplate/edit/process/discount.html index 54307b708..eb4e92e9f 100644 --- a/httemplate/edit/process/discount.html +++ b/httemplate/edit/process/discount.html @@ -1,7 +1,7 @@ <% include( 'elements/process.html', 'table' => 'discount', 'viewall_dir' => 'browse', - 'precheck_callback' => $precheck_callback, + 'fields' => [ fields('discount'), '_type' ], ) %> <%init> @@ -9,20 +9,4 @@ 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; - } - - ''; -}; -