X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fpart_pkg%2Fagent.pm;h=d9269972646d01022fab4d7e72de0aa2cb5e46b7;hb=e2213aaeab76983c26d92c1e1d928fe4e062accf;hp=37e7d9d3fa184529147725b5dab72528661a0057;hpb=6bab3cf66992f581d35ae57c633a81e8503d5c35;p=freeside.git diff --git a/FS/FS/part_pkg/agent.pm b/FS/FS/part_pkg/agent.pm index 37e7d9d3f..d92699726 100644 --- a/FS/FS/part_pkg/agent.pm +++ b/FS/FS/part_pkg/agent.pm @@ -40,6 +40,10 @@ $me = '[FS::part_pkg::agent]'; 'type' => 'checkbox', }, + 'cost_only' => { 'name' => 'Bill wholesale on cost only, disabling the price fallback', + 'type' => 'checkbox' + }, + }, 'fieldorder' => [qw( cutoff_day add_full_period no_pkg_prorate ) ], @@ -124,11 +128,15 @@ sub calc_recur { my $quantity = $cust_pkg->quantity || 1; - #option to not fallback? via options above - my $pkg_setup_fee = - $part_pkg->setup_cost || $part_pkg->option('setup_fee'); - my $pkg_base_recur = - $part_pkg->recur_cost || $part_pkg->base_recur_permonth($cust_pkg); + my $pkg_setup_fee = $part_pkg->setup_cost; + $pkg_setup_fee ||= $part_pkg->option('setup_fee') + unless $self->option('cost_only'); + $pkg_setup_fee ||= 0; + + my $pkg_base_recur = $part_pkg->recur_cost; + $pkg_base_recur ||= $part_pkg->base_recur_permonth($cust_pkg) + unless $self->option('cost_only'); + $pkg_base_recur ||= 0; my $pkg_start = $cust_pkg->get('setup'); if ( $pkg_start < $last_bill ) {