X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fflat_comission.pm;fp=FS%2FFS%2Fpart_pkg%2Fflat_comission.pm;h=4592bedef4501ee1790f2b1533b26dee2997594f;hp=bc02f9658e059465f8cbce3aba95d05798e4e817;hb=e8a09e945986a32f9b7d0a5d546142ada91654ca;hpb=b8a41c45daf3e4cfa21200f5d9e59e38bd41293c diff --git a/FS/FS/part_pkg/flat_comission.pm b/FS/FS/part_pkg/flat_comission.pm index bc02f9658..4592bedef 100644 --- a/FS/FS/part_pkg/flat_comission.pm +++ b/FS/FS/part_pkg/flat_comission.pm @@ -26,8 +26,15 @@ use FS::part_pkg::flat; '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 @@ sub calc_recur { 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; }