Hi,
First, you have the "Update the product stock on confirmed status" setting in the HikaShop configuration.
If that setting is turned off, then the stock will be updated when the order is created, when the customer clicks on the "Finish" button.
If that setting is turned on, then the stock will be updated when the order goes from the status selected under the "created" column to one of the statuses selected under the "invoice" column of the System>Order statuses menu. Note that in this case, the customer can potentially create several orders without blocking your stock for his orders and then pay several of them, leading to more products bought than actually available. Ideally, you rather want to reserve the stock when the order is created, and then have the "order auto cancel" plugin cancelling the created orders after a while to release the stock. That way, you can guarantee that no order will be paid for something which isn't in stock anymore. So I wouldn't recommend using this mode of operation.
So, supposing that the "Update the product stock on confirmed status" setting is turned on and the "created" is selected under the "created" column, and "confirmed" and "shipped" are selected under the "invoice" column, the stock will be updated when the order goes from created to confirmed, but not if it goes from "pending" to "confirmed", like you described in your message.