The bank is crediting the account when the payment is being made. Because of the nature of the "amortization", the loan is actually being prepaid.
Commercial and most consumer, the customer is paying interest for as long as they borrow the money. Make a payment and they will calculate the accrued interest from the last payment, deduct it from the principal and credit the rest to the loan balance.
Because most mortgage loans are sold in the 2ndary market, they use a 30/360 payment. Each payment is considered to be for a 30 day period and there are 360 days in the year. Your payments are based on an amortization schedule, except for the first and last odd days. Imagine the servicing and investor issues of each one had to be individually calculated, especially at payoff if the person historically paid a few days late. To compensate, usually no late fee until the payment is 15 days or more delinquent.
_________________________
Integrity. With it, nothing else matters. Without it, nothing else matters.