How to lock inventory

suppose i have 100 pcs of item A i sold all 100 in one invoice, i can create another invoice of A for 100 Items, when the actual balance is zero. it should show zero bal.

No, otherwise how do you review which inventory needs buying. If it showed zero you wouldn’t know if the second invoice had been delivered or not. Previously, this would have been shown up as “Back Order” rather then minus quantity.

It should not allow me to make invoice for the same item. As this item is not available.

Yes it should, many business sell first and then purchase later as they don’t carry inventory.
Having negative inventory tells them what they need to order.