X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fflat_comission_pkg.pm;h=6f5ee692c876406690230815faa56d64133d1aeb;hb=4ad8b72c0dde10d4907298277181ddfaa99dafb6;hp=0f4d02a58fa5072709acd1f4f1cfc33775e50aa2;hpb=c8cccb4a92adceb943c635fe62dad0d034462ce0;p=freeside.git diff --git a/FS/FS/part_pkg/flat_comission_pkg.pm b/FS/FS/part_pkg/flat_comission_pkg.pm index 0f4d02a58..6f5ee692c 100644 --- a/FS/FS/part_pkg/flat_comission_pkg.pm +++ b/FS/FS/part_pkg/flat_comission_pkg.pm @@ -9,6 +9,7 @@ use FS::part_pkg::flat; %info = ( 'name' => 'Flat rate with recurring commission per (selected) active package', + 'shortname' => 'Commission per (selected) active package', 'fields' => { 'setup_fee' => { 'name' => 'Setup fee for this package', 'default' => 0, @@ -33,8 +34,15 @@ use FS::part_pkg::flat; '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, @@ -47,4 +55,6 @@ sub calc_recur { $self->option('recur_fee'); } +sub can_discount { 0; } + 1;