[freeside-commits] freeside/httemplate/misc recharge_svc.html, 1.1, 1.1.2.1
Jeff Finucane,420,,
jeff at wavetail.420.am
Mon Apr 9 16:39:59 PDT 2007
Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory wavetail:/tmp/cvs-serv20059/httemplate/misc
Modified Files:
Tag: FREESIDE_1_7_BRANCH
recharge_svc.html
Log Message:
trigger recharge from the backend as in self-service (backport)
Index: recharge_svc.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/recharge_svc.html,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -d -r1.1 -r1.1.2.1
--- recharge_svc.html 30 Nov 2006 02:27:56 -0000 1.1
+++ recharge_svc.html 9 Apr 2007 23:39:57 -0000 1.1.2.1
@@ -12,9 +12,26 @@
<% "Recharge $svcnum: $label - $value" %>
<% ntable("#cccccc", 2) %>
+<SCRIPT>
+ function toggle_prep(what) {
+ if (what.value == "PREP"){
+ what.form.prepaid.disabled = false;
+ }else{
+ what.form.prepaid.disabled = true;
+ }
+ }
+</SCRIPT>
+<TR>
+ <TD><INPUT TYPE="radio" NAME="payby" onchange="toggle_prep(this)" VALUE="PREP" <% $payby eq "PREP" ? 'checked' : '' %> <% $recharge_label ? '' : 'disabled' %>></TD>
+ <TD>Prepaid Card</TD>
+% if ($recharge_label) {
+ <TD><INPUT TYPE="radio" NAME="payby" onchange="toggle_prep(this)" VALUE="<% $cust_svc->cust_pkg->cust_main->payby %>" <% $payby eq "PREP" ? '' : 'checked' %>></TD>
+ <TD><% $recharge_label %></TD>
+% }
+</TR>
<TR>
<TD>Enter prepaid card: </TD>
- <TD><INPUT TYPE="text" NAME="prepaid" VALUE="<% $prepaid %>"></TD>
+ <TD><INPUT TYPE="text" NAME="prepaid" VALUE="<% $prepaid %>" <% $payby eq "PREP" ? '' : 'disabled' %>></TD>
</TR>
</TABLE>
@@ -26,11 +43,16 @@
</BODY>
</HTML>
+<%once>
+my $conf = new FS::Conf;
+my $money_char = $conf->config('money_char') || '$';
+</%once>
<%init>
-my($svcnum, $cust_svc, $label, $value, $prepaid);
+my($svcnum, $cust_svc, $part_pkg, $label, $value, $prepaid, $amount, $payby);
if ( $cgi->param('error') ) {
$svcnum = $cgi->param('svcnum');
$prepaid = $cgi->param('prepaid');
+ $payby = $cgi->param('payby');
} elsif ( $cgi->param('svcnum') =~ /^(\d+)$/ ) {
$svcnum = $1;
} else {
@@ -44,5 +66,20 @@
($label, $value) = $cust_svc->label;
+$payby = $cust_svc->cust_pkg->cust_main->payby unless $payby;
+$part_pkg = $cust_svc->cust_pkg->part_pkg;
+$amount = $part_pkg->option('recharge_amount', 1) || 0;
+my $recharge_label = "Charge $money_char$amount for ";
+$recharge_label .= $part_pkg->option('recharge_seconds', 1) . 's '
+ if $part_pkg->option('recharge_seconds', 1);
+$recharge_label .= $part_pkg->option('recharge_upbytes', 1) . ' up '
+ if $part_pkg->option('recharge_upbytes', 1);
+$recharge_label .= $part_pkg->option('recharge_downbytes', 1) . ' down '
+ if $part_pkg->option('recharge_downbytes', 1);
+$recharge_label .= $part_pkg->option('recharge_totalbytes', 1) . ' total '
+ if $part_pkg->option('recharge_totalbytes', 1);
+$recharge_label = ''
+ unless ($recharge_label ne "Charge $money_char$amount for ");
+
</%init>
More information about the freeside-commits
mailing list