Search in sources :

Example 16 with GlDetailBO

use of org.mifos.application.accounting.business.GlDetailBO in project head by mifos.

the class VoucherBranchMappingAction method getGlDetailBOList.

List<GlDetailBO> getGlDetailBOList(VoucherBranchMappingActionForm actionForm, List<String> amountActionList) {
    List<GlDetailBO> glDetailBOList = new ArrayList<GlDetailBO>();
    String[] amounts = actionForm.getAmount();
    String[] transactionnotes = actionForm.getTransactionnotes();
    String[] coanames = actionForm.getCoaname();
    List<CoaNamesDto> coaNamesDtolist = new ArrayList<CoaNamesDto>();
    for (int i = 0; i < actionForm.getAmount().length; i++) {
        CoaNamesDto coanamesob = new CoaNamesDto();
        coanamesob.setAmount(amounts[i]);
        coanamesob.setTrxnnotes(transactionnotes[i]);
        coanamesob.setCoaName(coanames[i]);
        coaNamesDtolist.add(coanamesob);
    }
    for (CoaNamesDto namesdto : coaNamesDtolist) {
        List<CoaNamesDto> subaccounthead = accountingServiceFacade.loadCoaNamesWithGlcodeValues(namesdto.getCoaName());
        for (CoaNamesDto subaccount : subaccounthead) {
            double amount = Double.parseDouble(namesdto.getAmount());
            if (amount > 0) {
                glDetailBOList.add(new GlDetailBO(subaccount.getGlcodeValue(), new BigDecimal(namesdto.getAmount()), amountActionList.get(1), actionForm.getChequeNo(), DateUtils.getDate(actionForm.getChequeDate()), actionForm.getBankName(), actionForm.getBankBranch(), namesdto.getTrxnnotes()));
            }
        }
    }
    return glDetailBOList;
}
Also used : CoaNamesDto(org.mifos.dto.domain.CoaNamesDto) ArrayList(java.util.ArrayList) BigDecimal(java.math.BigDecimal) GlDetailBO(org.mifos.application.accounting.business.GlDetailBO)

Example 17 with GlDetailBO

use of org.mifos.application.accounting.business.GlDetailBO in project head by mifos.

the class InterOfficeTransferAction method getGlDetailBOList.

List<GlDetailBO> getGlDetailBOList(InterOfficeTransferActionForm actionForm, List<String> amountActionList) {
    List<GlDetailBO> glDetailBOList = new ArrayList<GlDetailBO>();
    glDetailBOList.add(new GlDetailBO("11301", new BigDecimal(actionForm.getAmount()), amountActionList.get(1), null, null, null, null, null));
    return glDetailBOList;
}
Also used : ArrayList(java.util.ArrayList) BigDecimal(java.math.BigDecimal) GlDetailBO(org.mifos.application.accounting.business.GlDetailBO)

Example 18 with GlDetailBO

use of org.mifos.application.accounting.business.GlDetailBO in project head by mifos.

the class JournalVoucherAction method getGlDetailBOList.

List<GlDetailBO> getGlDetailBOList(JournalVoucherActionForm 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, actionForm.getVoucherNotes()));
    return glDetailBOList;
}
Also used : ArrayList(java.util.ArrayList) BigDecimal(java.math.BigDecimal) GlDetailBO(org.mifos.application.accounting.business.GlDetailBO)

Example 19 with GlDetailBO

use of org.mifos.application.accounting.business.GlDetailBO in project head by mifos.

the class JournalVoucherAction method insertionSaveAndStage.

public void insertionSaveAndStage(JournalVoucherActionForm actionForm, HttpServletRequest request, int stage) {
    List<String> amountActionList = getAmountAction(actionForm);
    List<GlDetailBO> glDetailBOList = getGlDetailBOList(actionForm, amountActionList);
    //
    GlMasterBO glMasterBO = new GlMasterBO();
    glMasterBO.setTransactionDate(DateUtils.getDate(actionForm.getVoucherDate()));
    glMasterBO.setTransactionType(actionForm.getTrxnType());
    glMasterBO.setFromOfficeLevel(new Integer(actionForm.getOfficeHierarchy()));
    glMasterBO.setFromOfficeId(actionForm.getOffice());
    glMasterBO.setToOfficeLevel(new Integer(actionForm.getOfficeHierarchy()));
    glMasterBO.setToOfficeId(actionForm.getOffice());
    glMasterBO.setMainAccount(actionForm.getDebitAccountHead());
    glMasterBO.setTransactionAmount(new BigDecimal(actionForm.getAmount()));
    glMasterBO.setAmountAction(amountActionList.get(0));
    glMasterBO.setTransactionNarration(actionForm.getVoucherNotes());
    glMasterBO.setGlDetailBOList(glDetailBOList);
    glMasterBO.setStatus("");
    glMasterBO.setStage(stage);
    glMasterBO.setTransactionBy(0);
    glMasterBO.setCreatedBy(getUserContext(request).getId());
    glMasterBO.setCreatedDate(DateUtils.getCurrentDateWithoutTimeStamp());
    if (stage == 0) {
        accountingServiceFacade.savingStageAccountingTransactions(glMasterBO);
    } else {
        accountingServiceFacade.savingAccountingTransactions(glMasterBO);
    }
}
Also used : GlMasterBO(org.mifos.application.accounting.business.GlMasterBO) BigDecimal(java.math.BigDecimal) GlDetailBO(org.mifos.application.accounting.business.GlDetailBO)

Example 20 with GlDetailBO

use of org.mifos.application.accounting.business.GlDetailBO in project head by mifos.

the class ViewStageTransactionAction 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;
}
Also used : ArrayList(java.util.ArrayList) BigDecimal(java.math.BigDecimal) GlDetailBO(org.mifos.application.accounting.business.GlDetailBO)

Aggregations

GlDetailBO (org.mifos.application.accounting.business.GlDetailBO)22 BigDecimal (java.math.BigDecimal)21 ArrayList (java.util.ArrayList)12 GlMasterBO (org.mifos.application.accounting.business.GlMasterBO)11 GLCodeDto (org.mifos.dto.domain.GLCodeDto)3 ParseException (java.text.ParseException)2 HttpSession (javax.servlet.http.HttpSession)2 ViewStageTransactionActionForm (org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm)2 CoaNamesDto (org.mifos.dto.domain.CoaNamesDto)2 GlDetailDto (org.mifos.dto.domain.GlDetailDto)2 OfficeGlobalDto (org.mifos.dto.domain.OfficeGlobalDto)2 ViewStageTransactionsDto (org.mifos.dto.domain.ViewStageTransactionsDto)2 VoucherBranchMappingActionForm (org.mifos.accounting.struts.actionform.VoucherBranchMappingActionForm)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1