mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Merge pull request #4256 from jmacxx/fix_trade_fees_export
Display correct trade and tx fees in CSV export
This commit is contained in:
commit
799d48e74a
@ -63,7 +63,7 @@ shared.priceInCurForCur=Price in {0} for 1 {1}
|
||||
shared.fixedPriceInCurForCur=Fixed price in {0} for 1 {1}
|
||||
shared.amount=Amount
|
||||
shared.txFee=Transaction Fee
|
||||
shared.makerFee=Maker Fee
|
||||
shared.tradeFee=Trade Fee
|
||||
shared.buyerSecurityDeposit=Buyer Deposit
|
||||
shared.sellerSecurityDeposit=Seller Deposit
|
||||
shared.amountWithCur=Amount in {0}
|
||||
|
@ -41,7 +41,7 @@
|
||||
<TableColumn fx:id="amountColumn" minWidth="130"/>
|
||||
<TableColumn fx:id="volumeColumn" minWidth="130"/>
|
||||
<TableColumn fx:id="txFeeColumn" visible="false"/>
|
||||
<TableColumn fx:id="makerFeeColumn" visible="false"/>
|
||||
<TableColumn fx:id="tradeFeeColumn" visible="false"/>
|
||||
<TableColumn fx:id="buyerSecurityDepositColumn" visible="false"/>
|
||||
<TableColumn fx:id="sellerSecurityDepositColumn" visible="false"/>
|
||||
<TableColumn fx:id="directionColumn" minWidth="80"/>
|
||||
|
@ -82,7 +82,7 @@ public class ClosedTradesView extends ActivatableViewAndModel<VBox, ClosedTrades
|
||||
@FXML
|
||||
TableView<ClosedTradableListItem> tableView;
|
||||
@FXML
|
||||
TableColumn<ClosedTradableListItem, ClosedTradableListItem> priceColumn, amountColumn, volumeColumn, txFeeColumn, makerFeeColumn, buyerSecurityDepositColumn, sellerSecurityDepositColumn,
|
||||
TableColumn<ClosedTradableListItem, ClosedTradableListItem> priceColumn, amountColumn, volumeColumn, txFeeColumn, tradeFeeColumn, buyerSecurityDepositColumn, sellerSecurityDepositColumn,
|
||||
marketColumn, directionColumn, dateColumn, tradeIdColumn, stateColumn, avatarColumn;
|
||||
@FXML
|
||||
HBox footerBox;
|
||||
@ -121,7 +121,7 @@ public class ClosedTradesView extends ActivatableViewAndModel<VBox, ClosedTrades
|
||||
@Override
|
||||
public void initialize() {
|
||||
txFeeColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.txFee")));
|
||||
makerFeeColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.makerFee")));
|
||||
tradeFeeColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.tradeFee")));
|
||||
buyerSecurityDepositColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.buyerSecurityDeposit")));
|
||||
sellerSecurityDepositColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.sellerSecurityDeposit")));
|
||||
priceColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.price")));
|
||||
@ -141,7 +141,7 @@ public class ClosedTradesView extends ActivatableViewAndModel<VBox, ClosedTrades
|
||||
setDirectionColumnCellFactory();
|
||||
setAmountColumnCellFactory();
|
||||
setTxFeeColumnCellFactory();
|
||||
setMakerFeeColumnCellFactory();
|
||||
setTradeFeeColumnCellFactory();
|
||||
setBuyerSecurityDepositColumnCellFactory();
|
||||
setSellerSecurityDepositColumnCellFactory();
|
||||
setPriceColumnCellFactory();
|
||||
@ -167,7 +167,7 @@ public class ClosedTradesView extends ActivatableViewAndModel<VBox, ClosedTrades
|
||||
txFeeColumn.setComparator(nullsFirstComparing(o ->
|
||||
o instanceof Trade ? ((Trade) o).getTxFee() : o.getOffer().getTxFee()
|
||||
));
|
||||
makerFeeColumn.setComparator(nullsFirstComparing(o ->
|
||||
tradeFeeColumn.setComparator(nullsFirstComparing(o ->
|
||||
o instanceof Trade ? ((Trade) o).getTakerFee() : o.getOffer().getMakerFee()
|
||||
));
|
||||
buyerSecurityDepositColumn.setComparator(nullsFirstComparing(o ->
|
||||
@ -518,9 +518,9 @@ public class ClosedTradesView extends ActivatableViewAndModel<VBox, ClosedTrades
|
||||
});
|
||||
}
|
||||
|
||||
private void setMakerFeeColumnCellFactory() {
|
||||
makerFeeColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
|
||||
makerFeeColumn.setCellFactory(
|
||||
private void setTradeFeeColumnCellFactory() {
|
||||
tradeFeeColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
|
||||
tradeFeeColumn.setCellFactory(
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public TableCell<ClosedTradableListItem, ClosedTradableListItem> call(
|
||||
|
@ -91,7 +91,7 @@ class ClosedTradesViewModel extends ActivatableWithDataModel<ClosedTradesDataMod
|
||||
if (item == null)
|
||||
return "";
|
||||
Tradable tradable = item.getTradable();
|
||||
if (tradable instanceof Trade)
|
||||
if (!wasMyOffer(tradable) && (tradable instanceof Trade))
|
||||
return formatter.formatCoin(((Trade) tradable).getTxFee());
|
||||
else
|
||||
return formatter.formatCoin(tradable.getOffer().getTxFee());
|
||||
@ -101,7 +101,7 @@ class ClosedTradesViewModel extends ActivatableWithDataModel<ClosedTradesDataMod
|
||||
if (item == null)
|
||||
return "";
|
||||
Tradable tradable = item.getTradable();
|
||||
if (tradable instanceof Trade)
|
||||
if (!wasMyOffer(tradable) && (tradable instanceof Trade))
|
||||
return formatter.formatCoin(((Trade) tradable).getTakerFee());
|
||||
else
|
||||
return formatter.formatCoin(tradable.getOffer().getMakerFee());
|
||||
@ -195,4 +195,8 @@ class ClosedTradesViewModel extends ActivatableWithDataModel<ClosedTradesDataMod
|
||||
.collect(Collectors.toSet())
|
||||
.size();
|
||||
}
|
||||
|
||||
boolean wasMyOffer(Tradable tradable) {
|
||||
return dataModel.closedTradableManager.wasMyOffer(tradable.getOffer());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user