'type' => 'select',
#add additional ways to specify in the package def
'options' => [qw(
- base_recur_permonth cust_bill_pkg_recur recur_cost_permonth
- unit_setup setup_cost
+ base_recur_permonth cust_bill_pkg_recur recur_cost_permonth recur_margin_permonth
+ unit_setup setup_cost setup_margin
)],
'labels' => {
'base_recur_permonth' => 'Base monthly fee',
'recur_cost_permonth' => 'Monthly cost',
'unit_setup' => 'Setup fee',
'setup_cost' => 'Setup cost',
+ 'setup_margin' => 'Setup margin (fee minus cost)',
+ 'recur_margin_permonth' => 'Monthly margin (fee minus cost)',
},
},
);
$self->option('setup_fee') || 0;
}
+=item setup_margin
+
+unit_setup minus setup_cost
+
+=cut
+
+sub setup_margin {
+ my $self = shift;
+ $self->unit_setup(@_) - $self->setup_cost;
+}
+
+=item recur_margin_permonth
+
+base_recur_permonth minus recur_cost_permonth
+
+=cut
+
+sub recur_margin_permonth {
+ my $self = shift;
+ $self->base_recur_permonth(@_) - $self->recur_cost_permonth(@_);
+}
+
=item format OPTION DATA
Returns data formatted according to the function 'format' described