Prepare the data and setup the data structure for opening balance