We had added a Service Plan and Contract for a client but we are unable to edit or remove it ?

As per the design, Contract billing is used to store the contract information with an account, deleting this will end up in losing the historical information. It is not possible to delete or edit a contract bill entry once it is created.

However, There is a option to delete the contract by executing a query in the database,

 

Note: Always ensure that you take a backup before you execute the query and it is also advisable to try in a test setup if you have one, before trying it in the production server.

 

Please connect to the database and use the below steps to delete it,

 

Queries to delete all the contracts in an account:

 

delete from billhistory where accountid=<account to which contract need to be deleted>;

delete from accountcontract where accountid=<account to which contract need to be deleted>;

delete from lastaccountworkorder where accountid=<account to which contract need to be deleted>;

 

 Example:   delete from billhistory where accountid=1234;

 

Note: To know how to get an Account ID, kindly refer here.

 

This will remove all the contracts in an account. Only in case, if you need to delete any particular contract, kindly refer below,

 

Queries to delete a particular contract:

 

delete from billhistory where contractid=<contract which need to be deleted>;

delete from accountcontract where contractid =<contract which need to be deleted>;

 

If the particular contract is the last contract for that account then the following query should also be executed.

 

delete from lastaccountworkorder where accountid= (select accountid from accountcontract where contractid=<contract which need to be deleted>);

 

To get the Contract ID which you need to delete:

 

Execute the query below under Reports-> New Query Report,

 

select ad.org_name “Account”, sp.serviceplanname “Service Plan”, ac.contractid “Contract ID”, longtodate(ac.startdate) “Start date”, longtodate(ac.expirydate) “Expiry date” from accountcontract ac left join accountdefinition ad on ad.org_id=ac.accountid left join serviceplan sp on sp.serviceplanid=ac.serviceplanid order by 1

 

But be sure that the billing details associated with that accounts request will be removed.

 

After deleting the contract, you can delete the service plan. Hope this helps.

.

Need More Help?

Are you looking for a personalized customer support? Submit your question or Call our Toll Free Number to speak with ServiceDesk Plus MSP Expert who can offer a better solution for your requirements.

Submit a Ticket
Email : sdpmsp@manageengine.com
Toll Free : 1-888-720-9500