Commit 4f28d26f by NitefullWind

1. 修复三处容易引起崩溃的代码。

parent f0ce13d2
...@@ -99,7 +99,7 @@ void TaskFinal::packageServerReq() ...@@ -99,7 +99,7 @@ void TaskFinal::packageServerReq()
// 将POS新传的支付方式加入已付到金额中 // 将POS新传的支付方式加入已付到金额中
foreach (QJsonValue payValue, getPosJsonValue(PosProps.Pay_list).toArray()) { foreach (QJsonValue payValue, getPosJsonValue(PosProps.Pay_list).toArray()) {
QJsonObject pay_id = payValue.toObject(); QJsonObject pay_id = payValue.toObject();
QSharedPointer<FMItem::Pay> payPointer(new FMItem::Pay(this)); QSharedPointer<FMItem::Pay> payPointer = QSharedPointer<FMItem::Pay>(new FMItem::Pay(this));
payPointer->SetPropertiesByJson(pay_id); payPointer->SetPropertiesByJson(pay_id);
payPointer->setOrderDBID(_order->DBID()); payPointer->setOrderDBID(_order->DBID());
if(payPointer->payId() == "20001" || payPointer->payId() == "10001" || payPointer->payId() == "10004") { if(payPointer->payId() == "20001" || payPointer->payId() == "10001" || payPointer->payId() == "10004") {
...@@ -113,7 +113,7 @@ void TaskFinal::packageServerReq() ...@@ -113,7 +113,7 @@ void TaskFinal::packageServerReq()
// 如果订单还未付完,默认以现金补全 // 如果订单还未付完,默认以现金补全
if(_order->orderAmount() > _order->paidAmount()) { if(_order->orderAmount() > _order->paidAmount()) {
QSharedPointer<FMItem::Pay> cashPay(new FMItem::Pay()); QSharedPointer<FMItem::Pay> cashPay = QSharedPointer<FMItem::Pay>(new FMItem::Pay());
cashPay->setPayId("20005"); cashPay->setPayId("20005");
cashPay->setPayStr(QString::fromLocal8Bit("现金支付(默认)")); cashPay->setPayStr(QString::fromLocal8Bit("现金支付(默认)"));
cashPay->setPayAmount(_order->orderAmount() - _order->paidAmount()); cashPay->setPayAmount(_order->orderAmount() - _order->paidAmount());
......
...@@ -233,7 +233,7 @@ void TaskPay::packagePOSRsp() ...@@ -233,7 +233,7 @@ void TaskPay::packagePOSRsp()
totalPaid += pay_id[PosProps.Pay_amount].toInt(); totalPaid += pay_id[PosProps.Pay_amount].toInt();
if(isOk && amount!=0) { if(isOk && amount!=0) {
Pay *pay = new Pay(this); Pay *pay = new Pay();
pay->SetPropertiesByJson(pay_id); pay->SetPropertiesByJson(pay_id);
pay->setTransId(transId); pay->setTransId(transId);
pay->setOrderDBID(_order->DBID()); pay->setOrderDBID(_order->DBID());
......
...@@ -95,7 +95,8 @@ bool FMVipRefund::initWnd(Session *session) ...@@ -95,7 +95,8 @@ bool FMVipRefund::initWnd(Session *session)
ui->tableWidget_pays->setCellWidget(row, col, btn); ui->tableWidget_pays->setCellWidget(row, col, btn);
btn->setCursor(QCursor(Qt::PointingHandCursor)); btn->setCursor(QCursor(Qt::PointingHandCursor));
if((payPointer->payAmount() <= payPointer->refundAmount()) || order->settled() || order->refunded()) { if((payPointer->payAmount() <= payPointer->refundAmount()) || order->settled() || order->refunded()
|| payPointer->payId()!="20001") {
btn->setEnabled(false); btn->setEnabled(false);
} }
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#define VER_MINOR 1 #define VER_MINOR 1
#define VER_REVISION 0 #define VER_REVISION 0
#define VER_BUILD 31 #define VER_BUILD 32
//! Convert version numbers to string //! Convert version numbers to string
#define _STR(S) #S #define _STR(S) #S
......
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