diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/dashboard/DashBoardView.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/dashboard/DashBoardView.java index 99cf231..1079fcf 100644 --- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/dashboard/DashBoardView.java +++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/dashboard/DashBoardView.java @@ -726,65 +726,4 @@ public void showTransactionReport(final String title, dialogPane.setContent(container); dialog.showAndWait(); } - - /** - * Displays a clean transaction report pop-up detailing the financial breakdown. - * - * @param title The title of the dialog box - * (e.g., "Purchase Confirmed"). - * @param symbol The stock ticker symbol. - * @param qty The amount of shares processed. - * @param gross The gross value of the transaction. - * @param commission The commission fee charged. - * @param tax The capital gains tax charged. - * @param total The net total amount. - * @param errorMessage Optional error message if transaction did not - * succesfully commit. - */ - public void showTransactionReport(final String title, - final String symbol, - final float qty, - final float gross, - final float commission, - final float tax, - final float total, - final String errorMessage) { - Dialog dialog = new Dialog<>(); - dialog.setTitle(title); - - DialogPane dialogPane = dialog.getDialogPane(); - dialogPane.getButtonTypes().add(ButtonType.CLOSE); - - //NOTE: Requires hard coding styling due to DialogPane behavior. - VBox container = new VBox(10); - container.setStyle("-fx-padding: 20; -fx-min-width: 320;"); - - if (errorMessage != null && !errorMessage.isEmpty()) { - Label errorLabel = new Label(errorMessage); - errorLabel.setStyle("-fx-text-fill: red; -fx-font-weight: bold; -fx-font-size: 14px;"); - container.getChildren().add(errorLabel); - } else { - Label headerLabel = new Label(symbol + " Transaction Summary"); - headerLabel.setStyle("-fx-font-weight: bold; -fx-font-size: 14px;"); - container.getChildren().addAll(headerLabel, new Separator()); - - String[][] rows = { - {"Quantity:", String.format("%.3f", qty)}, - {"Gross:", String.format("%.2f NOK", gross)}, - {"Tax:", String.format("%.2f NOK", tax)}, - {"Commission fee:", String.format("%.2f NOK", commission)}, - {"Total:", String.format("%.2f NOK", total)} - }; - - for (String[] rowData : rows) { - Region spacer = new Region(); - HBox.setHgrow(spacer, Priority.ALWAYS); - HBox row = new HBox(new Label(rowData[0]), spacer, new Label(rowData[1])); - container.getChildren().add(row); - } - } - - dialogPane.setContent(container); - dialog.showAndWait(); - } }