小票打印bug修复

This commit is contained in:
谭凯凯
2024-11-29 10:18:38 +08:00
committed by Tankaikai
parent 136e119a2b
commit 18e401f5b0
2 changed files with 5 additions and 3 deletions

View File

@@ -90,7 +90,9 @@ public abstract class PrinterHandler {
if (isTemporary == 1) {
item.setProductId(0);
item.setProductSkuId(0);
item.setProductName("【临】" + item.getProductName());
if(!item.getProductName().startsWith("【临】")){
item.setProductName("【临】" + item.getProductName());
}
}
// 台位费不打印
if (item.getProductId().equals(-999)) {

View File

@@ -89,12 +89,12 @@ public class PrinterUtils {
builder.append("<S><L>时间: ").append(date).append(" </L></S><BR><BR><BR>");
remark = StrUtil.emptyToDefault(remark, "");
if (productName.length() > 4 || remark.length() > 4) {
builder.append("<CS:32>").append(productName).append(" ").append(number).append("</CS><BR>");
builder.append("<CS:32>").append(productName).append(" x ").append(number).append("</CS><BR>");
if (StrUtil.isNotBlank(remark)) {
builder.append("<CS:32>").append(remark).append(" </CS><BR>");
}
} else {
builder.append("<B>").append(productName).append(" ").append(number).append("</B><BR>");
builder.append("<B>").append(productName).append(" x ").append(number).append("</B><BR>");
if (StrUtil.isNotBlank(remark)) {
builder.append("<B>").append(remark).append(" </B><BR>");
}