@Deprecated public static void create(MClient client){
  MAcctSchema[] ass=MAcctSchema.getClientAcctSchema(client.getCtx(),client.getAD_Client_ID());
  String trxName=client.get_TrxName();
  String trxNameUsed=trxName;
  Trx trx=null;
  if (trxName == null) {
    trxNameUsed=Trx.createTrxName("Cost");
    trx=Trx.get(trxNameUsed,true);
  }
  boolean success=true;
  String sql="SELECT * FROM M_Product p " + "WHERE AD_Client_ID=?" + " AND EXISTS (SELECT * FROM M_CostDetail cd "+ "WHERE p.M_Product_ID=cd.M_Product_ID AND Processed='N')";
  PreparedStatement pstmt=null;
  try {
    pstmt=DB.prepareStatement(sql,trxNameUsed);
    pstmt.setInt(1,client.getAD_Client_ID());
    ResultSet rs=pstmt.executeQuery();
    while (rs.next()) {
      MProduct product=new MProduct(client.getCtx(),rs,trxNameUsed);
      for (int i=0; i < ass.length; i++) {
        BigDecimal cost=getCurrentCost(product,0,ass[i],0,0,null,Env.ONE,0,false,trxNameUsed);
        s_log.info(product.getName() + " = " + cost);
      }
    }
    rs.close();
    pstmt.close();
    pstmt=null;
  }
 catch (  Exception e) {
    s_log.log(Level.SEVERE,sql,e);
    success=false;
  }
  try {
    if (pstmt != null)     pstmt.close();
    pstmt=null;
  }
 catch (  Exception e) {
    pstmt=null;
  }
  if (trx != null) {
    if (success)     trx.commit();
 else     trx.rollback();
    trx.close();
  }
}

@ Deprecated public static void create ( MClient client ) { MAcctSchema [ ] ass = MAcctSchema . getClientAcctSchema ( client . getCtx ( ) , client . getAD_Client_ID ( ) ) ; String trxName = client . get_TrxName ( ) ; String trxNameUsed = trxName ; Trx trx = null ; if ( trxName == null ) { trxNameUsed = Trx . createTrxName ( "Cost" ) ; trx = Trx . get ( trxNameUsed , true ) ; } boolean success = true ; String sql = "SELECT * FROM M_Product p " + "WHERE AD_Client_ID=?" + " AND EXISTS (SELECT * FROM M_CostDetail cd " + "WHERE p.M_Product_ID=cd.M_Product_ID AND Processed='N')" ; PreparedStatement pstmt = null ; try { pstmt = DB . prepareStatement ( sql , trxNameUsed ) ; pstmt . setInt ( 1 , client . getAD_Client_ID ( ) ) ; ResultSet rs = pstmt . executeQuery ( ) ; while ( rs . next ( ) ) { MProduct product = new MProduct ( client . getCtx ( ) , rs , trxNameUsed ) ; for ( int i = 0 ; i < ass . length ; i ++ ) { BigDecimal cost = getCurrentCost ( product , 0 , ass [ i ] , 0 , 0 , null , Env . ONE , 0 , false , trxNameUsed ) ; s_log . info ( product . getName ( ) + " = " + cost ) ; } } rs . close ( ) ; pstmt . close ( ) ; pstmt = null ; } catch ( Exception e ) { s_log . log ( Level . SEVERE , sql , e ) ; success = false ; } try { if ( pstmt != null ) pstmt . close ( ) ; pstmt = null ; } catch ( Exception e ) { pstmt = null ; } if ( trx != null ) { if ( success ) trx . commit ( ) ; else trx . rollback ( ) ; trx . close ( ) ; } }
create costing for client . handles transaction if not in a transaction
