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 a.\"付款條件_id\", a.\"交易條件_id\",a.\"聯絡人一\",b.\"統一編號\" FROM \"供應商註記\" a LEFT OUTER JOIN \"供應商\" b ON a.\"供應商_id\"=b.\"供應商_id\" WHERE a.\"供應商_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.getString("聯絡人一") != null) A_Tab.setValue("聯絡人",rs. getString ("聯絡人一"));
if (rs.getString("統一編號") != null) A_Tab.setValue("統一編號",rs. getString ("統一編號"));
}
rs.close();
pstmt.close();
}
result=""
沒有留言:
張貼留言