End of Year Closing stock and Opening stock?

How do I journal closing stock at the end of the financial year and how to journal opening stock at the beginning of the next financial year?

For closing stock at the year end I suppose this is the correct way:
Dr 1001 Stock (balance sheet)
Cr 5201 Closing Stock (P&L)

Amount value - lower of cost or Net realisable value which ever is lower.

What about opening stock how to account for that?

once you run year end routine, you will have opening balance sheet. you can move opening stock to cost of sale through journal

Dr Opening stock (P&l)
Cr stock (BS)

I tried this myself, but all it does is puts the opening stock figure into P&L as a negative figure (in red) and remove the same amount from the BS leaving no stock as an asset. Is this what is suppose to happen?

Yes. At the next year end you’ll journal closing stock back to assets, so your overall P&L for the year shows your cost of sales as opening stock plus purchases minus closing stock.

So I guess after that you just do the same again for the start of the next tax year:

Dr Opening stock (P&L)
Cr stock (BS)

And at the end of the tax year:

Dr Stock (BS)
Cr Closing Stock (P&L)

This way everything balances each year?

That’s my understanding, yes.

ok , but in the balance sheet there is a difference which says balance difference. how do i off set it