From 3d79074efac048bc7a4c68d7df27166fe2c42dba Mon Sep 17 00:00:00 2001 From: buzzcode2007 <73412182+buzz_lightsnack_2007@users.noreply.github.com> Date: Tue, 27 Feb 2024 20:12:02 +0800 Subject: [PATCH] update code --- .../tech/iBeans/POSware/Lite/OnTransact.java | 29 +- .../tech/iBeans/POSware/Lite/OnPayment.form | 101 ++++ .../tech/iBeans/POSware/Lite/OnTransact.form | 436 ++++++++++++++++++ 3 files changed, 551 insertions(+), 15 deletions(-) create mode 100644 target/classes/tech/iBeans/POSware/Lite/OnPayment.form create mode 100644 target/classes/tech/iBeans/POSware/Lite/OnTransact.form diff --git a/src/main/java/tech/iBeans/POSware/Lite/OnTransact.java b/src/main/java/tech/iBeans/POSware/Lite/OnTransact.java index 36c595d..0b9bc54 100644 --- a/src/main/java/tech/iBeans/POSware/Lite/OnTransact.java +++ b/src/main/java/tech/iBeans/POSware/Lite/OnTransact.java @@ -149,7 +149,7 @@ public class OnTransact extends javax.swing.JFrame { jPanel_Information.add(jSpinner_price_tip_value, gridBagConstraints); jSpinner_price_tip_value.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { - cart_tip_add(); + cart_add_tip(); } }); @@ -448,8 +448,6 @@ public class OnTransact extends javax.swing.JFrame { /* Refresh the cart's details, such as the total cost. */ Dictionary prices = transact.calculate(); - // TODO fix text formatting. Perhaps to be done in a different function, not here. - jTextField_price_subtotal_value.setText(String.valueOf(prices.get("subtotal"))); jTextField_price_total_value.setText(String.valueOf(prices.get("total"))); jTextField_price_discounted.setText(String.valueOf(prices.get("discount"))); @@ -502,17 +500,12 @@ public class OnTransact extends javax.swing.JFrame { jTextField_ItemDetails_UnitPrice.setText(ITEM_SELECTED_DETAILS_PROCESSED.get("Unit Price")); jTextField_ItemDetails_Discount.setText(ITEM_SELECTED_DETAILS_PROCESSED.get("Discount")); - - return (true); }; - - private void cart_tip_add() { - /* Add a tip. */ - - transact.price.put("tip", Float.valueOf(String.valueOf(jSpinner_price_tip_value.getValue()))); - transact.calculate(); - cart_calculation_refresh(); + + private static void receipt_refresh() { + receipt.refresh(); + jTextArea1.setText(receipt.content); }; private boolean cart_add() { @@ -539,6 +532,14 @@ public class OnTransact extends javax.swing.JFrame { }; return(state); }; + + private void cart_add_tip() { + /* Add a tip. */ + + transact.price.put("tip", Float.valueOf(String.valueOf(jSpinner_price_tip_value.getValue()))); + transact.calculate(); + cart_calculation_refresh(); + }; private boolean cart_remove() { /* Remove the item to the cart. @@ -583,9 +584,7 @@ public class OnTransact extends javax.swing.JFrame { }; - private static void receipt_refresh() { - jTextArea1.setText(receipt.content); - }; + // Variables declaration - do not modify//GEN-BEGIN:variables diff --git a/target/classes/tech/iBeans/POSware/Lite/OnPayment.form b/target/classes/tech/iBeans/POSware/Lite/OnPayment.form new file mode 100644 index 0000000..1c7ea9c --- /dev/null +++ b/target/classes/tech/iBeans/POSware/Lite/OnPayment.form @@ -0,0 +1,101 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/target/classes/tech/iBeans/POSware/Lite/OnTransact.form b/target/classes/tech/iBeans/POSware/Lite/OnTransact.form new file mode 100644 index 0000000..9eed8dc --- /dev/null +++ b/target/classes/tech/iBeans/POSware/Lite/OnTransact.form @@ -0,0 +1,436 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +