Value change in database`

I changed expenses account head for purchase invoice item through database update statement to Cost of Goods Sold A/C it’s changed in the purchase invoice item document but still old transaction in the old account Stock Received But Not Billed in the general ledger report

General Ledger is separate table. You have only updated purchase invoice item thus it won’t reflect in General Ledger.

Also, don’t use update queries, follow the workflow, cancel existing PI and then amend with necessary changes.

Thanks @saurabh6790

But i have a lot of PI and it will take many time to update there is any way to update them as a patch

No built-in functionality. You can use python scripting for amendment.

could you give me an example please

We never recommend to update any value directly in the database, it can break the integrity between docs, which might very difficult to recover later.

You can update GL Entry table as well, but I could not understood your requirement. Why are you trying to replace the account head? Looks like the perpetual inventory system is enabled in your account and thats why it posted in the “Stock Received but not billed” account.
If you change the account in PI, it could have 2 wrong effect. First, COGS will be booked twice, once in PI and then while delivering goods via DN.
And second, as “Stock received but not billed” account has been credited in Purchase Receipt, it will never become zero.