X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fflat_comission_pkg.pm;h=26dd4d2fc82c79e782db7c0280aed9365ba1beb0;hb=84075b42e60c26ede49c9966af232c6308585c2f;hp=0a66ff03fbcaeb5b1d164bfc98bb36d53e6daa80;hpb=40a7b3dc653e099f7bd0bd762b649b04c4432db2;p=freeside.git diff --git a/FS/FS/part_pkg/flat_comission_pkg.pm b/FS/FS/part_pkg/flat_comission_pkg.pm index 0a66ff03f..26dd4d2fc 100644 --- a/FS/FS/part_pkg/flat_comission_pkg.pm +++ b/FS/FS/part_pkg/flat_comission_pkg.pm @@ -10,23 +10,8 @@ use FS::part_pkg::flat; %info = ( 'name' => 'Flat rate with recurring commission per (selected) active package', 'shortname' => 'Commission per (selected) active package', + 'inherit_fields' => [ 'flat_comission', '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 uncancelled package)', - 'default' => 0, - }, - 'comission_depth' => { 'name' => 'Number of layers', - 'default' => 1, - }, 'comission_pkgpart' => { 'name' => 'Applicable packages
(hold ctrl to select multiple packages)', 'type' => 'select_multiple', 'select_table' => 'part_pkg', @@ -34,15 +19,8 @@ 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', 'reason_type' ], + 'fieldorder' => [ '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, @@ -55,4 +33,6 @@ sub calc_recur { $self->option('recur_fee'); } +sub can_discount { 0; } + 1;