diff options
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/tr-select-invoice.html | 9 | ||||
-rw-r--r-- | httemplate/elements/tr-select-payment_options.html | 5 |
2 files changed, 10 insertions, 4 deletions
diff --git a/httemplate/elements/tr-select-invoice.html b/httemplate/elements/tr-select-invoice.html index 434042c..d35813f 100644 --- a/httemplate/elements/tr-select-invoice.html +++ b/httemplate/elements/tr-select-invoice.html @@ -26,10 +26,14 @@ Example: <OPTION VALUE="select">Select an invoice to pay</OPTION> % foreach my $record (@invoices) { % my $read_date = time2str("%b %o, %Y", $record->_date); - <OPTION VALUE="<% $record->charged %>"><% $record->invnum %> (<% $read_date %>) - <% $record->charged %></OPTION> +% $hidden .= '<INPUT TYPE="hidden" ID="inv'.$record->invnum.'" NAME="inv'.$record->invnum.'" VALUE="'.$record->owed.'">'; + <OPTION VALUE="<% $record->invnum %>"><% $record->invnum %> (<% $read_date %>) - <% $record->owed %></OPTION> % } - </SELECT> + </SELECT> + + <% $hidden %> + </TD> </TR> @@ -37,6 +41,7 @@ Example: my %opt = @_; my $status = $opt{'status'} ? $opt{'status'} : 'all'; +my $hidden; my @invoices; if ($status eq "all") { @invoices = $opt{'cust_main'}->cust_bill; } diff --git a/httemplate/elements/tr-select-payment_options.html b/httemplate/elements/tr-select-payment_options.html index 35e6def..f86f3ed 100644 --- a/httemplate/elements/tr-select-payment_options.html +++ b/httemplate/elements/tr-select-payment_options.html @@ -131,11 +131,12 @@ Example: function <% $opt{prefix} %>invoice_select_changed(what) { var surcharge; + var invdue = document.getElementById("<% $opt{prefix} %>inv" + what.value); if (document.getElementById('surcharge_percentage') || document.getElementById('surcharge_flatfee')) { - surcharge = (+what.value * +document.getElementById('surcharge_percentage').value) + +document.getElementById('surcharge_flatfee').value; + surcharge = (+invdue.value * +document.getElementById('surcharge_percentage').value) + +document.getElementById('surcharge_flatfee').value; } else { surcharge = 0; } - var amount = +what.value + +surcharge; + var amount = +invdue.value + +surcharge; if ( what.value == 'select' ) { $('#payment_amount_row').hide(); |