MIFOSX-2180

This commit is contained in:
Vishwas Babu A J
2015-09-01 04:19:55 +05:30
parent 879f3082ba
commit 56fe13852d
3 changed files with 3 additions and 2 deletions
@@ -92,7 +92,7 @@ public class Charge extends AbstractPersistable<Long> {
private Integer feeFrequency;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "gl_account_id")
@JoinColumn(name = "income_or_liability_account_id")
private GLAccount account;
public static Charge fromJson(final JsonCommand command, final GLAccount account) {
@@ -138,7 +138,7 @@ public class ClientChargeWritePlatformServiceJpaRepositoryImpl implements Client
ClientTransaction clientTransaction = ClientTransaction.payCharge(client, client.getOffice(), paymentDetail, transactionDate,
chargePaid, clientCharge.getCurrency().getCode(), getAppUserIfPresent());
this.clientTransactionRepository.save(clientTransaction);
this.clientTransactionRepository.saveAndFlush(clientTransaction);
// update charge paid by associations
final ClientChargePaidBy chargePaidBy = ClientChargePaidBy.instance(clientTransaction, clientCharge, amountPaid);
@@ -72,6 +72,7 @@ public class ClientTransactionWritePlatformServiceJpaRepositoryImpl implements C
}
// generate accounting entries
this.clientTransactionRepository.saveAndFlush(clientTransaction);
generateAccountingEntries(clientTransaction);
return new CommandProcessingResultBuilder() //