1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

using MBAPI to calculate Proration

Discussion in 'Customer&Business Manager (formerly Plesk Billing)' started by paulkelly, Nov 21, 2012.

  1. paulkelly

    paulkelly New Pleskian

    10
    60%
    Joined:
    Oct 23, 2012
    Messages:
    9
    Likes Received:
    0
    hi,
    I have successfully used the MBAPI function ProcessOrder() to submit a sale into cbm / modernbill. This will create the client, add the Products as packages and add relevant contacts.

    What i would like to do is summarise an order with consideration given to proration. does cbm / modernbill expose any functions to calculate Proration based upon ProcessOrder() or ProcessCheckout() ?

    Thanks
    Paul
     
  2. DmitryK.

    DmitryK. Regular Pleskian

    16
    30%
    Joined:
    Oct 13, 2011
    Messages:
    232
    Likes Received:
    0
    Hello,

    1) Could you clarify your PP version and OS?
    2) First of all you need to enable debug log, ( to enable debug log, edit /opt/plesk-billing/lib/lib-billing/include/config/config.php or for PP < 10.3.0 edit /lib-billing/include/config/config.php, change following line: define("ALLOW_DEBUG_LOGGING", true); )
    3) Go to "All Settings" -> Debug Log -> Enable Logging->Enable logging. Debug log for CBM should be appeared on the "/plesk-billing/admin/index.php/default?ctr=events&act=838" page. So you could open corresponding operation which you need as debug entry and review it.
    4) To enable monthly mode, go to All Settings -> Invoicing -> Set billing mode to monthly, you can learn more here
    5) I think that ProcessOrder() could be deprecated
    6) I know, that Proration done inside ProcessInvoices(), called in ProcessCheckout(), if CBM is configured to the monthly mode
    7) Don't forget to disable logging after all experiments.

    Best regards,
    Dmitry
     
    Last edited: Nov 23, 2012
  3. paulkelly

    paulkelly New Pleskian

    10
    60%
    Joined:
    Oct 23, 2012
    Messages:
    9
    Likes Received:
    0
    Dmitry,

    ok i think im getting the idea.

    the panel version is 11.04 i think - the data has come from a 6.03 modernbill installation.

    so i could call ProcessCheckout() with disableCharging and disableInvoicing set to 1.
    then GetInvoice() to get the generated invoice and display the charge summary from this as it would include proration
    then call ProcessInvoice() to charge.

    very useful - thanks

    thanks
    Paul
     
Loading...