Jump to content
  • 0

Help with a hook to update invoiced amounts


HostworX

Question

Good day,

We sell mobile Fixed LTE  access to our clients, this has an option to to activate the service immediately or the following month.  We have defined a custom field in the product that asks the user to select the option they want ie Immediately or Next Month.  The issue that we are now having is if the customer selects next month, he still gets an invoice for the current month, and depending on the date the following month as well, ie after the 17th of the current month, as we use prorata billing which is set to the 1st of each month and charge, next months invoice is ordered after the 17th of each month.

I need to create a hook, that will  query the Activation custom field and based on the clients selection do the following :

  1. If "immediate activation" selected, the invoiced amount needs to have 7 days deducted from the invoice period and amount  ie if its the 7th the invoice should reflect the invoice amount from the 14th till the end period and not from the 7th.
     
  2. Else if the client selects "Next Month" the hook needs to check the current date, and determine if its before the 15th or after the 15th.
    1. If its before the 15th,  the invoice voided, either no invoice or a 0.00 value invoice, preferably no invoice.
    2. If its after the 15th,  the system would normally generate the invoice for the balance of the current month and then add the following month on as well, I need it to generate the invoice only for the following month, ie the current months pro rata amount removed"

I am not sure if this can be done this way ? Is this possible via hooks or not ?

 

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
On 1/15/2020 at 4:45 PM, HostworX said:

Good day,

We sell mobile Fixed LTE  access to our clients, this has an option to to activate the service immediately or the following month.  We have defined a custom field in the product that asks the user to select the option they want ie Immediately or Next Month.  The issue that we are now having is if the customer selects next month, he still gets an invoice for the current month, and depending on the date the following month as well, ie after the 17th of the current month, as we use prorata billing which is set to the 1st of each month and charge, next months invoice is ordered after the 17th of each month.

I need to create a hook, that will  query the Activation custom field and based on the clients selection do the following :

  1. If "immediate activation" selected, the invoiced amount needs to have 7 days deducted from the invoice period and amount  ie if its the 7th the invoice should reflect the invoice amount from the 14th till the end period and not from the 7th.
     
  2. Else if the client selects "Next Month" the hook needs to check the current date, and determine if its before the 15th or after the 15th.
    1. If its before the 15th,  the invoice voided, either no invoice or a 0.00 value invoice, preferably no invoice.
    2. If its after the 15th,  the system would normally generate the invoice for the balance of the current month and then add the following month on as well, I need it to generate the invoice only for the following month, ie the current months pro rata amount removed"

I am not sure if this can be done this way ? Is this possible via hooks or not ?

 

 

Hi there,

What you've described should be possible with hooks, you could modify an invoice after order and the EmailPreSend hook to stop the invoice being sent out. Once the changes have been made, you could then send it out to the user. You would also have to read the services custom field value to determine what to do, but it's all possible. Feel free to PM me if you want to chat in any more detail 🙂 Hope you get it sorted. Josh

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated