Java tutorial
/* * TNTConcept Easy Enterprise Management by Autentia Real Bussiness Solution S.L. * Copyright (C) 2007 Autentia Real Bussiness Solution S.L. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Autentia Real Bussiness Solution S.L. * Tlf: +34 91 675 33 06, +34 655 99 11 72 * Fax: +34 91 656 65 04 * info@autentia.com */ package com.autentia.intra.bean.billing; import com.autentia.intra.bean.BaseBean; import com.autentia.intra.bean.NavigationResults; import com.autentia.intra.businessobject.FinancialRatio; import com.autentia.intra.dao.SortCriteria; import com.autentia.intra.dao.search.FinancialRatioSearch; import com.autentia.intra.manager.billing.FinancialRatioManager; import com.autentia.intra.manager.security.Permission; import com.autentia.intra.upload.Uploader; import com.autentia.intra.upload.UploaderFactory; import com.autentia.intra.util.FacesUtils; import com.autentia.intra.util.SpringUtils; import org.acegisecurity.acls.domain.BasePermission; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import javax.faces.component.UIComponent; import javax.faces.component.html.HtmlDataTable; import javax.faces.model.SelectItem; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.ArrayList; import java.util.Date; import java.util.List; public class FinancialRatioBean extends BaseBean { /** * Comparing FinancialRatio object 1 */ private FinancialRatio financialRatioCompOne; /** * Comparing FinancialRatio object 2 */ private FinancialRatio financialRatioCompTwo; public FinancialRatio getFinancialRatioCompOne() { return financialRatioCompOne; } public void setFinancialRatioCompOne(FinancialRatio financialRatioCompOne) { this.financialRatioCompOne = financialRatioCompOne; } public FinancialRatio getFinancialRatioCompTwo() { return financialRatioCompTwo; } public void setFinancialRatioCompTwo(FinancialRatio financialRatioCompTwo) { this.financialRatioCompTwo = financialRatioCompTwo; } /** * Get the list of all Financial Ratios * * @return the list of all Financial Ratios */ public List<SelectItem> getFinancialRatiosWithNull() { ArrayList<SelectItem> ret = new ArrayList<SelectItem>(); if (this.getId() != null) { search.setDifferentId(this.getId()); } List<FinancialRatio> refs = manager.getAllEntities(search, new SortCriteria(sortColumn, sortAscending)); for (FinancialRatio ref : refs) { ret.add(new SelectItem(ref, ref.getTitle())); } ret.add(0, new SelectItem("-- NINGUNO --")); search.unsetDifferentId(); return ret; } /** * Get the list of all Financial Ratios * * @return the list of all Financial Ratios */ public List<SelectItem> getFinancialRatios() { ArrayList<SelectItem> ret = new ArrayList<SelectItem>(); if (this.getId() != null) { search.setDifferentId(this.getId()); } List<FinancialRatio> refs = manager.getAllEntities(search, new SortCriteria(sortColumn, sortAscending)); for (FinancialRatio ref : refs) { ret.add(new SelectItem(ref, ref.getTitle())); } search.unsetDifferentId(); return ret; } /** * Go to create page * * @return forward to CREATE page */ public String compareRatioForm() { return NavigationResults.COMPARE_RATIOS_FORM; } /** * Go to create page * * @return forward to CREATE page */ public String compareRatios() { return NavigationResults.COMPARE_RATIOS; } /* FinancialRatio - generated by stajanov (do not edit/delete) */ /** * Logger */ private static final Log log = LogFactory.getLog(FinancialRatioBean.class); /** * Active search object */ private FinancialRatioSearch search = new FinancialRatioSearch(); /** * Manager */ private static FinancialRatioManager manager = FinancialRatioManager.getDefault(); /** * Upload service */ private static final Uploader uploader = UploaderFactory.getInstance("financialRatio"); /** * Active FinancialRatio object */ private FinancialRatio financialRatio; /** * Default sort column */ private String sortColumn = "ratioDate"; /** * Default sort order */ private boolean sortAscending = false; /** * Quick search letter for ABC pager control */ private Character letter; /** * List financialRatios. Order depends on Faces parameter sort. * * @return the list of all financialRatios sorted by requested criterion */ public List<FinancialRatio> getAll() { return manager.getAllEntities(search, new SortCriteria(sortColumn, sortAscending)); } // Getters to list possible values of related entities // Getters to list possible values of enum fields // Methods to create/remove instances of one-to-many entities (slave entities) /** * Whether or not create button is available for user * * @return true if user can create objects of type FinancialRatio */ public boolean isCreateAvailable() { return SpringUtils.isRolePermissionGranted(Permission.Entity_Create(FinancialRatio.class)); } /** * Whether or not edit button is available for user * * @return true if user can edit current object */ public boolean isEditAvailable() { return SpringUtils.isAclPermissionGranted(financialRatio, BasePermission.WRITE); } /** * Whether or not delete button is available for user * * @return true if user can delete current object */ public boolean isDeleteAvailable() { return (financialRatio.getId() != null) && SpringUtils.isAclPermissionGranted(financialRatio, BasePermission.DELETE); } /** * Go to create page * * @return forward to CREATE page */ public String create() { financialRatio = new FinancialRatio(); return NavigationResults.CREATE; } /** * Go to detail page * * @return forward to DETAIL page */ public String detail() { Integer id = Integer.parseInt(FacesUtils.getRequestParameter("id")); financialRatio = manager.getEntityById(id); return SpringUtils.isAclPermissionGranted(financialRatio, BasePermission.WRITE) ? NavigationResults.EDIT : NavigationResults.DETAIL; } /** * Save bean and stay on it * * @return forward to list page */ public String save() { doBeforeSave(); if (financialRatio.getId() == null) { manager.insertEntity(financialRatio); } else { manager.updateEntity(financialRatio); } // Calls an after save action String result = doAfterSave(NavigationResults.LIST); // Unselect object financialRatio = null; return result; } /** * Delete bean and go back to beans list * * @return forward to LIST page */ public String delete() { manager.deleteEntity(financialRatio); financialRatio = null; return NavigationResults.LIST; } /** * Go back to beans list * * @return forward to LIST page */ public String list() { return NavigationResults.LIST; } /** * Reset search criteria * * @return forward to LIST page */ public String reset() { search.reset(); return list(); } /** * Go to search page * * @return forward to SEARCH page */ public String search() { return NavigationResults.SEARCH; } /** * Check if we have an active object. * * @return true is an object is selected */ public boolean isFinancialRatioSelected() { return financialRatio != null; } // Getters and setters to manipulate sorting public boolean isSortAscending() { return sortAscending; } public void setSortAscending(boolean sortAscending) { this.sortAscending = sortAscending; } public String getSortColumn() { return sortColumn; } public void setSortColumn(String sortColumn) { this.sortColumn = sortColumn; } // Getters and setters to handle search public FinancialRatioSearch getSearch() { return search; } public String getSearchTitle() { return search.getTitle(); } public void setSearchTitle(String val) { if (search.isTitleSet()) { search.setTitle(val); } } public boolean isSearchTitleValid() { return search.isTitleSet(); } public void setSearchTitleValid(boolean val) { if (val) { search.setTitle(search.getTitle()); } else { search.unsetTitle(); } } public Date getSearchStartRatioDate() { return search.getStartRatioDate(); } public void setSearchStartRatioDate(Date val) { if (val != null) { search.setStartRatioDate(val); } else { search.unsetStartRatioDate(); } } public boolean isSearchStartRatioDateValid() { return search.isStartRatioDateSet(); } public void setSearchStartRatioDateValid(boolean val) { if (val) { search.setStartRatioDate(search.getStartRatioDate()); } else { search.unsetStartRatioDate(); } } public Date getSearchEndRatioDate() { return search.getEndRatioDate(); } public void setSearchEndRatioDate(Date val) { if (val != null) { search.setEndRatioDate(val); } else { search.unsetEndRatioDate(); } } public boolean isSearchEndRatioDateValid() { return search.isEndRatioDateSet(); } public void setSearchEndRatioDateValid(boolean val) { if (val) { search.setEndRatioDate(search.getEndRatioDate()); } else { search.unsetEndRatioDate(); } } public BigDecimal getSearchBanksAccounts() { return search.getBanksAccounts(); } public void setSearchBanksAccounts(BigDecimal val) { if (search.isBanksAccountsSet()) { search.setBanksAccounts(val); } } public boolean isSearchBanksAccountsValid() { return search.isBanksAccountsSet(); } public void setSearchBanksAccountsValid(boolean val) { if (val) { search.setBanksAccounts(search.getBanksAccounts()); } else { search.unsetBanksAccounts(); } } public BigDecimal getSearchCustomers() { return search.getCustomers(); } public void setSearchCustomers(BigDecimal val) { if (search.isCustomersSet()) { search.setCustomers(val); } } public boolean isSearchCustomersValid() { return search.isCustomersSet(); } public void setSearchCustomersValid(boolean val) { if (val) { search.setCustomers(search.getCustomers()); } else { search.unsetCustomers(); } } public BigDecimal getSearchStocks() { return search.getStocks(); } public void setSearchStocks(BigDecimal val) { if (search.isStocksSet()) { search.setStocks(val); } } public boolean isSearchStocksValid() { return search.isStocksSet(); } public void setSearchStocksValid(boolean val) { if (val) { search.setStocks(search.getStocks()); } else { search.unsetStocks(); } } public BigDecimal getSearchAmortizations() { return search.getAmortizations(); } public void setSearchAmortizations(BigDecimal val) { if (search.isAmortizationsSet()) { search.setAmortizations(val); } } public boolean isSearchAmortizationsValid() { return search.isAmortizationsSet(); } public void setSearchAmortizationsValid(boolean val) { if (val) { search.setAmortizations(search.getAmortizations()); } else { search.unsetAmortizations(); } } public BigDecimal getSearchInfrastructures() { return search.getInfrastructures(); } public void setSearchInfrastructures(BigDecimal val) { if (search.isInfrastructuresSet()) { search.setInfrastructures(val); } } public boolean isSearchInfrastructuresValid() { return search.isInfrastructuresSet(); } public void setSearchInfrastructuresValid(boolean val) { if (val) { search.setInfrastructures(search.getInfrastructures()); } else { search.unsetInfrastructures(); } } public BigDecimal getSearchShortTermLiability() { return search.getShortTermLiability(); } public void setSearchShortTermLiability(BigDecimal val) { if (search.isShortTermLiabilitySet()) { search.setShortTermLiability(val); } } public boolean isSearchShortTermLiabilityValid() { return search.isShortTermLiabilitySet(); } public void setSearchShortTermLiabilityValid(boolean val) { if (val) { search.setShortTermLiability(search.getShortTermLiability()); } else { search.unsetShortTermLiability(); } } public BigDecimal getSearchObligationBond() { return search.getObligationBond(); } public void setSearchObligationBond(BigDecimal val) { if (search.isObligationBondSet()) { search.setObligationBond(val); } } public boolean isSearchObligationBondValid() { return search.isObligationBondSet(); } public void setSearchObligationBondValid(boolean val) { if (val) { search.setObligationBond(search.getObligationBond()); } else { search.unsetObligationBond(); } } public BigDecimal getSearchCapital() { return search.getCapital(); } public void setSearchCapital(BigDecimal val) { if (search.isCapitalSet()) { search.setCapital(val); } } public boolean isSearchCapitalValid() { return search.isCapitalSet(); } public void setSearchCapitalValid(boolean val) { if (val) { search.setCapital(search.getCapital()); } else { search.unsetCapital(); } } public BigDecimal getSearchReserves() { return search.getReserves(); } public void setSearchReserves(BigDecimal val) { if (search.isReservesSet()) { search.setReserves(val); } } public boolean isSearchReservesValid() { return search.isReservesSet(); } public void setSearchReservesValid(boolean val) { if (val) { search.setReserves(search.getReserves()); } else { search.unsetReserves(); } } public BigDecimal getSearchIncomes() { return search.getIncomes(); } public void setSearchIncomes(BigDecimal val) { if (search.isIncomesSet()) { search.setIncomes(val); } } public boolean isSearchIncomesValid() { return search.isIncomesSet(); } public void setSearchIncomesValid(boolean val) { if (val) { search.setIncomes(search.getIncomes()); } else { search.unsetIncomes(); } } public BigDecimal getSearchExpenses() { return search.getExpenses(); } public void setSearchExpenses(BigDecimal val) { if (search.isExpensesSet()) { search.setExpenses(val); } } public boolean isSearchExpensesValid() { return search.isExpensesSet(); } public void setSearchExpensesValid(boolean val) { if (val) { search.setExpenses(search.getExpenses()); } else { search.unsetExpenses(); } } public BigDecimal getSearchOtherExploitationExpenses() { return search.getOtherExploitationExpenses(); } public void setSearchOtherExploitationExpenses(BigDecimal val) { if (search.isOtherExploitationExpensesSet()) { search.setOtherExploitationExpenses(val); } } public boolean isSearchOtherExploitationExpensesValid() { return search.isOtherExploitationExpensesSet(); } public void setSearchOtherExploitationExpensesValid(boolean val) { if (val) { search.setOtherExploitationExpenses(search.getOtherExploitationExpenses()); } else { search.unsetOtherExploitationExpenses(); } } public BigDecimal getSearchFinancialExpenses() { return search.getFinancialExpenses(); } public void setSearchFinancialExpenses(BigDecimal val) { if (search.isFinancialExpensesSet()) { search.setFinancialExpenses(val); } } public boolean isSearchFinancialExpensesValid() { return search.isFinancialExpensesSet(); } public void setSearchFinancialExpensesValid(boolean val) { if (val) { search.setFinancialExpenses(search.getFinancialExpenses()); } else { search.unsetFinancialExpenses(); } } public BigDecimal getSearchTaxes() { return search.getTaxes(); } public void setSearchTaxes(BigDecimal val) { if (search.isTaxesSet()) { search.setTaxes(val); } } public boolean isSearchTaxesValid() { return search.isTaxesSet(); } public void setSearchTaxesValid(boolean val) { if (val) { search.setTaxes(search.getTaxes()); } else { search.unsetTaxes(); } } public BigDecimal getSearchNetAsset() { return search.getNetAsset(); } public void setSearchNetAsset(BigDecimal val) { if (search.isNetAssetSet()) { search.setNetAsset(val); } } public boolean isSearchNetAssetValid() { return search.isNetAssetSet(); } public void setSearchNetAssetValid(boolean val) { if (val) { search.setNetAsset(search.getNetAsset()); } else { search.unsetNetAsset(); } } public BigDecimal getSearchTotalAsset() { return search.getTotalAsset(); } public void setSearchTotalAsset(BigDecimal val) { if (search.isTotalAssetSet()) { search.setTotalAsset(val); } } public boolean isSearchTotalAssetValid() { return search.isTotalAssetSet(); } public void setSearchTotalAssetValid(boolean val) { if (val) { search.setTotalAsset(search.getTotalAsset()); } else { search.unsetTotalAsset(); } } public BigDecimal getSearchTotalOtherResources() { return search.getTotalOtherResources(); } public void setSearchTotalOtherResources(BigDecimal val) { if (search.isTotalOtherResourcesSet()) { search.setTotalOtherResources(val); } } public boolean isSearchTotalOtherResourcesValid() { return search.isTotalOtherResourcesSet(); } public void setSearchTotalOtherResourcesValid(boolean val) { if (val) { search.setTotalOtherResources(search.getTotalOtherResources()); } else { search.unsetTotalOtherResources(); } } public BigDecimal getSearchTotalOurResources() { return search.getTotalOurResources(); } public void setSearchTotalOurResources(BigDecimal val) { if (search.isTotalOurResourcesSet()) { search.setTotalOurResources(val); } } public boolean isSearchTotalOurResourcesValid() { return search.isTotalOurResourcesSet(); } public void setSearchTotalOurResourcesValid(boolean val) { if (val) { search.setTotalOurResources(search.getTotalOurResources()); } else { search.unsetTotalOurResources(); } } public BigDecimal getSearchTotalLiability() { return search.getTotalLiability(); } public void setSearchTotalLiability(BigDecimal val) { if (search.isTotalLiabilitySet()) { search.setTotalLiability(val); } } public boolean isSearchTotalLiabilityValid() { return search.isTotalLiabilitySet(); } public void setSearchTotalLiabilityValid(boolean val) { if (val) { search.setTotalLiability(search.getTotalLiability()); } else { search.unsetTotalLiability(); } } public BigDecimal getSearchMargin() { return search.getMargin(); } public void setSearchMargin(BigDecimal val) { if (search.isMarginSet()) { search.setMargin(val); } } public boolean isSearchMarginValid() { return search.isMarginSet(); } public void setSearchMarginValid(boolean val) { if (val) { search.setMargin(search.getMargin()); } else { search.unsetMargin(); } } public BigDecimal getSearchBait() { return search.getBait(); } public void setSearchBait(BigDecimal val) { if (search.isBaitSet()) { search.setBait(val); } } public boolean isSearchBaitValid() { return search.isBaitSet(); } public void setSearchBaitValid(boolean val) { if (val) { search.setBait(search.getBait()); } else { search.unsetBait(); } } public BigDecimal getSearchBat() { return search.getBat(); } public void setSearchBat(BigDecimal val) { if (search.isBatSet()) { search.setBat(val); } } public boolean isSearchBatValid() { return search.isBatSet(); } public void setSearchBatValid(boolean val) { if (val) { search.setBat(search.getBat()); } else { search.unsetBat(); } } public BigDecimal getSearchBdt() { return search.getBdt(); } public void setSearchBdt(BigDecimal val) { if (search.isBdtSet()) { search.setBdt(val); } } public boolean isSearchBdtValid() { return search.isBdtSet(); } public void setSearchBdtValid(boolean val) { if (val) { search.setBdt(search.getBdt()); } else { search.unsetBdt(); } } public BigDecimal getSearchBaitd() { return search.getBaitd(); } public void setSearchBaitd(BigDecimal val) { if (search.isBaitdSet()) { search.setBaitd(val); } } public boolean isSearchBaitdValid() { return search.isBaitdSet(); } public void setSearchBaitdValid(boolean val) { if (val) { search.setBaitd(search.getBaitd()); } else { search.unsetBaitd(); } } public BigDecimal getSearchLiquidity() { return search.getLiquidity(); } public void setSearchLiquidity(BigDecimal val) { if (search.isLiquiditySet()) { search.setLiquidity(val); } } public boolean isSearchLiquidityValid() { return search.isLiquiditySet(); } public void setSearchLiquidityValid(boolean val) { if (val) { search.setLiquidity(search.getLiquidity()); } else { search.unsetLiquidity(); } } public BigDecimal getSearchExchequer() { return search.getExchequer(); } public void setSearchExchequer(BigDecimal val) { if (search.isExchequerSet()) { search.setExchequer(val); } } public boolean isSearchExchequerValid() { return search.isExchequerSet(); } public void setSearchExchequerValid(boolean val) { if (val) { search.setExchequer(search.getExchequer()); } else { search.unsetExchequer(); } } public BigDecimal getSearchAvailability() { return search.getAvailability(); } public void setSearchAvailability(BigDecimal val) { if (search.isAvailabilitySet()) { search.setAvailability(val); } } public boolean isSearchAvailabilityValid() { return search.isAvailabilitySet(); } public void setSearchAvailabilityValid(boolean val) { if (val) { search.setAvailability(search.getAvailability()); } else { search.unsetAvailability(); } } public BigDecimal getSearchExpensesCoverage() { return search.getExpensesCoverage(); } public void setSearchExpensesCoverage(BigDecimal val) { if (search.isExpensesCoverageSet()) { search.setExpensesCoverage(val); } } public boolean isSearchExpensesCoverageValid() { return search.isExpensesCoverageSet(); } public void setSearchExpensesCoverageValid(boolean val) { if (val) { search.setExpensesCoverage(search.getExpensesCoverage()); } else { search.unsetExpensesCoverage(); } } public BigDecimal getSearchWorkingCapital() { return search.getWorkingCapital(); } public void setSearchWorkingCapital(BigDecimal val) { if (search.isWorkingCapitalSet()) { search.setWorkingCapital(val); } } public boolean isSearchWorkingCapitalValid() { return search.isWorkingCapitalSet(); } public void setSearchWorkingCapitalValid(boolean val) { if (val) { search.setWorkingCapital(search.getWorkingCapital()); } else { search.unsetWorkingCapital(); } } public BigDecimal getSearchSolvency() { return search.getSolvency(); } public void setSearchSolvency(BigDecimal val) { if (search.isSolvencySet()) { search.setSolvency(val); } } public boolean isSearchSolvencyValid() { return search.isSolvencySet(); } public void setSearchSolvencyValid(boolean val) { if (val) { search.setSolvency(search.getSolvency()); } else { search.unsetSolvency(); } } public BigDecimal getSearchDebtRatio() { return search.getDebtRatio(); } public void setSearchDebtRatio(BigDecimal val) { if (search.isDebtRatioSet()) { search.setDebtRatio(val); } } public boolean isSearchDebtRatioValid() { return search.isDebtRatioSet(); } public void setSearchDebtRatioValid(boolean val) { if (val) { search.setDebtRatio(search.getDebtRatio()); } else { search.unsetDebtRatio(); } } public BigDecimal getSearchDebtTotalLiability() { return search.getDebtTotalLiability(); } public void setSearchDebtTotalLiability(BigDecimal val) { if (search.isDebtTotalLiabilitySet()) { search.setDebtTotalLiability(val); } } public boolean isSearchDebtTotalLiabilityValid() { return search.isDebtTotalLiabilitySet(); } public void setSearchDebtTotalLiabilityValid(boolean val) { if (val) { search.setDebtTotalLiability(search.getDebtTotalLiability()); } else { search.unsetDebtTotalLiability(); } } public BigDecimal getSearchGuarantee() { return search.getGuarantee(); } public void setSearchGuarantee(BigDecimal val) { if (search.isGuaranteeSet()) { search.setGuarantee(val); } } public boolean isSearchGuaranteeValid() { return search.isGuaranteeSet(); } public void setSearchGuaranteeValid(boolean val) { if (val) { search.setGuarantee(search.getGuarantee()); } else { search.unsetGuarantee(); } } public BigDecimal getSearchFinanceCoverage() { return search.getFinanceCoverage(); } public void setSearchFinanceCoverage(BigDecimal val) { if (search.isFinanceCoverageSet()) { search.setFinanceCoverage(val); } } public boolean isSearchFinanceCoverageValid() { return search.isFinanceCoverageSet(); } public void setSearchFinanceCoverageValid(boolean val) { if (val) { search.setFinanceCoverage(search.getFinanceCoverage()); } else { search.unsetFinanceCoverage(); } } public BigDecimal getSearchCollectionPeriod() { return search.getCollectionPeriod(); } public void setSearchCollectionPeriod(BigDecimal val) { if (search.isCollectionPeriodSet()) { search.setCollectionPeriod(val); } } public boolean isSearchCollectionPeriodValid() { return search.isCollectionPeriodSet(); } public void setSearchCollectionPeriodValid(boolean val) { if (val) { search.setCollectionPeriod(search.getCollectionPeriod()); } else { search.unsetCollectionPeriod(); } } public BigDecimal getSearchPayPeriod() { return search.getPayPeriod(); } public void setSearchPayPeriod(BigDecimal val) { if (search.isPayPeriodSet()) { search.setPayPeriod(val); } } public boolean isSearchPayPeriodValid() { return search.isPayPeriodSet(); } public void setSearchPayPeriodValid(boolean val) { if (val) { search.setPayPeriod(search.getPayPeriod()); } else { search.unsetPayPeriod(); } } public BigDecimal getSearchTurnoverAsset() { return search.getTurnoverAsset(); } public void setSearchTurnoverAsset(BigDecimal val) { if (search.isTurnoverAssetSet()) { search.setTurnoverAsset(val); } } public boolean isSearchTurnoverAssetValid() { return search.isTurnoverAssetSet(); } public void setSearchTurnoverAssetValid(boolean val) { if (val) { search.setTurnoverAsset(search.getTurnoverAsset()); } else { search.unsetTurnoverAsset(); } } public BigDecimal getSearchTurnoverPermanentAsset() { return search.getTurnoverPermanentAsset(); } public void setSearchTurnoverPermanentAsset(BigDecimal val) { if (search.isTurnoverPermanentAssetSet()) { search.setTurnoverPermanentAsset(val); } } public boolean isSearchTurnoverPermanentAssetValid() { return search.isTurnoverPermanentAssetSet(); } public void setSearchTurnoverPermanentAssetValid(boolean val) { if (val) { search.setTurnoverPermanentAsset(search.getTurnoverPermanentAsset()); } else { search.unsetTurnoverPermanentAsset(); } } public BigDecimal getSearchTurnoverFM() { return search.getTurnoverFM(); } public void setSearchTurnoverFM(BigDecimal val) { if (search.isTurnoverFMSet()) { search.setTurnoverFM(val); } } public boolean isSearchTurnoverFMValid() { return search.isTurnoverFMSet(); } public void setSearchTurnoverFMValid(boolean val) { if (val) { search.setTurnoverFM(search.getTurnoverFM()); } else { search.unsetTurnoverFM(); } } public BigDecimal getSearchGrossSpread() { return search.getGrossSpread(); } public void setSearchGrossSpread(BigDecimal val) { if (search.isGrossSpreadSet()) { search.setGrossSpread(val); } } public boolean isSearchGrossSpreadValid() { return search.isGrossSpreadSet(); } public void setSearchGrossSpreadValid(boolean val) { if (val) { search.setGrossSpread(search.getGrossSpread()); } else { search.unsetGrossSpread(); } } public BigDecimal getSearchBaitSpread() { return search.getBaitSpread(); } public void setSearchBaitSpread(BigDecimal val) { if (search.isBaitSpreadSet()) { search.setBaitSpread(val); } } public boolean isSearchBaitSpreadValid() { return search.isBaitSpreadSet(); } public void setSearchBaitSpreadValid(boolean val) { if (val) { search.setBaitSpread(search.getBaitSpread()); } else { search.unsetBaitSpread(); } } public BigDecimal getSearchBdtSpread() { return search.getBdtSpread(); } public void setSearchBdtSpread(BigDecimal val) { if (search.isBdtSpreadSet()) { search.setBdtSpread(val); } } public boolean isSearchBdtSpreadValid() { return search.isBdtSpreadSet(); } public void setSearchBdtSpreadValid(boolean val) { if (val) { search.setBdtSpread(search.getBdtSpread()); } else { search.unsetBdtSpread(); } } public BigDecimal getSearchBaitROA() { return search.getBaitROA(); } public void setSearchBaitROA(BigDecimal val) { if (search.isBaitROASet()) { search.setBaitROA(val); } } public boolean isSearchBaitROAValid() { return search.isBaitROASet(); } public void setSearchBaitROAValid(boolean val) { if (val) { search.setBaitROA(search.getBaitROA()); } else { search.unsetBaitROA(); } } public BigDecimal getSearchBaitdROA() { return search.getBaitdROA(); } public void setSearchBaitdROA(BigDecimal val) { if (search.isBaitdROASet()) { search.setBaitdROA(val); } } public boolean isSearchBaitdROAValid() { return search.isBaitdROASet(); } public void setSearchBaitdROAValid(boolean val) { if (val) { search.setBaitdROA(search.getBaitdROA()); } else { search.unsetBaitdROA(); } } public BigDecimal getSearchROE() { return search.getROE(); } public void setSearchROE(BigDecimal val) { if (search.isROESet()) { search.setROE(val); } } public boolean isSearchROEValid() { return search.isROESet(); } public void setSearchROEValid(boolean val) { if (val) { search.setROE(search.getROE()); } else { search.unsetROE(); } } public BigDecimal getSearchLeveraging() { return search.getLeveraging(); } public void setSearchLeveraging(BigDecimal val) { if (search.isLeveragingSet()) { search.setLeveraging(val); } } public boolean isSearchLeveragingValid() { return search.isLeveragingSet(); } public void setSearchLeveragingValid(boolean val) { if (val) { search.setLeveraging(search.getLeveraging()); } else { search.unsetLeveraging(); } } public BigDecimal getSearchROCE() { return search.getROCE(); } public void setSearchROCE(BigDecimal val) { if (search.isROCESet()) { search.setROCE(val); } } public boolean isSearchROCEValid() { return search.isROCESet(); } public void setSearchROCEValid(boolean val) { if (val) { search.setROCE(search.getROCE()); } else { search.unsetROCE(); } } public Integer getSearchOwnerId() { return search.getOwnerId(); } public void setSearchOwnerId(Integer val) { if (search.isOwnerIdSet()) { search.setOwnerId(val); } } public boolean isSearchOwnerIdValid() { return search.isOwnerIdSet(); } public void setSearchOwnerIdValid(boolean val) { if (val) { search.setOwnerId(search.getOwnerId()); } else { search.unsetOwnerId(); } } public Integer getSearchDepartmentId() { return search.getDepartmentId(); } public void setSearchDepartmentId(Integer val) { if (search.isDepartmentIdSet()) { search.setDepartmentId(val); } } public boolean isSearchDepartmentIdValid() { return search.isDepartmentIdSet(); } public void setSearchDepartmentIdValid(boolean val) { if (val) { search.setDepartmentId(search.getDepartmentId()); } else { search.unsetDepartmentId(); } } public Date getSearchStartInsertDate() { return search.getStartInsertDate(); } public void setSearchStartInsertDate(Date val) { if (val != null) { search.setStartInsertDate(val); } else { search.unsetStartInsertDate(); } } public boolean isSearchStartInsertDateValid() { return search.isStartInsertDateSet(); } public void setSearchStartInsertDateValid(boolean val) { if (val) { search.setStartInsertDate(search.getStartInsertDate()); } else { search.unsetStartInsertDate(); } } public Date getSearchEndInsertDate() { return search.getEndInsertDate(); } public void setSearchEndInsertDate(Date val) { if (val != null) { search.setEndInsertDate(val); } else { search.unsetEndInsertDate(); } } public boolean isSearchEndInsertDateValid() { return search.isEndInsertDateSet(); } public void setSearchEndInsertDateValid(boolean val) { if (val) { search.setEndInsertDate(search.getEndInsertDate()); } else { search.unsetEndInsertDate(); } } public Date getSearchStartUpdateDate() { return search.getStartUpdateDate(); } public void setSearchStartUpdateDate(Date val) { if (val != null) { search.setStartUpdateDate(val); } else { search.unsetStartUpdateDate(); } } public boolean isSearchStartUpdateDateValid() { return search.isStartUpdateDateSet(); } public void setSearchStartUpdateDateValid(boolean val) { if (val) { search.setStartUpdateDate(search.getStartUpdateDate()); } else { search.unsetStartUpdateDate(); } } public Date getSearchEndUpdateDate() { return search.getEndUpdateDate(); } public void setSearchEndUpdateDate(Date val) { if (val != null) { search.setEndUpdateDate(val); } else { search.unsetEndUpdateDate(); } } public boolean isSearchEndUpdateDateValid() { return search.isEndUpdateDateSet(); } public void setSearchEndUpdateDateValid(boolean val) { if (val) { search.setEndUpdateDate(search.getEndUpdateDate()); } else { search.unsetEndUpdateDate(); } } /** * Handle an ABC pager letter click: filter objects by specified starting letter */ public void letterClicked() { if (letter != null) { UIComponent comp = FacesUtils.getComponent("financialRatios:list"); HtmlDataTable tabla = (HtmlDataTable) comp; tabla.setFirst(0); search.setTitle(letter + "%"); } else { search.unsetTitle(); } } public Character getLetter() { return letter; } public void setLetter(Character letter) { this.letter = letter; } // Getters and setters to handle uploads // Getters and setters to manipulate active FinancialRatio object public java.lang.Integer getId() { return financialRatio.getId(); } public String getTitle() { return financialRatio.getTitle(); } public void setTitle(String title) { financialRatio.setTitle(title); } public Date getRatioDate() { return financialRatio.getRatioDate(); } public void setRatioDate(Date ratioDate) { financialRatio.setRatioDate(ratioDate); } public BigDecimal getBanksAccounts() { return financialRatio.getBanksAccounts(); } public void setBanksAccounts(BigDecimal banksAccounts) { financialRatio.setBanksAccounts(banksAccounts); } public BigDecimal getCustomers() { return financialRatio.getCustomers(); } public void setCustomers(BigDecimal customers) { financialRatio.setCustomers(customers); } public BigDecimal getStocks() { return financialRatio.getStocks(); } public void setStocks(BigDecimal stocks) { financialRatio.setStocks(stocks); } public BigDecimal getAmortizations() { return financialRatio.getAmortizations(); } public void setAmortizations(BigDecimal amortizations) { financialRatio.setAmortizations(amortizations); } public BigDecimal getInfrastructures() { return financialRatio.getInfrastructures(); } public void setInfrastructures(BigDecimal infrastructures) { financialRatio.setInfrastructures(infrastructures); } public BigDecimal getShortTermLiability() { return financialRatio.getShortTermLiability(); } public void setShortTermLiability(BigDecimal shortTermLiability) { financialRatio.setShortTermLiability(shortTermLiability); } public BigDecimal getObligationBond() { return financialRatio.getObligationBond(); } public void setObligationBond(BigDecimal obligationBond) { financialRatio.setObligationBond(obligationBond); } public BigDecimal getCapital() { return financialRatio.getCapital(); } public void setCapital(BigDecimal capital) { financialRatio.setCapital(capital); } public BigDecimal getReserves() { return financialRatio.getReserves(); } public void setReserves(BigDecimal reserves) { financialRatio.setReserves(reserves); } public BigDecimal getIncomes() { return financialRatio.getIncomes(); } public void setIncomes(BigDecimal incomes) { financialRatio.setIncomes(incomes); } public BigDecimal getExpenses() { return financialRatio.getExpenses(); } public void setExpenses(BigDecimal expenses) { financialRatio.setExpenses(expenses); } public BigDecimal getOtherExploitationExpenses() { return financialRatio.getOtherExploitationExpenses(); } public void setOtherExploitationExpenses(BigDecimal otherExploitationExpenses) { financialRatio.setOtherExploitationExpenses(otherExploitationExpenses); } public BigDecimal getFinancialExpenses() { return financialRatio.getFinancialExpenses(); } public void setFinancialExpenses(BigDecimal financialExpenses) { financialRatio.setFinancialExpenses(financialExpenses); } public BigDecimal getTaxes() { return financialRatio.getTaxes(); } public void setTaxes(BigDecimal taxes) { financialRatio.setTaxes(taxes); } public BigDecimal getNetAsset() { return financialRatio.getNetAsset(); } public void setNetAsset(BigDecimal netAsset) { financialRatio.setNetAsset(netAsset); } public BigDecimal getTotalAsset() { return financialRatio.getTotalAsset(); } public void setTotalAsset(BigDecimal totalAsset) { financialRatio.setTotalAsset(totalAsset); } public BigDecimal getTotalOtherResources() { return financialRatio.getTotalOtherResources(); } public void setTotalOtherResources(BigDecimal totalOtherResources) { financialRatio.setTotalOtherResources(totalOtherResources); } public BigDecimal getTotalOurResources() { return financialRatio.getTotalOurResources(); } public void setTotalOurResources(BigDecimal totalOurResources) { financialRatio.setTotalOurResources(totalOurResources); } public BigDecimal getTotalLiability() { return financialRatio.getTotalLiability(); } public void setTotalLiability(BigDecimal totalLiability) { financialRatio.setTotalLiability(totalLiability); } public BigDecimal getMargin() { return financialRatio.getMargin(); } public void setMargin(BigDecimal margin) { financialRatio.setMargin(margin); } public BigDecimal getBait() { return financialRatio.getBait(); } public void setBait(BigDecimal bait) { financialRatio.setBait(bait); } public BigDecimal getBat() { return financialRatio.getBat(); } public void setBat(BigDecimal bat) { financialRatio.setBat(bat); } public BigDecimal getBdt() { return financialRatio.getBdt(); } public void setBdt(BigDecimal bdt) { financialRatio.setBdt(bdt); } public BigDecimal getBaitd() { return financialRatio.getBaitd(); } public void setBaitd(BigDecimal baitd) { financialRatio.setBaitd(baitd); } public BigDecimal getLiquidity() { return financialRatio.getLiquidity(); } public void setLiquidity(BigDecimal liquidity) { financialRatio.setLiquidity(liquidity); } public BigDecimal getExchequer() { return financialRatio.getExchequer(); } public void setExchequer(BigDecimal exchequer) { financialRatio.setExchequer(exchequer); } public BigDecimal getAvailability() { return financialRatio.getAvailability(); } public void setAvailability(BigDecimal availability) { financialRatio.setAvailability(availability); } public BigDecimal getExpensesCoverage() { return financialRatio.getExpensesCoverage(); } public void setExpensesCoverage(BigDecimal expensesCoverage) { financialRatio.setExpensesCoverage(expensesCoverage); } public BigDecimal getWorkingCapital() { return financialRatio.getWorkingCapital(); } public void setWorkingCapital(BigDecimal workingCapital) { financialRatio.setWorkingCapital(workingCapital); } public BigDecimal getSolvency() { return financialRatio.getSolvency(); } public void setSolvency(BigDecimal solvency) { financialRatio.setSolvency(solvency); } public BigDecimal getDebtRatio() { return financialRatio.getDebtRatio(); } public void setDebtRatio(BigDecimal debtRatio) { financialRatio.setDebtRatio(debtRatio); } public BigDecimal getDebtTotalLiability() { return financialRatio.getDebtTotalLiability(); } public void setDebtTotalLiability(BigDecimal debtTotalLiability) { financialRatio.setDebtTotalLiability(debtTotalLiability); } public BigDecimal getGuarantee() { return financialRatio.getGuarantee(); } public void setGuarantee(BigDecimal guarantee) { financialRatio.setGuarantee(guarantee); } public BigDecimal getFinanceCoverage() { return financialRatio.getFinanceCoverage(); } public void setFinanceCoverage(BigDecimal financeCoverage) { financialRatio.setFinanceCoverage(financeCoverage); } public BigDecimal getCollectionPeriod() { return financialRatio.getCollectionPeriod(); } public void setCollectionPeriod(BigDecimal collectionPeriod) { financialRatio.setCollectionPeriod(collectionPeriod); } public BigDecimal getPayPeriod() { return financialRatio.getPayPeriod(); } public void setPayPeriod(BigDecimal payPeriod) { financialRatio.setPayPeriod(payPeriod); } public BigDecimal getTurnoverAsset() { return financialRatio.getTurnoverAsset(); } public void setTurnoverAsset(BigDecimal turnoverAsset) { financialRatio.setTurnoverAsset(turnoverAsset); } public BigDecimal getTurnoverPermanentAsset() { return financialRatio.getTurnoverPermanentAsset(); } public void setTurnoverPermanentAsset(BigDecimal turnoverPermanentAsset) { financialRatio.setTurnoverPermanentAsset(turnoverPermanentAsset); } public BigDecimal getTurnoverFM() { return financialRatio.getTurnoverFM(); } public void setTurnoverFM(BigDecimal turnoverFM) { financialRatio.setTurnoverFM(turnoverFM); } public BigDecimal getGrossSpread() { return financialRatio.getGrossSpread(); } public void setGrossSpread(BigDecimal grossSpread) { financialRatio.setGrossSpread(grossSpread); } public BigDecimal getBaitSpread() { return financialRatio.getBaitSpread(); } public void setBaitSpread(BigDecimal baitSpread) { financialRatio.setBaitSpread(baitSpread); } public BigDecimal getBdtSpread() { return financialRatio.getBdtSpread(); } public void setBdtSpread(BigDecimal bdtSpread) { financialRatio.setBdtSpread(bdtSpread); } public BigDecimal getBaitROA() { return financialRatio.getBaitROA(); } public void setBaitROA(BigDecimal baitROA) { financialRatio.setBaitROA(baitROA); } public BigDecimal getBaitdROA() { return financialRatio.getBaitdROA(); } public void setBaitdROA(BigDecimal baitdROA) { financialRatio.setBaitdROA(baitdROA); } public BigDecimal getROE() { return financialRatio.getROE(); } public void setROE(BigDecimal ROE) { financialRatio.setROE(ROE); } public BigDecimal getLeveraging() { return financialRatio.getLeveraging(); } public void setLeveraging(BigDecimal leveraging) { financialRatio.setLeveraging(leveraging); } public BigDecimal getROCE() { return financialRatio.getROCE(); } public void setROCE(BigDecimal ROCE) { financialRatio.setROCE(ROCE); } public Integer getOwnerId() { return financialRatio.getOwnerId(); } public void setOwnerId(Integer ownerId) { financialRatio.setOwnerId(ownerId); } public Integer getDepartmentId() { return financialRatio.getDepartmentId(); } public void setDepartmentId(Integer departmentId) { financialRatio.setDepartmentId(departmentId); } public Date getInsertDate() { return financialRatio.getInsertDate(); } public void setInsertDate(Date insertDate) { financialRatio.setInsertDate(insertDate); } public Date getUpdateDate() { return financialRatio.getUpdateDate(); } public void setUpdateDate(Date updateDate) { financialRatio.setUpdateDate(updateDate); } /* FinancialRatio - generated by stajanov (do not edit/delete) */ public BigDecimal getBanksAccountsVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getBanksAccounts().doubleValue()); res = res.divide(financialRatioCompOne.getBanksAccounts(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getBanksAccountsVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getBanksAccounts().doubleValue()); res = res.divide(financialRatioCompTwo.getBanksAccounts(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getCustomersVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getCustomers().doubleValue()); res = res.divide(financialRatioCompOne.getCustomers(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getCustomersVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getCustomers().doubleValue()); res = res.divide(financialRatioCompTwo.getCustomers(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getStocksVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getStocks().doubleValue()); res = res.divide(financialRatioCompOne.getStocks(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getStocksVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getStocks().doubleValue()); res = res.divide(financialRatioCompTwo.getStocks(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getNetAssetVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getNetAsset().doubleValue()); res = res.divide(financialRatioCompOne.getNetAsset(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getNetAssetVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getNetAsset().doubleValue()); res = res.divide(financialRatioCompTwo.getNetAsset(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getAmortizationsVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getAmortizations().doubleValue()); res = res.divide(financialRatioCompOne.getAmortizations(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getAmortizationsVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getAmortizations().doubleValue()); res = res.divide(financialRatioCompTwo.getAmortizations(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getInfrastructuresVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getInfrastructures().doubleValue()); res = res.divide(financialRatioCompOne.getInfrastructures(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getInfrastructuresVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getInfrastructures().doubleValue()); res = res.divide(financialRatioCompTwo.getInfrastructures(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getTotalAssetVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getTotalAsset().doubleValue()); res = res.divide(financialRatioCompOne.getTotalAsset(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getTotalAssetVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getTotalAsset().doubleValue()); res = res.divide(financialRatioCompTwo.getTotalAsset(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getShortTermLiabilityVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getShortTermLiability().doubleValue()); res = res.divide(financialRatioCompOne.getShortTermLiability(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getShortTermLiabilityVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getShortTermLiability().doubleValue()); res = res.divide(financialRatioCompTwo.getShortTermLiability(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getObligationBondVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getObligationBond().doubleValue()); res = res.divide(financialRatioCompOne.getObligationBond(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getObligationBondVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getObligationBond().doubleValue()); res = res.divide(financialRatioCompTwo.getObligationBond(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getTotalOtherResourcesVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getTotalOtherResources().doubleValue()); res = res.divide(financialRatioCompOne.getTotalOtherResources(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getTotalOtherResourcesVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getTotalOtherResources().doubleValue()); res = res.divide(financialRatioCompTwo.getTotalOtherResources(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getCapitalVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getCapital().doubleValue()); res = res.divide(financialRatioCompOne.getCapital(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getCapitalVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getCapital().doubleValue()); res = res.divide(financialRatioCompTwo.getCapital(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getReservesVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getReserves().doubleValue()); res = res.divide(financialRatioCompOne.getReserves(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getReservesVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getReserves().doubleValue()); res = res.divide(financialRatioCompTwo.getReserves(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getTotalOurResourcesVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getTotalOurResources().doubleValue()); res = res.divide(financialRatioCompOne.getReserves(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getTotalOurResourcesVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getTotalOurResources().doubleValue()); res = res.divide(financialRatioCompTwo.getReserves(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getTotalLiabilityVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getTotalLiability().doubleValue()); res = res.divide(financialRatioCompOne.getTotalLiability(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getTotalLiabilityVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getTotalLiability().doubleValue()); res = res.divide(financialRatioCompTwo.getTotalLiability(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getIncomesVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getIncomes().doubleValue()); res = res.divide(financialRatioCompOne.getIncomes(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getIncomesVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getIncomes().doubleValue()); res = res.divide(financialRatioCompTwo.getIncomes(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getExpensesVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getExpenses().doubleValue()); res = res.divide(financialRatioCompOne.getExpenses(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getExpensesVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getExpenses().doubleValue()); res = res.divide(financialRatioCompTwo.getExpenses(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getMarginVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getMargin().doubleValue()); res = res.divide(financialRatioCompOne.getMargin(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getMarginVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getMargin().doubleValue()); res = res.divide(financialRatioCompTwo.getMargin(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getOtherExploitationExpensesVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getOtherExploitationExpenses().doubleValue()); res = res.divide(financialRatioCompOne.getOtherExploitationExpenses(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getOtherExploitationExpensesVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getOtherExploitationExpenses().doubleValue()); res = res.divide(financialRatioCompTwo.getOtherExploitationExpenses(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getBaitVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getBait().doubleValue()); res = res.divide(financialRatioCompOne.getBait(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getBaitVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getBait().doubleValue()); res = res.divide(financialRatioCompTwo.getBait(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getFinancialExpensesVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getFinancialExpenses().doubleValue()); res = res.divide(financialRatioCompOne.getFinancialExpenses(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getFinancialExpensesVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getFinancialExpenses().doubleValue()); res = res.divide(financialRatioCompTwo.getFinancialExpenses(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getBatVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getBat().doubleValue()); res = res.divide(financialRatioCompOne.getBat(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getBatVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getBat().doubleValue()); res = res.divide(financialRatioCompTwo.getBat(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getTaxesVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getTaxes().doubleValue()); res = res.divide(financialRatioCompOne.getTaxes(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getTaxesVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getTaxes().doubleValue()); res = res.divide(financialRatioCompTwo.getTaxes(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getBdtVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getBdt().doubleValue()); res = res.divide(financialRatioCompOne.getBdt(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getBdtVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getBdt().doubleValue()); res = res.divide(financialRatioCompTwo.getBdt(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getBaitdVar1() { try { BigDecimal res = new BigDecimal(financialRatio.getBaitd().doubleValue()); res = res.divide(financialRatioCompOne.getBaitd(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } public BigDecimal getBaitdVar2() { try { BigDecimal res = new BigDecimal(financialRatio.getBaitd().doubleValue()); res = res.divide(financialRatioCompTwo.getBaitd(), 4, RoundingMode.HALF_UP); res = res.subtract(new BigDecimal(1)); return res; } catch (Exception e) { return new BigDecimal(0); } } }