Package java.math

Examples of java.math.BigDecimal.abs()


      line.convert(m_acctSchema.getC_Currency_ID(), m_doc.DateAcct, m_acctSchema
          .getCurrencyRateType(), conn);
      if (diff.compareTo(ZERO) < 0)
        line.setAmtAcct(diff.abs().toString(), ZERO.toString());
      else
        line.setAmtAcct(ZERO.toString(), diff.abs().toString());
      line.setAccount(m_acctSchema, m_acctSchema.getCurrencyBalancing_Acct());
      log4jFact.debug("balanceAccounting - " + line.toString());
      log4jFact
          .debug("************* fact - balanceAccounting - m_lines.size() - " + m_lines.size());
      m_lines.add(line);
View Full Code Here


      // Find line
      for (int i = 0; i < m_lines.size(); i++) {
        FactLine l = (FactLine) m_lines.get(i);
        BigDecimal amt = new BigDecimal(l.getAcctBalance());
        amt = amt.abs();
        if (l.isBalanceSheet() && amt.compareTo(BSamount) > 0) {
          BSamount = amt;
          BSline = l;
        } else if (!l.isBalanceSheet() && amt.compareTo(PLamount) > 0) {
          PLamount = amt;
View Full Code Here

          + " expenses to product expenses account.");
      return null;
    }
    if (!bdCost.equals(bdExpenses)) {
      diff = fact.createLine(null, p.getAccount(ProductInfo.ACCTTYPE_P_IPV, as, conn), as
          .getC_Currency_ID(), (bdDifference.compareTo(BigDecimal.ZERO) == 1) ? bdDifference.abs()
          .toString() : "0", (bdDifference.compareTo(BigDecimal.ZERO) < 1) ? bdDifference.abs()
          .toString() : "0", Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
      if (diff == null) {
        log4j.warn("createFact - unable to calculate line with "
            + " difference to InvoicePriceVariant account.");
View Full Code Here

      return null;
    }
    if (!bdCost.equals(bdExpenses)) {
      diff = fact.createLine(null, p.getAccount(ProductInfo.ACCTTYPE_P_IPV, as, conn), as
          .getC_Currency_ID(), (bdDifference.compareTo(BigDecimal.ZERO) == 1) ? bdDifference.abs()
          .toString() : "0", (bdDifference.compareTo(BigDecimal.ZERO) < 1) ? bdDifference.abs()
          .toString() : "0", Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
      if (diff == null) {
        log4j.warn("createFact - unable to calculate line with "
            + " difference to InvoicePriceVariant account.");
        return null;
View Full Code Here

          // Depending on the stt type and the signum of DP it will be
          // posted on credit or debit
          if (amount.signum() == 1) {
            fact.createLine(lineAux, new Account(conn,
                (lineAux.isReceipt.equals("Y") ? data[0].creditAcct : data[0].debitAcct)),
                C_Currency_ID, (lineAux.isReceipt.equals("Y") ? transitoryAmount.abs().toString()
                    : "0"), (lineAux.isReceipt.equals("Y") ? "0" : transitoryAmount.abs()
                    .toString()), Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
            if ((!changeGenerate && line.isReceipt.equals("N"))
                || (changeGenerate && line.isReceipt.equals("Y")))
              amount = amount.negate();
View Full Code Here

          // posted on credit or debit
          if (amount.signum() == 1) {
            fact.createLine(lineAux, new Account(conn,
                (lineAux.isReceipt.equals("Y") ? data[0].creditAcct : data[0].debitAcct)),
                C_Currency_ID, (lineAux.isReceipt.equals("Y") ? transitoryAmount.abs().toString()
                    : "0"), (lineAux.isReceipt.equals("Y") ? "0" : transitoryAmount.abs()
                    .toString()), Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
            if ((!changeGenerate && line.isReceipt.equals("N"))
                || (changeGenerate && line.isReceipt.equals("Y")))
              amount = amount.negate();
          } else {
View Full Code Here

                || (changeGenerate && line.isReceipt.equals("Y")))
              amount = amount.negate();
          } else {
            fact.createLine(lineAux, new Account(conn,
                (lineAux.isReceipt.equals("Y") ? data[0].creditAcct : data[0].debitAcct)),
                C_Currency_ID, (lineAux.isReceipt.equals("Y") ? "0" : transitoryAmount.abs()
                    .toString()), (lineAux.isReceipt.equals("Y") ? transitoryAmount.abs()
                    .toString() : "0"), Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
            if ((!changeGenerate && line.isReceipt.equals("Y"))
                || (changeGenerate && line.isReceipt.equals("N")))
              amount = amount.negate();
View Full Code Here

              amount = amount.negate();
          } else {
            fact.createLine(lineAux, new Account(conn,
                (lineAux.isReceipt.equals("Y") ? data[0].creditAcct : data[0].debitAcct)),
                C_Currency_ID, (lineAux.isReceipt.equals("Y") ? "0" : transitoryAmount.abs()
                    .toString()), (lineAux.isReceipt.equals("Y") ? transitoryAmount.abs()
                    .toString() : "0"), Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
            if ((!changeGenerate && line.isReceipt.equals("Y"))
                || (changeGenerate && line.isReceipt.equals("N")))
              amount = amount.negate();
          }
View Full Code Here

    }

    if ((isReceipt && AmtDiff.compareTo(new BigDecimal("0.00")) == 1)
        || (!isReceipt && AmtDiff.compareTo(new BigDecimal("0.00")) == -1)) {
      fact.createLine(line, getAccount(AcctServer.ACCTTYPE_ConvertGainDefaultAmt, as, conn),
          C_Currency_ID, "", AmtDiff.abs().toString(), Fact_Acct_Group_ID, nextSeqNo(SeqNo),
          DocumentType, conn);
    } else {
      fact.createLine(line, getAccount(AcctServer.ACCTTYPE_ConvertChargeDefaultAmt, as, conn),
          C_Currency_ID, AmtDiff.abs().toString(), "", Fact_Acct_Group_ID, nextSeqNo(SeqNo),
          DocumentType, conn);
View Full Code Here

      fact.createLine(line, getAccount(AcctServer.ACCTTYPE_ConvertGainDefaultAmt, as, conn),
          C_Currency_ID, "", AmtDiff.abs().toString(), Fact_Acct_Group_ID, nextSeqNo(SeqNo),
          DocumentType, conn);
    } else {
      fact.createLine(line, getAccount(AcctServer.ACCTTYPE_ConvertChargeDefaultAmt, as, conn),
          C_Currency_ID, AmtDiff.abs().toString(), "", Fact_Acct_Group_ID, nextSeqNo(SeqNo),
          DocumentType, conn);
    }

    return Amt;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.