protected Fact createComponentIssue(MAcctSchema as){
  final Fact fact=new Fact(this,as,Fact.POST_Actual);
  BigDecimal totalCost=Env.ZERO;
  FactLine dr=null;
  FactLine cr=null;
  MAccount debit=m_line.getAccount(ProductCost.ACCTTYPE_P_WorkInProcess,as);
  MAccount credit=m_line.getAccount(ProductCost.ACCTTYPE_P_Asset,as);
  if (m_cc.isFloorStock()) {
    credit=m_line.getAccount(ProductCost.ACCTTYPE_P_FloorStock,as);
  }
  for (  MCostDetail cd : getCostDetails()) {
    BigDecimal cost=MCostDetail.getTotalCost(cd,as);
    if (cost.compareTo(Env.ZERO) == 0)     continue;
    if (cost.scale() > as.getStdPrecision())     cost=cost.setScale(as.getStdPrecision(),RoundingMode.HALF_UP);
    dr=fact.createLine(m_line,debit,as.getC_Currency_ID(),cost);
    totalCost=totalCost.add(cost);
  }
  cr=fact.createLine(m_line,credit,as.getC_Currency_ID(),totalCost.negate());
  return fact;
}

protected Fact createComponentIssue ( MAcctSchema as ) { final Fact fact = new Fact ( this , as , Fact . POST_Actual ) ; BigDecimal totalCost = Env . ZERO ; FactLine dr = null ; FactLine cr = null ; MAccount debit = m_line . getAccount ( ProductCost . ACCTTYPE_P_WorkInProcess , as ) ; MAccount credit = m_line . getAccount ( ProductCost . ACCTTYPE_P_Asset , as ) ; if ( m_cc . isFloorStock ( ) ) { credit = m_line . getAccount ( ProductCost . ACCTTYPE_P_FloorStock , as ) ; } for ( MCostDetail cd : getCostDetails ( ) ) { BigDecimal cost = MCostDetail . getTotalCost ( cd , as ) ; if ( cost . compareTo ( Env . ZERO ) == 0 ) continue ; if ( cost . scale ( ) > as . getStdPrecision ( ) ) cost = cost . setScale ( as . getStdPrecision ( ) , RoundingMode . HALF_UP ) ; dr = fact . createLine ( m_line , debit , as . getC_Currency_ID ( ) , cost ) ; totalCost = totalCost . add ( cost ) ; } cr = fact . createLine ( m_line , credit , as . getC_Currency_ID ( ) , totalCost . negate ( ) ) ; return fact ; }
the issue component product created next account fact debit work in process account for each cost element using current cost create a fact line for each cost element type material labor ( resources ) burden overhead outsite processing credit product asset account for each cost element using current cost create a fact line for each cost element type material labor ( resources ) burden overhead outsite processing credit floor stock account for each cost element using current cost create a fact line for each cost element type material labor ( resources ) burden overhead outsite processing
