Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
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
王宇航
supplier
Commits
7410f941
Commit
7410f941
authored
Mar 14, 2020
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3-14 打印結賬單,金額錯誤問題
parent
f03728f5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
+5
-7
print-module/src/main/java/com/joe/print/mvp/print/PrintUtils.java
+5
-5
print-module/src/main/java/com/joe/print/mvp/ui/adapter/PrinterListAdapter.java
+0
-2
No files found.
print-module/src/main/java/com/joe/print/mvp/print/PrintUtils.java
View file @
7410f941
...
...
@@ -129,7 +129,7 @@ public class PrintUtils {
}
}
}
}
else
if
(
type
==
4
)
{
}
else
if
(
type
==
4
)
{
//清機報表
bitmaps
.
add
(
getReportBitmap
(
mContext
));
}
...
...
@@ -270,7 +270,7 @@ public class PrintUtils {
BigDecimal
totalAmount
=
new
BigDecimal
(
0
);
for
(
OrderDetail
OrderDetail
:
MyOrderManage
.
getInstance
().
getOrderFoodList
())
{
totalAmount
=
MoneyUtil
.
sum
(
totalAmount
,
MoneyUtil
.
priceCalculation
(
OrderDetail
.
getPrice
(),
OrderDetail
.
getNumber
()
));
totalAmount
=
MoneyUtil
.
sum
(
totalAmount
,
OrderDetail
.
getPrice
(
));
}
//總金額
mTvTotalAmount
.
setText
(
totalAmount
+
""
);
...
...
@@ -332,6 +332,7 @@ public class PrintUtils {
/**
* 獲取測試打印bitmap
*
* @param context
* @return
*/
...
...
@@ -340,16 +341,15 @@ public class PrintUtils {
return
viewToBitmap
(
context
,
view
);
}
private
static
Bitmap
getReportBitmap
(
Context
mContext
){
private
static
Bitmap
getReportBitmap
(
Context
mContext
)
{
View
view
=
PrintTransitUtils
.
getInstance
().
getPrintView
();
if
(
view
!=
null
)
{
if
(
view
!=
null
)
{
return
viewToBitmap
(
mContext
,
view
);
}
return
null
;
}
public
static
Bitmap
viewToBitmap
(
Context
context
,
View
view
)
{
LayoutToBitmapUtils
.
layoutView
(
context
,
view
);
//先测量view
//580為程序支持的打印紙最大寬度
...
...
print-module/src/main/java/com/joe/print/mvp/ui/adapter/PrinterListAdapter.java
View file @
7410f941
package
com
.
joe
.
print
.
mvp
.
ui
.
adapter
;
import
android.content.Context
;
import
android.util.Log
;
import
android.widget.RadioButton
;
import
androidx.annotation.Nullable
;
...
...
@@ -94,7 +93,6 @@ public class PrinterListAdapter extends BaseQuickAdapter<PrinterDeviceBean, Base
* @param isChecked
*/
private
void
setSelectPrint
(
BaseViewHolder
helper
,
PrinterDeviceBean
item
,
boolean
isChecked
)
{
Log
.
e
(
"error"
,
"是否選中:"
+
isChecked
+
item
.
getIp
()
+
"端口號:"
+
item
.
getPort
()
+
"紙張:"
+
item
.
getType
());
if
(
isChecked
)
{
SPUtils
.
put
(
mContext
,
PrintConstans
.
DEFAULT_PRINT_IP
,
item
.
getIp
());
SPUtils
.
put
(
mContext
,
PrintConstans
.
DEFAULT_PRINT_PORT
,
item
.
getPort
());
...
...
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