[freeside] First Month Charges
Luke Pfeifer
freeside at globalli.com
Tue Mar 19 22:52:32 PST 2002
Hi Everyone:
Here is what I added to the script to make this option work. I am not
sure on my "wording" of it for the description but it works just as I
planned. The first month is charged the recurring fee and not prorated
and then the next bill date will be the 1st of the next month.
I added this code starting at line 200. Please feel free to add this
to an upcoming release and let me know what you think of it..It seemed
pretty easy to hack up.
Hope this helps you all!!
Luke
----CODE STARTS BELOW THIS LINE-----
'flat_non_prorate' => {
'name' => 'First month full charge, then flat-rate billing from 1st
of month',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
},
'recur_fee' => { 'name' => 'Recurring fee for this package',
'default' => 0,
},
},
'fieldorder' => [ 'setup_fee', 'recur_fee' ],
'setup' => 'what.setup_fee.value',
'recur' => '\'my $mnow = $sdate; my
($sec,$min,$hour,$mday,$mon,$year) = (localtime($sdate) )[0,1,2,3,4,5];
my $mstart = timelocal(0,0,0,1,$mon,$year); $sdate = $mstart; \' +
what.recur_fee.value ',
},
----CODE ENDS ABOVE THIS LINE ------
> On Wed, Mar 20, 2002 at 12:04:04AM -0500, freeside at globalli.com wrote:
> > I just installed 1.4.0pre11 on my server and I was wondering it was
> > possible to have it charge full months price for the first month
and then
> > flat rate from the 1st of the month after that.
> >
> > Hopefully that is not confusing, but I will try to work it this
way. We
> > want a customer to be charged the full amount no matter what time
of the
> > month they sign up and then their next month is due on the 1st of
the next
> > month. Therefore if we charged $100 a month and they signed up on
the
> > 15th of March they would be billed $100 for March 15 - March 31 and
then
> > their next bill would be for $100 from April 1 - April 30.
> >
> > Let me know if this is possible, or what script I should hack up to
make
> > these changes to allow this to happen.
>
> You'd need to add a new price plan to httemplate/edit/part_pkg.cgi
>
> I sugest starting with the "prorate" plan as a skeleton (it already
does
> the date manipulation you're looking for); it would need to be
adjusted to
> charge full price for the first month.
>
> Good luck! Please consider contributing your changes back to the
> project.
>
> --
> _ivan
>
>
--
Luke Pfeifer
More information about the freeside-users
mailing list