Edit share account is not working because of merge

This commit is contained in:
Nazeer Hussain Shaik
2016-04-14 13:45:14 +05:30
parent 08c553f9fc
commit fe6e1e88fe
2 changed files with 5 additions and 5 deletions
@@ -354,10 +354,10 @@ public class ShareAccount extends AbstractPersistable<Long> {
}
public void updateRequestedShares(ShareAccountTransaction purchased) {
if (!this.shareAccountTransactions.isEmpty()) {
Iterator<ShareAccountTransaction> iter = this.shareAccountTransactions.iterator();
ShareAccountTransaction existing = iter.next();
existing.update(purchased.getPurchasedDate(), purchased.getTotalShares(), purchased.getPurchasePrice());
for(ShareAccountTransaction transaction: this.shareAccountTransactions) {
if(!transaction.isChargeTransaction() && transaction.getId().equals(purchased.getId())) {
transaction.update(purchased.getPurchasedDate(), purchased.getTotalShares(), purchased.getPurchasePrice());
}
}
}
@@ -112,7 +112,7 @@ public class ShareAccountTransaction extends AbstractPersistable<Long> {
final Integer status = PurchasedSharesStatusType.APPROVED.getValue() ;
final Integer type = PurchasedSharesStatusType.CHARGE_PAYMENT.getValue() ;
BigDecimal amount = charge.percentageOrAmount() ;
BigDecimal chargeAmount = amount ;
BigDecimal chargeAmount = null ;
return new ShareAccountTransaction(transactionDate, totalShares, unitPrice, status, type, amount, chargeAmount) ;
}