groovy:get採購單拉廠別帶出送廠別資訊
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 \"地址\" 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.getString("地址") != null) A_Tab.setValue("送貨地址",rs.getString("地址"));
}
rs.close();
pstmt.close();
}
result=""
沒有留言:
張貼留言