So, if in closing inventory, must be in purchases and payables (or paid for). That seems OK.
If in closing inventory, it has not been sold yet it is in sales and receivables. Inventory is correct (the item has been included as it has not been sold) but sales and receivables are wrong, so need to be reduced.
Whatever happens the item cannot be simultaneously be in inventory AND sold.