Database cleaning reversing balance

Hello, I’m having trouble perform the cleanup of the database with phpmyadmin.

I switched to the latest version of playsms, the previous I usually cleaned the tables:

Now the latest version can not clear because the customer’s account balance returns to the previous value to submissions.

I noticed that when removing credit transactions on the panel the customer’s balance is also removed.

Customer purchase 100,000 sms and send … when I do the cleanup the balance of 100,000 returns allowing shipments causing complications.

How can I make the cleanup via phpMyAdmin database keeping the balance left in the account?

(Excuse the English translator …)

hey, no one is going through this problem? :confounded:

Has this problem been addressed ?

No one to solve this case , i have the same problem if i clean the database users credit return to initial state.
Please can anyone help

You have to annotate user balance before cleaning, and reduce credits after.

I have this problem too.
how can clean DB without reverse balance ?

Hi, sadly this can’t be done today.

Up to now playSMS calculates billing from tblBilling join with tblSMSOutgoing, it needs tblSMSOutgoing for uid and parent_uid.

See plugin/feature/credit/fn.php starts from line 211, function _credit_get_billing() and _credit_get_billing_parent(). The SQL query on those 2 functions used to calculate billing.

To minimize space I suppose you can empty the message part on tblSMSOutgoing, but don’t delete the row.

If you have programmer, then perhaps ask them to add uid and parent_uid to tblBilling when billing posted. After that you can modify above functions to calculate billing just from tblBilling.

Billing posted by simplebilling_hook_billing_post() in plugin/feature/simplebilling/fn.php.


1 Like

I made some changes to billing in branch billing_update:

Above changes will work for new installation. If you already have data in your tblSMSOutgoing and tblBilling then you must alter tblBilling (see, and somehow fill empty uid in tblBilling from tblSMSOutgoing (this I haven’t work on it, but perhaps someone can help).

If everything works as expected then I’ll merge the branch to master and we will have this feature in 1.4.4 later.


1 Like

@anton can you create a summary table to hold billing, failed sms, delivered etc on daily basis as that will really help with the database clean up. and will not affect customer account balance.

e.g. i sometimes do a few millions of sms a month and the details data is not needed after say 45 days so i have to clean the tblSMSOutgoing. and tblBilling tables.