webERP Forum
Zero/delete all orders, Purchase and payment etc., - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (http://www.weberp.org/forum/forumdisplay.php?fid=1)
+--- Forum: Problems / Bugs? (http://www.weberp.org/forum/forumdisplay.php?fid=8)
+--- Thread: Zero/delete all orders, Purchase and payment etc., (/showthread.php?tid=8360)



Zero/delete all orders, Purchase and payment etc., - ALEXSHEN - 09-13-2019

Hi every,

Here I met other problems again.

I found our purchase, sales and payment had many mistake by ourselves, so I want to zero or delete all these deal, but still keep the Customers, suppliers and goods name information.

So I found this function: Delete Sales Transactions
But seems have some problem there
[attachment=977]
1- Zero all stocks balance, but got the error code 1701
[attachment=978]
2- Delete All Purchase Orders, got the error code 1451
[attachment=979]
3- Delete All PO Goods Received (GRNs), also got the error code 1451
[attachment=980]

And if all above operation done, seems the payment and invoice parts also can't delete, so how can I do?

Please help me again.

Alex


RE: Zero/delete all orders, Purchase and payment etc., - TimSchofield - 09-13-2019

A general word of warning to everybody. Any script starting with Z_ should be treated with caution. They are often scripts that bypass fundamental accounting principles, such as maintaining a strict audit trail of transactions, and are often poorly maintained, or not maintained at all. Always test first, and take a backup of your data first.

That said, Alex can you try the attached script and see if it helps your problem.

Tim


[attachment=981]


RE: Zero/delete all orders, Purchase and payment etc., - ALEXSHEN - 09-13-2019

Hi Tim,

This script is good, I have already deleted the data, thank you.

but seems some accounting data still there, how to clean these parts?

[attachment=982]

Alex


RE: Zero/delete all orders, Purchase and payment etc., - ALEXSHEN - 09-14-2019

OK

I have already deleted many data, but still have one place, please see below image, how can I delete it?
[attachment=983]

Alex


RE: Zero/delete all orders, Purchase and payment etc., - TimSchofield - 09-14-2019

Alex, how were these transactions created?

Tim


RE: Zero/delete all orders, Purchase and payment etc., - ALEXSHEN - 09-14-2019

Hi Tim,

A few days ago I tried to buy goods from a supplier and set up a new shipment, then the company voucher paid the goods cost, shipping costs, and taxes, but the bank did not actually pay. But today I executed your modified Z_DeleteSalesTransActions.php. All the information such as inventory, sales and purchasing has been deleted, but I have searched about the invoice and payment information from the supplier, It still exists. I later searched by myself from the database and deleted directly, but eventually there is still this information in this place.
[attachment=984]
[attachment=985]


And now I didn't know which place we didn't searched?

Alex


RE: Zero/delete all orders, Purchase and payment etc., - TimSchofield - 09-14-2019

Hi Alex, after removing GL transactions you need to run the script Z_RePostGLFromPeriod.php to recalculate the GL balances.

The Z_DeleteSalesTransActions.php won't remove those purchasing transactions which is why you had to remove them manually.

Tim


RE: Zero/delete all orders, Purchase and payment etc., - ALEXSHEN - 09-14-2019

Hi I'm,

Perfect, now it is running well.

Thanks

Alex


RE: Zero/delete all orders, Purchase and payment etc., - TimSchofield - 09-15-2019

Paul, I have issued a pull request for the revised Z_DeleteSalesTransactions.php

Tim


RE: Zero/delete all orders, Purchase and payment etc., - TurboPT - 09-16-2019

Pulled!