Add function

check if the receipt was empty
This commit is contained in:
buzzcode2007 2024-02-27 19:18:37 +08:00
parent d6548c1c8e
commit 4cf91267c3

View file

@ -4,7 +4,6 @@
*/
package tech.iBeans.POSware.Lite;
import java.util.*;
import tech.iBeans.POSware.Lite.data_test.*;
/**
*
@ -13,6 +12,7 @@ import tech.iBeans.POSware.Lite.data_test.*;
public class receipt {
public static String content = "";
private static Dictionary<String, String> data = new Hashtable<>();
public static Boolean clear = true;
public static void init() {
content = "";
@ -57,8 +57,15 @@ public class receipt {
ready();
};
if (data.get("cart") != null) {
content = content.concat(data.get("cart").toString());
ready();
if (!data.get("cart").isBlank()) {
clear = false;
content = content.concat(data.get("cart").toString());
ready();
} else {
clear = true;
};
} else {
clear = true;
};
if (data.get("payment") != null) {
content = content.concat(data.get("payment").toString());