diff options
author | jeff <jeff> | 2010-09-22 19:16:20 +0000 |
---|---|---|
committer | jeff <jeff> | 2010-09-22 19:16:20 +0000 |
commit | 5250c44bd7f282c7d782bf0e8349af12376929df (patch) | |
tree | b2afcd8e47270c6f5b78cff378849168d17ed765 /httemplate/elements/select-discount_term.html | |
parent | 60ee9af0e885def0dd61f4a5506ac0e55d779e89 (diff) |
prepayment discounts rt#5318
Diffstat (limited to 'httemplate/elements/select-discount_term.html')
-rw-r--r-- | httemplate/elements/select-discount_term.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/httemplate/elements/select-discount_term.html b/httemplate/elements/select-discount_term.html new file mode 100644 index 000000000..26d877a86 --- /dev/null +++ b/httemplate/elements/select-discount_term.html @@ -0,0 +1,32 @@ +% if ( scalar(@discount_term) ) { + <SELECT NAME="discount_term"> + <OPTION VALUE="">1 month +% foreach my $discount_term (@discount_term) { +% my $sel = ( $cgi->param('discount_term') == $discount_term ) ? 'SELECTED' : ''; + <OPTION <% $sel %> VALUE="<% $discount_term %>"><% $discount_term. " months" %> +% } + </SELECT> +% } +<%init> + +my %opt = @_; + +my $cgi = $opt{'cgi'}; + +my @discount_term; +if ( $opt{discount_term} ) { + + @discount_term = @{ $opt{discount_term} }; + +} else { + + my $custnum = $opt{'custnum'}; + + my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ) + or die "unknown custnum $custnum\n"; + + @discount_term = $cust_main->discount_terms; + +} + +</%init> |