Don't assume that the discount is automatically granted on your own.
Key points
Early repayment is handled according to the contract, bank policy, and applicable Sharia principles.
The bank may offer a discount without it being a pre-guaranteed condition that alters the nature of the contract.
Practically speaking, ask for the "early repayment settlement amount today" in writing and compare it to the total remaining installments before making your decision.