[freeside-commits] freeside/httemplate/edit part_pkg.cgi, 1.122, 1.123
Ivan,,,
ivan at wavetail.420.am
Thu Jun 9 20:33:45 PDT 2011
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail.420.am:/tmp/cvs-serv15864/httemplate/edit
Modified Files:
part_pkg.cgi
Log Message:
add package def option to show $0 recurring on invoices, RT#9777
Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_pkg.cgi,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -w -d -r1.122 -r1.123
--- part_pkg.cgi 18 Oct 2010 02:46:32 -0000 1.122
+++ part_pkg.cgi 10 Jun 2011 03:33:43 -0000 1.123
@@ -45,6 +45,7 @@
'agentnum' => 'Agent',
'setup_fee' => 'Setup fee',
'recur_fee' => 'Recurring fee',
+ 'recur_show_zero' => 'Show zero recurring',
'discountnum' => 'Offer discounts for longer terms',
'bill_dst_pkgpart' => 'Include line item(s) from package',
'svc_dst_pkgpart' => 'Include services of package',
@@ -107,6 +108,13 @@
{ field => 'recur_fee',
type => 'money',
disabled => sub { $recur_disabled },
+ onchange => 'recur_changed',
+ },
+
+ { field => 'recur_show_zero',
+ type => 'checkbox',
+ value => 'Y',
+ disabled => sub { $recur_show_zero_disabled },
},
#price plan
@@ -324,6 +332,7 @@
my %options = ();
my $recur_disabled = 1;
+my $recur_show_zero_disabled = 1;
my $pkgpart = '';
@@ -335,6 +344,10 @@
$opt->{action} = 'Custom' if $cgi->param('pkgnum');
$recur_disabled = $cgi->param('freq') ? 0 : 1;
+ $recur_show_zero_disabled =
+ $cgi->param('freq')
+ ? $cgi->param('recur_fee') ? 0 : 1
+ : 1;
foreach ($cgi->param) {
/^usage_taxproductnum_(\d+)$/ && ($taxproductnums{$1} = 1);
@@ -512,16 +525,34 @@
if ( freq == '0' ) {
what.form.recur_fee.disabled = true;
what.form.recur_fee.style.backgroundColor = '#dddddd';
+ what.form.recur_show_zero.disabled = true;
+ //what.form.recur_show_zero.style.backgroundColor= '#dddddd';
} else {
what.form.recur_fee.disabled = false;
what.form.recur_fee.style.backgroundColor = '#ffffff';
+ what.form.recur_show_zero.disabled = false;
+ //what.form.recur_show_zero.style.backgroundColor= '#ffffff';
}
}
+ function recur_changed(what) {
+ var recur = what.value;
+ if ( recur == 0 ) {
+ what.form.recur_show_zero.disabled = false;
+ } else {
+ what.form.recur_show_zero.disabled = true;
+ }
+ }
+
function agent_changed(what) {
- var agentnum = what.options[what.selectedIndex].value;
+ var agentnum;
+ if ( what.type == 'select-one' ) {
+ agentnum = what.options[what.selectedIndex].value;
+ } else {
+ agentnum = what.value;
+ }
if ( agentnum == 0 ) {
what.form.agent_type.disabled = false;
More information about the freeside-commits
mailing list