|
|
@@ -168,7 +168,7 @@ public class Accountbalance extends BaseClass {
|
|
|
} else {
|
|
|
BigDecimal newbalance = cashbillEntity.getAmount().add(rowsaccountbalance.get(0).getBigDecimal("balance"));
|
|
|
BigDecimal newdiscountamount = cashbillEntity.getDiscountamountamount().add(rowsaccountbalance.get(0).getBigDecimal("discountamount"));
|
|
|
- sqlList.add("update sa_accountbalance set balance='" + newbalance + "',discountamount='" + newdiscountamount + "',changedate=CURRENT_TIME,changeby ='" + controller.username + "',changeuserid='" + controller.userid + "' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='" + controller.siteid + "'");
|
|
|
+ sqlList.add("update sa_accountbalance set balance=balance+'" + cashbillEntity.getAmount() + "',discountamount=discountamount+'" + cashbillEntity.getDiscountamountamount() + "',changedate=CURRENT_TIME,changeby ='" + controller.username + "',changeuserid='" + controller.userid + "' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='" + controller.siteid + "'");
|
|
|
balance = newbalance;
|
|
|
}
|
|
|
sqlFactory.addParameter("balance", balance);
|
|
|
@@ -259,7 +259,7 @@ public class Accountbalance extends BaseClass {
|
|
|
}
|
|
|
BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").subtract(cashbillEntity.getAmount());
|
|
|
BigDecimal newdiscountamount = rowsaccountbalance.get(0).getBigDecimal("discountamount").subtract(cashbillEntity.getDiscountamountamount());
|
|
|
- sqlList.add("update sa_accountbalance set balance='" + newbalance + "',discountamount='" + newdiscountamount + "',changedate=CURRENT_TIME,changeby ='" + userInfo.getUserName() + "',changeuserid='" + userInfo.getUserId() + "' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='" + userInfo.getSiteId() + "'");
|
|
|
+ sqlList.add("update sa_accountbalance set balance=balance-'" + cashbillEntity.getAmount() + "',discountamount=discountamount-'" + cashbillEntity.getDiscountamountamount() + "',changedate=CURRENT_TIME,changeby ='" + userInfo.getUserName() + "',changeuserid='" + userInfo.getUserId() + "' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='" + userInfo.getSiteId() + "'");
|
|
|
balance = newbalance;
|
|
|
}
|
|
|
sqlFactory.addParameter("balance", balance);
|
|
|
@@ -341,7 +341,7 @@ public class Accountbalance extends BaseClass {
|
|
|
// }
|
|
|
BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").subtract(cashbillEntity.getAmount());
|
|
|
BigDecimal newdiscountamount = rowsaccountbalance.get(0).getBigDecimal("discountamount").subtract(cashbillEntity.getDiscountamountamount());
|
|
|
- sqlList.add("update sa_accountbalance set balance='" + newbalance + "',discountamount='" + newdiscountamount + "',changedate=CURRENT_TIME,changeby ='" + controller.username + "',changeuserid='" + controller.userid + "' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='" + controller.siteid + "'");
|
|
|
+ sqlList.add("update sa_accountbalance set balance=balance-'" + cashbillEntity.getAmount() + "',discountamount=discountamount-'" + cashbillEntity.getDiscountamountamount() + "',changedate=CURRENT_TIME,changeby ='" + controller.username + "',changeuserid='" + controller.userid + "' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='" + controller.siteid + "'");
|
|
|
balance = newbalance;
|
|
|
}
|
|
|
sqlFactory.addParameter("balance", balance);
|
|
|
@@ -499,9 +499,9 @@ public class Accountbalance extends BaseClass {
|
|
|
Rows rows = controller.dbConnect.runSqlQuery("SELECT * from sa_agentdecorationtrebate where sys_enterpriseid= " + sys_enterpriseid + " and siteid ='" + controller.siteid + "'");
|
|
|
if (!rows.isEmpty()) {
|
|
|
if (isrebateupdate) {
|
|
|
- sqlList.add("update sa_agentdecorationtrebate set balance=" + rows.get(0).getBigDecimal("balance").subtract(amount) + " where sa_agentdecorationtrebateid=" + rows.get(0).getLong("sa_agentdecorationtrebateid") + " and siteid ='" + controller.siteid + "'");
|
|
|
+ sqlList.add("update sa_agentdecorationtrebate set balance=balance-" + amount + " where sa_agentdecorationtrebateid=" + rows.get(0).getLong("sa_agentdecorationtrebateid") + " and siteid ='" + controller.siteid + "'");
|
|
|
} else {
|
|
|
- sqlList.add("update sa_agentdecorationtrebate set balance=" + rows.get(0).getBigDecimal("balance").add(amount) + " where sa_agentdecorationtrebateid=" + rows.get(0).getLong("sa_agentdecorationtrebateid") + " and siteid ='" + controller.siteid + "'");
|
|
|
+ sqlList.add("update sa_agentdecorationtrebate set balance=balance+" + amount + " where sa_agentdecorationtrebateid=" + rows.get(0).getLong("sa_agentdecorationtrebateid") + " and siteid ='" + controller.siteid + "'");
|
|
|
}
|
|
|
}
|
|
|
return sqlList;
|