Commit 7410f941 by Wyh

3-14 打印結賬單,金額錯誤問題

parent f03728f5
......@@ -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為程序支持的打印紙最大寬度
......
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());
......
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