Package org.jallinone.registers.currency.java

Examples of org.jallinone.registers.currency.java.CurrencyConvVO


        vo.getPaymentValueDOC28()==null
    ) {
      if (vo.getCurrencyCodeREG03().equals(payVO.getCurrencyCodeReg03DOC27()))
        vo.setPaymentValueDOC28( res );
      else {
        CurrencyConvVO convVO = null;
        for(int i=0;i<frame.getCurrConvs().size();i++) {
          convVO = (CurrencyConvVO)frame.getCurrConvs().get(i);
          if (convVO.getCurrencyCode2Reg03REG06().equals(vo.getCurrencyCodeREG03())) {
            vo.setPaymentValueDOC28( res.divide(convVO.getValueREG06(),vo.getDecimalsREG03().intValue(),BigDecimal.ROUND_HALF_UP) );
            break;
          }
        }
      }
    }
    else if (attributeName.equals("paymentValueDOC28")) {
      // check for total amount...
      BigDecimal total = new BigDecimal(0);
      if (newValue!=null)
        total = total.add((BigDecimal)newValue);
      for(int i=0;i<frame.getGrid().getVOListTableModel().getRowCount();i++) {
        vo = (PaymentDistributionVO)frame.getGrid().getVOListTableModel().getObjectForRow(i);
        if (i!=rowNumber &&
            vo.getPaymentValueDOC28()!=null)
          total = total.add(vo.getPaymentValueDOC28());
      }
      if (payVO.getPaymentValueDOC27()==null || payVO.getPaymentValueDOC27().subtract(total).doubleValue()<0)
        return false;

      vo = (PaymentDistributionVO)frame.getGrid().getVOListTableModel().getObjectForRow(rowNumber);
      if (newValue!=null) {
        BigDecimal conv = (BigDecimal)newValue;
        if (!vo.getCurrencyCodeREG03().equals(payVO.getCurrencyCodeReg03DOC27())) {
          CurrencyConvVO convVO = null;
          for(int i=0;i<frame.getCurrConvs().size();i++) {
            convVO = (CurrencyConvVO)frame.getCurrConvs().get(i);
            if (convVO.getCurrencyCode2Reg03REG06().equals(vo.getCurrencyCodeREG03())) {
              conv = conv.multiply(convVO.getValueREG06());
              break;
            }
          }
        }
        if (conv.equals(vo.getValueDOC19().subtract(vo.getAlreadyPayedDOC19())))
View Full Code Here


        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          ExpirationVO vo = (ExpirationVO)expController.getLookupVO();
          PaymentDistributionVO pVO = (PaymentDistributionVO)grid.getVOListTableModel().getObjectForRow(grid.getSelectedRow());
          if (vo!=null && vo.getProgressiveDOC19()!=null) {
            BigDecimal res = vo.getValueDOC19().subtract(vo.getAlreadyPayedDOC19());
            CurrencyConvVO convVO = null;
            if (vo.getCurrencyCodeReg03DOC19().equals(controlCurrency.getValue()))
              pVO.setPaymentValueDOC28( res );
            else {
              for(int i=0;i<currConvs.size();i++) {
                convVO = (CurrencyConvVO)currConvs.get(i);
                if (convVO.getCurrencyCode2Reg03REG06().equals(vo.getCurrencyCodeReg03DOC19())) {
                  pVO.setPaymentValueDOC28( res.divide(convVO.getValueREG06(),vo.getDecimalsREG03().intValue(),BigDecimal.ROUND_HALF_UP) );
                  break;
                }
              }
            }
          }
View Full Code Here

TOP

Related Classes of org.jallinone.registers.currency.java.CurrencyConvVO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.