Skip to content

Commit

Permalink
Feat: Added new fields for transactioncard
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyah committed May 26, 2026
1 parent 4bc2ef5 commit 19274ac
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ private void filterData(final String searchKeyword, final Integer weekTarget) {
transactionType,
t.getShare().getStock().getSymbol(),
t.getShare().getStock().getCompany(),
sharePrefix + t.getShare().getQuantity().floatValue() + " shares",
moneyPrefix + t.getCalculator().calculateTotal().floatValue() + " NOK",
sharePrefix + t.getShare().getQuantity().floatValue(),
moneyPrefix + t.getCalculator().calculateGross().floatValue(),
moneyPrefix + t.getCalculator().calculateCommission().floatValue(),
moneyPrefix + t.getCalculator().calculateTax().floatValue(),
moneyPrefix + t.getCalculator().calculateTotal().floatValue(),
weekTarget.toString());
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,22 @@ protected void initLayout() {
* transaction.
* @param shares the amount of shares gained or lost during this
* transaction.
* @param nok the amount of money in NOK gained or lost during
* the transactions.
* @param gross the gross amount of NOK gained or lost upon
* transaction.
* @param commission the calculated commission fee for the transaction.
* @param tax the calculated tax for the transaction.
* @param totalChange the total amount of NOK gained or lost upon
* transaction.
* @param week the week this transaction took place.
*/
public void addTransactionCard(final String type,
final String symbol,
final String companyName,
final String shares,
final String nok,
final String gross,
final String commission,
final String tax,
final String totalChange,
final String week) {
VBox card = new VBox();

Expand All @@ -123,10 +130,14 @@ public void addTransactionCard(final String type,
// Info Rows (+- shares, +- NOK)
VBox infoBox = new VBox();

Label textRow1 = new Label(shares);
Label textRow2 = new Label(nok);
Label textRow1 = new Label("Shares: " + shares);
Label textRow2 = new Label("Gross: " + gross);
Label textRow3 = new Label("tax: " + tax);
Label textRow4 = new Label("Comission fee : " + commission);
Label textRow5 = new Label("Total: " + totalChange + "NOK");


infoBox.getChildren().addAll(textRow1, textRow2);
infoBox.getChildren().addAll(textRow1, textRow2, textRow3, textRow4, textRow5);

Region spacer = new Region();
VBox.setVgrow(spacer, Priority.ALWAYS);
Expand Down

0 comments on commit 19274ac

Please sign in to comment.