attempt to solve warnings on OnTransact

This commit is contained in:
buzzcode2007 2024-02-28 08:36:27 +08:00
parent 666daaa623
commit 8f0193f55f

View file

@ -7,10 +7,6 @@ import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
import tech.iBeans.POSware.Lite.transact;
import tech.iBeans.POSware.Lite.WindowManagement;
import tech.iBeans.POSware.Lite.receipt;
import tech.iBeans.POSware.Lite.OnPayment;
/**
*
@ -469,6 +465,7 @@ public class OnTransact extends javax.swing.JFrame {
private static void cart_calculation_refresh() {
/* Refresh the cart's details, such as the total cost. */
@SuppressWarnings("unchecked")
Dictionary<String, String> prices = transact.calculate();
jTextField_price_subtotal_value.setText(String.valueOf(prices.get("subtotal")));
@ -497,7 +494,8 @@ public class OnTransact extends javax.swing.JFrame {
Dictionary<String, String> ITEM_SELECTED_DETAILS_PROCESSED = new Hashtable<>();
// Get the selected details.
Dictionary ITEM_SELECTED_DETAILS = inventory.find(ITEM_SELECTED);
@SuppressWarnings("unchecked")
Dictionary<String, Object> ITEM_SELECTED_DETAILS = inventory.find(ITEM_SELECTED);
if (ITEM_SELECTED_DETAILS == null) {return (false);};
ITEM_SELECTED_DETAILS_PROCESSED.put("SKU", inventory.list().get(ITEM_SELECTED).toString());
@ -538,6 +536,7 @@ public class OnTransact extends javax.swing.JFrame {
cart_add();
}
@SuppressWarnings("unchecked")
private boolean cart_add() {
/* Add the item to the cart.
@ -550,7 +549,7 @@ public class OnTransact extends javax.swing.JFrame {
if (ITEM_SELECTED >= 0) {
// Get the selected details.
Dictionary ITEM_SELECTED_DETAILS = inventory.find(ITEM_SELECTED);
Dictionary<String, Object> ITEM_SELECTED_DETAILS = inventory.find(ITEM_SELECTED);
if (ITEM_SELECTED_DETAILS == null) {return (false);};
String ITEM_SELECTED_SKU = inventory.list().get(ITEM_SELECTED).toString();
@ -572,6 +571,7 @@ public class OnTransact extends javax.swing.JFrame {
refresh_data();
};
@SuppressWarnings("unchecked")
private boolean cart_remove() {
/* Remove the item to the cart.
@ -584,7 +584,7 @@ public class OnTransact extends javax.swing.JFrame {
if (ITEM_SELECTED >= 0) {
// Get the selected details.
Dictionary ITEM_SELECTED_DETAILS = inventory.find(ITEM_SELECTED);
Dictionary<String, Object> ITEM_SELECTED_DETAILS = inventory.find(ITEM_SELECTED);
if (ITEM_SELECTED_DETAILS == null) {return (false);};
String ITEM_SELECTED_SKU = inventory.list().get(ITEM_SELECTED).toString();