Two Invoices are billed to Customer for Rs 10000 and 15000. Payment for first invoice made was 10000 which were paid in full instead of deducting the discount of 500 and paying the rest. This discount was cleared against the second invoice of 15000 and now the balance is 14500 with the customer and the second payment was made again for 15000 in which the due date was crossed so the interest on this need to be calculated. But the system is calculating interest for both 500(1st Invoice) and also for the second invoice on 500. But the requirement is interest should be calculated only on advance and not on discount.