[freeside-commits] freeside/FS/FS/part_pkg flat_comission.pm, 1.5, 1.6 flat_comission_cust.pm, 1.5, 1.6 flat_comission_pkg.pm, 1.4, 1.5
Jeff Finucane,420,,
jeff at wavetail.420.am
Tue Dec 4 10:21:00 PST 2007
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail:/tmp/cvs-serv23022/FS/FS/part_pkg
Modified Files:
flat_comission.pm flat_comission_cust.pm flat_comission_pkg.pm
Log Message:
change credit reasons from freetext to new reason/reason type system (#2777)
Index: flat_comission_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/flat_comission_pkg.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- flat_comission_pkg.pm 9 Jul 2005 10:36:43 -0000 1.4
+++ flat_comission_pkg.pm 4 Dec 2007 18:20:58 -0000 1.5
@@ -33,8 +33,15 @@
'select_key' => 'pkgpart',
'select_label' => 'pkg',
},
+ 'reason_type' => { 'name' => 'Reason type for commission credits',
+ 'type' => 'select',
+ 'select_table' => 'reason_type',
+ 'select_hash' => { 'class' => 'R' } ,
+ 'select_key' => 'typenum',
+ 'select_label' => 'type',
+ },
},
- 'fieldorder' => [ 'setup_fee', 'recur_fee', 'unused_credit', 'comission_depth', 'comission_amount', 'comission_pkgpart' ],
+ 'fieldorder' => [ 'setup_fee', 'recur_fee', 'unused_credit', 'comission_depth', 'comission_amount', 'comission_pkgpart', 'reason_type' ],
#'setup' => 'what.setup_fee.value',
#'recur' => '""; var pkgparts = ""; for ( var c=0; c < document.flat_comission_pkg.comission_pkgpart.options.length; c++ ) { if (document.flat_comission_pkg.comission_pkgpart.options[c].selected) { pkgparts = pkgparts + document.flat_comission_pkg.comission_pkgpart.options[c].value + \', \'; } } what.recur.value = \'my $error = $cust_pkg->cust_main->credit( \' + what.comission_amount.value + \' * scalar( grep { my $pkgpart = $_->pkgpart; grep { $_ == $pkgpart } ( \' + pkgparts + \' ) } $cust_pkg->cust_main->referral_cust_pkg(\' + what.comission_depth.value+ \')), "commission" ); die $error if $error; \' + what.recur_fee.value + \';\'',
#'disabled' => 1,
Index: flat_comission.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/flat_comission.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- flat_comission.pm 2 Dec 2006 22:04:10 -0000 1.5
+++ flat_comission.pm 4 Dec 2007 18:20:58 -0000 1.6
@@ -26,8 +26,15 @@
'comission_depth' => { 'name' => 'Number of layers',
'default' => 1,
},
+ 'reason_type' => { 'name' => 'Reason type for commission credits',
+ 'type' => 'select',
+ 'select_table' => 'reason_type',
+ 'select_hash' => { 'class' => 'R' },
+ 'select_key' => 'typenum',
+ 'select_label' => 'type',
+ },
},
- 'fieldorder' => [ 'setup_fee', 'recur_fee', 'unused_credit', 'comission_depth', 'comission_amount' ],
+ 'fieldorder' => [ 'setup_fee', 'recur_fee', 'unused_credit', 'comission_depth', 'comission_amount', 'reason_type' ],
#'setup' => 'what.setup_fee.value',
#'recur' => '\'my $error = $cust_pkg->cust_main->credit( \' + what.comission_amount.value + \' * scalar($cust_pkg->cust_main->referral_cust_pkg(\' + what.comission_depth.value+ \')), "commission" ); die $error if $error; \' + what.recur_fee.value + \';\'',
'weight' => 62,
@@ -45,7 +52,10 @@
if ( $commission > 0 ) {
- my $error = $cust_pkg->cust_main->credit( $commission, "commission" );
+ my $error =
+ $cust_pkg->cust_main->credit( $commission, "commission",
+ 'reason_type'=>$self->option('reason_type'),
+ );
die $error if $error;
}
Index: flat_comission_cust.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/flat_comission_cust.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- flat_comission_cust.pm 9 Jul 2005 10:36:43 -0000 1.5
+++ flat_comission_cust.pm 4 Dec 2007 18:20:58 -0000 1.6
@@ -26,8 +26,15 @@
'comission_depth' => { 'name' => 'Number of layers',
'default' => 1,
},
+ 'reason_type' => { 'name' => 'Reason type for commission credits',
+ 'type' => 'select_table',
+ 'select_table' => 'reason_type',
+ 'select_hash' => { 'class' => 'R' },
+ 'select_key' => 'typenum',
+ 'select_label' => 'type',
+ },
},
- 'fieldorder' => [ 'setup_fee', 'recur_fee', 'unused_credit', 'comission_depth', 'comission_amount' ],
+ 'fieldorder' => [ 'setup_fee', 'recur_fee', 'unused_credit', 'comission_depth', 'comission_amount', 'reason_type' ],
#'setup' => 'what.setup_fee.value',
#'recur' => '\'my $error = $cust_pkg->cust_main->credit( \' + what.comission_amount.value + \' * scalar($cust_pkg->cust_main->referral_cust_main_ncancelled(\' + what.comission_depth.value+ \')), "commission" ); die $error if $error; \' + what.recur_fee.value + \';\'',
'weight' => '60',
@@ -45,7 +52,9 @@
if ( $amount && $num_active ) {
my $error =
- $cust_pkg->cust_main->credit( $amount*$num_active, "commission" );
+ $cust_pkg->cust_main->credit( $amount*$num_active, "commission",
+ 'reason_type'=>$self->option('reason_type'),
+ );
die $error if $error;
}
More information about the freeside-commits
mailing list