private void prepareJournalStandardAccounts() { JournalStandardSettingPickerHelper helper = new JournalStandardSettingPickerHelper(m_conn, m_sessionid, IDBConstants.MODUL_ACCOUNTING); List journalStdList = null; if (m_type.equalsIgnoreCase("Project Cost")) { journalStdList = helper.getJournalStandardSettingWithAccount(IConstants.PAYMENT_PROJECT_COST); } else { journalStdList = helper.getJournalStandardSettingWithAccount(IConstants.PAYMENT_OPERASIONAL_COST); } journalStandardAccountsMap = new HashMap(); Iterator iterator = journalStdList.iterator(); while (iterator.hasNext()) { JournalStandardSetting setting = (JournalStandardSetting) iterator.next(); String key = setting.getAttribute(); if (journalStandardAccountsMap.containsKey(key)) { } else { JournalStandard journal = setting.getJournalStandard(); JournalStandardAccount[] jsAcc = journal.getJournalStandardAccount(); journalStandardAccountsMap.put(key, jsAcc); } } // journalStandardAccountsMap }
// Project Cost public JournalStandardAccount[] getJournalStandardAccount(String attr) { JournalStandardSettingPickerHelper helper = new JournalStandardSettingPickerHelper( m_conn, m_sessionid, IDBConstants.MODUL_ACCOUNTING); List journalStdList = helper.getJournalStandardSettingWithAccount(IConstants.PAYMENT_PROJECT_COST, attr); JournalStandardSetting setting = (JournalStandardSetting) journalStdList.get(0); JournalStandard journal = setting.getJournalStandard(); JournalStandardAccount[] jsAcc = journal.getJournalStandardAccount(); return jsAcc; }
// Operational Cost public JournalStandardAccount[] getJournalStandardAccount(PmtOperationalCost entity) { String attr = ""; if (entity.getCashAccount() != null) { attr = IConstants.ATTR_PMT_CASH; } else if (entity.getBankAccount() != null) { attr = IConstants.ATTR_PMT_BANK; } else if (entity.getPaymentSource().equalsIgnoreCase("BANK")) { attr = IConstants.ATTR_PMT_BANK; } else if (entity.getPaymentSource().equalsIgnoreCase("CASH")) { attr = IConstants.ATTR_PMT_CASH; } JournalStandardSettingPickerHelper helper = new JournalStandardSettingPickerHelper( m_conn, m_sessionid, IDBConstants.MODUL_ACCOUNTING); List journalStdList = helper.getJournalStandardSettingWithAccount(IConstants.PAYMENT_OPERASIONAL_COST, attr); JournalStandardSetting setting = (JournalStandardSetting) journalStdList.get(0); JournalStandard journal = setting.getJournalStandard(); JournalStandardAccount[] jsAcc = journal.getJournalStandardAccount(); return jsAcc; }