|
|
函数格式:
getBudgetAmount(pwpno)
函数说明:
pwpno:
示例:
实现getBudgetAmount(pwpno)函数的应用
function getBudgetAmount(pwpno){
var domainid = getDomainid();
if(!pwpno) pwpno = getItemValue("pwpno");
var sql = " select sum(t.item_amount) as item_amount,'"+domainid+"' as domainid from("
+" select isnull(item_tmexpenses,0) as item_amount from tlk_tm_budget_expense where item_pwpno='"+pwpno+"'"
+" union all"
+" select isnull(d.item_transferamount,0) from tlk_tm_budget_change_in d,tlk_tm_budget m where d.parent=m.id and m.statelabel='完成' and d.item_pwpno='"+pwpno+"'"
+" union all"
+" select isnull(d.item_adjustamount,0) from tlk_tm_budget_change_out d,tlk_tm_budget m where d.parent=m.id and m.statelabel='完成' and d.item_pwpno='"+pwpno+"'"
+" ) t";
var amount = 0;
var datas = queryBySQL(sql);
var iter = datas.iterator();
if (iter.hasNext()) {
var data = iter.next();
amount = data.getItemValueAsDouble("amount");
}
return amount;
}
调用
#include " businesslib ";
getBudgetAmount ("pwpno "); |
|