Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Zero/delete all orders, Purchase and payment etc.,
09-13-2019, 09:59 AM,
#1
Zero/delete all orders, Purchase and payment etc.,
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
   
1- Zero all stocks balance, but got the error code 1701
   
2- Delete All Purchase Orders, got the error code 1451
   
3- Delete All PO Goods Received (GRNs), also got the error code 1451
   

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
Reply
09-13-2019, 07:27 PM,
#2
RE: Zero/delete all orders, Purchase and payment etc.,
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



.php   Z_DeleteSalesTransActions.php (Size: 6.79 KB / Downloads: 3)
Reply
09-13-2019, 10:52 PM,
#3
RE: Zero/delete all orders, Purchase and payment etc.,
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?

   

Alex
Reply
09-14-2019, 06:25 AM,
#4
RE: Zero/delete all orders, Purchase and payment etc.,
OK

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

Alex
Reply
09-14-2019, 07:00 AM,
#5
RE: Zero/delete all orders, Purchase and payment etc.,
Alex, how were these transactions created?

Tim
Reply
09-14-2019, 08:25 AM,
#6
RE: Zero/delete all orders, Purchase and payment etc.,
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.
   
   


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

Alex
Reply
09-14-2019, 05:33 PM,
#7
RE: Zero/delete all orders, Purchase and payment etc.,
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
Reply
09-14-2019, 09:14 PM,
#8
RE: Zero/delete all orders, Purchase and payment etc.,
Hi I'm,

Perfect, now it is running well.

Thanks

Alex
Reply
09-15-2019, 09:27 PM,
#9
RE: Zero/delete all orders, Purchase and payment etc.,
Paul, I have issued a pull request for the revised Z_DeleteSalesTransactions.php

Tim
Reply
09-16-2019, 02:09 AM,
#10
RE: Zero/delete all orders, Purchase and payment etc.,
Pulled!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)