Commit b0654efa by NitefullWind

1. 结算接口中计算代金券金额,根据其他金额算先进金额。

parent c155641f
......@@ -29,7 +29,7 @@ void TaskFinal::packageServerReq()
QJsonArray coupons = getPosJsonValue(PosProps.Coupons).toArray();
// 储值金、积分、第三方、代金券
int codeAmount=0, scoreAmount=0, cashAmount=0, thirdAmount=0;
int codeAmount=0, scoreAmount=0, cashAmount=0, couponAmount=0, thirdAmount=0;
trans["third_pay_type"] = 4;
foreach(auto pay_v , getPosJsonValue(PosProps.Pay_ids).toArray())
{
......@@ -41,6 +41,7 @@ void TaskFinal::packageServerReq()
scoreAmount = pay_ob[PosProps.Pay_amount].toInt();
} else if(type == "20003") { // 代金券
coupons.append(pay_ob[PosProps.Coupon_code].toString());
couponAmount += pay_ob[PosProps.Pay_amount].toInt();
} else if(type == "10001" || type == "10004") {
thirdAmount = pay_ob[PosProps.Pay_amount].toInt();
trans["third_pay_trans_id"] = pay_ob[PosProps.Pay_transId];
......@@ -54,7 +55,7 @@ void TaskFinal::packageServerReq()
}
trans[ServerProps(PosProps.Coupons)] = coupons;
cashAmount = getPosJsonValue(PosProps.PaidAmount).toInt() - codeAmount -scoreAmount - thirdAmount;
cashAmount = getPosJsonValue(PosProps.PaidAmount).toInt() - codeAmount -scoreAmount - couponAmount - thirdAmount;
trans[ServerProps(PosProps.CodeAmount)] = codeAmount;
trans[ServerProps(PosProps.ScoreAmount)] = scoreAmount;
trans[ServerProps(PosProps.CashAmount)] = cashAmount;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment