I have a data set with invoices raised on different customers and the payments received subsequently. I need to set off the payment received in month X with Invoice raised in month X or Month X-1 and the netted off amount should appear as balance for the invoice. Sample input file and the required out put file is attached.