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 \"營業稅率\" 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.getBigDecimal ("營業稅率") != null) A_Tab.setValue("營業稅率",rs.getBigDecimal ("營業稅率"));
}
rs.close();
pstmt.close();
}
result=""
沒有留言:
張貼留言