From cdff187910272fcf7567c25dd936fdb27ed94548 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Fri, 17 Aug 2018 04:44:49 +0200 Subject: [PATCH] Fix sell fees equation --- .../RecordTransactionFragments/SellFragment.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionFragments/SellFragment.java b/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionFragments/SellFragment.java index c7802d8..8efdd43 100644 --- a/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionFragments/SellFragment.java +++ b/app/src/main/java/com/herbron/moodl/Activities/RecordTransactionFragments/SellFragment.java @@ -301,11 +301,11 @@ public class SellFragment extends CustomRecordFragment { { if(isAmountLastUpdated) { - totalValueEditText.setText(String.valueOf(totalValue + fees)); + totalValueEditText.setText(String.valueOf(totalValue - fees)); } else { - amoutEditText.setText(String.valueOf(amount - (fees / purchasePrice))); + amoutEditText.setText(String.valueOf(amount + (fees / purchasePrice))); } } else @@ -314,22 +314,22 @@ public class SellFragment extends CustomRecordFragment { { if(isAmountLastUpdated) { - totalValueEditText.setText(String.valueOf(totalValue + (fees * purchasePrice))); + totalValueEditText.setText(String.valueOf(totalValue - (fees * purchasePrice))); } else { - amoutEditText.setText(String.valueOf((totalValue / purchasePrice) - fees)); + amoutEditText.setText(String.valueOf((totalValue / purchasePrice) + fees)); } } else { if(isAmountLastUpdated) { - totalValueEditText.setText(String.valueOf(totalValue + fees)); + totalValueEditText.setText(String.valueOf(totalValue - fees)); } else { - amoutEditText.setText(String.valueOf((totalValue - fees) / purchasePrice)); + amoutEditText.setText(String.valueOf((totalValue + fees) / purchasePrice)); } } }