Extracting arguments from dynamic URLs
If your node is 12, your internal path is node/12 when the alias is 'inventory'. In that case arg(0) gives you 'node' and arg(1) gives you '12'.

In the case of dynamic URLs like inventory/ABCD, I assume that the internal path is 'inventory/ABCD' (so that inventory/ABCD does not have anything to do with node 12). Then arg(0) gives you 'inventory' and arg(1) gives you 'ABCD'.