[freeside-commits] freeside/httemplate/edit/process discount.html, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Fri Jan 29 23:38:34 PST 2010
Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv5851/httemplate/edit/process
Added Files:
discount.html
Log Message:
discounts, RT#6679
--- NEW FILE: discount.html ---
<% 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>
More information about the freeside-commits
mailing list