groovy:出貨通知拉出貨通知資料
Callout
========================
import java.sql.Timestamp
import java.math.BigDecimal
import java.sql.PreparedStatement
import java.sql.ResultSet
import org.compiere.util.DB
import org.compiere.model.MUser
//@script:groovy:getQuotationForOrder
if (A_Value != null )
{
int id = ((Integer) A_Value).intValue();
String sql ="SELECT \"客戶_id\", \"部門_id\",\"業務人員_id\",\"廠別_id\",\"幣別_id\" FROM \"出貨通知\" WHERE \"出貨通知_id\"=? ";
PreparedStatement pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, id);
ResultSet rs = pstmt.executeQuery();
// 只作 1筆 while (rs.next()){
if (rs.next()) {
if (rs.getInt("客戶_id") > 0) A_Tab.setValue("客戶_id",new Integer(rs.getInt("客戶_id")));
if (rs.getInt("部門_id") > 0) A_Tab.setValue("部門_id",new Integer(rs.getInt("部門_id")));
if (rs.getInt("業務人員_id") > 0) A_Tab.setValue("業務人員_id",new Integer(rs.getInt("業務人員_id")));
if (rs.getInt("廠別_id") > 0) A_Tab.setValue("廠別_id",new Integer(rs.getInt("廠別_id")));
if (rs.getInt("幣別_id") > 0) A_Tab.setValue("幣別_id",new Integer(rs.getInt("幣別_id")));
}
rs.close();
pstmt.close();
}
result=""
沒有留言:
張貼留言