Jump to content

Janitor: Order Cleanup Utility Plugin


blazedd

Recommended Posts


Small Blesta plugin to automate cleaning of abandoned orders, invoices, and services.

 

Installation

Download the latest release version from our releases and then simply upload the janitor folder to ~/plugins directory on your Blesta installation.

 

How it Works:

Janitor creates two cron entries which can be configured both by the cron settings and by the direct plugin settings. All of the plugin’s settings are based on the time the order was created. It may be important that you not cleanup and cancel at the same interval if you expect the orders to be marked as cancelled for any amount of time.

 

Both cron tasks will never cleanup any orders or services which meeting the following criteria:

 

  • The order’s invoice has any amount paid towards it.
  • The order’s service is active or already cancelled.
  • The order’s invoice is completely paid and is already closed (database: invoices.invoice_date_closed)
Cron Task: Cancel Abandoned Orders

This task is designed to strictly check for open orders which have never had any payments attached to them. First, the task will cancel the order and then next, it will void the invoice with a message as described in the language file. This cron task will also cancel any services attached to the order. This part of the cron intentionally leaves orders, invoices, and services in the database, in the possible event of this data being used by sales automation, etc.

 

Cleanup Order Database

This task is designed to completely delete all related database entries related to the order. It will remove the orders database entry, the order_services entry, and provides you the option to either leave the services as marked cancelled, or completely delete the service from the database via the plugins options. Only canceled services will be deleted if this option is set. If the service on this task is any other status than canceled, as set in the ‘Cancel Abandoned Orders’ cron task, it will ignore the service entirely.

 



Link to comment
Share on other sites

  • 3 weeks later...

I've been wanting this module for a while, thank you!

 

One feature I would love, but maybe it falls outside your scope: if a user has had no active or pending services, no open invoices, and no open tickets, it will change that users status to "Inactive" after X days.

Link to comment
Share on other sites

I've been wanting this module for a while, thank you!

 

One feature I would love, but maybe it falls outside your scope: if a user has had no active or pending services, no open invoices, and no open tickets, it will change that users status to "Inactive" after X days.

 

this can be done with a simple plugin ......

 

please remind me after ~20 days , i will code it for you free :)

Link to comment
Share on other sites

 

First, the task will cancel the order and then next, it will void the invoice with a message as described in the language file. This cron task will also cancel any services attached to the order.

Maybe I'm just loosing my marbles, but where does the client or admin see the void message? Usually you just click the void button, and you do not get a space to type in a message.

Link to comment
Share on other sites

Maybe I'm just loosing my marbles, but where does the client or admin see the void message? Usually you just click the void button, and you do not get a space to type in a message.

You're not losing your marbles. :) It's added as a "public note" on the invoice, which can be seen under the collapsible "Notes" section via the "Edit Invoice" UI within Blesta.

Link to comment
Share on other sites

  • 1 year later...

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