complete settlement logic, fix toEdit loading bug and re-layout the summary tables