use of org.mifos.application.accounting.business.GlDetailBO in project head by mifos.
the class AccountingServiceFacadeWebTier method getGlMasterBO.
GlMasterBO getGlMasterBO(MisProcessingTransactionsDto dto, Short createdBy) {
GlMasterBO bo = new GlMasterBO();
List<GlDetailBO> glDetailBOList = new ArrayList<GlDetailBO>();
glDetailBOList.add(new GlDetailBO(dto.getGlCredit(), dto.getAmount(), "credit", "", null, "", "", dto.getTransactionNotes()));
bo.setGlDetailBOList(glDetailBOList);
bo.setTransactionDate(dto.getPostedDate());
bo.setTransactionType(dto.getVoucherType());
bo.setFromOfficeLevel(dto.getOfficeLevel());
bo.setFromOfficeId(dto.getGlobalOfficeNum());
bo.setToOfficeLevel(dto.getOfficeLevel());
bo.setToOfficeId(dto.getGlobalOfficeNum());
//
bo.setMainAccount(dto.getGlDebit());
bo.setTransactionAmount(dto.getAmount());
//
bo.setAmountAction("debit");
//
bo.setTransactionNarration("Mis Processing");
// default value
bo.setStatus("");
// default value
bo.setTransactionBy(1);
bo.setCreatedBy(createdBy);
bo.setCreatedDate(dto.getVoucherDate());
return bo;
}
use of org.mifos.application.accounting.business.GlDetailBO in project head by mifos.
the class SimpleAccountingRestController method getSavingAccountingTranctions.
@RequestMapping(value = "/accounting/savingeneralledger", method = RequestMethod.GET)
@ResponseBody
public boolean getSavingAccountingTranctions(@RequestParam String transactionDate, @RequestParam String transactionType, @RequestParam String officeLevel, @RequestParam String officeId, @RequestParam String mainAccount, @RequestParam String transactionAmount, @RequestParam String subAccount, @RequestParam(required = false) String chequeNo, @RequestParam(required = false) String chequeDate, @RequestParam(required = false) String bankName, @RequestParam(required = false) String bankBranch, @RequestParam String transactionNarration, HttpServletRequest request) throws Exception {
List<String> amountActionList = getAmountAction(transactionType);
List<GlDetailBO> glDetailBOList = getGlDetailBOList(subAccount, transactionAmount, chequeNo, chequeDate, bankName, bankBranch, amountActionList);
GlMasterBO glMasterBO = new GlMasterBO();
glMasterBO.setTransactionDate(DateUtils.getDate(transactionDate));
//
glMasterBO.setTransactionType(transactionType);
//
glMasterBO.setAmountAction(amountActionList.get(0));
glMasterBO.setFromOfficeLevel(new Integer(officeLevel));
glMasterBO.setFromOfficeId(officeId);
glMasterBO.setToOfficeLevel(new Integer(officeLevel));
glMasterBO.setToOfficeId(officeId);
glMasterBO.setMainAccount(mainAccount);
glMasterBO.setTransactionAmount(new BigDecimal(transactionAmount));
glMasterBO.setTransactionNarration(transactionNarration);
glMasterBO.setGlDetailBOList(glDetailBOList);
// default value
glMasterBO.setStatus("");
// default value
glMasterBO.setTransactionBy(0);
glMasterBO.setCreatedBy(((UserContext) SessionUtils.getAttribute(Constants.USER_CONTEXT_KEY, request.getSession())).getId());
glMasterBO.setCreatedDate(DateUtils.getCurrentDateWithoutTimeStamp());
return accountingservicefacade.savingAccountingTransactions(glMasterBO);
}
use of org.mifos.application.accounting.business.GlDetailBO in project head by mifos.
the class SimpleAccountingRestController method getGlDetailBOList.
List<GlDetailBO> getGlDetailBOList(String subAccount, String transactionAmount, String chequeNo, String chequeDate, String bankName, String bankBranch, List<String> amountActionList) {
List<GlDetailBO> glDetailBOList = new ArrayList<GlDetailBO>();
glDetailBOList.add(new GlDetailBO(subAccount, new BigDecimal(transactionAmount), amountActionList.get(1), chequeNo, DateUtils.getDate(chequeDate), bankName, bankBranch, null));
return glDetailBOList;
}
use of org.mifos.application.accounting.business.GlDetailBO in project head by mifos.
the class ConsolidatedTransactionAction method approveCRBRTransactions.
public void approveCRBRTransactions(ConsolidatedTransactionActionForm actionForm, String Transactionno, HttpServletRequest request) {
ViewStageTransactionsDto viewStageTransactionsDto = accountingServiceFacade.getstagedAccountingTransactions(Transactionno);
try {
actionForm.setStageTrxnDate(changeDateFormat(viewStageTransactionsDto.getTransactionDate().toString()));
actionForm.setStageOfficeHierarchy(this.getOfficeHierarchy(viewStageTransactionsDto.getOfficeLevel()));
actionForm.setStageTrxnType(getTranType(viewStageTransactionsDto.getTransactionType()));
actionForm.setStageMainAccount(viewStageTransactionsDto.getMainAccount());
viewStageTransactionsDto.getSubAccount();
actionForm.setStageAccountHead(viewStageTransactionsDto.getSubAccount());
actionForm.setStageOffice(viewStageTransactionsDto.getFromOfficeId());
} catch (Exception e) {
e.printStackTrace();
}
GlDetailDto glDetailDto = accountingServiceFacade.getChequeDetails(Transactionno);
if (glDetailDto != null) {
actionForm.setStageChequeNo(glDetailDto.getChequeNo());
if (glDetailDto.getChequeDate() != null) {
actionForm.setChequeDate(changeDateFormat(glDetailDto.getChequeDate().toString()));
}
actionForm.setStageBankName(glDetailDto.getBankName());
actionForm.setStageankBranch(glDetailDto.getBankBranch());
}
short s = new Integer(actionForm.getStageOfficeHierarchy()).shortValue();
List<OfficeGlobalDto> officeDetailsDtos = null;
if (actionForm.getStageOfficeHierarchy() == "0") {
officeDetailsDtos = null;
// To recognize center
} else if (actionForm.getStageOfficeHierarchy() == "6") {
officeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("3"));
// to recognize group
} else if (actionForm.getStageOfficeHierarchy() == "7") {
officeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("2"));
} else {
officeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(s);
}
storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
// load main accounts
List<GLCodeDto> accountingDtos = null;
if (actionForm.getStageTrxnType().equals("CR") || actionForm.getStageTrxnType().equals("CP") || actionForm.getStageTrxnType().equals("BR") || actionForm.getStageTrxnType().equals("BP") || actionForm.getStageTrxnType().equals("JV")) {
accountingDtos = accountingServiceFacade.auditAccountHeads();
}
actionForm.setTransactionDetailID(viewStageTransactionsDto.getTransactionID());
actionForm.setStageMainAccount(viewStageTransactionsDto.getMainAccount());
actionForm.setStageAccountHead(viewStageTransactionsDto.getSubAccount());
actionForm.setStageNotes(viewStageTransactionsDto.getNarration());
actionForm.setStageAmount(viewStageTransactionsDto.getTransactionAmount());
String[] Transactionno1 = actionForm.getTransactionNo();
String[] cpbpTransactionNO1 = actionForm.getTransactionCpBpNo();
for (int j = 0; j < Transactionno1.length; j++) {
GlMasterBO glMasterBO = new GlMasterBO();
int stage = 1;
List<String> amountActionList = getAmountAction(actionForm);
List<GlDetailBO> glDetailBOList = getGlDetailBOList(actionForm, amountActionList, Integer.parseInt(actionForm.getTransactionDetailID()));
glMasterBO.setTransactionMasterId(Integer.parseInt(Transactionno1[j]));
glMasterBO.setTransactionDate(DateUtils.getDate(actionForm.getStageTrxnDate()));
glMasterBO.setTransactionType(actionForm.getStageTrxnType());
glMasterBO.setFromOfficeLevel(new Integer(actionForm.getStageOfficeHierarchy()));
glMasterBO.setFromOfficeId(actionForm.getStageOffice());
glMasterBO.setToOfficeLevel(new Integer(actionForm.getStageOfficeHierarchy()));
glMasterBO.setToOfficeId(actionForm.getStageOffice());
glMasterBO.setMainAccount(actionForm.getStageMainAccount());
glMasterBO.setTransactionAmount(new BigDecimal(actionForm.getStageAmount()));
glMasterBO.setAmountAction(amountActionList.get(0));
glMasterBO.setTransactionNarration(actionForm.getStageNotes());
glMasterBO.setStage(stage);
glMasterBO.setGlDetailBOList(glDetailBOList);
// default value
glMasterBO.setStatus("");
// default value
glMasterBO.setTransactionBy(0);
glMasterBO.setCreatedBy(getUserContext(request).getId());
glMasterBO.setCreatedDate(DateUtils.getCurrentDateWithoutTimeStamp());
accountingServiceFacade.savingAccountingTransactions(glMasterBO);
}
}
use of org.mifos.application.accounting.business.GlDetailBO in project head by mifos.
the class InterOfficeTransferAction method getInterOfficeGlDetailBOList.
List<GlDetailBO> getInterOfficeGlDetailBOList(InterOfficeTransferActionForm actionForm, List<String> amountActionList) {
List<GlDetailBO> glDetailBOList = new ArrayList<GlDetailBO>();
glDetailBOList.add(new GlDetailBO(actionForm.getCreditAccountHead(), new BigDecimal(actionForm.getAmount()), amountActionList.get(1), null, null, null, null, null));
return glDetailBOList;
}
Aggregations