summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/city.html4
-rw-r--r--httemplate/elements/contact.html2
-rw-r--r--httemplate/elements/progress-init.html2
-rw-r--r--httemplate/elements/select-cust-fields.html10
-rw-r--r--httemplate/elements/tr-amount_fee.html6
-rw-r--r--httemplate/elements/tr-select-cust-fields.html9
-rw-r--r--httemplate/elements/tr-select-payment_options.html2
7 files changed, 28 insertions, 7 deletions
diff --git a/httemplate/elements/city.html b/httemplate/elements/city.html
index 3c5e91782..f710d04db 100644
--- a/httemplate/elements/city.html
+++ b/httemplate/elements/city.html
@@ -131,6 +131,10 @@ function <% $pre %>county_changed(what, callback) {}
<% $select_style %>
>
+% if ( $opt{city} ) {
+ <OPTION VALUE="<% $opt{city} %>" SELECTED><% $opt{city} %></OPTION>
+% }
+
% unless ( $opt{'disable_empty'} ) {
<OPTION VALUE="" <% $opt{city} eq '' ? 'SELECTED' : '' %>><% $opt{empty_label} %></OPTION>
% }
diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html
index 599f6629d..308b846bc 100644
--- a/httemplate/elements/contact.html
+++ b/httemplate/elements/contact.html
@@ -180,7 +180,7 @@ unless ($opt{'for_prospect'}) {
}
my $first = 0;
-foreach my $phone_type ( qsearch({table=>'phone_type', order_by=>'weight'}) ) {
+foreach my $phone_type ( FS::phone_type->get_phone_types() ) {
next if $phone_type->typename =~ /^(Home|Fax)$/;
my $f = 'phonetypenum'.$phone_type->phonetypenum;
$label{$f} = $phone_type->typename. ' phone';
diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html
index 2a62c5e99..de3c6b761 100644
--- a/httemplate/elements/progress-init.html
+++ b/httemplate/elements/progress-init.html
@@ -126,6 +126,8 @@ function <%$key%>process () {
}
}
+ Hash.push('key', '<%$key%>');
+
// jsrsPOST = true;
// jsrsExecute( '<% $action %>', <%$key%>myCallback, 'start_job', Hash );
diff --git a/httemplate/elements/select-cust-fields.html b/httemplate/elements/select-cust-fields.html
index 5e3063877..833f7c1af 100644
--- a/httemplate/elements/select-cust-fields.html
+++ b/httemplate/elements/select-cust-fields.html
@@ -1,8 +1,14 @@
<%init>
my( $cust_fields, %opt ) = @_;
- use FS::ConfDefaults;
- $opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ];
+ my @fields = FS::ConfDefaults->cust_fields_avail();
+ my $contact_phone_list;
+ foreach my $phone_type ( FS::phone_type->get_phone_types() ) {
+ $contact_phone_list .= " | Contact ".$phone_type->typename." phone(s)";
+ }
+ @fields = map {s/ \| Contact phone\(s\)/$contact_phone_list/g; $_; } @fields;
+
+ $opt{'avail_fields'} ||= [ @fields ];
tie my %hash, 'Tie::IxHash', @{ $opt{'avail_fields'} };
</%init>
diff --git a/httemplate/elements/tr-amount_fee.html b/httemplate/elements/tr-amount_fee.html
index 94795de37..40f55e7a3 100644
--- a/httemplate/elements/tr-amount_fee.html
+++ b/httemplate/elements/tr-amount_fee.html
@@ -5,7 +5,7 @@
<% $money_char %><INPUT NAME = "amount"
ID = "amount"
TYPE = "text"
- VALUE = "<% $amount %>"
+ VALUE = "0.00"
SIZE = 8
STYLE = "text-align:right;"
% if ( $fee || $surcharge_percentage || $surcharge_flatfee || $processing_fee) {
@@ -44,7 +44,7 @@
<TD>
<TABLE><TR>
<TD BGCOLOR="#ffffff">
- <INPUT TYPE="checkbox" NAME="processing_fee" ID="processing_fee" VALUE="<% $processing_fee %>" onclick="<% $opt{prefix} %>process_fee_changed()">
+ <INPUT TYPE="checkbox" NAME="processing_fee" ID="processing_fee" VALUE="<% $processing_fee %>" onclick="<% $opt{prefix} %>process_fee_changed()" checked>
</TD>
<TD ID="ajax_processingfee_cell" BGCOLOR="#dddddd" STYLE="border:1px solid blue">
<FONT SIZE="+1">A processing fee of <% $processing_fee %> is being applied to this transaction.</FONT>
@@ -140,6 +140,8 @@ if ( $amount ) {
$amount += $surcharge;
+ $amount += $processing_fee; ## needed if processing fee is checked on default.
+
$amount = sprintf("%.2f", $amount);
}
diff --git a/httemplate/elements/tr-select-cust-fields.html b/httemplate/elements/tr-select-cust-fields.html
index dd8513316..cbac20280 100644
--- a/httemplate/elements/tr-select-cust-fields.html
+++ b/httemplate/elements/tr-select-cust-fields.html
@@ -6,6 +6,13 @@
my( $cust_fields, %opt ) = @_;
-$opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ];
+my @fields = FS::ConfDefaults->cust_fields_avail();
+my $contact_phone_list;
+foreach my $phone_type ( FS::phone_type->get_phone_types() ) {
+ $contact_phone_list .= " | Contact ".$phone_type->typename." phone(s)";
+}
+@fields = map {s/ \| Contact phone\(s\)/$contact_phone_list/g; $_; } @fields;
+
+$opt{'avail_fields'} ||= [ @fields ];
</%init>
diff --git a/httemplate/elements/tr-select-payment_options.html b/httemplate/elements/tr-select-payment_options.html
index c5b84e756..27df9622e 100644
--- a/httemplate/elements/tr-select-payment_options.html
+++ b/httemplate/elements/tr-select-payment_options.html
@@ -60,7 +60,7 @@ Example:
$('#payment_option_row').<% $payment_option_row %>();
$('#payment_amount_row').<% $payment_amount_row %>();
- $('#ajax_processingfee_cell').hide();
+ $('#ajax_processingfee_cell').show();
if($('#payment_amount_row').is(':visible')) {
var surcharge;