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:
gatewayGeneric_log
tblBilling
tblDLR
tblSMSOutgoing
tblSMSOutgoing_queue
tblSMSOutgoing_queue_dst
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.
Example:
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?
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.
@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.