groovy:getVendorForPO
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\" 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")));
}
rs.close();
pstmt.close();
}
result=""
沒有留言:
張貼留言