Add function
check if the receipt was empty
This commit is contained in:
		
							parent
							
								
									d6548c1c8e
								
							
						
					
					
						commit
						4cf91267c3
					
				
					 1 changed files with 10 additions and 3 deletions
				
			
		|  | @ -4,7 +4,6 @@ | ||||||
|  */ |  */ | ||||||
| package tech.iBeans.POSware.Lite; | package tech.iBeans.POSware.Lite; | ||||||
| import java.util.*; | 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 class receipt { | ||||||
|     public static String content = ""; |     public static String content = ""; | ||||||
| 	private static Dictionary<String, String> data = new Hashtable<>(); | 	private static Dictionary<String, String> data = new Hashtable<>(); | ||||||
|  | 	public static Boolean clear = true; | ||||||
|      |      | ||||||
|     public static void init() { |     public static void init() { | ||||||
|         content = ""; |         content = ""; | ||||||
|  | @ -57,8 +57,15 @@ public class receipt { | ||||||
| 			ready(); | 			ready(); | ||||||
| 		}; | 		}; | ||||||
| 		if (data.get("cart") != null) { | 		if (data.get("cart") != null) { | ||||||
|  | 			if (!data.get("cart").isBlank()) { | ||||||
|  | 				clear = false; | ||||||
| 				content = content.concat(data.get("cart").toString()); | 				content = content.concat(data.get("cart").toString()); | ||||||
| 				ready(); | 				ready(); | ||||||
|  | 			} else { | ||||||
|  | 				clear = true; | ||||||
|  | 			}; | ||||||
|  | 		} else { | ||||||
|  | 			clear = true; | ||||||
| 		}; | 		}; | ||||||
| 		if (data.get("payment") != null) { | 		if (data.get("payment") != null) { | ||||||
| 			content = content.concat(data.get("payment").toString()); | 			content = content.concat(data.get("payment").toString()); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue