Commit ee2d6b4f by NitefullWind

1. 折扣券抵扣金额四舍五入,精确到元。 2. 代金券抵扣金额作为商家优惠金额返回给POS。 3. 支付前的会员认证界面提示输入支付码。

parent c0f570ef
...@@ -41,9 +41,11 @@ void TaskCoupon::packagePOSRsp() ...@@ -41,9 +41,11 @@ void TaskCoupon::packagePOSRsp()
int type = couponOb[ServerProps(PosProps.Coupon_type)].toInt(); int type = couponOb[ServerProps(PosProps.Coupon_type)].toInt();
QString limitTime = couponOb["expiration_date"].toString(); QString limitTime = couponOb["expiration_date"].toString();
double disAmount = qRound((1-amount)*canDisAmount/100);
if(amount<1) // 折扣券 if(amount<1) // 折扣券
{ {
Coupon c(desc, code, "discount", (1-amount)*canDisAmount/100, 0, limitTime, false); Coupon c(desc, code, "discount", disAmount , 0, limitTime, false);
c.setDiscountFactor(amount*10); c.setDiscountFactor(amount*10);
QVariant v; QVariant v;
v.setValue(c); v.setValue(c);
......
...@@ -180,9 +180,15 @@ void TaskPay::packagePOSRsp() ...@@ -180,9 +180,15 @@ void TaskPay::packagePOSRsp()
for(int i = 0; i < servPayArray.size(); i++) for(int i = 0; i < servPayArray.size(); i++)
{ {
QJsonObject pay_id; QJsonObject pay_id;
pay_id[PosProps.Pay_id] = servPayArray[i].toObject()[ServerProps(PosProps.Pay_id)].toString(); QString payId = servPayArray[i].toObject()[ServerProps(PosProps.Pay_id)].toString();
pay_id[PosProps.Pay_str] = description[servPayArray[i].toObject()["typeModeFlag"].toString()]; if(payId == "20003") {
pay_id[PosProps.Pay_amount] = 0;
pay_id["merchant_discount"] = servPayArray[i].toObject()[ServerProps(PosProps.Pay_amount)].toInt();
} else {
pay_id[PosProps.Pay_amount] = servPayArray[i].toObject()[ServerProps(PosProps.Pay_amount)].toInt(); pay_id[PosProps.Pay_amount] = servPayArray[i].toObject()[ServerProps(PosProps.Pay_amount)].toInt();
}
pay_id[PosProps.Pay_id] = payId;
pay_id[PosProps.Pay_str] = description[servPayArray[i].toObject()["typeModeFlag"].toString()];
pay_id[PosProps.Coupon_code] = servPayArray[i].toObject()["code"].toString(); pay_id[PosProps.Coupon_code] = servPayArray[i].toObject()["code"].toString();
pay_ids.push_back(pay_id); pay_ids.push_back(pay_id);
......
...@@ -22,11 +22,9 @@ bool FMVipLogin::initWnd(Session *session) ...@@ -22,11 +22,9 @@ bool FMVipLogin::initWnd(Session *session)
this->_session = session; this->_session = session;
QString placeText = QString::fromLocal8Bit("输入手机号/会员码/支付码"); QString placeText = QString::fromLocal8Bit("输入手机号/会员码/支付码");
// if(session->data(PosProps.FM_Type).toInt() == FM_Pay) { if(session->data(PosProps.FM_Type).toInt() == FM_Pay) {
// placeText = QString::fromLocal8Bit("输入支付码"); placeText = QString::fromLocal8Bit("输入支付码");
// } else { }
// placeText = QString::fromLocal8Bit("输入手机号/会员码/支付码");
// }
ui->store_label->setText(session->data(PosProps.StoreId).toString()); ui->store_label->setText(session->data(PosProps.StoreId).toString());
ui->pos_label->setText(session->data(PosProps.PosId).toString()); ui->pos_label->setText(session->data(PosProps.PosId).toString());
ui->operator_label->setText(session->data(PosProps.OperatorId).toString()); ui->operator_label->setText(session->data(PosProps.OperatorId).toString());
......
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