大家好,
有一个需求是费用类的应付单,通过插件生成并且自动勾选“计入成本”?流程为 采购收料单(单据类型为:费用物料接收单)-》应付单(费用应付单)。
我是在采购收料单的审核操作中添加插件的,核心代码是:
/**
*采购收料单(单据类型:费用物料接收单)下推生成应收单
*
*/
private void ModifiedDetails_ReceiveBillToReceiveBill_FY(Dictionary
{
foreach (var billObj in billObjs)
{
DynamicObject destChargeId = null;
String destChargeId_Id = null;
var entryRows = billObj["AP_PAYABLEENTRY"] as DynamicObjectCollection;
foreach (var row in entryRows)
{
DynamicObjectCollection linkEntityRows = null;
linkEntityRows = row["FEntityDetail_Link"] as DynamicObjectCollection;
foreach (var linkRow in linkEntityRows)
{
var srcEntryId = Convert.ToInt64(linkRow["SId"]);
DynamicObject srcRow = dctSrcEntryRows[srcEntryId];
destChargeId_Id = srcRow["ChargeProjectId_Id"].ToString();
destChargeId = srcRow["ChargeProjectId"] as DynamicObject;
}
//费用项目从采购收料单(收货通知单)带过来
row["FCostId"] = destChargeId;
row["FCostId_Id"]=destChargeId_Id;
//计入成本勾选
row["INCLUDECOST"] = true;
}
}
}
row["INCLUDECOST"] = true; 是把计入成本勾选,但是这样写并不能实现应付单明细中计入成本勾选(奇怪的是在列表里查看,是否计入成本项是“是”)。
请教下如何才能实现?
推荐阅读