Freeside:1.7:Documentation:Developer:Price Plans

From Freeside
Revision as of 15:53, 19 July 2009 by LicarIcbas (talk | contribs)

Jump to: navigation, search

destinys child survivor lyrics site http defiant teens http pirate desktop themes drinking glasses ever licensed to ill lyrics free redheads teen sex geyser st. john villa rental movie site spongebob squarepants web sprinting videos plastic welder another movie not soundtrack teen alabama birmingham ymca medication online phentermine architectural embellishment use taboo board games link master track.com pinellas county marriage licenses camouflage patterns sinbad brain damaged video lowrance map create 6 super puma raft movie mobile wallpapers filthy rich cattle drive shrimp on the barbie movie nvidia pure video suicidal tendencies shane west inu yasha movie 1 download killer norco pain rapers teen kelly lesbian beach legs spread kenshin ova 2 torrent networking tutorial socal mac and bumble videos teen drinking and driving storeys in british columbia movie making software free download latina sluts movie lung cancer chemo drug free nokia 6600 ringtones download andres ativan book com drug guest site stepper motor controler The part_pkg class links the packages to the database. The plan field indicates which pricing plan to use. The pricing plans are are found in FS/FS/part_pkg/. You will find such favorites as "flat" and "prorate" as well as new hits like "voip". You are welcome (and encouraged) to add your own plans and share them with the rest of us. Here's how to do it (I'm assuming that you have access to the code so that you can follow along):

  1. Find a package that is close to what you want to do. For example, if you wanted to add a plan that would give you until the end of the month for free and then charge you every month therafter, you would probably want to start with the prorate package because it's pretty similar.
  2. Make a copy of the old package under a new name. In this example you may want to call it free_rest_of_month.pm
  3. Change the following:
    •  %info hash - This is the description and fields for this package. The data here will be loaded upon instantiation and will be available for you to use in calculating the charge for this package. You should set the fieldorder and any defaults as appropriate.
    • calc_setup - This sub returns the amount to be added to the invoice line item if the setup date is null. you can do some magic here, but be VERY careful. The flat_delayed module does some of this magic. You won't have to add this one for our example.
    • calc_recur - This sub returns the amount to be added to the invoice line item. For examples of interesting recurs check out the voip packages. The most boring package, flat, just returns the value of recur from the package definition. We want to return the recur from the package definition if the last_bill and setup are set. We also want to be sure to do the $$sdate magic so that the next bill date is set correctly. We don't return anything if this is the first bill.
    • calc_remain - If you are accruing revenue, then you will defer revenue for accounts that prepay. This allows you to give them credit for the service that they've paid for when they cancel. This method calculates it for you. Be careful here because this is essentially giving back money.
    • is_free_options -
    • is_prepaid - If you're building a prepaid plan, this has to be 1

Once you've updated these methods, go ahead and create an account and take it for a spin. Please consider contributing your price plan back to the project! Good Luck!