* @see net.yanhl.finance.service.FinanceManager#repay(long, java.lang.Double)
*/
public boolean repay(long detailId, Double repayTotal) throws FinanceException {
Object srcDetail = get(FinanceMoneyDetail.class, detailId);
if(srcDetail == null) {
throw new FinanceException("未找到ID为<" + detailId + ">的债务记录");
}
FinanceMoneyDetail moneyDetail = (FinanceMoneyDetail) srcDetail;
if(moneyDetail.getRequitedArrearage() > moneyDetail.getTotalArrearage()
|| moneyDetail.getRequitedArrearage() + repayTotal > moneyDetail.getTotalArrearage()) {
throw new FinanceException("还款总额大于借款总额!");
} else {
moneyDetail.setRequitedArrearage(moneyDetail.getRequitedArrearage() + repayTotal);
update(moneyDetail);
return true;
}