use of org.mifos.platform.accounting.AccountingDto in project head by mifos.
the class TallyMessageBuilderTest method testTallyMessageBuilderNegativeAmountDebit.
@Test(expected = TallyMessageBuilderException.class)
public void testTallyMessageBuilderNegativeAmountDebit() throws TallyMessageBuilderException {
AccountingDto voucherEntry = new AccountingDto("branch", "2010-04-20", "Payment", "4365", "GL CODE NAME", "-4", "-6");
new TallyMessageBuilder(VoucherType.JOURNAL, "branch").withVoucherDate(new Date()).addDebitEntry(voucherEntry).build();
}
use of org.mifos.platform.accounting.AccountingDto in project head by mifos.
the class AccountingDataCacheManager method accountingDataFromCache.
public List<AccountingDto> accountingDataFromCache(File file) {
BufferedReader br;
try {
br = new BufferedReader(new FileReader(file));
} catch (FileNotFoundException e) {
LOGGER.error(file.toString(), e);
throw new AccountingRuntimeException(file.toString(), e);
}
String line = null;
// skip first line
try {
br.readLine();
} catch (IOException e) {
LOGGER.error("skipping header line", e);
throw new AccountingRuntimeException("skipping header line", e);
}
List<AccountingDto> accountingData = new ArrayList<AccountingDto>();
try {
while ((line = br.readLine()) != null) {
accountingData.add(parseLine(line));
}
br.close();
} catch (IOException e) {
throw new AccountingRuntimeException("reading line" + line, e);
}
return accountingData;
}
Aggregations