Jump to content

Add Extra Cost (Lines) In Invoice From Plugin Cron


hsidhu

Recommended Posts

Hello Everyone,

 

I am new to Blesta. I am trying to add additional costs to client invoice. Invoices are created by cron job and I want to add cron job to my plugin which will add additional costs to due or next invoice. 

 

If anyone know about any plugin or can help me out will be great 

 

 

Thanks in advance

Link to comment
Share on other sites

Thanks for getting back.

Requirement is make it automatic add it to invoice. Like It creates a invoice on monthly bases and it will also check if there is additional service been taken by client and add that it into invoice with plugin cron.

 

We could do it manually but want to cut that step for staff.

Link to comment
Share on other sites

Thanks for getting back.

Requirement is make it automatic add it to invoice. Like It creates a invoice on monthly bases and it will also check if there is additional service been taken by client and add that it into invoice with plugin cron.

 

We could do it manually but want to cut that step for staff.

 

You'd need a plugin then with the following:

 

https://docs.blesta.com/display/dev/Event+HandlersInvoices.edit

Link to comment
Share on other sites

Doesn't any event attach to that will only run when Invoice.edit will be called in url or it will run by cron or other means too? 

I have other idea in mind let me know if i am wrong. I should do a look up in invoice table for client and get there latest invoice and edit that but ( what if any thing like package got changed or do you think anything will effect that ).

Link to comment
Share on other sites

Doesn't any event attach to that will only run when Invoice.edit will be called in url or it will run by cron or other means too? 

I have other idea in mind let me know if i am wrong. I should do a look up in invoice table for client and get there latest invoice and edit that but ( what if any thing like package got changed or do you think anything will effect that ).

 

You make a plugin to use the event to add a line item, in the plugin you also make a cron task which will run when you want it too, that will then do the changes you want. I don't know any more than that as I'm not a developer sorry.

Link to comment
Share on other sites

That works while

one more thing came up - how do i make sure that line is add to right invoice - service and package.

For example : One service is renew everyday and other every month both have domain cost which has to be add on every renew.

 

I have rough idea how i can do it. e.g by finding the service id from invoice_lines but not sure its right way to go.

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.

Loading...
×
×
  • Create New...