<% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>

FS::part_pkg::discount_Mixin

NAME

FS::part_pkg::discount_Mixin - Mixin class for part_pkg:: classes that can be discounted.

SYNOPSIS

package FS::part_pkg::...; use base qw( FS::part_pkg::discount_Mixin );

sub calc_recur { ... my $discount = $self->calc_discount($cust_pkg, $$sdate, $details, $param); $charge -= $discount; ... }

calc_discount CUST_PKG, SDATE, DETAILS_ARRAYREF, PARAM_HASHREF

Takes all the arguments of calc_recur. Calculates and returns the amount by which to reduce the charge; also increments months used on the discount.

If there is a setup fee, this will be called once with 'setup_charge' => the setup fee amount (and should return the discount to be applied to the setup charge, if any), and again without it (for the recurring fee discount). PARAM_HASHREF carries over between the two invocations.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 30:

Unknown directive: =head

Around line 32:

'=item' outside of any '=over'

=over without closing =back

<% include ('/elements/footer.html' ) %>