|
|
@@ -2321,12 +2321,7 @@ public class Order extends Controller {
|
|
|
Rows promotion = dbConnect.runSqlQuery("select * from sa_promotion where siteid='" + siteid + "'and sa_promotionid=" + sa_promotionid);
|
|
|
if (islimit) {
|
|
|
if (promotion.isNotEmpty()) {
|
|
|
- Rows amountrows = dbConnect.runSqlQuery("select sum(amount) amount from sa_cashbill where ownerid='" + sa_orderid + "' and ownertable='sa_order' and sa_accountclassid=" + promotion.get(0).getLong("sa_accountclassid"));
|
|
|
- if (amountrows.isNotEmpty()) {
|
|
|
- if (amountrows.get(0).getBigDecimal("amount").compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- sqlList.add("update sa_promotion_auth set saledamount=saledamount-" + amountrows.get(0).getBigDecimal("amount") + " where sa_promotion_authid=" + promotion_auth.get(0).getLong("sa_promotion_authid"));
|
|
|
- }
|
|
|
- }
|
|
|
+ sqlList.add("update sa_promotion_auth set saledamount=saledamount-" + amount + " where sa_promotion_authid=" + promotion_auth.get(0).getLong("sa_promotion_authid"));
|
|
|
}
|
|
|
|
|
|
}
|