|
|
@@ -195,8 +195,10 @@ public class Accountbalance extends BaseClass {
|
|
|
throw new YosException("该营销账户不存在,支出凭证无法审核");
|
|
|
} else {
|
|
|
BigDecimal canuseamount = rowsaccountbalance.get(0).getBigDecimal("creditquota").add(rowsaccountbalance.get(0).getBigDecimal("balance"));
|
|
|
- if (cashbillEntity.getAmount().compareTo(canuseamount) == 1) {
|
|
|
- throw new YosException("该营销账户可用余额不足,支出凭证无法审核");
|
|
|
+ if (cashbillEntity.getAmount().compareTo(new BigDecimal("0")) == 1) {
|
|
|
+ if (cashbillEntity.getAmount().compareTo(canuseamount) == 1) {
|
|
|
+ throw new YosException("该营销账户可用余额不足,支出凭证无法审核");
|
|
|
+ }
|
|
|
}
|
|
|
BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").subtract(cashbillEntity.getAmount());
|
|
|
sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + controller.username + "',changeuserid='" + controller.userid + "' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='" + controller.siteid + "'");
|