Edit share account is not working because of merge
This commit is contained in:
+4
-4
@@ -354,10 +354,10 @@ public class ShareAccount extends AbstractPersistable<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateRequestedShares(ShareAccountTransaction purchased) {
|
public void updateRequestedShares(ShareAccountTransaction purchased) {
|
||||||
if (!this.shareAccountTransactions.isEmpty()) {
|
for(ShareAccountTransaction transaction: this.shareAccountTransactions) {
|
||||||
Iterator<ShareAccountTransaction> iter = this.shareAccountTransactions.iterator();
|
if(!transaction.isChargeTransaction() && transaction.getId().equals(purchased.getId())) {
|
||||||
ShareAccountTransaction existing = iter.next();
|
transaction.update(purchased.getPurchasedDate(), purchased.getTotalShares(), purchased.getPurchasePrice());
|
||||||
existing.update(purchased.getPurchasedDate(), purchased.getTotalShares(), purchased.getPurchasePrice());
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -112,7 +112,7 @@ public class ShareAccountTransaction extends AbstractPersistable<Long> {
|
|||||||
final Integer status = PurchasedSharesStatusType.APPROVED.getValue() ;
|
final Integer status = PurchasedSharesStatusType.APPROVED.getValue() ;
|
||||||
final Integer type = PurchasedSharesStatusType.CHARGE_PAYMENT.getValue() ;
|
final Integer type = PurchasedSharesStatusType.CHARGE_PAYMENT.getValue() ;
|
||||||
BigDecimal amount = charge.percentageOrAmount() ;
|
BigDecimal amount = charge.percentageOrAmount() ;
|
||||||
BigDecimal chargeAmount = amount ;
|
BigDecimal chargeAmount = null ;
|
||||||
return new ShareAccountTransaction(transactionDate, totalShares, unitPrice, status, type, amount, chargeAmount) ;
|
return new ShareAccountTransaction(transactionDate, totalShares, unitPrice, status, type, amount, chargeAmount) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user