采购订单,想通过插件实现从价目表中获取物料的税率,并赋值到明细对应物料的税率上,我写了LOG的,值都是存在,但是就是显示不出来,代码我贴出来了,求大神指点一下!万分感谢!
public class get_pricelist_tax : AbstractBillPlugIn
{
public override void AfterEntryBarItemClick( Kingdee.BOS.Core.DynamicForm.PlugIn.Args.AfterBarItemClickEventArgs e)
{
DynamicObject FSUPPLIERID = this.View.Model.GetValue("FSUPPLIERID") as DynamicObject;
DynamicObjectCollection entity = Model.DataObject["POOrderEntry"] as DynamicObjectCollection;
switch (e.BarItemKey)
{
case "getpricelisttax":
if (entity != null && entity.Count >= 1 && FSUPPLIERID!=null)
{
for (int i = 0; i <= entity.Count-1; i++)
{
string strSql = "select t1.FTAXRATE from t_PUR_PriceList t inner join T_PUR_PRICELISTENTRY t1 on t.FID=t1.FID where t.FSUPPLIERID='" + FSUPPLIERID[0].ToString() + "' and t1.FMATERIALID='" + Convert.ToString(entity[i]["MaterialId_Id"]) + "' and t.FDOCUMENTSTATUS='C'";
DynamicObjectCollection ret = DBUtils.ExecuteDynamicObject(this.View.Context, strSql);
if (ret.Count > 0)
{
this.Model.SetValue("FTAXRATE", Convert.ToDouble(ret[0]["FTAXRATE"].ToString()), i);
this.View.UpdateView("FTAXRATE",i);
}
}
}
break;
}
}
}
推荐阅读