One is to subtract the tax allowable depreciation to get the taxable profit, then calculate the tax, then add back the tax allowable depreciation because it is not a cash flow.
The other way is to calculate the net operating cash flow (obviously before any depreciation) then calculate the tax on this (ignoring tax allowable depreciation). Then separately calculate the tax saving on the tax allowable depreciation. This is usually the quicker and safer way.
Best is to look at the F9 lectures on relevant cash flows – it is the same problem for F9 and P4.