|
@@ -773,17 +773,20 @@ public class cashbill extends Controller {
|
|
|
sqlList.add(DataContrlLog.createLog(this, "sa_cashbill", sa_cashbillid, "审核", "收入凭证审核成功").getSQL());
|
|
|
} else {
|
|
|
if (rowsaccountbalance.isEmpty()) {
|
|
|
-// SQLFactory sqlFactory = new SQLFactory(this, "营销账户余额新增");
|
|
|
-// sqlFactory.addParameter("sa_accountbalanceid", createTableID("sa_accountbalance"));
|
|
|
-// sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
|
|
|
-// sqlFactory.addParameter("sa_accountclassid", sa_accountclassid);
|
|
|
-// sqlFactory.addParameter("siteid", siteid);
|
|
|
-// sqlFactory.addParameter("balance", -rows.get(0).getLong("amount"));
|
|
|
-// sqlFactory.addParameter("userid", userid);
|
|
|
-// sqlFactory.addParameter("username", username);
|
|
|
-// sqlList.add(sqlFactory.getSQL());
|
|
|
- return getErrReturnObject().setErrMsg("该营销账户不存在,支出凭证无法审核")
|
|
|
- .toString();
|
|
|
+ if(rows.get(0).getBigDecimal("amount").compareTo(BigDecimal.ZERO)<0){
|
|
|
+ SQLFactory sqlFactory = new SQLFactory(this, "营销账户余额新增");
|
|
|
+ sqlFactory.addParameter("sa_accountbalanceid", createTableID("sa_accountbalance"));
|
|
|
+ sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
|
|
|
+ sqlFactory.addParameter("sa_accountclassid", sa_accountclassid);
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
+ sqlFactory.addParameter("balance", rows.get(0).getBigDecimal("amount").abs());
|
|
|
+ sqlFactory.addParameter("userid", userid);
|
|
|
+ sqlFactory.addParameter("username", username);
|
|
|
+ sqlList.add(sqlFactory.getSQL());
|
|
|
+ }else{
|
|
|
+ return getErrReturnObject().setErrMsg("该营销账户不存在,支出凭证无法审核")
|
|
|
+ .toString();
|
|
|
+ }
|
|
|
} else {
|
|
|
BigDecimal canuseamount = rowsaccountbalance.get(0).getBigDecimal("creditquota").add(rowsaccountbalance.get(0).getBigDecimal("balance"));
|
|
|
if (rows.get(0).getBigDecimal("amount").compareTo(canuseamount) == 1 ) {
|