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 VoucherBranchMappingAction method submit.
public ActionForward submit(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
String totalAmount = "0";
String[] amounts;
VoucherBranchMappingActionForm actionForm = (VoucherBranchMappingActionForm) form;
//storingSession(request, "coaNamesList", coaNameslist);
List<String> amountActionList = getAmountAction(actionForm);
List<GlDetailBO> glDetailBOList = getGlDetailBOList(actionForm, amountActionList);
String[] amounts1 = actionForm.getAmount();
amounts = actionForm.getAmount();
double totalcheck = Double.parseDouble(actionForm.getTotal());
if (totalcheck != 0) {
GlMasterBO glMasterBO = new GlMasterBO();
glMasterBO.setTransactionDate(DateUtils.getDate(actionForm.getTransactiondate()));
glMasterBO.setTransactionType(actionForm.getTransactiontype());
glMasterBO.setFromOfficeLevel(new Integer("5"));
glMasterBO.setFromOfficeId(actionForm.getBranch());
glMasterBO.setToOfficeLevel(new Integer("5"));
glMasterBO.setToOfficeId(actionForm.getBranch());
glMasterBO.setMainAccount(actionForm.getMainAccount());
glMasterBO.setTransactionAmount(new BigDecimal(Double.parseDouble(actionForm.getTotal())));
glMasterBO.setAmountAction(amountActionList.get(0));
glMasterBO.setTransactionNarration("success");
glMasterBO.setGlDetailBOList(glDetailBOList);
// default value
glMasterBO.setStatus("");
glMasterBO.setStage(0);
// default value
glMasterBO.setTransactionBy(0);
glMasterBO.setCreatedBy(getUserContext(request).getId());
glMasterBO.setCreatedDate(DateUtils.getCurrentDateWithoutTimeStamp());
accountingServiceFacade.savingAccountingTransactions(glMasterBO);
actionForm.setTransactiontype(null);
}
return mapping.findForward(ActionForwards.submit_success.toString());
}
use of org.mifos.application.accounting.business.GlDetailBO in project head by mifos.
the class ApproveTransactions method submit.
public ActionForward submit(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
HttpSession session = request.getSession(true);
ViewStageTransactionActionForm actionForm = (ViewStageTransactionActionForm) form;
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(actionForm.getStageTransactionNo()));
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);
return mapping.findForward("submit_success");
}
use of org.mifos.application.accounting.business.GlDetailBO in project head by mifos.
the class ApproveTransactions method getGlDetailBOList.
List<GlDetailBO> getGlDetailBOList(ViewStageTransactionActionForm actionForm, List<String> amountActionList, int transactionDetailID) {
List<GlDetailBO> glDetailBOList = new ArrayList<GlDetailBO>();
glDetailBOList.add(new GlDetailBO(transactionDetailID, actionForm.getStageAccountHead(), new BigDecimal(actionForm.getStageAmount()), amountActionList.get(1), actionForm.getStageChequeNo(), DateUtils.getDate(actionForm.getChequeDate()), actionForm.getStageBankName(), actionForm.getStageankBranch()));
return glDetailBOList;
}
use of org.mifos.application.accounting.business.GlDetailBO in project head by mifos.
the class MultipleGeneralLedgerAction method getGlDetailBOList.
List<GlDetailBO> getGlDetailBOList(MultipleGeneralLedgerActionForm actionForm, List<String> amountActionList) {
List<GlDetailBO> glDetailBOList = new ArrayList<GlDetailBO>();
String[] amounts = actionForm.getAmount1();
String[] trannotes = actionForm.getNotes1();
String[] accountHeads = actionForm.getAccountHead1();
List<GLCodeDto> gLCodeDtolist = new ArrayList<GLCodeDto>();
for (int i = 0; i < amounts.length; i++) {
GLCodeDto gLCodeDto = new GLCodeDto();
gLCodeDto.setAmounts(amounts[i]);
gLCodeDto.setTrannotes(trannotes[i]);
if (amounts.length <= accountHeads.length) {
gLCodeDto.setAccountHead(accountHeads[i]);
}
gLCodeDtolist.add(gLCodeDto);
}
for (GLCodeDto glCodeDto : gLCodeDtolist) {
if (glCodeDto.getAccountHead() != null) {
List<CoaNamesDto> subaccounthead = accountingServiceFacade.loadCoaNamesWithGlcodeValues(glCodeDto.getAccountHead());
for (CoaNamesDto subaccount : subaccounthead) {
double amount = Double.parseDouble(glCodeDto.getAmounts());
String Accounthead = glCodeDto.getAccountHead();
if (amount > 0) {
glDetailBOList.add(new GlDetailBO(subaccount.getGlcodeValue(), new BigDecimal(glCodeDto.getAmounts()), amountActionList.get(1), actionForm.getChequeNo(), DateUtils.getDate(actionForm.getChequeDate()), actionForm.getBankName(), actionForm.getBankBranch(), glCodeDto.getTrannotes()));
}
}
}
}
return glDetailBOList;
}
Aggregations