Jump to content

Get service id in Invoice Creation hook


Kamran

Recommended Posts

Hi,

I want to perform some tasks that require the service id on a hook(specifically invoice creation) the paramters there are limited all I get is the invoice id.

Is there a way to fetch service id using that invoice id any indication/help/solution would be highly appreciated. The hook must trigger either before or after invoice generation.

Thanks. 👍

Link to comment
Share on other sites

5 minutes ago, Kamran said:

Is there a way to fetch service id using that invoice id any indication/help/solution would be highly appreciated.

if you know the invoiceid, then you could look at the tblinvoiceitems database table, if the type = 'Hosting', then the relid value should equal the service ID.

though bear in mind that an invoice could contain multiple services, so you might need to be more specific in the query if you have some specific product/service to look for.

an alternative would be to use the Billing model (if you're more familiar with that).

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
Reply to this topic...

×   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.

×
×
  • 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