Commit afe3c0f0 by 李定达

1.小票支持 非码自提 非码预约 非码外卖 ; 2.添加原始的预约时间; 3.修复退单显示完成bug;4.版本号自增

parent c25275b8
......@@ -69,7 +69,7 @@ void PrintLib::_PrintLab( OrderObject* order)
QString deliveryTime;
QString datetime;
int tmpdelitime = order->delivery_time;
int tmpdelitime = order->srcdlv_time;
if(order->delivery_time==0)
{
......@@ -97,22 +97,28 @@ void PrintLib::_PrintLab( OrderObject* order)
f_TSCInit();
//qDebug() << "f_TSCInit";
QString title = QString(" %2 %3 %4/%5").arg(datetime, deliveryTime, QString::number(++index), QString::number(allprod));
QString title = QString(" %2 %4/%5").arg(datetime, QString::number(++index), QString::number(allprod));
QString tmptitle;
if(order->order_type == 3 || order->order_type == 4 || order->order_type == 5 || order->order_type == 6)
if(order->order_type == 3 || order->order_type == 4 || order->order_type == 5)
{
tmptitle = QString("\xE8\x87\xAA\xE6\x8F\x90").append(order->code).append(title);
tmptitle = QString("\xE9\x9D\x9E\xE7\xA0\x81\xE8\x87\xAA\xE6\x8F\x90").append(order->code).append(" ").append(title);
}
else if(order->order_type == 6)
{
tmptitle = QString("\xE9\x9D\x9E\xE7\xA0\x81\xE9\xA2\x84\xE7\xBA\xA6").append(order->code).append(" ").append(title);
}
else
{
tmptitle = QString("\xE5\xA4\x96\xE5\x8D\x96").append(QString::number(order->order_index)).append(title);
tmptitle = QString("\xE9\x9D\x9E\xE7\xA0\x81\xE5\xA4\x96\xE5\x8D\x96").append(QString::number(order->order_index)).append(" ").append(title);
}
QString prodname = dish->name;
f_TSCWinPrintln(0,0,22,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),tmptitle.toLocal8Bit().data(),0);
f_TSCWinPrintln(0,0,22,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),"-----------------------------------",0.0266666);
f_TSCWinPrintln(10,0,30,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),dish->name.
f_TSCWinPrintln(10,0,30,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(), prodname.
append(" ¥").
append(QString::number(dish->price/100.0, 'f', 2)).toLocal8Bit().data(),0.0666665);
QString property_tags;
......@@ -135,7 +141,9 @@ void PrintLib::_PrintLab( OrderObject* order)
//预约送达
QString sendtimes = QString("\xE9\xA2\x84\xE7\xBA\xA6\xE9\x80\x81\xE8\xBE\xBE\x3A");
if(tmpdelitime != 0 && (order->order_type == 1 || order->order_type == 2))
QLOG_DEBUG() << "tmpdelitime : " << tmpdelitime << order->srcdlv_time;
if(tmpdelitime != 0 /*&& (order->order_type == 1 || order->order_type == 2)*/)
{
sendtimes.append(QDateTime::fromTime_t(order->delivery_time).toString("yyyy-MM-dd hh:mm:ss"));
f_TSCWinPrintln(10,140,24,0,2,2,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),sendtimes.toLocal8Bit().data(),0.0666665);
......@@ -180,8 +188,9 @@ bool PrintLib::DoPrint(const QByteArray &content, OrderObject *orderObject, QStr
}
_PrintLineNode(doc,_order);
QString confilename = qApp->applicationDirPath() + "/" + "config.ini";
QString tmpconfilename = qApp->applicationDirPath() + "/" + "printer.ini";
//QString confilename = qApp->applicationDirPath() + "/" + "config.ini";
//QString tmpconfilename = qApp->applicationDirPath() + "/" + "printer.ini";
QString tmpconfilename = qApp->applicationDirPath() + "/" + "needprt.ini";
int needlabel = QSettings(tmpconfilename, QSettings::IniFormat).value("all/needlabel", 0).toInt();
if(needlabel)
_PrintLab(_order);
......@@ -223,8 +232,9 @@ bool PrintLib::DoPrint(const QString &content, OrderObject *orderObject, QString
}
_PrintLineNode(doc,_order);
QString confilename = qApp->applicationDirPath() + "/" + "config.ini";
QString tmpconfilename = qApp->applicationDirPath() + "/" + "printer.ini";
//QString confilename = qApp->applicationDirPath() + "/" + "config.ini";
//QString tmpconfilename = qApp->applicationDirPath() + "/" + "printer.ini";
QString tmpconfilename = qApp->applicationDirPath() + "/" + "needprt.ini";
int needlabel = QSettings(tmpconfilename, QSettings::IniFormat).value("all/needlabel", 0).toInt();
if(needlabel)
_PrintLab(_order);
......
......@@ -627,7 +627,18 @@ void OrderGetWork::optOrderWithType(const QVariantMap &map)
int order_type = -1;
if(PosOrderPool::GetOrderObject(orderid, localorder))
order_type = localorder.order_type;
{
int tmpstatus = 0;
if(localorder.refund_status == 20 || localorder.refund_status == 100 || localorder.refund_status == 22)
tmpstatus = localorder.refund_status;
else
tmpstatus = localorder.status;
order_type = tmpstatus;
}
if(localorder.refund_status )
QLOG_DEBUG() << "order type : " << order_type << "opt type : " << type;
......
......@@ -63,6 +63,13 @@ bool orderprintwork::event(QEvent *e)
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTTAKE80_TEMPLET);
}
else if(order.order_type == 6)
{
if(prtwi == 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTYY_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTYY80_TEMPLET);
}
else
{
if(prtwi == 56)
......@@ -126,8 +133,9 @@ bool orderprintwork::event(QEvent *e)
}
}
QString otherfile = qApp->applicationDirPath() + "/" + PREINTER_CONSS;
QString tmpotherfile = qApp->applicationDirPath() + "/" + PREINTER_NEED;
int needptr = QSettings(otherfile, QSettings::IniFormat).value(INI_NEEDPTR, 0).toInt();
int needptr = QSettings(tmpotherfile, QSettings::IniFormat).value(INI_NEEDPTR, 0).toInt();
QEventLoop loop;
......
......@@ -164,6 +164,14 @@ int main(int argc, char *argv[])
QThread threadt;
QLOG_INFO() << "Thread List :" << &thread << &threadt << QThread::currentThread();
QFile tmpfile(qApp->applicationDirPath() + "/" + PREINTER_NEED);
if(!tmpfile.exists())
{
if(tmpfile.open(QFile::ReadWrite))
tmpfile.close();
}
OrderGetWork work;
orderprintwork printwork;
......
......@@ -100,6 +100,7 @@ void OrderObject::FromJson(const QJsonObject &json)
disList.append(disObject);
}
srcdlv_time = json[JSON_KEY_DELIVERTIME].toInt();
if(json[JSON_KEY_DELIVERTIME].toInt()==0){
this->delivery_time = (int)QDateTime::currentDateTime().toTime_t();
......@@ -112,6 +113,16 @@ void OrderObject::FromJson(const QJsonObject &json)
return;
}
int OrderObject::getSrcdlv_time() const
{
return srcdlv_time;
}
void OrderObject::setSrcdlv_time(int value)
{
srcdlv_time = value;
}
QString OrderObject::getCode() const
{
return code;
......
......@@ -71,6 +71,8 @@ public:
Q_PROPERTY (QString store_name READ getstore_name WRITE setstore_name)
Q_PROPERTY (QString store_phone READ getStore_phone WRITE setStore_phone)
Q_PROPERTY (int srcdlv_time READ getSrcdlv_time WRITE setSrcdlv_time)
Q_PROPERTY (QString code READ getCode WRITE setCode)
......@@ -97,6 +99,7 @@ public:
int delivery_type; //自配送/平台配送
QString delivery_party; //派送方式
int delivery_time; //期望送达时间
int srcdlv_time; //真实的期望送达时间兼容SB的需求
int delivery_status; //配送状态
int discount_fee; //商品优惠
int expire_time; //订单倒计时
......@@ -134,6 +137,9 @@ public:
QString getCode() const;
void setCode(const QString &value);
int getSrcdlv_time() const;
void setSrcdlv_time(int value);
protected:
QString getstore_name() const;
void setstore_name(const QString &value);
......
......@@ -37,6 +37,7 @@
#define STOREINFO_NAME "store.ini"
#define USERCONFIG_NAME "userConfig.ini"
#define PREINTER_CONSS "printer.ini"
#define PREINTER_NEED "needprt.ini"
#define UI_CASHIER "<font color='#ff0000'>未选择</font>"
#define UI_STOREID "<font color='#ff0000'>未登录</font>"
......@@ -253,6 +254,9 @@
#define FILE_PRINTTAKE_TEMPLET "printtemplettake.txt"
#define FILE_PRINT80_TEMPLET "printtemplet80.txt"
#define FILE_PRINTTAKE80_TEMPLET "printtemplettake80.txt"
#define FILE_PRINTYY_TEMPLET "printtempletyy.txt"
#define FILE_PRINTYY80_TEMPLET "printtempletyy80.txt"
#define DEFAULT_PRINTF_MAIN_SESSION "Printer"
#define DEFAULT_PRINTF_OTHER_SESSION "OtherPrinter"
......
......@@ -4,8 +4,8 @@
#include <winver.h>
#endif
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,0,7
PRODUCTVERSION 2,0,0,7
FILEVERSION 2,0,0,8
PRODUCTVERSION 2,0,0,8
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
......@@ -22,12 +22,12 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "ShangHai Freemud Co., Ltd."
VALUE "FileDescription", "FREEMUD Manager System"
VALUE "FileVersion", "2.0.0.7"
VALUE "FileVersion", "2.0.0.8"
VALUE "InternalName", "FREEMUD"
VALUE "LegalCopyright", "Copyright (C)2017-2020"
VALUE "OriginalFilename", "fmTakeout.exe"
VALUE "ProductName", "fmTakeout"
VALUE "ProductVersion", "2.0.0.7"
VALUE "ProductVersion", "2.0.0.8"
END
END
BLOCK "VarFileInfo"
......
......@@ -162,8 +162,10 @@ void DetailForm::InitData(OrderObject *orderObject)
ui->detailBtn3->setProperty("operation", OPERATION_SENDOUT);
}
if(orderObject->status == 5 || orderObject->status == 4)
if((orderObject->status == 5 || orderObject->status == 4) && (orderObject->refund_status != 20 && orderObject->refund_status != 22))
{
QLOG_DEBUG() << "++++++++++++++++++++++++++++++++++" << "111111111111111" << orderObject->status << orderObject->refund_status;
ui->detailBtn3->setText(QString::fromLocal8Bit(OPERATIONNAME_COMPLETE));
ui->detailBtn3->setProperty("operation", OPERATION_COMPLETE);
}
......
......@@ -369,11 +369,12 @@ void PrtSettingForm::on_pushButton_save_clicked()
return ;
QString confilename = qApp->applicationDirPath() + "/" + CONFIG_NAME;
QString tmpconfilename = qApp->applicationDirPath() + "/" + PREINTER_NEED;
if(ui->checkBox_dbprt->isChecked())
QSettings(filename, QSettings::IniFormat).setValue(INI_NEEDPTR, 1);
QSettings(tmpconfilename, QSettings::IniFormat).setValue(INI_NEEDPTR, 1);
else
QSettings(filename, QSettings::IniFormat).setValue(INI_NEEDPTR, 0);
QSettings(tmpconfilename, QSettings::IniFormat).setValue(INI_NEEDPTR, 0);
QSettings(filename, QSettings::IniFormat).setValue(session + "/" + "usb", ui->lineEdit_usb->text());
QSettings(filename, QSettings::IniFormat).setValue(session + "/" + "parallel", ui->lineEdit_lpt->text());
......@@ -403,12 +404,13 @@ void PrtSettingForm::on_btn_lab_save_clicked()
labtype = "1";
QString filename = qApp->applicationDirPath() + "/" + PREINTER_CONSS;
QString confilename = qApp->applicationDirPath() + "/" + CONFIG_NAME;
//QString confilename = qApp->applicationDirPath() + "/" + CONFIG_NAME;
QString tmpfilename = qApp->applicationDirPath() + "/" + PREINTER_NEED;
if(ui->checkBox_needlabel->isChecked())
QSettings(filename, QSettings::IniFormat).setValue(INI_NEEDLABEL, 1);
QSettings(tmpfilename, QSettings::IniFormat).setValue(INI_NEEDLABEL, 1);
else
QSettings(filename, QSettings::IniFormat).setValue(INI_NEEDLABEL, 0);
QSettings(tmpfilename, QSettings::IniFormat).setValue(INI_NEEDLABEL, 0);
QString wigth = ui->lineEdit_lab_widgh->text();
QString high = ui->lineEdit_lab_high->text();
......
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