maektwain commented on a change in pull request #796:
URL: https://github.com/apache/fineract/pull/796#discussion_r418995676
##########
File path:
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java
##########
@@ -625,6 +622,63 @@ private void saveAllDebitOrCreditEntries(final
JournalEntryCommand command, fina
}
}
+ @Transactional
+ @Override
+ public String createJournalEntryForIncomeAndExpenseBookOff(final
JournalEntryCommand journalEntryCommand) {
+ try{
+ journalEntryCommand.validateForCreate();
+
+ // check office is valid
+ final Long officeId = journalEntryCommand.getOfficeId();
+ final Office office =
this.officeRepositoryWrapper.findOneWithNotFoundDetection(officeId);
+
+ final String currencyCode = journalEntryCommand.getCurrencyCode();
+
+ validateBusinessRulesForJournalEntries(journalEntryCommand);
+ /** Capture payment details **/
+ final PaymentDetail paymentDetail =null;
+
+ /** Set a transaction Id and save these Journal entries **/
+ final Date transactionDate =
journalEntryCommand.getTransactionDate().toDate();
+ final String transactionId = generateTransactionId(officeId);
+ final String referenceNumber =
journalEntryCommand.getReferenceNumber();
+
+
debitOrCreditEntriesForIncomeAndExpenseBooking(journalEntryCommand, office,
paymentDetail, currencyCode, transactionDate,
+ journalEntryCommand.getDebits(), transactionId,
JournalEntryType.DEBIT, referenceNumber);
+
+
debitOrCreditEntriesForIncomeAndExpenseBooking(journalEntryCommand, office,
paymentDetail, currencyCode, transactionDate,
+ journalEntryCommand.getCredits(), transactionId,
JournalEntryType.CREDIT, referenceNumber);
+
+ return transactionId;
+ }catch (final DataIntegrityViolationException dve) {
+ handleJournalEntryDataIntegrityIssues(dve);
+ return null;
Review comment:
Rebase here ack.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]