Difference between revisions of "Freeside:3:Documentation:Developer/FS/part pkg/prorate Mixin"

From Freeside
Jump to: navigation, search
m (Edit via perl MediaWiki framework (1.13))
 
(No difference)

Latest revision as of 20:08, 27 June 2012

NAME

FS::part_pkg::prorate_Mixin - Mixin class for part_pkg:: classes that need to prorate partial months

SYNOPSIS

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

sub calc_recur { ... if( conditions that trigger prorate ) { # sets $$sdate and $param->{'months'}, returns the prorated charge $charges = $self->calc_prorate($cust_pkg, $sdate, $param, $cutoff_day); } ... }

calc_prorate CUST_PKG SDATE DETAILS PARAM CUTOFF_DAY
Takes all the arguments of calc_recur. Calculates a prorated charge from the $sdate to the cutoff day for this package definition, and sets the $sdate and $param->{months} accordingly. base_recur() will be called to determine the base price per billing cycle.
Options: - add_full_period: Bill for the time up to the prorate day plus one full billing period after that. - prorate_round_day: Round the current time to the nearest full day, instead of using the exact time. - prorate_defer_bill: Don't bill the prorate interval until the prorate day arrives. - prorate_verbose: Generate details to explain the prorate calculations.
prorate_setup CUST_PKG SDATE
Set up the package. This only has an effect if prorate_defer_bill is set, in which case it postpones the next bill to the cutoff day.
_endpoints TIME CUTOFF_DAY
Given a current time and a day of the month to prorate to, return three times: the start of the prorate interval (usually the current time), the end of the prorate interval (i.e. the cutoff date), and the time one month before the end of the prorate interval.

POD ERRORS

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

Around line 59:
Unknown directive: =head
Around line 61:
'=item' outside of any '=over'