X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fflat_comission.pm;h=0bc1e7cb42f72524aa5cfc30b9d7e3b79d18ddae;hb=b1cd043555e332d70d686f3011f3f8a64c30a779;hp=4592bedef4501ee1790f2b1533b26dee2997594f;hpb=5e05724a635a22776f1b973f5d7e77989da4e048;p=freeside.git diff --git a/FS/FS/part_pkg/flat_comission.pm b/FS/FS/part_pkg/flat_comission.pm index 4592bedef..0bc1e7cb4 100644 --- a/FS/FS/part_pkg/flat_comission.pm +++ b/FS/FS/part_pkg/flat_comission.pm @@ -9,17 +9,9 @@ use FS::part_pkg::flat; %info = ( 'name' => 'Flat rate with recurring commission per (any) active package', + 'shortname' => 'Commission per (any) active package', + 'inherit_fields' => [ 'global_Mixin' ], 'fields' => { - 'setup_fee' => { 'name' => 'Setup fee for this package', - 'default' => 0, - }, - 'recur_fee' => { 'name' => 'Recurring fee for this package', - 'default' => 0, - }, - 'unused_credit' => { 'name' => 'Credit the customer for the unused portion'. - ' of service at cancellation', - 'type' => 'checkbox', - }, 'comission_amount' => { 'name' => 'Commission amount per month (per active package)', 'default' => 0, }, @@ -34,12 +26,20 @@ use FS::part_pkg::flat; 'select_label' => 'type', }, }, - 'fieldorder' => [ 'setup_fee', 'recur_fee', 'unused_credit', 'comission_depth', 'comission_amount', 'reason_type' ], + 'fieldorder' => [ '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, ); +sub price_info { + my $self = shift; + my $str = $self->SUPER::price_info; + my $com = $self->option('comission_amount'); + $str .= ", $com commission" if $com; + $str; +} + sub calc_recur { my($self, $cust_pkg ) = @_; @@ -63,4 +63,6 @@ sub calc_recur { $self->option('recur_fee'); } +sub can_discount { 0; } + 1;