[freeside-commits] freeside/httemplate/edit/cust_main billing.html, 1.31.2.1, 1.31.2.2
Erik Levinson
levinse at wavetail.420.am
Sun Apr 24 10:04:41 PDT 2011
Update of /home/cvs/cvsroot/freeside/httemplate/edit/cust_main
In directory wavetail.420.am:/tmp/cvs-serv753/httemplate/edit/cust_main
Modified Files:
Tag: FREESIDE_2_1_BRANCH
billing.html
Log Message:
add per-customer configurable billing date, RT10813
Index: billing.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main/billing.html,v
retrieving revision 1.31.2.1
retrieving revision 1.31.2.2
diff -u -w -d -r1.31.2.1 -r1.31.2.2
--- billing.html 12 Apr 2011 02:51:52 -0000 1.31.2.1
+++ billing.html 24 Apr 2011 17:04:39 -0000 1.31.2.2
@@ -96,6 +96,14 @@
return true;
}
+ function payauto_changed(payauto_field){
+ var f = (payauto_field.name == 'CARD_payauto') ? 'card_billday' : 'chek_billday';
+ f = document.getElementById(f);
+ if ( f == null) return;
+ if(payauto_field.checked) f.style.display = 'inline';
+ else f.style.display = 'none';
+ }
+
</SCRIPT>
<% include('/elements/init_overlib.html') %>
@@ -120,6 +128,19 @@
% : $payby eq 'CHEK' ? 'CHECKED'
% : $disable_payauto ? '' : 'CHECKED';
%
+% sub billday_options {
+% my $curr_value = shift;
+% my $ret = '<OPTION></OPTION>';
+% for my $billday ( 1 .. 28 ) {
+% my $sel = '';
+% $sel = "SELECTED='SELECTED'" if $curr_value == $billday;
+% $ret .= "<OPTION VALUE='$billday' $sel>$billday</OPTION>";
+% }
+% $ret;
+% }
+% my $billday_card_display = $payby eq 'CARD' ? 'inline' : 'none';
+% my $billday_chek_display = $payby eq 'CHEK' ? 'inline' : 'none';
+%
% my %payby = (
%
% 'CARD' =>
@@ -171,7 +192,14 @@
% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Exact name on card </TD>!.
% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="CARD_payname" VALUE="!. ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->payname : '' ). qq!"></TD></TR>!.
%
-% qq!<TR><TD COLSPAN=2 WIDTH="608"><INPUT TYPE="checkbox" NAME="CARD_payauto" $CARD_payauto_checked> Charge future payments to this card automatically</TD></TR>!.
+% qq!<TR><TD COLSPAN=2 WIDTH="608"><INPUT TYPE="checkbox" onchange="payauto_changed(this);" NAME="CARD_payauto" $CARD_payauto_checked> Charge future payments to this card automatically</TD></TR>!.
+%
+% ( $conf->exists('cust_main-select-billday') ?
+% qq!<TR><TD COLSPAN=2 WIDTH="608" id="card_billday" style="display: $billday_card_display">
+% Charge on the <SELECT NAME="billday">!
+% . billday_options($cust_main->billday) . qq!</SELECT> day of each month</TD></TR>!
+% : ''
+% ).
%
% '</TABLE>',
%
@@ -209,7 +237,14 @@
% ).
%
%
-% qq!<TR><TD COLSPAN=4 WIDTH="608"><INPUT TYPE="checkbox" NAME="CHEK_payauto" $CHEK_payauto_checked> Charge future payments to this electronic check automatically</TD></TR>!.
+% qq!<TR><TD COLSPAN=4 WIDTH="608"><INPUT TYPE="checkbox" onchange="payauto_changed(this);" NAME="CHEK_payauto" $CHEK_payauto_checked> Charge future payments to this electronic check automatically</TD></TR>!.
+%
+% ( $conf->exists('cust_main-select-billday') ?
+% qq!<TR><TD COLSPAN=2 WIDTH="608" id="chek_billday" style="display: $billday_chek_display">
+% Charge on the <SELECT NAME="billday">!
+% . billday_options($cust_main->billday) . qq!</SELECT> day of each month</TD></TR>!
+% : ''
+% ).
%
% '<TR><TD> </TD></TR>'.
% '<TR><TD> </TD></TR>'.
More information about the freeside-commits
mailing list