Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FmTakeaway
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shangshang.dai
FmTakeaway
Commits
ce26e15b
Commit
ce26e15b
authored
Jun 05, 2017
by
ss.dai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 1:修复小票不打印篮子信息
parent
c986f6cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
6 deletions
+32
-6
fmPrinter/fmPrinter.cpp
+32
-6
No files found.
fmPrinter/fmPrinter.cpp
View file @
ce26e15b
...
@@ -20,6 +20,7 @@ bool FmPrinter::DoPrint(QString printerName, OrderObject *pData, QString& error)
...
@@ -20,6 +20,7 @@ bool FmPrinter::DoPrint(QString printerName, OrderObject *pData, QString& error)
{
{
if
(
printerName
.
compare
(
"禁用此打印机"
))
if
(
printerName
.
compare
(
"禁用此打印机"
))
{
{
qDebug
()
<<
data
;
if
(
!
_RawDataToPrinter
(
printerName
,
data
,
error
))
if
(
!
_RawDataToPrinter
(
printerName
,
data
,
error
))
{
{
return
false
;
return
false
;
...
@@ -48,15 +49,40 @@ QStringList FmPrinter::_GetPrintData(OrderObject *pData)
...
@@ -48,15 +49,40 @@ QStringList FmPrinter::_GetPrintData(OrderObject *pData)
if
(
!
file
.
open
(
QFile
::
ReadOnly
)){
if
(
!
file
.
open
(
QFile
::
ReadOnly
)){
return
QStringList
();
return
QStringList
();
}
}
for
(
int
i
=
0
;
i
<
pData
->
proList
.
count
();
i
++
)
QMultiMap
<
QString
,
ProductObject
*
>
map
;
QListIterator
<
ProductObject
*>
listIte
(
pData
->
proList
);
while
(
listIte
.
hasNext
())
{
ProductObject
*
pObj
=
listIte
.
next
();
map
.
insert
(
pObj
->
bsk_num
,
pObj
);
}
foreach
(
QString
key
,
map
.
uniqueKeys
())
{
{
QString
name
,
price
;
QString
topName
=
QString
(
"【%1号口袋】
\r\n
"
).
arg
(
key
);
name
=
pData
->
proList
[
i
]
->
name
;
str_comd_list
.
append
(
topName
);
price
=
QString
(
"
\r\n
x%1 %2 %3
\r\n
"
).
arg
(
pData
->
proList
[
i
]
->
productAmount
).
arg
(
_Penny2Dollar
(
pData
->
proList
[
i
]
->
price
))
foreach
(
ProductObject
*
pObj
,
map
.
values
(
key
))
.
arg
(
_Penny2Dollar
(
pData
->
proList
[
i
]
->
price
*
pData
->
proList
[
i
]
->
productAmount
));
{
str_comd_list
.
append
(
QString
(
name
+
price
));
QString
name
,
price
;
name
=
pObj
->
name
;
price
=
QString
(
"
\r\n
x%1 %2 %3
\r\n
"
).
arg
(
pObj
->
productAmount
).
arg
(
_Penny2Dollar
(
pObj
->
price
))
.
arg
(
_Penny2Dollar
(
pObj
->
price
*
pObj
->
productAmount
));
str_comd_list
.
append
(
QString
(
name
+
price
));
}
}
}
// for(int i=0; i<pData->proList.count(); i++)
// {
// QString name, price;
// name = pData->proList[i]->name;
// price = QString("\r\n x%1 %2 %3\r\n").arg(pData->proList[i]->productAmount).arg(_Penny2Dollar(pData->proList[i]->price))
// .arg(_Penny2Dollar(pData->proList[i]->price*pData->proList[i]->productAmount));
// str_comd_list.append(QString(name+price));
// }
QByteArray
array
=
file
.
readAll
();
QByteArray
array
=
file
.
readAll
();
str_print
=
QString
::
fromUtf8
(
array
);
str_print
=
QString
::
fromUtf8
(
array
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment