public void processCashDeposit()

in service/src/main/java/org/apache/fineract/cn/teller/service/internal/processor/DepositTransactionHandler.java [127:166]


  public void processCashDeposit(final String tellerCode, final TellerTransaction tellerTransaction,
                                 final boolean chargesIncluded) {
    final TellerEntity tellerEntity = getTellerEntity(tellerCode);
    final TellerTransactionCosts tellerTransactionCosts = this.getTellerTransactionCosts(tellerTransaction);

    if (tellerTransactionCosts.getTotalAmount().compareTo(BigDecimal.ZERO) == 0) {
      return;
    }

    final String resolvedCustomerAccount = this.accountingService.resolveAccountIdentifier(tellerTransaction.getCustomerAccountIdentifier());

    final JournalEntry journalEntry = this.prepareJournalEntry(tellerTransaction);
    final HashSet<Debtor> debtors = new HashSet<>();
    journalEntry.setDebtors(debtors);

    final Debtor tellerDebtor = new Debtor();
    tellerDebtor.setAccountNumber(tellerEntity.getTellerAccountIdentifier());
    if (chargesIncluded) {
      tellerDebtor.setAmount(tellerTransactionCosts.getTotalAmount().toString());
    } else {
      tellerDebtor.setAmount(tellerTransaction.getAmount().toString());
      if (!tellerTransactionCosts.getCharges().isEmpty()) {
        debtors.add(this.createChargesDebtor(resolvedCustomerAccount, tellerTransactionCosts));
      }
    }
    debtors.add(tellerDebtor);

    final HashSet<Creditor> creditors = new HashSet<>();
    journalEntry.setCreditors(creditors);

    final Creditor customerCreditor = new Creditor();
    customerCreditor.setAccountNumber(resolvedCustomerAccount);
    customerCreditor.setAmount(tellerTransaction.getAmount().toString());
    creditors.add(customerCreditor);

    creditors.addAll(this.createChargeCreditors(tellerTransactionCosts));

    this.accountingService.postJournalEntry(journalEntry);
    this.depositAccountManagementService.transactedProductInstance(resolvedCustomerAccount);
  }